From 1c31dfdcb295c69aa6497f70452c9c11816505dd Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 6 Dec 2007 21:56:26 +0000 Subject: [PATCH] correção na obtenção da extensão geográfica do mapa --- classesphp/classe_mapa.php | 9 +++------ classesphp/funcoes_gerais.php | 12 +++++++++--- classesphp/mapa_controle.php | 5 +++-- classesphp/mapa_inicia.php | 7 +------ 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/classesphp/classe_mapa.php b/classesphp/classe_mapa.php index 1707e47..19d2111 100644 --- a/classesphp/classe_mapa.php +++ b/classesphp/classe_mapa.php @@ -210,12 +210,9 @@ Include: // if (isset($utilizacgi) && strtolower($utilizacgi) == "sim" && $tipoimagem=="nenhum" && !$qy) { - //foreach($this->layers as $l) - //{$l->set("status",MS_OFF);} - //$imgo = @$this->mapa->draw(); - - $imgo = @$this->mapa->prepareImage(); - $this->mapa->preparequery(); + foreach($this->layers as $l) + {$l->set("status",MS_OFF);} + $imgo = @$this->mapa->draw(); } else { diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index 0ed83de..4ac34a2 100644 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -718,11 +718,11 @@ function retornaReferencia() //pega a extensao original caso ela tenha sido registrada no modo dinamico // $original = $objMapa->getmetadata("referenciaextentoriginal"); + $ref = $objMapa->reference; + $em = $ref->extent; if($original != "") { $original = explode(" ",$original); - $ref = $objMapa->reference; - $em = $ref->extent; $em->set("minx",$original[0]); $em->set("miny",$original[1]); $em->set("maxx",$original[2]); @@ -735,7 +735,10 @@ function retornaReferencia() $nomer = ($objImagem->imagepath)."ref".$nomeImagem.".png"; $objImagem->saveImage($nomer); $nomer = ($objImagem->imageurl).basename($nomer); - $s = "var refimagem='".$nomer."';var refwidth=".$objImagem->width.";var refheight=".$objImagem->height.";var refpath='".$objImagem->imagepath."';var refurl='".$objImagem->imageurl."'"; + $d = (abs($em->maxx - $em->minx)) / ($objImagem->width); + $s = "g_celularef = ".$d.";"; + $s .= "objmapa.extentref = '".$em->minx." ".$em->miny." ".$em->maxx." ".$em->maxy."';"; + $s .= "var refimagem='".$nomer."';var refwidth=".$objImagem->width.";var refheight=".$objImagem->height.";var refpath='".$objImagem->imagepath."';var refurl='".$objImagem->imageurl."'"; $cp->set_data($s); } /* @@ -813,6 +816,9 @@ function retornaReferenciaDinamica() $original = $r->minx." ".$r->miny." ".$r->maxx." ".$r->maxy; $mapa->setmetadata("referenciaextentoriginal",$original); } + $s .= ";objmapa.extentref = '".$r->minx." ".$r->miny." ".$r->maxx." ".$r->maxy."';"; + $d = (abs($r->maxx - $r->minx)) / ($objImagem->width); + $s .= "g_celularef = ".$d.";"; $emt = $objMapa->extent; $r->set("minx",$emt->minx); $r->set("miny",$emt->miny); diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index 35409be..46a4b85 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -1267,7 +1267,7 @@ Include: case "listaPontosShape": include("classe_shp.php"); $m = new SHP($map_file,$tema); - $cp->set_data($m->listaPontosShape($xy)); + $cp->set_data($m->listaPontosShape()); break; /* Property: criashpvazio @@ -1279,7 +1279,8 @@ Include: */ case "criashpvazio": include("classe_shp.php"); - copiaSeguranca($map_file); + //se colocar aqui da um erro + //copiaSeguranca($map_file); $m = new SHP($map_file); $cp->set_data($m->criaSHPvazio()); $m->salva(); diff --git a/classesphp/mapa_inicia.php b/classesphp/mapa_inicia.php index 4512c6b..001c258 100644 --- a/classesphp/mapa_inicia.php +++ b/classesphp/mapa_inicia.php @@ -95,11 +95,6 @@ function iniciaMapa() $m = new Mapa($map_file); $m->mudaQS($w,$h); $m = new Mapa($map_file); - // - //aplica a extensao geografica que for passada como parametro - //para pegar o valor da escala e necessario redesenhar o mapa - //para o redesenho ficar mais rapido, um mapa temporario e criado e os temas sao desligados - // $m->mapa->setsize($w,$h); // //verifica se a legenda deve ser embebida no mapa @@ -134,7 +129,7 @@ function iniciaMapa() // //cuidado ao mexer aqui //o mapa precisa ser salvo para registrar a extensão geográfica - // + // $imgo = $m->mapa->draw(); $m->salva($map_file); $e = $m->mapa->extent; -- libgit2 0.21.2