diff --git a/classesphp/classe_mapa.php b/classesphp/classe_mapa.php index e923877..a7b6d32 100755 --- a/classesphp/classe_mapa.php +++ b/classesphp/classe_mapa.php @@ -227,7 +227,6 @@ class Mapa $temas = array(); $existesel = false; $dir = dirname($this->arquivo); - //$qy = file_exists($this->qyfile); foreach($this->layers as $l){ $l->set("template","none.htm"); } @@ -278,7 +277,7 @@ class Mapa foreach ($this->layers as $oLayer){ $sel = "nao"; $nSel = 0; - $arqS = $dir."/".$oLayer->name.".php"; + $arqS = $dir."/".$oLayer->name."_qy.map"; if(file_exists($arqS)){ $sel = "sim"; $existesel = true; @@ -462,51 +461,6 @@ class Mapa } $ferramentas["animagif"] = json_decode($f); } - //formatacao antiga, antes da versao 6.0 - /* - $temas[] = array( - "name"=>($oLayer->name), - "nomeoriginal"=>($oLayer->getmetadata("nomeoriginal")), - "status"=>($oLayer->status), - "tema"=>(mb_convert_encoding(($oLayer->getmetadata("tema")),"UTF-8","ISO-8859-1")), - "transparency"=>($oLayer->opacity), - "type"=>($oLayer->type), - "sel"=>$sel, - "nsel"=>$nSel, - "escala"=>$escala, - "download"=>$down, - "features"=>$f, - "connectiontype"=>$ct, - "zoomtema"=>$zoomtema, - "contextoescala"=>$contextoescala, - "etiquetas"=>($oLayer->getmetadata("TIP")), - "identifica"=>($oLayer->getmetadata("IDENTIFICA")), - "editorsql"=>$editorsql, - "linhadotempo"=>$ltempo, - "escondido"=>strtolower($escondido), - "iconetema"=>($oLayer->getmetadata("iconetema")), - "classe"=>($oLayer->getmetadata("classe")), - "permitecomentario"=>$permitecomentario, - "exttema"=>$exttema, - "aplicaextensao"=>$aplicaextensao, - "transitioneffect"=>$transitioneffect, - "wmsurl"=>$wmsurl, - "wmsname"=>$wmsname, - "wmsformat"=>$wmsformat, - "wmssrs"=>$wmssrs, - "wmstile"=>$wmstile, - "tiles"=>$tiles, - "temporizador"=>($oLayer->getmetadata("temporizador")), - "permiteogc"=>($oLayer->getmetadata("permiteogc")), - "itembuscarapida"=>($oLayer->getmetadata("itembuscarapida")), - "usasld"=>$usasld, - "cache"=>$cache, - "editavel"=>($oLayer->getmetadata("EDITAVEL")), - "colunaidunico"=>($oLayer->getmetadata("COLUNAIDUNICO")), - "cortepixels"=>$cortepixels, - "plugini3geo"=>$plugini3geo - ); - */ $temas[] = array( $oLayer->name, $oLayer->getmetadata("nomeoriginal"), diff --git a/classesphp/classe_selecao.php b/classesphp/classe_selecao.php index 04316b4..16b2d7e 100755 --- a/classesphp/classe_selecao.php +++ b/classesphp/classe_selecao.php @@ -103,9 +103,9 @@ $ext - extensão geográfica do mapa $this->postgis_mapa = $postgis_mapa; $this->v = versao(); $this->v = $this->v["principal"]; - $this->qyfile = str_replace(".map",".qy",$map_file); + $this->qyfile = str_replace(".map","_qy.map",$map_file); if($tema != ""){ - $this->qyfileTema = dirname($map_file)."/".$tema.".php"; + $this->qyfileTema = dirname($map_file)."/".$tema."_qy.map"; } else{ $this->qyfileTema = ""; @@ -953,6 +953,7 @@ $arquivo - arquivo que será processado */ function unserializeQ($arq) { + $arq = str_replace("_qy.map","",$arq)."_qy.map"; $handle = fopen ($arq, "r"); $conteudo = fread ($handle, filesize ($arq)); fclose ($handle); @@ -970,8 +971,10 @@ $geos - array com os dados */ function serializeQ($arq,$geos) { - if (file_exists($arq)) - {unlink($arq);} + $arq = str_replace("_qy.map","",$arq)."_qy.map"; + if (file_exists($arq)){ + unlink($arq); + } $fp = fopen($arq,"w"); $r = serialize($geos); fwrite($fp,$r); diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index 7e793e8..6efb825 100755 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -2491,7 +2491,7 @@ function removeLinha($texto,$mapfile) // function carregaquery($mapfile,$objlayer,$objmapa) { - $qyfile = dirname($mapfile)."/".$objlayer->name.".php"; + $qyfile = dirname($mapfile)."/".$objlayer->name."_qy.map"; if(file_exists($qyfile)) { $indxlayer = $objlayer->index; @@ -2522,7 +2522,7 @@ $objmapa */ function carregaquery2($mapfile,&$objlayer,&$objmapa) { - $qyfile = dirname($mapfile)."/".$objlayer->name.".php"; + $qyfile = dirname($mapfile)."/".$objlayer->name."_qy.map"; if(file_exists($qyfile)){ $indxlayer = $objlayer->index; $handle = fopen ($qyfile, "r"); @@ -2620,11 +2620,10 @@ function retornaShapesMapext($objLayer,$objMapa){ } function retornaShapesSelecionados($objLayer,$map_file,$objMapa,$indexado=false){ $shapes = array(); - $qyfile = dirname($map_file)."/".$objLayer->name.".php"; + $qyfile = dirname($map_file)."/".$objLayer->name."_qy.map"; if(!file_exists($qyfile)){ return $shapes; } - $handle = fopen ($qyfile, "r"); $conteudo = fread ($handle, filesize ($qyfile)); fclose ($handle); diff --git a/classesphp/mapa_googleearth.php b/classesphp/mapa_googleearth.php index d96d390..f43f7c5 100755 --- a/classesphp/mapa_googleearth.php +++ b/classesphp/mapa_googleearth.php @@ -122,7 +122,7 @@ function retornaWms($map_fileX,$postgis_mapa){ // //resolve o problema da seleção na versão nova do mapserver // - $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; + $qyfile = dirname($map_fileX)."/".$_GET["layer"]."_qy.map"; $qy = file_exists($qyfile); $o = $mapa->outputformat; $o->set("imagemode",MS_IMAGEMODE_RGBA); diff --git a/classesphp/mapa_googlemaps.php b/classesphp/mapa_googlemaps.php index a99b7cb..50c05dc 100755 --- a/classesphp/mapa_googlemaps.php +++ b/classesphp/mapa_googlemaps.php @@ -110,7 +110,7 @@ elseif ($_GET["X"] != ""){ $y = $_GET["Y"]; $z = $_GET["Z"]; - $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; + $qyfile = dirname($map_fileX)."/".$_GET["layer"]."_qy.map"; $qy = file_exists($qyfile); if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ carregaCacheImagem(); diff --git a/classesphp/mapa_openlayers.php b/classesphp/mapa_openlayers.php index fc7ad3f..d13961f 100755 --- a/classesphp/mapa_openlayers.php +++ b/classesphp/mapa_openlayers.php @@ -144,7 +144,7 @@ if(!empty($_GET["request"])){ // //resolve o problema da selecao nas versoes mais recentes nova do mapserver // -$qyfile = dirname($map_fileX)."/".$_GET["layer"]; +$qyfile = dirname($map_fileX)."/".$_GET["layer"]."_qy.map"; $qy = file_exists($qyfile); if($_GET["REQUEST"] == "getlegendgraphic" || $_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature"){ diff --git a/ferramentas/inicia.php b/ferramentas/inicia.php index 7b0e2a3..274c12c 100755 --- a/ferramentas/inicia.php +++ b/ferramentas/inicia.php @@ -45,6 +45,7 @@ if(!empty($g_sid)){ $mapdir = $_SESSION["mapdir"]; $imgdir = $_SESSION["imgdir"]; $contadorsalva = $_SESSION["contadorsalva"]; + $fingerprint = $_SESSION['fingerprint']; } include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); if(isset($fingerprint) && !empty($g_sid)) { diff --git a/ferramentas/safe.php b/ferramentas/safe.php new file mode 100755 index 0000000..fc59954 --- /dev/null +++ b/ferramentas/safe.php @@ -0,0 +1,87 @@ +mudaExtensao($mapexten); + $m->salva(); + } + include_once(dirname(__FILE__)."/../classesphp/classe_mapa.php"); + $m = New Mapa($map_file); + $par = $m->parametrosTemas(); + // + //na interface googlemaps não é necessário gerar a imagem + // + $e = $m->mapa->extent; + $ext = $e->minx." ".$e->miny." ".$e->maxx." ".$e->maxy; + $res["mapimagem"] = ""; + $res["mapexten"] = $ext; + $res["mapres"] = ""; + $res["erro"] = ""; + $res["mapscale"] = ""; + $res["pixelsize"] = ""; + $res["mapimagem"] = ""; + $res["w"] = $m->mapa->width; + $res["h"] = $m->mapa->height; + $res["mappath"] = ""; + $res["mapurl"] = ""; + $res["mensagens"] = $m->pegaMensagens(); + $res["tempo"] = microtime(1) - $tempo; + restauraCon($map_file,$postgis_mapa); + ob_clean(); + if ($par == "") + {$retorno = "erro";} + else + {$retorno = array("variaveis"=>$res,"temas"=>$par);} + cpjson($retorno); +} +?> \ No newline at end of file -- libgit2 0.21.2