From 0d1691181b6c6f2eea48c4094676a1d48fa2eb3a Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 1 Apr 2010 03:34:03 +0000 Subject: [PATCH] correções nas opções de seleção para compatibilizar com as novas versões do Mapserver --- classesphp/classe_mapa.php | 25 +++++++++++++++++++++++-- classesphp/classe_selecao.php | 9 ++++++++- classesphp/mapa_controle.php | 1 + 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/classesphp/classe_mapa.php b/classesphp/classe_mapa.php index b7947e1..22a2626 100644 --- a/classesphp/classe_mapa.php +++ b/classesphp/classe_mapa.php @@ -148,6 +148,9 @@ string - javascript com os parametros { $existesel = false; $qy = file_exists($this->qyfile); + foreach($this->layers as $l) + {$l->set("template","none.htm");} + if ($qy) {$this->mapa->loadquery($this->qyfile);} foreach ($this->layers as $oLayer) @@ -230,8 +233,8 @@ string - javascript com os parametros } } //apaga o arquivo qy se não for necessário - if (!$existesel && $qy) - {unlink($this->qyfile);} + //if (!$existesel && $qy) + //{unlink($this->qyfile);} $temas = array_reverse($temas); return $temas; } @@ -261,6 +264,12 @@ Include: include_once("classe_imagem.php"); $nomer = ""; $qy = file_exists($this->qyfile); + if($qy) + { + foreach($this->layers as $l) + {$l->set("template","none.htm");} + $this->mapa->loadquery($this->qyfile); + } $legenda = $this->mapa->legend; // //prepara a legenda para incluir no mapa, preenchendo os nomes das classes que podem estar em branco @@ -300,12 +309,24 @@ Include: $of = $this->mapa->outputformat; $of->set("imagemode",MS_IMAGEMODE_RGB); } + + if (!$qy) {$imgo = @$this->mapa->draw();} else {$imgo = @$this->mapa->drawQuery();} + + $error = ms_GetErrorObj(); + while($error && $error->code != MS_NOERR) + { + printf("
Error in %s: %s
\n", $error->routine, $error->message); + $error = $error->next(); + } + ms_ResetErrorList(); + $nomer = ($imgo->imagepath)."mapa".$nome.".png"; $imgo->saveImage($nomer); + // //aplica o filtro de imagem se estiver definido em $tipoimagem // diff --git a/classesphp/classe_selecao.php b/classesphp/classe_selecao.php index 60dc633..edf488c 100644 --- a/classesphp/classe_selecao.php +++ b/classesphp/classe_selecao.php @@ -89,6 +89,12 @@ $tema - nome do tema if($tema != "" && @$this->mapa->getlayerbyname($tema)) $this->layer = $this->mapa->getlayerbyname($tema); $this->nome = $tema; + $c = $this->mapa->numlayers; + for ($i=0;$i < $c;++$i) + { + $l = $this->mapa->getlayer($i); + $l->set("template","none.htm"); + } } /* function: salva @@ -600,6 +606,7 @@ function: selecaoAdiciona Adiciona elementos na seleção do tema. parameters: + $shpi - Indices dos registros novos. $shp_atual - Indices dos elementos já selecionados. @@ -607,7 +614,7 @@ $shp_atual - Indices dos elementos já selecionados. function selecaoAdiciona($shpi,$shp_atual) { if(!$this->layer){return "erro";} - $this->layer->set("template","none.htm"); + //$this->layer->set("template","none.htm"); $indxlayer = $this->layer->index; $shp = array_merge($shpi,$shp_atual); $shp = array_unique($shp); diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index c26febd..c89d5eb 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -2672,6 +2672,7 @@ function redesenhaMapa() if (connection_aborted()){exit();} include_once("classe_mapa.php"); $m = New Mapa($map_file); + $par = $m->parametrosTemas(); // //na interface googlemaps não é necessário gerar a imagem -- libgit2 0.21.2