Commit 0d1691181b6c6f2eea48c4094676a1d48fa2eb3a
1 parent
1dd15b3c
Exists in
master
and in
7 other branches
correções nas opções de seleção para compatibilizar com as novas versões do Mapserver
Showing
3 changed files
with
32 additions
and
3 deletions
Show diff stats
classesphp/classe_mapa.php
@@ -148,6 +148,9 @@ string - javascript com os parametros | @@ -148,6 +148,9 @@ string - javascript com os parametros | ||
148 | { | 148 | { |
149 | $existesel = false; | 149 | $existesel = false; |
150 | $qy = file_exists($this->qyfile); | 150 | $qy = file_exists($this->qyfile); |
151 | + foreach($this->layers as $l) | ||
152 | + {$l->set("template","none.htm");} | ||
153 | + | ||
151 | if ($qy) | 154 | if ($qy) |
152 | {$this->mapa->loadquery($this->qyfile);} | 155 | {$this->mapa->loadquery($this->qyfile);} |
153 | foreach ($this->layers as $oLayer) | 156 | foreach ($this->layers as $oLayer) |
@@ -230,8 +233,8 @@ string - javascript com os parametros | @@ -230,8 +233,8 @@ string - javascript com os parametros | ||
230 | } | 233 | } |
231 | } | 234 | } |
232 | //apaga o arquivo qy se não for necessário | 235 | //apaga o arquivo qy se não for necessário |
233 | - if (!$existesel && $qy) | ||
234 | - {unlink($this->qyfile);} | 236 | + //if (!$existesel && $qy) |
237 | + //{unlink($this->qyfile);} | ||
235 | $temas = array_reverse($temas); | 238 | $temas = array_reverse($temas); |
236 | return $temas; | 239 | return $temas; |
237 | } | 240 | } |
@@ -261,6 +264,12 @@ Include: | @@ -261,6 +264,12 @@ Include: | ||
261 | include_once("classe_imagem.php"); | 264 | include_once("classe_imagem.php"); |
262 | $nomer = ""; | 265 | $nomer = ""; |
263 | $qy = file_exists($this->qyfile); | 266 | $qy = file_exists($this->qyfile); |
267 | + if($qy) | ||
268 | + { | ||
269 | + foreach($this->layers as $l) | ||
270 | + {$l->set("template","none.htm");} | ||
271 | + $this->mapa->loadquery($this->qyfile); | ||
272 | + } | ||
264 | $legenda = $this->mapa->legend; | 273 | $legenda = $this->mapa->legend; |
265 | // | 274 | // |
266 | //prepara a legenda para incluir no mapa, preenchendo os nomes das classes que podem estar em branco | 275 | //prepara a legenda para incluir no mapa, preenchendo os nomes das classes que podem estar em branco |
@@ -300,12 +309,24 @@ Include: | @@ -300,12 +309,24 @@ Include: | ||
300 | $of = $this->mapa->outputformat; | 309 | $of = $this->mapa->outputformat; |
301 | $of->set("imagemode",MS_IMAGEMODE_RGB); | 310 | $of->set("imagemode",MS_IMAGEMODE_RGB); |
302 | } | 311 | } |
312 | + | ||
313 | + | ||
303 | if (!$qy) | 314 | if (!$qy) |
304 | {$imgo = @$this->mapa->draw();} | 315 | {$imgo = @$this->mapa->draw();} |
305 | else | 316 | else |
306 | {$imgo = @$this->mapa->drawQuery();} | 317 | {$imgo = @$this->mapa->drawQuery();} |
318 | + | ||
319 | + $error = ms_GetErrorObj(); | ||
320 | + while($error && $error->code != MS_NOERR) | ||
321 | + { | ||
322 | + printf("<br>Error in %s: %s<br>\n", $error->routine, $error->message); | ||
323 | + $error = $error->next(); | ||
324 | + } | ||
325 | + ms_ResetErrorList(); | ||
326 | + | ||
307 | $nomer = ($imgo->imagepath)."mapa".$nome.".png"; | 327 | $nomer = ($imgo->imagepath)."mapa".$nome.".png"; |
308 | $imgo->saveImage($nomer); | 328 | $imgo->saveImage($nomer); |
329 | + | ||
309 | // | 330 | // |
310 | //aplica o filtro de imagem se estiver definido em $tipoimagem | 331 | //aplica o filtro de imagem se estiver definido em $tipoimagem |
311 | // | 332 | // |
classesphp/classe_selecao.php
@@ -89,6 +89,12 @@ $tema - nome do tema | @@ -89,6 +89,12 @@ $tema - nome do tema | ||
89 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) | 89 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) |
90 | $this->layer = $this->mapa->getlayerbyname($tema); | 90 | $this->layer = $this->mapa->getlayerbyname($tema); |
91 | $this->nome = $tema; | 91 | $this->nome = $tema; |
92 | + $c = $this->mapa->numlayers; | ||
93 | + for ($i=0;$i < $c;++$i) | ||
94 | + { | ||
95 | + $l = $this->mapa->getlayer($i); | ||
96 | + $l->set("template","none.htm"); | ||
97 | + } | ||
92 | } | 98 | } |
93 | /* | 99 | /* |
94 | function: salva | 100 | function: salva |
@@ -600,6 +606,7 @@ function: selecaoAdiciona | @@ -600,6 +606,7 @@ function: selecaoAdiciona | ||
600 | Adiciona elementos na seleção do tema. | 606 | Adiciona elementos na seleção do tema. |
601 | 607 | ||
602 | parameters: | 608 | parameters: |
609 | + | ||
603 | $shpi - Indices dos registros novos. | 610 | $shpi - Indices dos registros novos. |
604 | 611 | ||
605 | $shp_atual - Indices dos elementos já selecionados. | 612 | $shp_atual - Indices dos elementos já selecionados. |
@@ -607,7 +614,7 @@ $shp_atual - Indices dos elementos já selecionados. | @@ -607,7 +614,7 @@ $shp_atual - Indices dos elementos já selecionados. | ||
607 | function selecaoAdiciona($shpi,$shp_atual) | 614 | function selecaoAdiciona($shpi,$shp_atual) |
608 | { | 615 | { |
609 | if(!$this->layer){return "erro";} | 616 | if(!$this->layer){return "erro";} |
610 | - $this->layer->set("template","none.htm"); | 617 | + //$this->layer->set("template","none.htm"); |
611 | $indxlayer = $this->layer->index; | 618 | $indxlayer = $this->layer->index; |
612 | $shp = array_merge($shpi,$shp_atual); | 619 | $shp = array_merge($shpi,$shp_atual); |
613 | $shp = array_unique($shp); | 620 | $shp = array_unique($shp); |
classesphp/mapa_controle.php
@@ -2672,6 +2672,7 @@ function redesenhaMapa() | @@ -2672,6 +2672,7 @@ function redesenhaMapa() | ||
2672 | if (connection_aborted()){exit();} | 2672 | if (connection_aborted()){exit();} |
2673 | include_once("classe_mapa.php"); | 2673 | include_once("classe_mapa.php"); |
2674 | $m = New Mapa($map_file); | 2674 | $m = New Mapa($map_file); |
2675 | + | ||
2675 | $par = $m->parametrosTemas(); | 2676 | $par = $m->parametrosTemas(); |
2676 | // | 2677 | // |
2677 | //na interface googlemaps não é necessário gerar a imagem | 2678 | //na interface googlemaps não é necessário gerar a imagem |