diff --git a/admin/admin.db b/admin/admin.db index c3a19ab..8c6e523 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/classesphp/mapa_openlayers.php b/classesphp/mapa_openlayers.php index 84b497c..8eb1358 100644 --- a/classesphp/mapa_openlayers.php +++ b/classesphp/mapa_openlayers.php @@ -67,6 +67,7 @@ inicializa(); //nos casos do modo notile, a requisicao e feita como se fosse um wms //quando for do tipo tms $_GET["tms"] contem os parametros do tile // + if(isset($_GET["tms"])){ $_GET["WIDTH"] = 256; $_GET["HEIGHT"] = 256; @@ -83,10 +84,11 @@ if(isset($_GET["tms"])){ $lat2 = ($y+1) / $n * 180.0 - 90.0; $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2; } + //para o caso da versao 3 do OpenLayers -//excluir? -if(isset($_GET["X"])){ - $box = explode(",",$_GET["BBOX"]); +if(isset($_GET["X"]) && !($_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature")){ + $box = str_replace(" ",",",$_GET["BBOX"]); + $box = explode(",",$box); $res = ($box[2] + 180) - ($box[0] + 180); $res = $res / 256; $z = intval((0.703125 / $res) / 4) + 1; @@ -98,6 +100,7 @@ if(isset($_GET["X"])){ $_GET["tms"] = "/".$_GET["layer"]."/".$z."/".$x."/".$y.".png"; echo $_GET["BBOX"]." ".$_GET["tms"];exit; } + if(isset($_GET["TileMatrix"])){ $_GET["WIDTH"] = 256; $_GET["HEIGHT"] = 256; @@ -128,6 +131,7 @@ if(isset($_GET["TileMatrix"])){ $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2; } + $map_fileX = $_SESSION["map_file"]; // //verifica se o request e OGC @@ -139,11 +143,14 @@ if(!empty($_GET["request"])){ // $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; $qy = file_exists($qyfile); -if($_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature"){ + +if($_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature"){ $_GET["DESLIGACACHE"] = "sim"; } -if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ - carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"],$_SESSION["i3georendermode"]); +else{ + if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ + carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"],$_SESSION["i3georendermode"]); + } } // //map_fileX e para o caso register_globals = On no PHP.INI @@ -219,7 +226,6 @@ if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alter } } } - if($layerName == $_GET["layer"]){ if(strtolower($l->getmetadata("cache")) == "sim"){ $cache = true; @@ -228,7 +234,7 @@ if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alter $nomecache = $layerName; } } - if($_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature" ){ + if($_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature" ){ $l->setmetadata("gml_include_items","all"); $l->set("template","none.htm"); $l->setmetadata("WMS_INCLUDE_ITEMS","all"); @@ -243,6 +249,7 @@ if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alter } } } + if (!function_exists('imagepng')){ $_GET["TIPOIMAGEM"] = ""; } @@ -273,9 +280,13 @@ if(isset($_GET["mapext"])){ // //qd a cahamda e para um WMS, redireciona para ogc.php // -if($_GET["REQUEST"] == "GetFeatureInfo" || $_GET["REQUEST"] == "getfeature"){ +if($_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST"] == "GetFeatureInfo" || $_GET["REQUEST"] == "getfeature"){ $req = ms_newowsrequestobj(); + if($_GET["BBOX"]){ + $_GET["BBOX"] = str_replace(" ",",",$_GET["BBOX"]); + } $_GET = array_merge($_GET,$_POST); + foreach ($_GET as $k=>$v){ $req->setParameter($k, $v); } @@ -283,7 +294,6 @@ if($_GET["REQUEST"] == "GetFeatureInfo" || $_GET["REQUEST"] == "getfeature"){ $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; $or = $proto.$server.$_SERVER['PHP_SELF']; $mapa->setmetadata("wfs_onlineresource",$or."?".$_SERVER["QUERY_STRING"]); - ms_ioinstallstdouttobuffer(); $mapa->owsdispatch($req); $contenttype = ms_iostripstdoutbuffercontenttype(); @@ -560,7 +570,7 @@ function inicializa(){ ilegal(); } session_start(); - if($_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature"){ + if($_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature"){ return; } if(@$_SESSION["fingerprint"]){ diff --git a/ferramentas/editorol/editorol.js b/ferramentas/editorol/editorol.js index 2747def..e5d9abd 100755 --- a/ferramentas/editorol/editorol.js +++ b/ferramentas/editorol/editorol.js @@ -747,13 +747,16 @@ i3GEO.editorOL = YAHOO.legendaeditorOL.container.panel.show(); } }, - captura : function(lonlat) { - // if(i3GEO.desenho.layergrafico !== ""){return;} - - var d = 0.1, layers = [ - i3GEO.editorOL.layerAtivo() - ], xy = lonlat.split(","), u = layers[0].url + "&REQUEST=getfeature&service=wfs&version=1.0.0"; - u += "&OUTPUTFORMAT=gml2&typename=" + layers[0].params.LAYERS; + captura : function(x,y,tema) { + var d = 0.1, + layer = i3geoOL.getLayersByName(tema)[0], + xy = [x,y], + u = layer.getSource().getUrls()[0], + poligono, retorno; + + u += "&REQUEST=getfeature&service=wfs&version=1.0.0"; + u += "&OUTPUTFORMAT=gml2&typename=undefined"; + // remove parametros nao desejados if (i3GEO.Interface.openlayers.googleLike === true) { u += "&SRS=EPSG:3857"; @@ -761,12 +764,10 @@ i3GEO.editorOL = u = u.replace("&cache=sim", "&DESLIGACACHE=sim"); u = u.replace("&Z=${z}&X=${x}&Y=${y}", ""); u = u.replace("Z=${z}&X=${x}&Y=${y}", ""); - // u += - // "&filter=Geometry"+lonlat+""; xy[0] = xy[0] * 1; xy[1] = xy[1] * 1; - var poligono = + poligono = (xy[0] - d) + "," + (xy[1] + d) + " " @@ -788,46 +789,13 @@ i3GEO.editorOL = u += "&filter=Geometry" + poligono + ""; - - document.body.style.cursor = "wait"; - if (document.getElementById("i3geoMapa")) { - document.getElementById("i3geoMapa").style.cursor = "wait"; - } - OpenLayers.Request.issue({ - method : "GET", - url : u, - callback : function(retorno) { - document.body.style.cursor = "default"; - if (document.getElementById("i3geoMapa")) { - document.getElementById("i3geoMapa").style.cursor = "default"; - } - var i, n, f, fromgml = new OpenLayers.Format.GML({ - geometryName : "msGeometry" - }), gml = fromgml.read(retorno.responseText); - n = gml.length; - for (i = 0; i < n; i++) { - f = gml[i]; - f["attributes"] = { - opacidade : i3GEO.editorOL.simbologia.opacidade, - texto : i3GEO.editorOL.simbologia.texto, - fillColor : i3GEO.editorOL.simbologia.fillColor, - strokeWidth : i3GEO.editorOL.simbologia.strokeWidth, - strokeColor : i3GEO.editorOL.simbologia.strokeColor, - pointRadius : i3GEO.editorOL.simbologia.pointRadius, - graphicName : i3GEO.editorOL.simbologia.graphicName, - registros : f["attributes"] - }; - } - i3GEO.desenho.layergrafico.addFeatures(gml); - }, - failure : function() { - document.body.style.cursor = "default"; - if (document.getElementById("i3geoMapa")) { - document.getElementById("i3geoMapa").style.cursor = "default"; - } - alert("Erro"); - } - }); + retorno = function(r){ + //parser gml + }; + u = i3GEO.configura.locaplic + "/classesphp/proxy.php?" + + u + + "&tipoRetornoProxy=string"; + cpJSON.call(u, "foo", retorno, ""); }, salvaGeometrias : function() { var geos = i3GEO.desenho.layergrafico.selectedFeatures, n = geos.length, ins = ""; @@ -1514,18 +1482,45 @@ i3GEO.editorOL = url = layer.getSource().getUrls()[0]; xy = evt.target.downPx_; retorno = function(r){ - var xy = evt.feature.getGeometry().getFirstCoordinate(); + var texto = "", lonlattexto, xy, temp, temp1, n, i, f = [], textoN = r.split(":"); + xy = evt.feature.getGeometry().getFirstCoordinate(); i3GEO.eventos.cliquePerm.ativo = true; - i3GEO.Interface.openlayers.balao(r,"", xy[0], xy[1]); + try { + if (textoN.length > 1) { + temp = textoN[2].replace(/\n\r/g, ""); + temp = temp.replace(/'/g, ""); + temp = temp.replace(/\n/g, "|"); + temp = temp.replace(/_/g, " "); + temp = temp.replace(/=/g, ":"); + temp = temp.split("|"); + n = temp.length; + for (i = 0; i < n; i++) { + temp1 = temp[i].replace(/^\s+/, ""); + temp1 = temp1.replace(/\s+$/, ""); + if (temp1 != "") + f.push(temp1); + } + texto = "
" + f.join("
") + "
"; + } + } catch (e) {} + //funcao para capturar a geometria + lonlattexto = + "edita geometria
"; + i3GEO.Interface.openlayers.balao("
" + lonlattexto + texto + "
","", xy[0], xy[1], false, false); i3GEO.eventos.cliquePerm.ativo = false; }; p = i3GEO.configura.locaplic + "/classesphp/proxy.php?" + url + "&tipoRetornoProxy=string&REQUEST=GetFeatureInfo&TIPOIMAGEM=nenhum&DESLIGACACHE=sim&STYLES=&SERVICE=WMS&VERSION=1.1.1&FEATURE_COUNT=1" + "&FORMAT=image/png&INFO_FORMAT=text/plain&SRS=EPSG:4326" - + "&LAYERS= " + tema.value - + "&layer= " + tema.value - + "&QUERY_LAYERS= " + tema.value + + "&LAYERS=" + tema.value + + "&layer=" + tema.value + + "&QUERY_LAYERS=" + tema.value + "&HEIGHT=" + i3GEO.parametros.h + "&WIDTH=" + i3GEO.parametros.w + "&BBOX=" + i3geoOL.getExtent().toBBOX().split(",").join(" ") diff --git a/js/interface.js b/js/interface.js index 4c705bf..19b15df 100755 --- a/js/interface.js +++ b/js/interface.js @@ -735,9 +735,15 @@ i3GEO.Interface = minWidth : '200px', baloes : [] }, - balao : function(texto, completo, x, y) { + balao : function(texto, completo, x, y, botaoMais, botaoProp) { var icone, painel, b, cabecalho, conteudo, p = i3GEO.Interface.openlayers.BALAOPROP, removeBaloes; + if(botaoMais === undefined){ + botaoMais = true; + } + if(botaoProp === undefined){ + botaoProp = true; + } removeBaloes = function() { var t, n = i3GEO.Interface.openlayers.BALAOPROP.baloes.length, i; for (i = 0; i < n; i++) { @@ -775,25 +781,29 @@ i3GEO.Interface = }; cabecalho.appendChild(icone); // icone das propriedades - icone = document.createElement("div"); - icone.className = "i3GEOiconeFerramentas"; - icone.style.left = "3px"; - icone.onclick = function() { - i3GEO.janela.prompt($trad("tolerancia"), function() { - i3GEO.mapa.RESOLUCAOTIP = $i("i3GEOjanelaprompt").value; - }, i3GEO.mapa.RESOLUCAOTIP); - return false; - }; - cabecalho.appendChild(icone); + if(botaoProp === true){ + icone = document.createElement("div"); + icone.className = "i3GEOiconeFerramentas"; + icone.style.left = "3px"; + icone.onclick = function() { + i3GEO.janela.prompt($trad("tolerancia"), function() { + i3GEO.mapa.RESOLUCAOTIP = $i("i3GEOjanelaprompt").value; + }, i3GEO.mapa.RESOLUCAOTIP); + return false; + }; + cabecalho.appendChild(icone); + } // icone mais info - icone = document.createElement("div"); - icone.className = "i3GEOiconeMais"; - icone.style.left = "9px"; - icone.onclick = function() { - i3GEO.janela.mensagemSimples("
" + completo + "
", ""); - return false; - }; - cabecalho.appendChild(icone); + if(botaoMais === true){ + icone = document.createElement("div"); + icone.className = "i3GEOiconeMais"; + icone.style.left = "9px"; + icone.onclick = function() { + i3GEO.janela.mensagemSimples("
" + completo + "
", ""); + return false; + }; + cabecalho.appendChild(icone); + } // icone x icone = document.createElement("div"); icone.className = "ol-popup-closer"; -- libgit2 0.21.2