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,9 +161,12 @@ if(!isset($tema) && isset($typename)){ | ||
161 | } | 161 | } |
162 | // | 162 | // |
163 | //garante que layers possam ser especificados de diferentes maneiras | 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 | $layers = $tema; | 170 | $layers = $tema; |
168 | // | 171 | // |
169 | //verifica o OUTPUTFORMAT e o cache de arquivo | 172 | //verifica o OUTPUTFORMAT e o cache de arquivo |
@@ -273,7 +276,15 @@ if(isset($_GET["DESLIGACACHE"]) && $_GET["DESLIGACACHE"] == "sim"){ | @@ -273,7 +276,15 @@ if(isset($_GET["DESLIGACACHE"]) && $_GET["DESLIGACACHE"] == "sim"){ | ||
273 | $agora = time(); | 276 | $agora = time(); |
274 | $cache = false; | 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 | //essa variavel e usada para definir se a imagem final gerada devera ser cortada ou nao | 288 | //essa variavel e usada para definir se a imagem final gerada devera ser cortada ou nao |
278 | $cortePixels = 0; | 289 | $cortePixels = 0; |
279 | if(file_exists($nomeMapfileTmp) && $tipo == ""){ | 290 | if(file_exists($nomeMapfileTmp) && $tipo == ""){ |
@@ -1220,7 +1231,8 @@ function restauraMapaSalvo(){ | @@ -1220,7 +1231,8 @@ function restauraMapaSalvo(){ | ||
1220 | $l = $m->getlayerbyname("copyright"); | 1231 | $l = $m->getlayerbyname("copyright"); |
1221 | if($l != ""){ | 1232 | if($l != ""){ |
1222 | $l->set("status",MS_DELETE); | 1233 | $l->set("status",MS_DELETE); |
1223 | - } | 1234 | + } |
1235 | + $m->setmetadata("ows_enable_request","*"); | ||
1224 | $m->save($xbase); | 1236 | $m->save($xbase); |
1225 | //$fundo = $xbase; | 1237 | //$fundo = $xbase; |
1226 | $tema = $xbase; | 1238 | $tema = $xbase; |