Commit 71b55e1dbec6d4ff0a0f3a6d3c149ca3cf92b1fb
1 parent
2b64264f
Exists in
master
and in
7 other branches
Correção da função de zoom para o tema para permitir o uso de temas em UTM
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
classesphp/classe_temas.php
@@ -338,11 +338,20 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa extensão. | @@ -338,11 +338,20 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa extensão. | ||
338 | */ | 338 | */ |
339 | function zoomTema() | 339 | function zoomTema() |
340 | { | 340 | { |
341 | + $prjMapa = $this->mapa->getProjection(); | ||
342 | + $prjTema = $this->layer->getProjection(); | ||
341 | $extatual = $this->mapa->extent; | 343 | $extatual = $this->mapa->extent; |
342 | $ret = $this->layer->getmetadata("extent"); | 344 | $ret = $this->layer->getmetadata("extent"); |
343 | if ($ret == "") | 345 | if ($ret == "") |
344 | { | 346 | { |
345 | $ret = $this->layer->getextent(); | 347 | $ret = $this->layer->getextent(); |
348 | + //reprojeta o retangulo | ||
349 | + if (($prjTema != "") && ($prjMapa != $prjTema)) | ||
350 | + { | ||
351 | + $projInObj = ms_newprojectionobj($prjTema); | ||
352 | + $projOutObj = ms_newprojectionobj($prjMapa); | ||
353 | + $ret->project($projInObj, $projOutObj); | ||
354 | + } | ||
346 | $extatual->setextent($ret->minx,$ret->miny,$ret->maxx,$ret->maxy); | 355 | $extatual->setextent($ret->minx,$ret->miny,$ret->maxx,$ret->maxy); |
347 | } | 356 | } |
348 | else | 357 | else |