Commit abe1f813c97bceb904309b17d89981a5c7cdb8d3
1 parent
ad120d45
Exists in
master
and in
7 other branches
--no commit message
Showing
5 changed files
with
24 additions
and
88 deletions
Show diff stats
classesphp/classe_alteraclasse.php
@@ -81,6 +81,8 @@ $tema - nome do tema | @@ -81,6 +81,8 @@ $tema - nome do tema | ||
81 | $this->locaplic = $locaplic; | 81 | $this->locaplic = $locaplic; |
82 | $this->mapa = ms_newMapObj($map_file); | 82 | $this->mapa = ms_newMapObj($map_file); |
83 | $this->arquivo = $map_file; | 83 | $this->arquivo = $map_file; |
84 | + $this->layer = ""; | ||
85 | + if($tema != "") | ||
84 | $this->layer = $this->mapa->getlayerbyname($tema); | 86 | $this->layer = $this->mapa->getlayerbyname($tema); |
85 | $this->nome = $tema; | 87 | $this->nome = $tema; |
86 | } | 88 | } |
@@ -364,8 +366,8 @@ A nova classe será uma cópia da classe 0. | @@ -364,8 +366,8 @@ A nova classe será uma cópia da classe 0. | ||
364 | { | 366 | { |
365 | $classe = $this->layer->getclass(0); | 367 | $classe = $this->layer->getclass(0); |
366 | $c = ms_newClassObj($this->layer, $classe); | 368 | $c = ms_newClassObj($this->layer, $classe); |
367 | - $classe = $this->layer->getclass(0); | ||
368 | - $nova = $classe->clone; | 369 | + //$classe = $this->layer->getclass(0); |
370 | + //$nova = $classe->clone; | ||
369 | return("ok"); | 371 | return("ok"); |
370 | } | 372 | } |
371 | /* | 373 | /* |
@@ -467,7 +469,7 @@ Parameters: | @@ -467,7 +469,7 @@ Parameters: | ||
467 | $classe - id da classe | 469 | $classe - id da classe |
468 | 470 | ||
469 | */ | 471 | */ |
470 | - function statusClasse($classe,$status) | 472 | + function statusClasse($classe) |
471 | { | 473 | { |
472 | $classe = $this->layer->getclass($classe); | 474 | $classe = $this->layer->getclass($classe); |
473 | $status = $classe->status; | 475 | $status = $classe->status; |
@@ -475,6 +477,7 @@ $classe - id da classe | @@ -475,6 +477,7 @@ $classe - id da classe | ||
475 | {$classe->set("status",MS_ON);} | 477 | {$classe->set("status",MS_ON);} |
476 | else | 478 | else |
477 | {$classe->set("status",MS_OFF);} | 479 | {$classe->set("status",MS_OFF);} |
480 | + return("ok"); | ||
478 | } | 481 | } |
479 | } | 482 | } |
480 | ?> | 483 | ?> |
481 | \ No newline at end of file | 484 | \ No newline at end of file |
classesphp/classe_legenda.php
@@ -422,7 +422,7 @@ function listaSimbolos($tipo,$dir_tmp,$imgdir) | @@ -422,7 +422,7 @@ function listaSimbolos($tipo,$dir_tmp,$imgdir) | ||
422 | if ($tipo == 3){$tipo = 2;} //tipo raster | 422 | if ($tipo == 3){$tipo = 2;} //tipo raster |
423 | if (!file_exists($dir_tmp."/".$imgdir."/simbolos".$tipo.".inc")) | 423 | if (!file_exists($dir_tmp."/".$imgdir."/simbolos".$tipo.".inc")) |
424 | { | 424 | { |
425 | - $f = fopen($dir_tmp."/".$imgdir."/simbolos".$tipo.".inc",w); | 425 | + $f = fopen($dir_tmp."/".$imgdir."/simbolos".$tipo.".inc","w"); |
426 | if ($tipo == 2){$t="simpol.map";} | 426 | if ($tipo == 2){$t="simpol.map";} |
427 | if ($tipo == 0){$t="simpt.map";} | 427 | if ($tipo == 0){$t="simpt.map";} |
428 | if ($tipo == 1){$t="simlin.map";} | 428 | if ($tipo == 1){$t="simlin.map";} |
classesphp/classe_mapa.php
@@ -661,7 +661,7 @@ $incluitexto - sim|nao | @@ -661,7 +661,7 @@ $incluitexto - sim|nao | ||
661 | */ | 661 | */ |
662 | function gradeCoord($intervalo,$corlinha="200,200,200",$larguralinha=1,$tipolinha="linha",$tamanhotexto=MS_TINY,$cortexto="0,0,0",$incluitexto="sim") | 662 | function gradeCoord($intervalo,$corlinha="200,200,200",$larguralinha=1,$tipolinha="linha",$tamanhotexto=MS_TINY,$cortexto="0,0,0",$incluitexto="sim") |
663 | { | 663 | { |
664 | - echo $corlinha; | 664 | + //echo $corlinha; |
665 | if (file_exists(($this->arquivo)."qy")) | 665 | if (file_exists(($this->arquivo)."qy")) |
666 | {unlink (($this->arquivo)."qy");} | 666 | {unlink (($this->arquivo)."qy");} |
667 | $nlayer = criaLayer($this->mapa,MS_LAYER_LINE,MS_DEFAULT,"Grade de coordenadas","SIM"); | 667 | $nlayer = criaLayer($this->mapa,MS_LAYER_LINE,MS_DEFAULT,"Grade de coordenadas","SIM"); |
@@ -745,91 +745,20 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | @@ -745,91 +745,20 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | ||
745 | //{$random == "sim" ? $nomeunico[$n] = nomeRandomico() : $nomeunico[$n] = $n;} | 745 | //{$random == "sim" ? $nomeunico[$n] = nomeRandomico() : $nomeunico[$n] = $n;} |
746 | foreach ($novosnomes as $n) | 746 | foreach ($novosnomes as $n) |
747 | { | 747 | { |
748 | - $temp = $nmap->getlayerbyname($n); | ||
749 | - if($temp->tileindex != ""){$random = "nao";} | 748 | + if(!@$this->mapa->getlayerbyname($n)) |
749 | + {$random = "nao";} | ||
750 | $random == "sim" ? $nomeunico[$n] = nomeRandomico() : $nomeunico[$n] = $n; | 750 | $random == "sim" ? $nomeunico[$n] = nomeRandomico() : $nomeunico[$n] = $n; |
751 | } | 751 | } |
752 | //altera os temas para incluir o nome unico | 752 | //altera os temas para incluir o nome unico |
753 | + include_once($locaplic."/classesphp/funcoes_gerais.php"); | ||
753 | foreach ($novosnomes as $n) | 754 | foreach ($novosnomes as $n) |
754 | { | 755 | { |
755 | $nlayer = $nmap->getlayerbyname($n); | 756 | $nlayer = $nmap->getlayerbyname($n); |
757 | + if(function_exists("autoClasses")) | ||
756 | autoClasses(&$nlayer,$this->mapa); | 758 | autoClasses(&$nlayer,$this->mapa); |
757 | // | 759 | // |
758 | //cria as classes com base em atributos | 760 | //cria as classes com base em atributos |
759 | // | 761 | // |
760 | - /* | ||
761 | - if($nlayer->getmetadata("classesitem") != "") | ||
762 | - { | ||
763 | - $itemnome = $nlayer->getmetadata("classesnome"); | ||
764 | - $itemid = $nlayer->getmetadata("classesitem"); | ||
765 | - $itemcor = $nlayer->getmetadata("classescor"); | ||
766 | - $itemsimbolo = $nlayer->getmetadata("classesimbolo"); | ||
767 | - $itemtamanho = $nlayer->getmetadata("classestamanho"); | ||
768 | - $classeoriginal = $nlayer->getclass(0); | ||
769 | - // | ||
770 | - //pega o número de ocorrências de itemid | ||
771 | - // | ||
772 | - $nlayer->open(); | ||
773 | - $status = $nlayer->whichShapes($this->mapa->extent); | ||
774 | - $parametrosClasses = array(); | ||
775 | - if ($status == 0) | ||
776 | - { | ||
777 | - while ($shape = $nlayer->nextShape()) | ||
778 | - { | ||
779 | - $id = trim($shape->values[$itemid]); | ||
780 | - if (!$parametrosClasses[$id]) | ||
781 | - { | ||
782 | - $nome = ""; | ||
783 | - if($itemnome != "") | ||
784 | - $nome = trim($shape->values[$itemnome]); | ||
785 | - $cor = ""; | ||
786 | - if($itemcor != "") | ||
787 | - $cor = explode(",",trim($shape->values[$itemcor])); | ||
788 | - if(count($cor) != 3) | ||
789 | - $cor = explode(" ",trim($shape->values[$itemcor])); | ||
790 | - $tamanho = ""; | ||
791 | - if($itemtamanho != "") | ||
792 | - $tamanho = trim($shape->values[$itemtamanho]); | ||
793 | - $simbolo = ""; | ||
794 | - if($itemsimbolo != "") | ||
795 | - $simbolo = trim($shape->values[$itemsimbolo]); | ||
796 | - $parametrosClasses[$id] = array("nome"=>$nome,"cor"=>$cor,"tamanho"=>$tamanho,"simbolo"=>$simbolo); | ||
797 | - } | ||
798 | - } | ||
799 | - $fechou = $nlayer->close(); | ||
800 | - //echo "<pre>";var_dump($parametrosClasses); | ||
801 | - if (count($parametrosClasses) > 0) | ||
802 | - { | ||
803 | - $ids = array_keys($parametrosClasses); | ||
804 | - for($i=0;$i < count($parametrosClasses);++$i) | ||
805 | - { | ||
806 | - $p = $parametrosClasses[$ids[$i]]; | ||
807 | - //echo "<pre>";var_dump($p); | ||
808 | - $nclasse = ms_newClassObj($nlayer,$classeoriginal); | ||
809 | - if($p["nome"] != "") | ||
810 | - $nclasse->set("name",$p["nome"]); | ||
811 | - $estilo = $nclasse->getstyle(0); | ||
812 | - if($p["cor"] != "") | ||
813 | - { | ||
814 | - $cor = $p["cor"]; | ||
815 | - $ncor = $estilo->color; | ||
816 | - if($ncor == "") | ||
817 | - $ncor = $estilo->outlinecolor; | ||
818 | - $ncor->setrgb($cor[0],$cor[1],$cor[2]); | ||
819 | - } | ||
820 | - if($p["tamanho"] != "") | ||
821 | - $estilo->set("size",$p["tamanho"]); | ||
822 | - if($p["simbolo"] != "") | ||
823 | - $estilo->set("symbolname",$p["simbolo"]); | ||
824 | - | ||
825 | - $strE = "('[".$itemid."]'eq'".$ids[$i]."')"; | ||
826 | - $nclasse->setexpression($strE); | ||
827 | - } | ||
828 | - $classeoriginal->set("status",MS_DELETE); | ||
829 | - } | ||
830 | - } | ||
831 | - } | ||
832 | - */ | ||
833 | // | 762 | // |
834 | //muda para RGB para melhorar o desenho da imagem raster | 763 | //muda para RGB para melhorar o desenho da imagem raster |
835 | // | 764 | // |
@@ -842,7 +771,7 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | @@ -842,7 +771,7 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | ||
842 | $nlayer->setmetadata("nomeoriginal",$nlayer->name); | 771 | $nlayer->setmetadata("nomeoriginal",$nlayer->name); |
843 | $nlayer->set("name",$nomeunico[$n]); | 772 | $nlayer->set("name",$nomeunico[$n]); |
844 | //altera o nome do grupo se existir | 773 | //altera o nome do grupo se existir |
845 | - if ($nlayer->group != " ") | 774 | + if ($nlayer->group != " " && $nlayer->group != "" ) |
846 | { | 775 | { |
847 | $lr = $nlayer->group; | 776 | $lr = $nlayer->group; |
848 | $nlayer->set("group",$nomeunico[$lr]); | 777 | $nlayer->set("group",$nomeunico[$lr]); |
@@ -1091,17 +1020,16 @@ Include: | @@ -1091,17 +1020,16 @@ Include: | ||
1091 | $urllegenda = $servico."&service=wms&request=getlegendgraphic&version=".$versao."&service=wms&layer=".$tema."&format=".$im; | 1020 | $urllegenda = $servico."&service=wms&request=getlegendgraphic&version=".$versao."&service=wms&layer=".$tema."&format=".$im; |
1092 | $layer->setmetadata("legendawms",$urllegenda); | 1021 | $layer->setmetadata("legendawms",$urllegenda); |
1093 | } | 1022 | } |
1094 | - | ||
1095 | $layer->setmetadata("wms_format",$im); | 1023 | $layer->setmetadata("wms_format",$im); |
1096 | $layer->setmetadata("wfs","nao"); | 1024 | $layer->setmetadata("wfs","nao"); |
1097 | //verifica se o serviço tem wfs | 1025 | //verifica se o serviço tem wfs |
1098 | - $wfs = existeWFS($servico); | 1026 | + $wfs = existeWFS(); |
1099 | if ($wfs != "nao") | 1027 | if ($wfs != "nao") |
1100 | { | 1028 | { |
1101 | - //verifica se a camada esta no wfs | ||
1102 | - $existeWFS = existeTemaWFS(); | ||
1103 | - if ($existeWFS == "sim") | ||
1104 | - {$layer->setmetadata("wfs","sim");} | 1029 | + $layer->setmetadata("wfs","sim"); |
1030 | + //$existeWFS = existeTemaWFS(); | ||
1031 | + //if ($existeWFS == "sim") | ||
1032 | + //{$layer->setmetadata("wfs","sim");} | ||
1105 | } | 1033 | } |
1106 | $c = $layer->offsite; | 1034 | $c = $layer->offsite; |
1107 | $c->setrgb(255,255,255); | 1035 | $c->setrgb(255,255,255); |
classesphp/classe_menutemas.php
@@ -155,6 +155,7 @@ array | @@ -155,6 +155,7 @@ array | ||
155 | function pegaListaDeGrupos($idmenu="",$listasistemas="sim",$listasgrupos="sim",$menutemas=null) | 155 | function pegaListaDeGrupos($idmenu="",$listasistemas="sim",$listasgrupos="sim",$menutemas=null) |
156 | { | 156 | { |
157 | $this->xml = ""; | 157 | $this->xml = ""; |
158 | + //echo $menutemas; | ||
158 | if(isset($menutemas)) | 159 | if(isset($menutemas)) |
159 | { | 160 | { |
160 | if (file_exists("../ms_configura.php")) | 161 | if (file_exists("../ms_configura.php")) |
classesphp/mapa_controle.php
@@ -989,7 +989,7 @@ Include: | @@ -989,7 +989,7 @@ Include: | ||
989 | if(!isset($testa)){$testa="";} | 989 | if(!isset($testa)){$testa="";} |
990 | { | 990 | { |
991 | $cp->set_data($m->insereFiltro($filtro,$testa)); | 991 | $cp->set_data($m->insereFiltro($filtro,$testa)); |
992 | - $cp->return_data(); | 992 | + //$cp->return_data(); |
993 | } | 993 | } |
994 | if($testa != "sim") | 994 | if($testa != "sim") |
995 | { | 995 | { |
@@ -1656,6 +1656,8 @@ Include: | @@ -1656,6 +1656,8 @@ Include: | ||
1656 | <classe_menutemas.php> | 1656 | <classe_menutemas.php> |
1657 | */ | 1657 | */ |
1658 | case "pegalistadegrupos": | 1658 | case "pegalistadegrupos": |
1659 | + if (file_exists("../ms_configura.php")) | ||
1660 | + {include_once("../ms_configura.php");} | ||
1659 | include_once("classe_menutemas.php"); | 1661 | include_once("classe_menutemas.php"); |
1660 | $m = new Menutemas($map_file,$perfil,$locsistemas); | 1662 | $m = new Menutemas($map_file,$perfil,$locsistemas); |
1661 | if(!isset($idmenu)){$idmenu="";} | 1663 | if(!isset($idmenu)){$idmenu="";} |
@@ -1988,6 +1990,7 @@ Include: | @@ -1988,6 +1990,7 @@ Include: | ||
1988 | include_once("classe_navegacao.php"); | 1990 | include_once("classe_navegacao.php"); |
1989 | copiaSeguranca($map_file); | 1991 | copiaSeguranca($map_file); |
1990 | $m = new Navegacao($map_file); | 1992 | $m = new Navegacao($map_file); |
1993 | + if(!isset($tipo)){$tipo = "";} | ||
1991 | $m->pan($x,$y,$escala,$tipo); | 1994 | $m->pan($x,$y,$escala,$tipo); |
1992 | $m->salva(); | 1995 | $m->salva(); |
1993 | redesenhaMapa(); | 1996 | redesenhaMapa(); |
@@ -2299,6 +2302,7 @@ Include: | @@ -2299,6 +2302,7 @@ Include: | ||
2299 | include_once("classe_selecao.php"); | 2302 | include_once("classe_selecao.php"); |
2300 | copiaSeguranca($map_file); | 2303 | copiaSeguranca($map_file); |
2301 | $m = new Selecao($map_file,$tema); | 2304 | $m = new Selecao($map_file,$tema); |
2305 | + if(!isset($xy)){$xy = "";} | ||
2302 | $cp->set_data($m->selecaoPT($xy,$tipo,$tolerancia)); | 2306 | $cp->set_data($m->selecaoPT($xy,$tipo,$tolerancia)); |
2303 | break; | 2307 | break; |
2304 | /* | 2308 | /* |