Commit 579e190fc1918d3071fe01df2aa91185ac451351
1 parent
fb073958
Exists in
master
Correção na função de criação de layers do tipo anotação para evitar o uso de op…
…acity 100, que estava gerando erro nas versões mais novas do Mapserer
Showing
49 changed files
with
20 additions
and
8 deletions
Show diff stats
classesphp/classe_mapa.php
@@ -281,7 +281,9 @@ class Mapa | @@ -281,7 +281,9 @@ class Mapa | ||
281 | "numclasses", | 281 | "numclasses", |
282 | "id_medida_variavel", | 282 | "id_medida_variavel", |
283 | "codigo_tipo_regiao", | 283 | "codigo_tipo_regiao", |
284 | - "utfgrid" | 284 | + "utfgrid", |
285 | + "maxscaledenom", | ||
286 | + "minscaledenom" | ||
285 | ); | 287 | ); |
286 | foreach ($this->layers as $oLayer){ | 288 | foreach ($this->layers as $oLayer){ |
287 | $sel = "nao"; | 289 | $sel = "nao"; |
@@ -525,7 +527,9 @@ class Mapa | @@ -525,7 +527,9 @@ class Mapa | ||
525 | $oLayer->numclasses, | 527 | $oLayer->numclasses, |
526 | $oLayer->getmetadata("METAESTAT_ID_MEDIDA_VARIAVEL"), | 528 | $oLayer->getmetadata("METAESTAT_ID_MEDIDA_VARIAVEL"), |
527 | $oLayer->getmetadata("METAESTAT_CODIGO_TIPO_REGIAO"), | 529 | $oLayer->getmetadata("METAESTAT_CODIGO_TIPO_REGIAO"), |
528 | - $utfgrid | 530 | + $utfgrid, |
531 | + $oLayer->maxscaledenom, | ||
532 | + $oLayer->minscaledenom | ||
529 | ); | 533 | ); |
530 | } | 534 | } |
531 | } | 535 | } |
classesphp/classe_metaestatinfo.php
@@ -545,7 +545,7 @@ class MetaestatInfo{ | @@ -545,7 +545,7 @@ class MetaestatInfo{ | ||
545 | * @param faz o cache do mapfile | 545 | * @param faz o cache do mapfile |
546 | * @return array("mapfile"=>,"layer"=>,"titulolayer"=>) | 546 | * @return array("mapfile"=>,"layer"=>,"titulolayer"=>) |
547 | */ | 547 | */ |
548 | - function mapfileMedidaVariavel($id_medida_variavel,$filtro="",$todasascolunas = 0,$tipolayer="polygon",$titulolayer="",$id_classificacao="",$agruparpor="",$codigo_tipo_regiao="",$opacidade="",$suportaWMST=false,$cachemapfile=true){ | 548 | + function mapfileMedidaVariavel($id_medida_variavel,$filtro="",$todasascolunas = 0,$tipolayer="polygon",$titulolayer="",$id_classificacao="",$agruparpor="",$codigo_tipo_regiao="",$opacidade="",$suportaWMST=false,$cachemapfile=true,$nomeTemp=""){ |
549 | //para permitir a inclusao de filtros, o fim do sql e marcado com /*FW*//*FW*/ | 549 | //para permitir a inclusao de filtros, o fim do sql e marcado com /*FW*//*FW*/ |
550 | //indicando onde deve comecar e terminar uma possivel clausula where | 550 | //indicando onde deve comecar e terminar uma possivel clausula where |
551 | //ou com /*FA*//*FA*/ | 551 | //ou com /*FA*//*FA*/ |
@@ -557,7 +557,13 @@ class MetaestatInfo{ | @@ -557,7 +557,13 @@ class MetaestatInfo{ | ||
557 | if($cachemapfile == false){ | 557 | if($cachemapfile == false){ |
558 | $this->nomecache = $this->nomecache . $this->nomeRandomico(5); | 558 | $this->nomecache = $this->nomecache . $this->nomeRandomico(5); |
559 | } | 559 | } |
560 | - $arq = $this->dir_tmp."/".$this->nomecache.".map"; | 560 | + if($nomeTemp == ""){ |
561 | + $arq = $this->dir_tmp."/".$this->nomecache.".map"; | ||
562 | + $nomeDoLayer = $this->nomecache; | ||
563 | + } else { | ||
564 | + $arq = $nomeTemp; | ||
565 | + $nomeDoLayer = str_replace(".map","",basename($nomeTemp)); | ||
566 | + } | ||
561 | //error_log("-- "); | 567 | //error_log("-- "); |
562 | //error_log("--xxxxxxxxxxx---- nomecache: ".$arq); | 568 | //error_log("--xxxxxxxxxxx---- nomecache: ".$arq); |
563 | if(!file_exists($arq)){ | 569 | if(!file_exists($arq)){ |
@@ -699,7 +705,7 @@ class MetaestatInfo{ | @@ -699,7 +705,7 @@ class MetaestatInfo{ | ||
699 | } | 705 | } |
700 | } | 706 | } |
701 | $dados[] = "LAYER"; | 707 | $dados[] = "LAYER"; |
702 | - $dados[] = ' NAME "'.$this->nomecache.'"'; | 708 | + $dados[] = ' NAME "'.$nomeDoLayer.'"'; |
703 | $dados[] = " TYPE $tipolayer"; | 709 | $dados[] = " TYPE $tipolayer"; |
704 | $dados[] = ' DATA "'.$sqlf.'"'; | 710 | $dados[] = ' DATA "'.$sqlf.'"'; |
705 | //$dados[] = ' CONNECTION "'.$conexao.'"'; | 711 | //$dados[] = ' CONNECTION "'.$conexao.'"'; |
@@ -793,7 +799,7 @@ class MetaestatInfo{ | @@ -793,7 +799,7 @@ class MetaestatInfo{ | ||
793 | } | 799 | } |
794 | } | 800 | } |
795 | 801 | ||
796 | - return array("mapfile"=>$arq,"layer"=>$this->nomecache,"titulolayer"=>$titulolayer); | 802 | + return array("mapfile"=>$arq,"layer"=>$nomeDoLayer,"titulolayer"=>$titulolayer); |
797 | } | 803 | } |
798 | /** | 804 | /** |
799 | * Cria um mapfile para visualizacao de regioes | 805 | * Cria um mapfile para visualizacao de regioes |
classesphp/classe_temas.php
@@ -914,7 +914,7 @@ $wkt - boolean indicando se $xy e um WKT | @@ -914,7 +914,7 @@ $wkt - boolean indicando se $xy e um WKT | ||
914 | $pinlayer->setmetadata("TEMA",$texto); | 914 | $pinlayer->setmetadata("TEMA",$texto); |
915 | $pinlayer->setmetadata("tiles","nao"); | 915 | $pinlayer->setmetadata("tiles","nao"); |
916 | $pinlayer->set("type",MS_LAYER_POINT); | 916 | $pinlayer->set("type",MS_LAYER_POINT); |
917 | - $pinlayer->set("opacity","100"); | 917 | + //$pinlayer->set("opacity","100"); |
918 | break; | 918 | break; |
919 | } | 919 | } |
920 | } | 920 | } |
classesphp/mapa_controle.php
@@ -267,6 +267,7 @@ include_once ("classe_estatistica.php"); | @@ -267,6 +267,7 @@ include_once ("classe_estatistica.php"); | ||
267 | $protocolo = explode("/", $_SERVER['SERVER_PROTOCOL']); | 267 | $protocolo = explode("/", $_SERVER['SERVER_PROTOCOL']); |
268 | $protocolo = strtolower($protocolo[0]) . '://' . $_SERVER['HTTP_HOST']; // $_SERVER['SERVER_NAME'] .":". $_SERVER['SERVER_PORT']; | 268 | $protocolo = strtolower($protocolo[0]) . '://' . $_SERVER['HTTP_HOST']; // $_SERVER['SERVER_NAME'] .":". $_SERVER['SERVER_PORT']; |
269 | $urli3geo = str_replace("/classesphp/mapa_controle.php", "", $protocolo . $_SERVER["PHP_SELF"]); | 269 | $urli3geo = str_replace("/classesphp/mapa_controle.php", "", $protocolo . $_SERVER["PHP_SELF"]); |
270 | + | ||
270 | // | 271 | // |
271 | // inserido na versão 4.6 | 272 | // inserido na versão 4.6 |
272 | // | 273 | // |
@@ -276,13 +277,13 @@ if (! isset($locaplic)) { | @@ -276,13 +277,13 @@ if (! isset($locaplic)) { | ||
276 | // | 277 | // |
277 | // substitui a string de conexão | 278 | // substitui a string de conexão |
278 | // | 279 | // |
279 | - | ||
280 | if ($funcao != "recuperamapa" && $funcao != "TEMA2SLD") { | 280 | if ($funcao != "recuperamapa" && $funcao != "TEMA2SLD") { |
281 | if (! substituiCon($map_file, $postgis_mapa)) { | 281 | if (! substituiCon($map_file, $postgis_mapa)) { |
282 | cpjson("erro", $cp); | 282 | cpjson("erro", $cp); |
283 | return; | 283 | return; |
284 | } | 284 | } |
285 | } | 285 | } |
286 | + | ||
286 | // | 287 | // |
287 | // faz a busca da função que deve ser executada | 288 | // faz a busca da função que deve ser executada |
288 | // | 289 | // |
@@ -1070,6 +1071,7 @@ switch (strtoupper($funcao)) { | @@ -1070,6 +1071,7 @@ switch (strtoupper($funcao)) { | ||
1070 | * <Temas->insereFeature> | 1071 | * <Temas->insereFeature> |
1071 | */ | 1072 | */ |
1072 | case "INSEREFEATURE": | 1073 | case "INSEREFEATURE": |
1074 | + | ||
1073 | include_once ("classe_temas.php"); | 1075 | include_once ("classe_temas.php"); |
1074 | copiaSeguranca($map_file); | 1076 | copiaSeguranca($map_file); |
1075 | $m = new Temas($map_file, ""); | 1077 | $m = new Temas($map_file, ""); |