Commit 91325586843c05bcb1c15e88eed6407f215c948e
1 parent
c14c9eca
Exists in
master
and in
7 other branches
Atualização do código
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
admin/admin.db
No preview for this file type
ferramentas/carregamapa/upload.php
| @@ -26,7 +26,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | @@ -26,7 +26,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | ||
| 26 | echo "<p class='paragrafo' >Carregando o arquivo...</p>"; | 26 | echo "<p class='paragrafo' >Carregando o arquivo...</p>"; |
| 27 | $dirmap = $dir_tmp; | 27 | $dirmap = $dir_tmp; |
| 28 | $Arquivo = $_FILES['i3GEOcarregamapafilemap']['name']; | 28 | $Arquivo = $_FILES['i3GEOcarregamapafilemap']['name']; |
| 29 | - $Arquivo = str_replace(".map","",$Arquivo).".map"; | 29 | + $Arquivo = str_replace(".map","",$Arquivo)."_up.map"; |
| 30 | 30 | ||
| 31 | verificaNome($Arquivo); | 31 | verificaNome($Arquivo); |
| 32 | /* | 32 | /* |
| @@ -44,14 +44,13 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | @@ -44,14 +44,13 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | ||
| 44 | if($status == 1) | 44 | if($status == 1) |
| 45 | { | 45 | { |
| 46 | echo "<p class='paragrafo' >Arquivo enviado. Verificando o mapa...</p>"; | 46 | echo "<p class='paragrafo' >Arquivo enviado. Verificando o mapa...</p>"; |
| 47 | - substituiCon($map_file,$postgis_mapa); | ||
| 48 | - substituiCon($dirmap."/".$Arquivo,$postgis_mapa); | 47 | + |
| 49 | $mapt = ms_newMapObj($dirmap."/".$Arquivo); | 48 | $mapt = ms_newMapObj($dirmap."/".$Arquivo); |
| 50 | $map = ms_newMapObj($map_file); | 49 | $map = ms_newMapObj($map_file); |
| 50 | + | ||
| 51 | //apaga os layers do mapa atual | 51 | //apaga os layers do mapa atual |
| 52 | $numlayers = $map->numlayers; | 52 | $numlayers = $map->numlayers; |
| 53 | - for ($i=0;$i < $numlayers;$i++) | ||
| 54 | - { | 53 | + for ($i=0;$i < $numlayers;$i++) { |
| 55 | $layer = $map->getlayer($i); | 54 | $layer = $map->getlayer($i); |
| 56 | $layer->set("status",MS_DELETE); | 55 | $layer->set("status",MS_DELETE); |
| 57 | } | 56 | } |
| @@ -85,6 +84,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | @@ -85,6 +84,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | ||
| 85 | } | 84 | } |
| 86 | $map->save($map_file); | 85 | $map->save($map_file); |
| 87 | restauraCon($map_file,$postgis_mapa); | 86 | restauraCon($map_file,$postgis_mapa); |
| 87 | + unlink($dirmap."/".$Arquivo); | ||
| 88 | $e = $mapt->extent; | 88 | $e = $mapt->extent; |
| 89 | $extatual = $e->minx." ".$e->miny." ".$e->maxx." ".$e->maxy; | 89 | $extatual = $e->minx." ".$e->miny." ".$e->maxx." ".$e->maxy; |
| 90 | echo "<p class='paragrafo' >Ok. redesenhando."; | 90 | echo "<p class='paragrafo' >Ok. redesenhando."; |