Commit 0d1691181b6c6f2eea48c4094676a1d48fa2eb3a

Authored by Edmar Moretti
1 parent 1dd15b3c

correções nas opções de seleção para compatibilizar com as novas versões do Mapserver

classesphp/classe_mapa.php
... ... @@ -148,6 +148,9 @@ string - javascript com os parametros
148 148 {
149 149 $existesel = false;
150 150 $qy = file_exists($this->qyfile);
  151 + foreach($this->layers as $l)
  152 + {$l->set("template","none.htm");}
  153 +
151 154 if ($qy)
152 155 {$this->mapa->loadquery($this->qyfile);}
153 156 foreach ($this->layers as $oLayer)
... ... @@ -230,8 +233,8 @@ string - javascript com os parametros
230 233 }
231 234 }
232 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 238 $temas = array_reverse($temas);
236 239 return $temas;
237 240 }
... ... @@ -261,6 +264,12 @@ Include:
261 264 include_once("classe_imagem.php");
262 265 $nomer = "";
263 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 273 $legenda = $this->mapa->legend;
265 274 //
266 275 //prepara a legenda para incluir no mapa, preenchendo os nomes das classes que podem estar em branco
... ... @@ -300,12 +309,24 @@ Include:
300 309 $of = $this->mapa->outputformat;
301 310 $of->set("imagemode",MS_IMAGEMODE_RGB);
302 311 }
  312 +
  313 +
303 314 if (!$qy)
304 315 {$imgo = @$this->mapa->draw();}
305 316 else
306 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 327 $nomer = ($imgo->imagepath)."mapa".$nome.".png";
308 328 $imgo->saveImage($nomer);
  329 +
309 330 //
310 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 89 if($tema != "" && @$this->mapa->getlayerbyname($tema))
90 90 $this->layer = $this->mapa->getlayerbyname($tema);
91 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 100 function: salva
... ... @@ -600,6 +606,7 @@ function: selecaoAdiciona
600 606 Adiciona elementos na seleção do tema.
601 607  
602 608 parameters:
  609 +
603 610 $shpi - Indices dos registros novos.
604 611  
605 612 $shp_atual - Indices dos elementos já selecionados.
... ... @@ -607,7 +614,7 @@ $shp_atual - Indices dos elementos já selecionados.
607 614 function selecaoAdiciona($shpi,$shp_atual)
608 615 {
609 616 if(!$this->layer){return "erro";}
610   - $this->layer->set("template","none.htm");
  617 + //$this->layer->set("template","none.htm");
611 618 $indxlayer = $this->layer->index;
612 619 $shp = array_merge($shpi,$shp_atual);
613 620 $shp = array_unique($shp);
... ...
classesphp/mapa_controle.php
... ... @@ -2672,6 +2672,7 @@ function redesenhaMapa()
2672 2672 if (connection_aborted()){exit();}
2673 2673 include_once("classe_mapa.php");
2674 2674 $m = New Mapa($map_file);
  2675 +
2675 2676 $par = $m->parametrosTemas();
2676 2677 //
2677 2678 //na interface googlemaps não é necessário gerar a imagem
... ...