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 | 81 | $this->locaplic = $locaplic; |
| 82 | 82 | $this->mapa = ms_newMapObj($map_file); |
| 83 | 83 | $this->arquivo = $map_file; |
| 84 | + $this->layer = ""; | |
| 85 | + if($tema != "") | |
| 84 | 86 | $this->layer = $this->mapa->getlayerbyname($tema); |
| 85 | 87 | $this->nome = $tema; |
| 86 | 88 | } |
| ... | ... | @@ -364,8 +366,8 @@ A nova classe será uma cópia da classe 0. |
| 364 | 366 | { |
| 365 | 367 | $classe = $this->layer->getclass(0); |
| 366 | 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 | 371 | return("ok"); |
| 370 | 372 | } |
| 371 | 373 | /* |
| ... | ... | @@ -467,7 +469,7 @@ Parameters: |
| 467 | 469 | $classe - id da classe |
| 468 | 470 | |
| 469 | 471 | */ |
| 470 | - function statusClasse($classe,$status) | |
| 472 | + function statusClasse($classe) | |
| 471 | 473 | { |
| 472 | 474 | $classe = $this->layer->getclass($classe); |
| 473 | 475 | $status = $classe->status; |
| ... | ... | @@ -475,6 +477,7 @@ $classe - id da classe |
| 475 | 477 | {$classe->set("status",MS_ON);} |
| 476 | 478 | else |
| 477 | 479 | {$classe->set("status",MS_OFF);} |
| 480 | + return("ok"); | |
| 478 | 481 | } |
| 479 | 482 | } |
| 480 | 483 | ?> |
| 481 | 484 | \ No newline at end of file | ... | ... |
classesphp/classe_legenda.php
| ... | ... | @@ -422,7 +422,7 @@ function listaSimbolos($tipo,$dir_tmp,$imgdir) |
| 422 | 422 | if ($tipo == 3){$tipo = 2;} //tipo raster |
| 423 | 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 | 426 | if ($tipo == 2){$t="simpol.map";} |
| 427 | 427 | if ($tipo == 0){$t="simpt.map";} |
| 428 | 428 | if ($tipo == 1){$t="simlin.map";} | ... | ... |
classesphp/classe_mapa.php
| ... | ... | @@ -661,7 +661,7 @@ $incluitexto - sim|nao |
| 661 | 661 | */ |
| 662 | 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 | 665 | if (file_exists(($this->arquivo)."qy")) |
| 666 | 666 | {unlink (($this->arquivo)."qy");} |
| 667 | 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 | 745 | //{$random == "sim" ? $nomeunico[$n] = nomeRandomico() : $nomeunico[$n] = $n;} |
| 746 | 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 | 750 | $random == "sim" ? $nomeunico[$n] = nomeRandomico() : $nomeunico[$n] = $n; |
| 751 | 751 | } |
| 752 | 752 | //altera os temas para incluir o nome unico |
| 753 | + include_once($locaplic."/classesphp/funcoes_gerais.php"); | |
| 753 | 754 | foreach ($novosnomes as $n) |
| 754 | 755 | { |
| 755 | 756 | $nlayer = $nmap->getlayerbyname($n); |
| 757 | + if(function_exists("autoClasses")) | |
| 756 | 758 | autoClasses(&$nlayer,$this->mapa); |
| 757 | 759 | // |
| 758 | 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 | 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 | 771 | $nlayer->setmetadata("nomeoriginal",$nlayer->name); |
| 843 | 772 | $nlayer->set("name",$nomeunico[$n]); |
| 844 | 773 | //altera o nome do grupo se existir |
| 845 | - if ($nlayer->group != " ") | |
| 774 | + if ($nlayer->group != " " && $nlayer->group != "" ) | |
| 846 | 775 | { |
| 847 | 776 | $lr = $nlayer->group; |
| 848 | 777 | $nlayer->set("group",$nomeunico[$lr]); |
| ... | ... | @@ -1091,17 +1020,16 @@ Include: |
| 1091 | 1020 | $urllegenda = $servico."&service=wms&request=getlegendgraphic&version=".$versao."&service=wms&layer=".$tema."&format=".$im; |
| 1092 | 1021 | $layer->setmetadata("legendawms",$urllegenda); |
| 1093 | 1022 | } |
| 1094 | - | |
| 1095 | 1023 | $layer->setmetadata("wms_format",$im); |
| 1096 | 1024 | $layer->setmetadata("wfs","nao"); |
| 1097 | 1025 | //verifica se o serviço tem wfs |
| 1098 | - $wfs = existeWFS($servico); | |
| 1026 | + $wfs = existeWFS(); | |
| 1099 | 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 | 1034 | $c = $layer->offsite; |
| 1107 | 1035 | $c->setrgb(255,255,255); | ... | ... |
classesphp/classe_menutemas.php
classesphp/mapa_controle.php
| ... | ... | @@ -989,7 +989,7 @@ Include: |
| 989 | 989 | if(!isset($testa)){$testa="";} |
| 990 | 990 | { |
| 991 | 991 | $cp->set_data($m->insereFiltro($filtro,$testa)); |
| 992 | - $cp->return_data(); | |
| 992 | + //$cp->return_data(); | |
| 993 | 993 | } |
| 994 | 994 | if($testa != "sim") |
| 995 | 995 | { |
| ... | ... | @@ -1656,6 +1656,8 @@ Include: |
| 1656 | 1656 | <classe_menutemas.php> |
| 1657 | 1657 | */ |
| 1658 | 1658 | case "pegalistadegrupos": |
| 1659 | + if (file_exists("../ms_configura.php")) | |
| 1660 | + {include_once("../ms_configura.php");} | |
| 1659 | 1661 | include_once("classe_menutemas.php"); |
| 1660 | 1662 | $m = new Menutemas($map_file,$perfil,$locsistemas); |
| 1661 | 1663 | if(!isset($idmenu)){$idmenu="";} |
| ... | ... | @@ -1988,6 +1990,7 @@ Include: |
| 1988 | 1990 | include_once("classe_navegacao.php"); |
| 1989 | 1991 | copiaSeguranca($map_file); |
| 1990 | 1992 | $m = new Navegacao($map_file); |
| 1993 | + if(!isset($tipo)){$tipo = "";} | |
| 1991 | 1994 | $m->pan($x,$y,$escala,$tipo); |
| 1992 | 1995 | $m->salva(); |
| 1993 | 1996 | redesenhaMapa(); |
| ... | ... | @@ -2299,6 +2302,7 @@ Include: |
| 2299 | 2302 | include_once("classe_selecao.php"); |
| 2300 | 2303 | copiaSeguranca($map_file); |
| 2301 | 2304 | $m = new Selecao($map_file,$tema); |
| 2305 | + if(!isset($xy)){$xy = "";} | |
| 2302 | 2306 | $cp->set_data($m->selecaoPT($xy,$tipo,$tolerancia)); |
| 2303 | 2307 | break; |
| 2304 | 2308 | /* | ... | ... |