Commit bd86c671213b11b7f5833de5727d86ac3913c356

Authored by Edmar Moretti
1 parent b6052a0c

Correção no desenho do mapa quando no modo cgi e com seleção existente

Showing 1 changed file with 14 additions and 12 deletions   Show diff stats
classesphp/classe_mapa.php
... ... @@ -163,6 +163,7 @@ Include:
163 163 function redesenhaCorpo($locsistemas,$locidentifica,$tipoimagem,$utilizacgi,$locmapserv)
164 164 {
165 165 require_once("classe_imagem.php");
  166 + $qy = file_exists(($this->arquivo)."qy");
166 167 $legenda = $this->mapa->legend;
167 168 //prepara a legenda para incluir no mapa, preenchendo os nomes das classes em branco
168 169 if ($legenda->status == MS_EMBED)
... ... @@ -181,14 +182,7 @@ Include:
181 182 }
182 183 }
183 184 $nome = nomeRandomico();
184   -
185   - /*
186   - if (!file_exists(($this->arquivo)."qy"))
187   - {$imgo = @$this->mapa->draw();}
188   - else
189   - {$imgo = @$this->mapa->drawQuery();}
190   - */
191   - if (isset($utilizacgi) && strtolower($utilizacgi) == "sim" && $tipoimagem=="nenhum")
  185 + if (isset($utilizacgi) && strtolower($utilizacgi) == "sim" && $tipoimagem=="nenhum" && !$qy)
192 186 {
193 187 foreach($this->layers as $l)
194 188 {$l->set("status",MS_OFF);}
... ... @@ -196,7 +190,7 @@ Include:
196 190 }
197 191 else
198 192 {
199   - if (!file_exists(($this->arquivo)."qy"))
  193 + if (!$qy)
200 194 {$imgo = @$this->mapa->draw();}
201 195 else
202 196 {$imgo = @$this->mapa->drawQuery();}
... ... @@ -222,7 +216,7 @@ Include:
222 216 $e = $this->mapa->extent;
223 217 $ext = $e->minx." ".$e->miny." ".$e->maxx." ".$e->maxy;
224 218 $nomer = ($imgo->imageurl).basename($nomer);
225   - if (isset($utilizacgi) && strtolower($utilizacgi) == "sim")
  219 + if (isset($utilizacgi) && strtolower($utilizacgi) == "sim" && !$qy)
226 220 {
227 221 $nomer = $locmapserv."?map=".$this->arquivo."&mode=map&".nomeRandomico();
228 222 }
... ... @@ -661,8 +655,14 @@ $locaplic - string Diretório onde fica a aplicação.
661 655 foreach ($novosnomes as $n)
662 656 {
663 657 $nlayer = $nmap->getlayerbyname($n);
664   - //if($nlayer->type == MS_LAYER_RASTER)
665   - //{$this->mapa->selectOutputFormat("png2");}
  658 + //
  659 + //muda para RGB para melhorar o desenho da imagem raster
  660 + //
  661 + if($nlayer->type == MS_LAYER_RASTER)
  662 + {
  663 + $of = $this->mapa->outputformat;
  664 + $of->set("imagemode",MS_IMAGEMODE_RGB);
  665 + }
666 666 $nlayer->set("status",MS_DEFAULT);
667 667 $nlayer->setmetadata("nomeoriginal",$nlayer->name);
668 668 $nlayer->set("name",$nomeunico[$n]);
... ... @@ -908,6 +908,8 @@ Include:
908 908 $c = $layer->offsite;
909 909 $c->setrgb(255,255,255);
910 910 ms_newLayerObj($this->mapa, $layer);
  911 + $of = $this->mapa->outputformat;
  912 + $of->set("imagemode",MS_IMAGEMODE_RGB);
911 913 $this->salva();
912 914 }
913 915 /*
... ...