Commit f6e59278801b6b06572a6e1aaf5ec1e9498b4e6e
1 parent
8f350302
Exists in
master
and in
7 other branches
Inclusão de função para mover layers do tipo annotation para o topo do mapa
Showing
5 changed files
with
60 additions
and
22 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/classe_analise.php
@@ -233,24 +233,24 @@ Include: | @@ -233,24 +233,24 @@ Include: | ||
233 | break; | 233 | break; |
234 | //delaunay e voronoi | 234 | //delaunay e voronoi |
235 | case "deldir": | 235 | case "deldir": |
236 | - $this->mapaDeldir($nomearq,$dir_tmp,$R_path,$locaplic); | ||
237 | - $this->deldirDir2shp($nomearq."dirsgs",$dir_tmp,$locaplic); | ||
238 | - $this->deldirDel2shp($nomearq."delsgs",$dir_tmp,$locaplic); | ||
239 | - if(file_exists($this->qyfile)) | ||
240 | - {unlink($this->qyfile);} | 236 | + $this->mapaDeldir($nomearq,$dir_tmp,$R_path,$locaplic); |
237 | + $this->deldirDir2shp($nomearq."dirsgs",$dir_tmp,$locaplic); | ||
238 | + $this->deldirDel2shp($nomearq."delsgs",$dir_tmp,$locaplic); | ||
239 | + if(file_exists($this->qyfile)) | ||
240 | + {unlink($this->qyfile);} | ||
241 | return "ok"; | 241 | return "ok"; |
242 | break; | 242 | break; |
243 | case "kernel": | 243 | case "kernel": |
244 | - $this->mapaKernel($nomearq,$dimx,$dimy,$dir_tmp,$R_path,$locaplic,$sigma); | 244 | + $this->mapaKernel($nomearq,$dimx,$dimy,$dir_tmp,$R_path,$locaplic,$sigma); |
245 | break; | 245 | break; |
246 | case "densidade": | 246 | case "densidade": |
247 | - $this->mapaDensidade($nomearq,$dimx,$dimy,$dir_tmp,$R_path,$locaplic); | 247 | + $this->mapaDensidade($nomearq,$dimx,$dimy,$dir_tmp,$R_path,$locaplic); |
248 | break; | 248 | break; |
249 | case "distancia": | 249 | case "distancia": |
250 | - $this->mapaDistancia($nomearq,$dimx,$dimy,$dir_tmp,$R_path,$locaplic); | 250 | + $this->mapaDistancia($nomearq,$dimx,$dimy,$dir_tmp,$R_path,$locaplic); |
251 | break; | 251 | break; |
252 | case "relatorio": | 252 | case "relatorio": |
253 | - $r = $this->mapaRelatorioAnaliseDist($nomearq,$dimx,$dimy,$dir_tmp,$R_path,$locaplic); | 253 | + $r = $this->mapaRelatorioAnaliseDist($nomearq,$dimx,$dimy,$dir_tmp,$R_path,$locaplic); |
254 | return($tmpurl.basename($this->diretorio)."/".basename($nomearq).'.htm'); | 254 | return($tmpurl.basename($this->diretorio)."/".basename($nomearq).'.htm'); |
255 | break; | 255 | break; |
256 | } | 256 | } |
@@ -293,20 +293,29 @@ Include: | @@ -293,20 +293,29 @@ Include: | ||
293 | // | 293 | // |
294 | //reposiciona o layer | 294 | //reposiciona o layer |
295 | // | 295 | // |
296 | - $indicel = $novolayer->index; | ||
297 | - $numlayers = $this->mapa->numlayers; | ||
298 | - $nummove = 0; | ||
299 | - for ($i = $numlayers-1;$i > 0;$i--) | ||
300 | - { | ||
301 | - $layerAbaixo = $this->mapa->getlayer($i); | ||
302 | - $tipo = $layerAbaixo->type; | ||
303 | - if (($tipo != 2) && ($tipo != 3)) | ||
304 | - {$nummove++;} | 296 | + $layer = $this->mapa->getlayerbyname($this->nome); |
297 | + if($layer != ""){ | ||
298 | + $temp = ms_newLayerObj($this->mapa,$novolayer); | ||
299 | + $novolayer->set("status",MS_DELETE); | ||
300 | + $temp = ms_newLayerObj($this->mapa,$layer); | ||
301 | + $layer->set("status",MS_DELETE); | ||
305 | } | 302 | } |
306 | - if ($nummove > 2) | ||
307 | - { | ||
308 | - for ($i=0;$i<=($nummove - 3);++$i) | ||
309 | - {$this->mapa->movelayerup($indicel);} | 303 | + else{ |
304 | + $indicel = $novolayer->index; | ||
305 | + $numlayers = $this->mapa->numlayers; | ||
306 | + $nummove = 0; | ||
307 | + for ($i = $numlayers-1;$i > 0;$i--) | ||
308 | + { | ||
309 | + $layerAbaixo = $this->mapa->getlayer($i); | ||
310 | + $tipo = $layerAbaixo->type; | ||
311 | + if (($tipo != 2) && ($tipo != 3)) | ||
312 | + {$nummove++;} | ||
313 | + } | ||
314 | + if ($nummove > 2) | ||
315 | + { | ||
316 | + for ($i=0;$i<=($nummove - 3);++$i) | ||
317 | + {$this->mapa->movelayerup($indicel);} | ||
318 | + } | ||
310 | } | 319 | } |
311 | } | 320 | } |
312 | else | 321 | else |
classesphp/classe_atlas.php
@@ -235,6 +235,10 @@ locaplic - localização do i3geo no servidor | @@ -235,6 +235,10 @@ locaplic - localização do i3geo no servidor | ||
235 | {$ext->setextent($newext[0], $newext[1], $newext[2], $newext[3]);} | 235 | {$ext->setextent($newext[0], $newext[1], $newext[2], $newext[3]);} |
236 | $mapa->save($map_file); | 236 | $mapa->save($map_file); |
237 | } | 237 | } |
238 | + if(!function_exists("sobeAnno")){ | ||
239 | + include_once("funcoes_gerais.php"); | ||
240 | + } | ||
241 | + sobeAnno($map_file); | ||
238 | if ($w == ""){$w = 300;} | 242 | if ($w == ""){$w = 300;} |
239 | if($h == ""){$h = 300;} | 243 | if($h == ""){$h = 300;} |
240 | return (array("link"=>$link,"w"=>$w,"h"=>$h,"mapexten"=>implode(" ",$newext))); | 244 | return (array("link"=>$link,"w"=>$w,"h"=>$h,"mapexten"=>implode(" ",$newext))); |
classesphp/funcoes_gerais.php
@@ -2858,6 +2858,27 @@ function verificaEditores($editores) | @@ -2858,6 +2858,27 @@ function verificaEditores($editores) | ||
2858 | } | 2858 | } |
2859 | return $editor; | 2859 | return $editor; |
2860 | } | 2860 | } |
2861 | +/* | ||
2862 | +Function: sobeAnno | ||
2863 | + | ||
2864 | +Coloca todas as camadas do tipo ANNOTATION sobre as demais | ||
2865 | + | ||
2866 | +Parametros: | ||
2867 | + | ||
2868 | +$map_file - arquivo mapfile que será processado | ||
2869 | +*/ | ||
2870 | +function sobeAnno($map_file){ | ||
2871 | + $mapa = ms_newMapObj($map_file); | ||
2872 | + $numlayers = $mapa->numlayers; | ||
2873 | + for ($i=0;$i<$numlayers;$i++){ | ||
2874 | + $layer = $mapa->getlayer($i); | ||
2875 | + if($layer->type == 4){ | ||
2876 | + $temp = ms_newLayerObj($mapa,$layer); | ||
2877 | + $layer->set("status",MS_DELETE); | ||
2878 | + } | ||
2879 | + } | ||
2880 | + $mapa->save($map_file); | ||
2881 | +} | ||
2861 | function retornaShapesMapext($objLayer,$objMapa){ | 2882 | function retornaShapesMapext($objLayer,$objMapa){ |
2862 | $shapes = array(); | 2883 | $shapes = array(); |
2863 | $status = $objLayer->open(); | 2884 | $status = $objLayer->open(); |
classesphp/mapa_inicia.php
@@ -154,6 +154,10 @@ function iniciaMapa() | @@ -154,6 +154,10 @@ function iniciaMapa() | ||
154 | //altera o tamanho do query map para ficar igual ao do mapa | 154 | //altera o tamanho do query map para ficar igual ao do mapa |
155 | include_once("classe_mapa.php"); | 155 | include_once("classe_mapa.php"); |
156 | error_reporting(E_ALL); | 156 | error_reporting(E_ALL); |
157 | + if(!function_exists("sobeAnno")){ | ||
158 | + include_once("funcoes_gerais.php"); | ||
159 | + } | ||
160 | + sobeAnno($map_file); | ||
157 | $m = new Mapa($map_file); | 161 | $m = new Mapa($map_file); |
158 | if(isset($w)) | 162 | if(isset($w)) |
159 | { | 163 | { |