diff --git a/admin/admin.db b/admin/admin.db index de13626..f9f63d6 100755 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/classesphp/mapa_googlemaps.php b/classesphp/mapa_googlemaps.php index 715571e..99ddf47 100755 --- a/classesphp/mapa_googlemaps.php +++ b/classesphp/mapa_googlemaps.php @@ -140,9 +140,10 @@ elseif ($_GET["X"] != ""){ $_GET["WIDTH"] = 256; $_GET["HEIGHT"] = 256; } -else{ +elseif(isset($_GET["BBOX"])){ $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]); } + $mapa = ms_newMapObj($map_fileX); $ret = $mapa->extent; diff --git a/ferramentas/cores.htm b/ferramentas/cores.htm index 61e1bcc..3a757ca 100755 --- a/ferramentas/cores.htm +++ b/ferramentas/cores.htm @@ -44,11 +44,11 @@ navn = false; // netscape var app = navigator.appName.substring(0,1); if (app=='N') navn=true; else navm=true; -numl = 20 -numc = 20 -nco = 255 +numl = 20; +numc = 20; +nco = 255; -inicia("vermelho") +inicia("vermelho"); function inicia(esquema) { intnl = Math.ceil(nco / numl); @@ -56,7 +56,7 @@ function inicia(esquema) r = 0; g = 0; b = 0; - ins = "" + ins = ""; for (linhas = 1; linhas < numl; linhas++) { ins += "\n"; @@ -79,29 +79,29 @@ function inicia(esquema) if (esquema == "ciano"){b = 255; g = linhas; r = 0;} if (esquema == "amarelo"){b = 0; g = linhas; r = 255;} } - document.getElementById("cores").innerHTML = "\"+ins+"\<\/table\>" + document.getElementById("cores").innerHTML = "\
"+ins+"\<\/table\>"; } function muda (e) { - inicia(e.value) + inicia(e.value); } function mais() { - nco = nco + 20 - inicia(document.getElementById("esq").value) + nco = nco + 20; + inicia(document.getElementById("esq").value); } function menos() { - nco = nco - 20 - inicia(document.getElementById("esq").value) + nco = nco - 20; + inicia(document.getElementById("esq").value); } function aplicacor(c) { - var doc = unescape(((((window.location.href).split("doc="))[1]).split("&"))[0] ) - var doc = (navm) ? window.parent.frames(doc).document : window.parent.document.getElementById(doc).contentDocument + var doc = unescape(((((window.location.href).split("doc="))[1]).split("&"))[0] ); + var doc = (navm) ? window.parent.frames(doc).document : window.parent.document.getElementById(doc).contentDocument; var elemento = unescape(((((window.location.href).split("elemento="))[1]).split("&"))[0] ); - doc.getElementById(elemento).value = c - window.parent.wdocafechaf('wdocac') + doc.getElementById(elemento).value = c; + window.parent.wdocafechaf('wdocac'); } diff --git a/js/analise.js b/js/analise.js index 1d1da66..cfc2a0d 100755 --- a/js/analise.js +++ b/js/analise.js @@ -528,7 +528,7 @@ i3GEO.analise = * layer para receber os graficos */ inicia : function() { - i3GEO.analise.medeDistancia.openlayers.estilo = + i3GEO.analise.medeDistancia.openlayers.estilo = new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#ffcc33', @@ -641,8 +641,10 @@ i3GEO.analise = i3GEO.analise.medeDistancia.ultimoWkt = i3GEO.analise.medeDistancia.pontos2wkt(); // raio if ($i("pararraios") && $i("pararraios").checked === true) { + + temp = i3GEO.util.projGeo2OSM(new ol.geom.Point([x1*1, y1*1])); circ = new ol.Feature({ - geometry: new ol.geom.Circle([x1, y1],raio) + geometry: new ol.geom.Circle(temp.getCoordinates(),raio) }); circ.setProperties({ origem : "medeDistanciaExcluir" @@ -661,7 +663,7 @@ i3GEO.analise = // desenha ponto if ($i("parartextos") && $i("parartextos").checked === true) { label = new ol.Feature({ - geometry: new ol.geom.Point([x2, y2]) + geometry: i3GEO.util.projGeo2OSM(new ol.geom.Point([x2*1, y2*1])) }); label.setProperties({ origem : "medeDistanciaExcluir" @@ -1236,8 +1238,8 @@ i3GEO.analise = x1 = temp[0]; y1 = temp[1]; } - per += i3GEO.calculo.distancia(x1, y1, x2, y2); - //getGeodesicArea + per += i3GEO.calculo.distancia(x1, y1, x2, y2); + //getGeodesicArea sourceProj = i3geoOL.getView().getProjection(); geom = (geom.clone().transform(sourceProj, 'EPSG:4326')); coordinates = geom.getLinearRing(0).getCoordinates(); diff --git a/js/desenho.js b/js/desenho.js index 0e4dc46..67046bb 100755 --- a/js/desenho.js +++ b/js/desenho.js @@ -346,9 +346,7 @@ i3GEO.desenho = ox = 0.5; oy = 1; } - point = new ol.geom.Point([x, y]); - point = i3GEO.util.extGeo2OSM(point); - + point = i3GEO.util.extGeo2OSM(new ol.geom.Point([x, y])); f = new ol.Feature({ geometry: point }); @@ -386,7 +384,8 @@ i3GEO.desenho = } }, movePin : function(pin, x, y) { - pin.getGeometry().setCoordinates([x,y]); + var point = i3GEO.util.extGeo2OSM(new ol.geom.Point([x, y])); + pin.getGeometry().setCoordinates(point.getCoordinates()); }, criaLayerGrafico : function() { if (!i3GEO.desenho.layergrafico) { diff --git a/js/interface.js b/js/interface.js index 6384fae..5eda632 100755 --- a/js/interface.js +++ b/js/interface.js @@ -825,9 +825,7 @@ i3GEO.Interface = }); p.baloes.push(b); i3geoOL.addOverlay(b); - b.setPosition([ - x, y - ]); + b.setPosition(i3GEO.util.projGeo2OSM(new ol.geom.Point([x, y])).getCoordinates()); }, /** * Redesenha o mapa atual @@ -1557,7 +1555,6 @@ i3GEO.Interface = opcoes.isBaseLayer = false; opcoes.visible = true; } else { - // verifica se havera apenas um tile // 10 e do tipo grid de coordenadas if (camada.tiles === "nao" || camada.escondido.toLowerCase() === "sim" @@ -1598,19 +1595,30 @@ i3GEO.Interface = }); source.set("tipoServico", "ImageWMS"); } else { - source = new ol.source.WMTS({ - url : urllayer, - matrixSet : opcoes.projection, - format : 'image/png', - projection : opcoes.projection, - tileGrid : new ol.tilegrid.WMTS({ - origin : ol.extent.getTopLeft(projectionExtent), - resolutions : resolutions, - matrixIds : matrixIds - }), - wrapX : true - }); - source.set("tipoServico", "WMTS"); + if(i3GEO.Interface.openlayers.googleLike === false){ + source = new ol.source.WMTS({ + url : urllayer, + matrixSet : opcoes.projection, + format : 'image/png', + projection : opcoes.projection, + tileGrid : new ol.tilegrid.WMTS({ + origin : ol.extent.getTopLeft(projectionExtent), + resolutions : resolutions, + matrixIds : matrixIds + }), + wrapX : true + }); + source.set("tipoServico", "WMTS"); + }else{ + source = new ol.source.XYZ({ + url : urllayer+"&X={x}&Y={y}&Z={z}", + matrixSet : opcoes.projection, + format : 'image/png', + projection : opcoes.projection, + wrapX : true + }); + source.set("tipoServico", "WMTS"); + } } opcoes.title = camada.tema; opcoes.name = camada.name; diff --git a/js/util.js b/js/util.js index 36ac7c7..db2c9c6 100755 --- a/js/util.js +++ b/js/util.js @@ -2946,11 +2946,11 @@ i3GEO.util = } if (temp[0] * 1 <= 180 && temp[0] * 1 >= -180) { point = new ol.geom.Point([temp[0]*1, temp[1]*1]); - metrica = point.transform("EPSG:4326","EPSG:900913"); + metrica = point.transform("EPSG:4326","EPSG:3857"); ext = metrica.getCoordinates()[0] + sep + metrica.getCoordinates()[1]; if (temp.length > 2) { point = new ol.geom.Point([temp[2]*1, temp[3]*1]); - metrica = point.transform("EPSG:4326","EPSG:900913"); + metrica = point.transform("EPSG:4326","EPSG:3857"); ext += sep + metrica.getCoordinates()[0] + sep + metrica.getCoordinates()[1]; } } @@ -2967,7 +2967,7 @@ i3GEO.util = * Converte string 'xmin ymin xmax ymax' ou 'xmin ymin' de geo para a projecao OSM */ extOSM2Geo : function(ext, retornaArray) { - var metrica, point, temp, sep; + var point, temp, sep; sep = " "; if (typeof ext == "object") { return i3GEO.util.projOSM2Geo(ext); @@ -2980,12 +2980,12 @@ i3GEO.util = } if (temp[0] * 1 >= 180 || temp[0] * 1 <= -180) { point = new ol.geom.Point([temp[0], temp[1]]); - metrica = point.transform("EPSG:900913","EPSG:4326"); - ext = metrica.getCoordinates()[0] + sep + metrica.getCoordinates()[1]; + point.transform("EPSG:3857","EPSG:4326"); + ext = point.getCoordinates()[0] + sep + point.getCoordinates()[1]; if (temp.length > 2) { point = new ol.geom.Point([temp[2], temp[3]]); - metrica = point.transform("EPSG:900913","EPSG:4326"); - ext += sep + metrica.getCoordinates()[0] + sep + metrica.getCoordinates()[1]; + point.transform("EPSG:3857","EPSG:4326"); + ext += sep + point.getCoordinates()[0] + sep + point.getCoordinates()[1]; } } } @@ -3002,9 +3002,12 @@ i3GEO.util = */ projOSM2Geo : function(obj) { if (i3GEO.Interface.openlayers.googleLike === true) { - obj = obj.transform("EPSG:900913","EPSG:4326"); + var clone = obj.clone(); + clone.transform("EPSG:3857","EPSG:4326"); + return clone; + }else{ + return obj; } - return obj; }, /** * Function: projGeo2OSM @@ -3013,9 +3016,12 @@ i3GEO.util = */ projGeo2OSM : function(obj) { if (i3GEO.Interface.openlayers.googleLike === true) { - obj = obj.transform("EPSG:4326","EPSG:900913"); + var clone = obj.clone(); + clone.transform("EPSG:4326","EPSG:3857"); + return clone; + }else{ + return obj; } - return obj; }, /** * Function: navegadorDir -- libgit2 0.21.2