Commit 1c31dfdcb295c69aa6497f70452c9c11816505dd
1 parent
49aa748e
Exists in
master
and in
7 other branches
correção na obtenção da extensão geográfica do mapa
Showing
4 changed files
with
16 additions
and
17 deletions
Show diff stats
classesphp/classe_mapa.php
| ... | ... | @@ -210,12 +210,9 @@ Include: |
| 210 | 210 | // |
| 211 | 211 | if (isset($utilizacgi) && strtolower($utilizacgi) == "sim" && $tipoimagem=="nenhum" && !$qy) |
| 212 | 212 | { |
| 213 | - //foreach($this->layers as $l) | |
| 214 | - //{$l->set("status",MS_OFF);} | |
| 215 | - //$imgo = @$this->mapa->draw(); | |
| 216 | - | |
| 217 | - $imgo = @$this->mapa->prepareImage(); | |
| 218 | - $this->mapa->preparequery(); | |
| 213 | + foreach($this->layers as $l) | |
| 214 | + {$l->set("status",MS_OFF);} | |
| 215 | + $imgo = @$this->mapa->draw(); | |
| 219 | 216 | } |
| 220 | 217 | else |
| 221 | 218 | { | ... | ... |
classesphp/funcoes_gerais.php
| ... | ... | @@ -718,11 +718,11 @@ function retornaReferencia() |
| 718 | 718 | //pega a extensao original caso ela tenha sido registrada no modo dinamico |
| 719 | 719 | // |
| 720 | 720 | $original = $objMapa->getmetadata("referenciaextentoriginal"); |
| 721 | + $ref = $objMapa->reference; | |
| 722 | + $em = $ref->extent; | |
| 721 | 723 | if($original != "") |
| 722 | 724 | { |
| 723 | 725 | $original = explode(" ",$original); |
| 724 | - $ref = $objMapa->reference; | |
| 725 | - $em = $ref->extent; | |
| 726 | 726 | $em->set("minx",$original[0]); |
| 727 | 727 | $em->set("miny",$original[1]); |
| 728 | 728 | $em->set("maxx",$original[2]); |
| ... | ... | @@ -735,7 +735,10 @@ function retornaReferencia() |
| 735 | 735 | $nomer = ($objImagem->imagepath)."ref".$nomeImagem.".png"; |
| 736 | 736 | $objImagem->saveImage($nomer); |
| 737 | 737 | $nomer = ($objImagem->imageurl).basename($nomer); |
| 738 | - $s = "var refimagem='".$nomer."';var refwidth=".$objImagem->width.";var refheight=".$objImagem->height.";var refpath='".$objImagem->imagepath."';var refurl='".$objImagem->imageurl."'"; | |
| 738 | + $d = (abs($em->maxx - $em->minx)) / ($objImagem->width); | |
| 739 | + $s = "g_celularef = ".$d.";"; | |
| 740 | + $s .= "objmapa.extentref = '".$em->minx." ".$em->miny." ".$em->maxx." ".$em->maxy."';"; | |
| 741 | + $s .= "var refimagem='".$nomer."';var refwidth=".$objImagem->width.";var refheight=".$objImagem->height.";var refpath='".$objImagem->imagepath."';var refurl='".$objImagem->imageurl."'"; | |
| 739 | 742 | $cp->set_data($s); |
| 740 | 743 | } |
| 741 | 744 | /* |
| ... | ... | @@ -813,6 +816,9 @@ function retornaReferenciaDinamica() |
| 813 | 816 | $original = $r->minx." ".$r->miny." ".$r->maxx." ".$r->maxy; |
| 814 | 817 | $mapa->setmetadata("referenciaextentoriginal",$original); |
| 815 | 818 | } |
| 819 | + $s .= ";objmapa.extentref = '".$r->minx." ".$r->miny." ".$r->maxx." ".$r->maxy."';"; | |
| 820 | + $d = (abs($r->maxx - $r->minx)) / ($objImagem->width); | |
| 821 | + $s .= "g_celularef = ".$d.";"; | |
| 816 | 822 | $emt = $objMapa->extent; |
| 817 | 823 | $r->set("minx",$emt->minx); |
| 818 | 824 | $r->set("miny",$emt->miny); | ... | ... |
classesphp/mapa_controle.php
| ... | ... | @@ -1267,7 +1267,7 @@ Include: |
| 1267 | 1267 | case "listaPontosShape": |
| 1268 | 1268 | include("classe_shp.php"); |
| 1269 | 1269 | $m = new SHP($map_file,$tema); |
| 1270 | - $cp->set_data($m->listaPontosShape($xy)); | |
| 1270 | + $cp->set_data($m->listaPontosShape()); | |
| 1271 | 1271 | break; |
| 1272 | 1272 | /* |
| 1273 | 1273 | Property: criashpvazio |
| ... | ... | @@ -1279,7 +1279,8 @@ Include: |
| 1279 | 1279 | */ |
| 1280 | 1280 | case "criashpvazio": |
| 1281 | 1281 | include("classe_shp.php"); |
| 1282 | - copiaSeguranca($map_file); | |
| 1282 | + //se colocar aqui da um erro | |
| 1283 | + //copiaSeguranca($map_file); | |
| 1283 | 1284 | $m = new SHP($map_file); |
| 1284 | 1285 | $cp->set_data($m->criaSHPvazio()); |
| 1285 | 1286 | $m->salva(); | ... | ... |
classesphp/mapa_inicia.php
| ... | ... | @@ -95,11 +95,6 @@ function iniciaMapa() |
| 95 | 95 | $m = new Mapa($map_file); |
| 96 | 96 | $m->mudaQS($w,$h); |
| 97 | 97 | $m = new Mapa($map_file); |
| 98 | - // | |
| 99 | - //aplica a extensao geografica que for passada como parametro | |
| 100 | - //para pegar o valor da escala e necessario redesenhar o mapa | |
| 101 | - //para o redesenho ficar mais rapido, um mapa temporario e criado e os temas sao desligados | |
| 102 | - // | |
| 103 | 98 | $m->mapa->setsize($w,$h); |
| 104 | 99 | // |
| 105 | 100 | //verifica se a legenda deve ser embebida no mapa |
| ... | ... | @@ -134,7 +129,7 @@ function iniciaMapa() |
| 134 | 129 | // |
| 135 | 130 | //cuidado ao mexer aqui |
| 136 | 131 | //o mapa precisa ser salvo para registrar a extensão geográfica |
| 137 | - // | |
| 132 | + // | |
| 138 | 133 | $imgo = $m->mapa->draw(); |
| 139 | 134 | $m->salva($map_file); |
| 140 | 135 | $e = $m->mapa->extent; | ... | ... |