From 2f6a0f43986c100cfb070b6b419c50f139c246b6 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 12 Dec 2007 13:43:19 +0000 Subject: [PATCH] Correção do método extensaoShape da classe_atributos.php para permitir o zoom em feições UTM --- classesphp/classe_atributos.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/classesphp/classe_atributos.php b/classesphp/classe_atributos.php index a4d7ead..97e1acd 100644 --- a/classesphp/classe_atributos.php +++ b/classesphp/classe_atributos.php @@ -103,14 +103,24 @@ xmin ymin xmax ymax separados por espaço. */ function extensaoShape($shape) { - $ext = $shape->bounds->minx." ".$shape->bounds->miny." ".$shape->bounds->maxx." ".$shape->bounds->maxy; + $prjMapa = $this->mapa->getProjection(); + $prjTema = $this->layer->getProjection(); + $ret = $shape->bounds; + //reprojeta o retangulo + if (($prjTema != "") && ($prjMapa != $prjTema)) + { + $projInObj = ms_newprojectionobj($prjTema); + $projOutObj = ms_newprojectionobj($prjMapa); + $ret->project($projInObj, $projOutObj); + } + $ext = $ret->minx." ".$ret->miny." ".$ret->maxx." ".$ret->maxy; if ($shape->type == MS_SHP_POINT) { - $minx = $shape->bounds->minx; + $minx = $ret->minx; $minx = $minx - 0.01; - $maxx = $shape->bounds->maxx; + $maxx = $ret->maxx; $maxx = $maxx + 0.01; - $ext = $minx." ".$shape->bounds->miny." ".$maxx." ".$shape->bounds->maxy; + $ext = $minx." ".$ret->miny." ".$maxx." ".$ret->maxy; } return $ext; } -- libgit2 0.21.2