Commit 2f6a0f43986c100cfb070b6b419c50f139c246b6

Authored by Edmar Moretti
1 parent 71b55e1d

Correção do método extensaoShape da classe_atributos.php para permitir o zoom em feições UTM

Showing 1 changed file with 14 additions and 4 deletions   Show diff stats
classesphp/classe_atributos.php
@@ -103,14 +103,24 @@ xmin ymin xmax ymax separados por espaço. @@ -103,14 +103,24 @@ xmin ymin xmax ymax separados por espaço.
103 */ 103 */
104 function extensaoShape($shape) 104 function extensaoShape($shape)
105 { 105 {
106 - $ext = $shape->bounds->minx." ".$shape->bounds->miny." ".$shape->bounds->maxx." ".$shape->bounds->maxy; 106 + $prjMapa = $this->mapa->getProjection();
  107 + $prjTema = $this->layer->getProjection();
  108 + $ret = $shape->bounds;
  109 + //reprojeta o retangulo
  110 + if (($prjTema != "") && ($prjMapa != $prjTema))
  111 + {
  112 + $projInObj = ms_newprojectionobj($prjTema);
  113 + $projOutObj = ms_newprojectionobj($prjMapa);
  114 + $ret->project($projInObj, $projOutObj);
  115 + }
  116 + $ext = $ret->minx." ".$ret->miny." ".$ret->maxx." ".$ret->maxy;
107 if ($shape->type == MS_SHP_POINT) 117 if ($shape->type == MS_SHP_POINT)
108 { 118 {
109 - $minx = $shape->bounds->minx; 119 + $minx = $ret->minx;
110 $minx = $minx - 0.01; 120 $minx = $minx - 0.01;
111 - $maxx = $shape->bounds->maxx; 121 + $maxx = $ret->maxx;
112 $maxx = $maxx + 0.01; 122 $maxx = $maxx + 0.01;
113 - $ext = $minx." ".$shape->bounds->miny." ".$maxx." ".$shape->bounds->maxy; 123 + $ext = $minx." ".$ret->miny." ".$maxx." ".$ret->maxy;
114 } 124 }
115 return $ext; 125 return $ext;
116 } 126 }