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