Commit 85c3eb1e67dc76af8258533deb2467e5ba631aac

Authored by Edmar Moretti
1 parent f502f42a

Correção no teste rapido para não usar imagem em cache

Showing 2 changed files with 9 additions and 6 deletions   Show diff stats
admin/js/editormapfile.js
... ... @@ -316,7 +316,7 @@ function testarMapfileRapido(codigoMap,extensao)
316 316 $i("testeRapido"+codigoMap).style.display = "none";
317 317 return;
318 318 }
319   - $i("testeRapido"+codigoMap).src = "../../testamapfile.php?tipo=grande&map="+codigoMap+".map";
  319 + $i("testeRapido"+codigoMap).src = "../../testamapfile.php?cache=nao&tipo=grande&map="+codigoMap+".map";
320 320 $i("testeRapido"+codigoMap).style.display = "block";
321 321 }
322 322 function testarMapfile(codigoMap,extensao)
... ...
testamapfile.php
... ... @@ -125,7 +125,10 @@ if (isset($map) && $map != "")
125 125 echo "<hr><br><br><a href='testamapfile.php?map=todos&iniciar=".($iniciar+10)."' >Próximos mapas</a>";
126 126 }
127 127 else{
128   - verifica($map,$solegenda,$tabela);
  128 + if(empty($cache)){
  129 + $cache = "sim";
  130 + }
  131 + verifica($map,$solegenda,$tabela,$cache);
129 132 }
130 133 }
131 134 ?>
... ... @@ -152,15 +155,15 @@ if (isset($map) &amp;&amp; $map != &quot;&quot;)
152 155 </html>
153 156  
154 157 <?php
155   -function verifica($map,$solegenda,$tabela){
  158 +function verifica($map,$solegenda,$tabela,$cache="sim"){
156 159 global $tipo,$locaplic,$postgis_mapa,$versao,$base,$dir_tmp,$tempo;
157 160 $mapUrl = $map;
158   - if ($tipo == "mini" && file_exists('temas/miniaturas/'.$map.".mini.png")){
  161 + if ($tipo == "mini" && file_exists('temas/miniaturas/'.$map.".mini.png") && $cache == "sim"){
159 162 Header("Content-type: image/png");
160 163 ImagePng(ImageCreateFromPNG('temas/miniaturas/'.$map.".mini.png"));
161 164 exit;
162 165 }
163   - if ($tipo == "grande" && file_exists('temas/miniaturas/'.$map.".grande.png")){
  166 + if ($tipo == "grande" && file_exists('temas/miniaturas/'.$map.".grande.png") && $cache == "sim"){
164 167 Header("Content-type: image/png");
165 168 ImagePng(ImageCreateFromPNG('temas/miniaturas/'.$map.".grande.png"));
166 169 exit;
... ... @@ -510,4 +513,4 @@ function zoomTema($nomelayer,&amp;$mapa){
510 513 $extatual->setextent($ret[0],$ret[1],$ret[2],$ret[3]);
511 514 }
512 515 }
513   -?>
514 516 \ No newline at end of file
  517 +?>
... ...