Commit 5a64ab510ab464934d369530fc6fd4203323a8ee
1 parent
47132124
Exists in
master
and in
7 other branches
--no commit message
Showing
5 changed files
with
76 additions
and
4 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/mapa_openlayers.php
@@ -112,7 +112,9 @@ if(isset($_GET["TileMatrix"])){ | @@ -112,7 +112,9 @@ if(isset($_GET["TileMatrix"])){ | ||
112 | $temp = $temp / 2; | 112 | $temp = $temp / 2; |
113 | } | 113 | } |
114 | $_GET["tms"] = "/wmts/".$_GET["layer"]."/".$z."/".$x."/".$y.".png"; | 114 | $_GET["tms"] = "/wmts/".$_GET["layer"]."/".$z."/".$x."/".$y.".png"; |
115 | - | 115 | + if($z."/".$x."/".$y == "0/0/0" || $x == -1 || $y == -1){ |
116 | + return; | ||
117 | + } | ||
116 | $top_left_minx = -180; | 118 | $top_left_minx = -180; |
117 | $top_left_maxy = 90; | 119 | $top_left_maxy = 90; |
118 | 120 |
ferramentas/selecao/index.js
@@ -374,6 +374,7 @@ i3GEOF.selecao = | @@ -374,6 +374,7 @@ i3GEOF.selecao = | ||
374 | if(i3GEO.Interface["ATUAL"] === "openlayers"){ | 374 | if(i3GEO.Interface["ATUAL"] === "openlayers"){ |
375 | if (typeof OpenLayers == "undefined") { | 375 | if (typeof OpenLayers == "undefined") { |
376 | api = "ol3"; | 376 | api = "ol3"; |
377 | + i3GEO.Interface.openlayers.interacoes[0].setActive(true);//duplo clique | ||
377 | } else { | 378 | } else { |
378 | api = "openlayers"; | 379 | api = "openlayers"; |
379 | } | 380 | } |
@@ -882,6 +883,36 @@ i3GEOF.selecao = | @@ -882,6 +883,36 @@ i3GEOF.selecao = | ||
882 | * Seleciona elementos com base em uma figura existente no mapa | 883 | * Seleciona elementos com base em uma figura existente no mapa |
883 | */ | 884 | */ |
884 | figura : { | 885 | figura : { |
886 | + ol3 : { | ||
887 | + draw : "", | ||
888 | + inicia : function() { | ||
889 | + var features = i3GEO.desenho.layergrafico.getFeatures(); | ||
890 | + if(features.getLength() === 0){ | ||
891 | + return; | ||
892 | + } | ||
893 | + i3GEO.eventos.cliquePerm.desativa(); | ||
894 | + i3GEOF.selecao.figura.ol3.removeControle(); | ||
895 | + i3GEOF.selecao.figura.ol3.draw = new ol.interaction.Select(); | ||
896 | + i3GEOF.selecao.figura.ol3.draw.on("select",function(evt){ | ||
897 | + var wkt, geo, i, n, f, format = new ol.format.WKT(); | ||
898 | + geo = i3GEOF.selecao.figura.ol3.draw.getFeatures(); | ||
899 | + n = geo.getLength(); | ||
900 | + for(i=0; i<n; i++){ | ||
901 | + f = geo.item(i); | ||
902 | + f = i3GEO.util.projOSM2Geo(f); | ||
903 | + wkt = format.writeFeature(f); | ||
904 | + i3GEOF.selecao.figura.termina(i3GEO.temaAtivo, $i("i3GEOselecaotipoOperacao").value, wkt); | ||
905 | + } | ||
906 | + i3GEO.eventos.cliquePerm.ativa(); | ||
907 | + i3GEOF.selecao.figura.ol3.removeControle(); | ||
908 | + }); | ||
909 | + i3geoOL.addInteraction(i3GEOF.selecao.figura.ol3.draw); | ||
910 | + }, | ||
911 | + removeControle : function() { | ||
912 | + i3geoOL.removeInteraction(i3GEOF.selecao.figura.ol3.draw); | ||
913 | + i3GEOF.selecao.figura.ol3.draw = ""; | ||
914 | + } | ||
915 | + }, | ||
885 | openlayers : { | 916 | openlayers : { |
886 | executa : function(feature) { | 917 | executa : function(feature) { |
887 | i3GEOF.selecao.figura.openlayers.removeControle(); | 918 | i3GEOF.selecao.figura.openlayers.removeControle(); |
@@ -957,6 +988,7 @@ i3GEOF.selecao = | @@ -957,6 +988,7 @@ i3GEOF.selecao = | ||
957 | }; | 988 | }; |
958 | i3GEO.eventos.cliquePerm.ativa(); | 989 | i3GEO.eventos.cliquePerm.ativa(); |
959 | i3GEO.php.selecaoWkt(retorna, tema, tipo, wkt, $i("i3GEOselecaotoleranciapt").value); | 990 | i3GEO.php.selecaoWkt(retorna, tema, tipo, wkt, $i("i3GEOselecaotoleranciapt").value); |
991 | + i3GEOF.selecao.mudaicone(); | ||
960 | } | 992 | } |
961 | }, | 993 | }, |
962 | /* | 994 | /* |
@@ -965,6 +997,43 @@ i3GEOF.selecao = | @@ -965,6 +997,43 @@ i3GEOF.selecao = | ||
965 | * Realiza a seleção desenhando um polígono no mapa | 997 | * Realiza a seleção desenhando um polígono no mapa |
966 | */ | 998 | */ |
967 | poligono : { | 999 | poligono : { |
1000 | + ol3 : { | ||
1001 | + draw : "", | ||
1002 | + inicia : function() { | ||
1003 | + i3GEO.eventos.cliquePerm.desativa(); | ||
1004 | + i3GEOF.selecao.poligono.ol3.removeControle(); | ||
1005 | + i3GEOF.selecao.poligono.ol3.draw = new ol.interaction.Draw({ | ||
1006 | + // features : i3GEO.desenho.layergrafico.getFeatures(), | ||
1007 | + type : "Polygon" | ||
1008 | + }); | ||
1009 | + i3GEO.Interface.openlayers.interacoes[0].setActive(false); | ||
1010 | + i3GEOF.selecao.poligono.ol3.draw.on("drawend",function(evt){ | ||
1011 | + var n, i, x = [],y =[],geo, pol = evt.feature.getGeometry(); | ||
1012 | + if ($i("i3GEOFselecaoMantemFigura").checked === true) { | ||
1013 | + evt.feature.setProperties({origem : "i3GEOFselecao"}); | ||
1014 | + i3GEO.desenho.layergrafico.addFeature(evt.feature); | ||
1015 | + } | ||
1016 | + i3GEOF.selecao.poligono.ol3.removeControle(); | ||
1017 | + i3GEO.eventos.cliquePerm.ativa(); | ||
1018 | + pol = i3GEO.util.projOSM2Geo(pol); | ||
1019 | + geo = pol.getCoordinates()[0]; | ||
1020 | + n = geo.length; | ||
1021 | + for(i=0; i<n; i++){ | ||
1022 | + x.push(geo[i][0]); | ||
1023 | + y.push(geo[i][1]); | ||
1024 | + } | ||
1025 | + i3GEOF.selecao.poligono.termina({ | ||
1026 | + xpt : x, | ||
1027 | + ypt : y | ||
1028 | + }); | ||
1029 | + }); | ||
1030 | + i3geoOL.addInteraction(i3GEOF.selecao.poligono.ol3.draw); | ||
1031 | + }, | ||
1032 | + removeControle : function() { | ||
1033 | + i3geoOL.removeInteraction(i3GEOF.selecao.poligono.ol3.draw); | ||
1034 | + i3GEOF.selecao.poligono.ol3.draw = ""; | ||
1035 | + } | ||
1036 | + }, | ||
968 | openlayers : { | 1037 | openlayers : { |
969 | inicia : function() { | 1038 | inicia : function() { |
970 | var poligono; | 1039 | var poligono; |
@@ -1110,6 +1179,7 @@ i3GEOF.selecao = | @@ -1110,6 +1179,7 @@ i3GEOF.selecao = | ||
1110 | }; | 1179 | }; |
1111 | i3GEO.janela.abreAguarde("i3GEO.atualiza", $trad("o1")); | 1180 | i3GEO.janela.abreAguarde("i3GEO.atualiza", $trad("o1")); |
1112 | i3GEO.eventos.cliquePerm.ativa(); | 1181 | i3GEO.eventos.cliquePerm.ativa(); |
1182 | + i3GEOF.selecao.mudaicone(); | ||
1113 | p = i3GEO.configura.locaplic + "/ferramentas/selecao/exec.php?g_sid=" + i3GEO.configura.sid + "&funcao=selecaoPoli"; | 1183 | p = i3GEO.configura.locaplic + "/ferramentas/selecao/exec.php?g_sid=" + i3GEO.configura.sid + "&funcao=selecaoPoli"; |
1114 | cp = new cpaint(); | 1184 | cp = new cpaint(); |
1115 | // cp.set_debug(2) | 1185 | // cp.set_debug(2) |
js/interface.js
@@ -1725,7 +1725,7 @@ i3GEO.Interface = | @@ -1725,7 +1725,7 @@ i3GEO.Interface = | ||
1725 | var url = funcaoLoad.apply(this, arguments); | 1725 | var url = funcaoLoad.apply(this, arguments); |
1726 | url = url.replace("&cache=sim", "&cache=nao"); | 1726 | url = url.replace("&cache=sim", "&cache=nao"); |
1727 | //console.info(layer.getSource().getProperties().tipoServico) | 1727 | //console.info(layer.getSource().getProperties().tipoServico) |
1728 | - return url + '&r=' + Math.random(); | 1728 | + return url.split('&r=')[0] + '&r=' + Math.random(); |
1729 | }); | 1729 | }); |
1730 | } | 1730 | } |
1731 | } | 1731 | } |
@@ -1734,7 +1734,7 @@ i3GEO.Interface = | @@ -1734,7 +1734,7 @@ i3GEO.Interface = | ||
1734 | if(funcaoLoad){ | 1734 | if(funcaoLoad){ |
1735 | layer.getSource().setImageLoadFunction(function(image,src) { | 1735 | layer.getSource().setImageLoadFunction(function(image,src) { |
1736 | src = src.replace("&cache=sim", "&cache=nao"); | 1736 | src = src.replace("&cache=sim", "&cache=nao"); |
1737 | - src += '&r=' + Math.random(); | 1737 | + src = src.split('&r=')[0] + '&r=' + Math.random(); |
1738 | image.getImage().src = src; | 1738 | image.getImage().src = src; |
1739 | }); | 1739 | }); |
1740 | } | 1740 | } |
js/mapa.js
@@ -946,7 +946,7 @@ i3GEO.mapa = | @@ -946,7 +946,7 @@ i3GEO.mapa = | ||
946 | + "<a class=ajuda_usuario target=_blank href='" | 946 | + "<a class=ajuda_usuario target=_blank href='" |
947 | + i3GEO.configura.locaplic | 947 | + i3GEO.configura.locaplic |
948 | + "/ajuda_usuario.php?idcategoria=6&idajuda=123' ><b> </b></a></div>"; | 948 | + "/ajuda_usuario.php?idcategoria=6&idajuda=123' ><b> </b></a></div>"; |
949 | - i3GEO.janela.cria("500px", "350px", url, "", "", titulo, idjanela, false, "hd", cabecalho, minimiza); | 949 | + i3GEO.janela.cria("500px", "350px", url, "", "", titulo, idjanela, false, "hd", cabecalho, minimiza, "", "", "", "", false); |
950 | } | 950 | } |
951 | }, | 951 | }, |
952 | /** | 952 | /** |