Commit 75da765234eb49e78be2eeceb3a8ffedfcf95e61

Authored by Edmar Moretti
1 parent 62eb9c7d

Inclusão de rotina para limpeza de cache de arquivos mapfile usados por ogc.php

admin/php/editormapfile.php
@@ -2030,8 +2030,14 @@ function alterarEstilo() @@ -2030,8 +2030,14 @@ function alterarEstilo()
2030 $nclasses = $layer->numclasses; 2030 $nclasses = $layer->numclasses;
2031 $classe = $layer->getclass($indiceClasse); 2031 $classe = $layer->getclass($indiceClasse);
2032 $estilo = $classe->getstyle($indiceEstilo); 2032 $estilo = $classe->getstyle($indiceEstilo);
2033 - $estilo->set("symbolname",$symbolname); 2033 + if(!empty($symbolname)){
  2034 + $estilo->set("symbolname",$symbolname);
  2035 + }
  2036 + if(empty($symbolname)){
  2037 + $estilo->set("symbolname"," ");
  2038 + }
2034 corE($estilo,$color,"color"); 2039 corE($estilo,$color,"color");
  2040 +
2035 $estilo->set("size",$size); 2041 $estilo->set("size",$size);
2036 $estilo->set("minsize",$minsize); 2042 $estilo->set("minsize",$minsize);
2037 $estilo->set("maxsize",$maxsize); 2043 $estilo->set("maxsize",$maxsize);
@@ -2052,6 +2058,15 @@ function alterarEstilo() @@ -2052,6 +2058,15 @@ function alterarEstilo()
2052 2058
2053 function removeCabecalho($arq,$symbolset=true) 2059 function removeCabecalho($arq,$symbolset=true)
2054 { 2060 {
  2061 + global $dir_tmp;
  2062 + //remove o cache OGC
  2063 + $nomeMapfileTmp = $dir_tmp."/ogc_".md5($arq).".map";
  2064 + $nomeMapfileTmp = str_replace(",","",$nomeMapfileTmp);
  2065 + $nomeMapfileTmp = str_replace(" ","",$nomeMapfileTmp);
  2066 + chmod($nomeMapfileTmp,0777);
  2067 + unlink($nomeMapfileTmp);
  2068 + //echo $nomeMapfileTmp;exit;
  2069 + //remove o cache OGC
2055 $handle = fopen($arq, "r"); 2070 $handle = fopen($arq, "r");
2056 if ($handle) 2071 if ($handle)
2057 { 2072 {
admin/php/editortexto.php
@@ -43,6 +43,14 @@ body { @@ -43,6 +43,14 @@ body {
43 { 43 {
44 echo "Arquivo $mapfile não existe.";exit; 44 echo "Arquivo $mapfile não existe.";exit;
45 } 45 }
  46 + //remove o cache OGC
  47 + $nomeMapfileTmp = $dir_tmp."/ogc_".md5($mapfile).".map";
  48 + $nomeMapfileTmp = str_replace(",","",$nomeMapfileTmp);
  49 + $nomeMapfileTmp = str_replace(" ","",$nomeMapfileTmp);
  50 + chmod($nomeMapfileTmp,0777);
  51 + unlink($nomeMapfileTmp);
  52 + //echo $nomeMapfileTmp;exit;
  53 + //
46 if($_POST["tipo"] == "gravar"){ 54 if($_POST["tipo"] == "gravar"){
47 $fp = fopen($mapfile,"w"); 55 $fp = fopen($mapfile,"w");
48 fwrite($fp,$gravarTexto); 56 fwrite($fp,$gravarTexto);
@@ -45,7 +45,7 @@ legenda - (opcional) mostra a legenda no corpo do mapa sim|nao @@ -45,7 +45,7 @@ legenda - (opcional) mostra a legenda no corpo do mapa sim|nao
45 perfil - (opcional) perfil utilizado para restringir os temas que serão mostrados 45 perfil - (opcional) perfil utilizado para restringir os temas que serão mostrados
46 46
47 format - (opcional) pode ser utilizado a opção &format=application/openlayers para abrir o mashup do OpenLayers com as camadas definida em temas 47 format - (opcional) pode ser utilizado a opção &format=application/openlayers para abrir o mashup do OpenLayers com as camadas definida em temas
48 - 48 +
49 Exemplos: 49 Exemplos:
50 50
51 ogc.php?temas=biomashp&format=application/openlayers&bbox=-54,-14,-50,-10 51 ogc.php?temas=biomashp&format=application/openlayers&bbox=-54,-14,-50,-10
temas/_lbiomashp.map
@@ -21,6 +21,7 @@ MAP @@ -21,6 +21,7 @@ MAP
21 PROCESSING "ITEMS=CD_LEGENDA" 21 PROCESSING "ITEMS=CD_LEGENDA"
22 STATUS OFF 22 STATUS OFF
23 TEMPLATE "none.htm" 23 TEMPLATE "none.htm"
  24 + TILEITEM "location"
24 OPACITY 50 25 OPACITY 50
25 TYPE POLYGON 26 TYPE POLYGON
26 UNITS METERS 27 UNITS METERS
@@ -29,7 +30,7 @@ MAP @@ -29,7 +30,7 @@ MAP
29 EXPRESSION ('[CD_LEGENDA]'eq'CAATINGA') 30 EXPRESSION ('[CD_LEGENDA]'eq'CAATINGA')
30 STYLE 31 STYLE
31 ANGLE 0 32 ANGLE 0
32 - COLOR 21 44 114 33 + COLOR 255 255 0
33 OFFSET 0 0 34 OFFSET 0 0
34 END # STYLE 35 END # STYLE
35 END # CLASS 36 END # CLASS
@@ -56,7 +57,7 @@ MAP @@ -56,7 +57,7 @@ MAP
56 EXPRESSION ('[CD_LEGENDA]'eq'PANTANAL') 57 EXPRESSION ('[CD_LEGENDA]'eq'PANTANAL')
57 STYLE 58 STYLE
58 ANGLE 0 59 ANGLE 0
59 - COLOR 242 192 145 60 + COLOR 0 192 145
60 OFFSET 0 0 61 OFFSET 0 0
61 END # STYLE 62 END # STYLE
62 END # CLASS 63 END # CLASS