Commit cf4334c5eb51d23a005b6c86c1d2a9b5f62b7700
1 parent
a6d21752
Exists in
master
and in
7 other branches
Resolvido o problema de desenho do drawquery em layers postgis na versão 5.x do Mapserver
Showing
2 changed files
with
35 additions
and
7 deletions
Show diff stats
classesphp/mapa_googlemaps.php
... | ... | @@ -225,12 +225,41 @@ else |
225 | 225 | $shp = unserialize($conteudo); |
226 | 226 | $l = $mapa->getLayerByname($_GET["layer"]); |
227 | 227 | $indxlayer = $l->index; |
228 | - foreach ($shp as $indx) | |
229 | - {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | |
230 | - $qm = $mapa->querymap; | |
231 | - $qm->set("width",$map_size[0]); | |
232 | - $qm->set("height",$map_size[1]); | |
233 | - $img = $mapa->drawQuery(); | |
228 | + if ($l->connectiontype != MS_POSTGIS){ | |
229 | + foreach ($shp as $indx) | |
230 | + {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | |
231 | + $qm = $mapa->querymap; | |
232 | + $qm->set("width",$map_size[0]); | |
233 | + $qm->set("height",$map_size[1]); | |
234 | + $img = $mapa->drawQuery(); | |
235 | + } | |
236 | + else{ | |
237 | + $img = $mapa->draw(); | |
238 | + $c = $mapa->querymap->color; | |
239 | + $numclasses = $l->numclasses; | |
240 | + if ($numclasses > 0) | |
241 | + { | |
242 | + $classe0 = $l->getClass(0); | |
243 | + $classe0->setexpression(""); | |
244 | + $classe0->set("name"," "); | |
245 | + for ($i=1; $i < $numclasses; ++$i) | |
246 | + { | |
247 | + $classe = $l->getClass($i); | |
248 | + $classe->set("status",MS_DELETE); | |
249 | + } | |
250 | + } | |
251 | + $cor = $classe0->getstyle(0)->color; | |
252 | + $cor->setrgb($c->red,$c->green,$c->blue); | |
253 | + $cor = $classe0->getstyle(0)->outlinecolor; | |
254 | + $cor->setrgb($c->red,$c->green,$c->blue); | |
255 | + $l->open(); | |
256 | + foreach ($shp as $indx){ | |
257 | + $shape = $l->getfeature($indx,-1); | |
258 | + $shape->draw($mapa,$l,$img); | |
259 | + } | |
260 | + $l->close(); | |
261 | + } | |
262 | + | |
234 | 263 | } |
235 | 264 | if (!function_exists('imagepng')) |
236 | 265 | { | ... | ... |
classesphp/mapa_openlayers.php
... | ... | @@ -105,7 +105,6 @@ $mapa = ms_newMapObj($map_fileX); //map_file vem de section |
105 | 105 | // |
106 | 106 | $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; |
107 | 107 | $qy = file_exists($qyfile); |
108 | - | |
109 | 108 | if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alterado |
110 | 109 | $numlayers = $mapa->numlayers; |
111 | 110 | $cache = false; | ... | ... |