From 27a59fb9a82b22ee83b129efbd647f0e2797b5b3 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 14 Nov 2011 15:03:55 +0000 Subject: [PATCH] Resolução do problema de drawquery com camada postgis --- classesphp/mapa_openlayers.php | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/classesphp/mapa_openlayers.php b/classesphp/mapa_openlayers.php index e1eca25..63bd61b 100644 --- a/classesphp/mapa_openlayers.php +++ b/classesphp/mapa_openlayers.php @@ -228,10 +228,42 @@ if(!$qy) {$img = $mapa->draw();} else { - $qm = $mapa->querymap; - $qm->set("width",$map_size[0]); - $qm->set("height",$map_size[1]); - $img = $mapa->drawQuery(); + if ($l->connectiontype != MS_POSTGIS){ + $qm = $mapa->querymap; + $qm->set("width",$map_size[0]); + $qm->set("height",$map_size[1]); + $img = $mapa->drawQuery(); + } + else{ + $img = $mapa->draw(); + $c = $mapa->querymap->color; + $l = $mapa->getLayerByname($_GET["layer"]); + $numclasses = $l->numclasses; + if ($numclasses > 0) + { + $classe0 = $l->getClass(0); + $classe0->setexpression(""); + $classe0->set("name"," "); + for ($i=1; $i < $numclasses; ++$i) + { + $classe = $l->getClass($i); + $classe->set("status",MS_DELETE); + } + } + $cor = $classe0->getstyle(0)->color; + $cor->setrgb($c->red,$c->green,$c->blue); + $cor = $classe0->getstyle(0)->outlinecolor; + $cor->setrgb($c->red,$c->green,$c->blue); + $shp = unserialize($conteudo); + $status = $l->open(); + $status = $l->whichShapes($mapa->extent); + while ($shape = $l->nextShape()) + { + if(in_array($shape->index,$shp)) + $shape->draw($mapa,$l,$img); + } + $l->close(); + } } if (!function_exists('imagepng')) -- libgit2 0.21.2