Commit 88b15e63e856f08654f59e47575097871d9eef7a
1 parent
676af260
Exists in
master
and in
7 other branches
Corrige o uso da opção de restaurar um mapa e usar OGC com o arquivo restaurado
Showing
2 changed files
with
16 additions
and
4 deletions
Show diff stats
admin/admin.db
No preview for this file type
ogc.php
| ... | ... | @@ -161,9 +161,12 @@ if(!isset($tema) && isset($typename)){ |
| 161 | 161 | } |
| 162 | 162 | // |
| 163 | 163 | //garante que layers possam ser especificados de diferentes maneiras |
| 164 | +//mas evita definir o layer como o nome do mapfile | |
| 164 | 165 | // |
| 165 | -$_GET["layers"] = $tema; | |
| 166 | -$_GET["LAYERS"] = $tema; | |
| 166 | +if(!file_exists($tema)){ | |
| 167 | + $_GET["layers"] = $tema; | |
| 168 | + $_GET["LAYERS"] = $tema; | |
| 169 | +} | |
| 167 | 170 | $layers = $tema; |
| 168 | 171 | // |
| 169 | 172 | //verifica o OUTPUTFORMAT e o cache de arquivo |
| ... | ... | @@ -273,7 +276,15 @@ if(isset($_GET["DESLIGACACHE"]) && $_GET["DESLIGACACHE"] == "sim"){ |
| 273 | 276 | $agora = time(); |
| 274 | 277 | $cache = false; |
| 275 | 278 | } |
| 276 | -$nomeMapfileTmp = $dir_tmp."/ogc_".md5(implode("",$_GET))."_".$agora.".map"; | |
| 279 | +//remove o bbox do calculo do nome do mapfile | |
| 280 | +$arrayget = $_GET; | |
| 281 | +$arrayget["bbox"] = ""; | |
| 282 | +$arrayget["BBOX"] = ""; | |
| 283 | +$arrayget["Z"] = ""; | |
| 284 | +$arrayget["X"] = ""; | |
| 285 | +$arrayget["Y"] = ""; | |
| 286 | +$arrayget["tms"] = ""; | |
| 287 | +$nomeMapfileTmp = $dir_tmp."/ogc_".md5(implode("",$arrayget))."_".$agora.".map"; | |
| 277 | 288 | //essa variavel e usada para definir se a imagem final gerada devera ser cortada ou nao |
| 278 | 289 | $cortePixels = 0; |
| 279 | 290 | if(file_exists($nomeMapfileTmp) && $tipo == ""){ |
| ... | ... | @@ -1220,7 +1231,8 @@ function restauraMapaSalvo(){ |
| 1220 | 1231 | $l = $m->getlayerbyname("copyright"); |
| 1221 | 1232 | if($l != ""){ |
| 1222 | 1233 | $l->set("status",MS_DELETE); |
| 1223 | - } | |
| 1234 | + } | |
| 1235 | + $m->setmetadata("ows_enable_request","*"); | |
| 1224 | 1236 | $m->save($xbase); |
| 1225 | 1237 | //$fundo = $xbase; |
| 1226 | 1238 | $tema = $xbase; | ... | ... |