Commit 27a59fb9a82b22ee83b129efbd647f0e2797b5b3
1 parent
93e9ef4b
Exists in
master
and in
7 other branches
Resolução do problema de drawquery com camada postgis
Showing
1 changed file
with
36 additions
and
4 deletions
Show diff stats
classesphp/mapa_openlayers.php
| @@ -228,10 +228,42 @@ if(!$qy) | @@ -228,10 +228,42 @@ if(!$qy) | ||
| 228 | {$img = $mapa->draw();} | 228 | {$img = $mapa->draw();} |
| 229 | else | 229 | else |
| 230 | { | 230 | { |
| 231 | - $qm = $mapa->querymap; | ||
| 232 | - $qm->set("width",$map_size[0]); | ||
| 233 | - $qm->set("height",$map_size[1]); | ||
| 234 | - $img = $mapa->drawQuery(); | 231 | + if ($l->connectiontype != MS_POSTGIS){ |
| 232 | + $qm = $mapa->querymap; | ||
| 233 | + $qm->set("width",$map_size[0]); | ||
| 234 | + $qm->set("height",$map_size[1]); | ||
| 235 | + $img = $mapa->drawQuery(); | ||
| 236 | + } | ||
| 237 | + else{ | ||
| 238 | + $img = $mapa->draw(); | ||
| 239 | + $c = $mapa->querymap->color; | ||
| 240 | + $l = $mapa->getLayerByname($_GET["layer"]); | ||
| 241 | + $numclasses = $l->numclasses; | ||
| 242 | + if ($numclasses > 0) | ||
| 243 | + { | ||
| 244 | + $classe0 = $l->getClass(0); | ||
| 245 | + $classe0->setexpression(""); | ||
| 246 | + $classe0->set("name"," "); | ||
| 247 | + for ($i=1; $i < $numclasses; ++$i) | ||
| 248 | + { | ||
| 249 | + $classe = $l->getClass($i); | ||
| 250 | + $classe->set("status",MS_DELETE); | ||
| 251 | + } | ||
| 252 | + } | ||
| 253 | + $cor = $classe0->getstyle(0)->color; | ||
| 254 | + $cor->setrgb($c->red,$c->green,$c->blue); | ||
| 255 | + $cor = $classe0->getstyle(0)->outlinecolor; | ||
| 256 | + $cor->setrgb($c->red,$c->green,$c->blue); | ||
| 257 | + $shp = unserialize($conteudo); | ||
| 258 | + $status = $l->open(); | ||
| 259 | + $status = $l->whichShapes($mapa->extent); | ||
| 260 | + while ($shape = $l->nextShape()) | ||
| 261 | + { | ||
| 262 | + if(in_array($shape->index,$shp)) | ||
| 263 | + $shape->draw($mapa,$l,$img); | ||
| 264 | + } | ||
| 265 | + $l->close(); | ||
| 266 | + } | ||
| 235 | } | 267 | } |
| 236 | 268 | ||
| 237 | if (!function_exists('imagepng')) | 269 | if (!function_exists('imagepng')) |