diff --git a/admin/admin.db b/admin/admin.db index 7e25eef..2508a91 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/ferramentas/carregakml/index.js b/ferramentas/carregakml/index.js index f1ced76..380297a 100644 --- a/ferramentas/carregakml/index.js +++ b/ferramentas/carregakml/index.js @@ -150,12 +150,19 @@ i3GEOF.carregakml = { Adiciona o KML ao mapa */ adiciona: function(){ - if(i3GEOF.carregakml.aguarde.visibility === "visible") - {return;} - var url = $i("i3GEOcarregakmlurl").value; + var url, temp, cp, p; + if(i3GEOF.carregakml.aguarde.visibility === "visible"){ + return; + } + url = $i("i3GEOcarregakmlurl").value; if(url !== ""){ - i3GEOF.carregakml.aguarde.visibility = "visible"; - i3GEO.Interface[i3GEO.Interface.ATUAL].adicionaKml(false,url,url,true); + temp = function(retorno){ + i3GEO.atualiza(); + }; + cp = new cpaint(); + cp.set_response_type("JSON"); + p = i3GEO.configura.locaplic+"/ferramentas/carregakml/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=crialayer&url="+url; + cp.call(p,"foo",temp); i3GEOF.carregakml.aguarde.visibility = "hidden"; } } diff --git a/ferramentas/conectarservicos/index.js b/ferramentas/conectarservicos/index.js index fdb46ea..dff8795 100755 --- a/ferramentas/conectarservicos/index.js +++ b/ferramentas/conectarservicos/index.js @@ -154,7 +154,7 @@ i3GEOF.conectarservicos = * Cria a janela flutuante para controle da ferramenta. */ iniciaJanelaFlutuante : function() { - var minimiza, cabecalho, janela, divid, temp, titulo; + var minimiza, cabecalho, janela, divid, titulo; if($i("i3GEOF.conectarservicos")){ return; } diff --git a/ferramentas/mascara/index.js b/ferramentas/mascara/index.js index 02c4d83..7db6c9d 100755 --- a/ferramentas/mascara/index.js +++ b/ferramentas/mascara/index.js @@ -194,7 +194,7 @@ i3GEOF.mascara = { + "&funcao=aplicar" + "&tema=" + tema + "&mascarar=" + mascarar.join(","); - cp = new cpaint() + cp = new cpaint(); fim = function(retorno){ i3GEO.Interface.atualizaMapa(); i3GEOF.mascara.aguarde.visibility = "hidden"; diff --git a/js/interface.js b/js/interface.js index be381fc..3e33ff3 100755 --- a/js/interface.js +++ b/js/interface.js @@ -728,7 +728,7 @@ i3GEO.Interface = autoPanAnimation : { duration : 250 }, - width : '200px', + minWidth : '200px', baloes : [] }, balao : function(texto, completo, x, y) { @@ -748,7 +748,7 @@ i3GEO.Interface = removeBaloes(); } painel = document.createElement("div"); - painel.style.width = p.width; + painel.style.minWidth = p.minWidth; painel.className = "ol-popup"; cabecalho = document.createElement("div"); @@ -972,7 +972,6 @@ i3GEO.Interface = // insere a lista de layers de fundo // temp = $i("listaLayersBase"); - // FIXME testar isso if (temp && i3GEO.arvoreDeCamadas.INCLUILFUNDO === false) { // // torna false a variavel que pode permitir que as camadas de fundo @@ -1058,9 +1057,6 @@ i3GEO.Interface = // verifica se nas preferencias existem ferramentas que devem ser // abertas i3GEO.configura.iniciaFerramentas.executa(); - - // FIXME nao esta funcionando - // i3GEO.Interface.openlayers.sobeLayersGraficos(); }, /** * Aplica um valor de opacidade aos layers do mapa @@ -1217,68 +1213,48 @@ i3GEO.Interface = insereLayerKml : function(id, url) { var l, temp; url = i3GEO.configura.locaplic + "/classesphp/proxy.php?url=" + url; - /* - * eval(id + " = new OpenLayers.Layer.Vector('" + id + "', - * {displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true, strategies: [new - * OpenLayers.Strategy.Fixed()],protocol: new OpenLayers.Protocol.HTTP({url: '" + url + "',format: new - * OpenLayers.Format.KML({extractStyles: true,extractAttributes: true,maxDepth: 5})})})"); eval("i3geoOL.addLayer(" + id + - * ");"); eval("temp = " + id + ".div;"); - */ - l = new OpenLayers.Layer.Vector(id, { - displayOutsideMaxExtent : true, - displayInLayerSwitcher : false, - visibility : true, - strategies : [ - new OpenLayers.Strategy.Fixed() - ], - protocol : new OpenLayers.Protocol.HTTP({ + l = new ol.layer.Vector({ + title : url, + name : id, + isBaseLayer : false, + source : new ol.source.Vector({ url : url, - format : new OpenLayers.Format.KML({ - extractStyles : true, - extractAttributes : true, - maxDepth : 5 - }) + format : new ol.format.KML({ + extractStyles : true + }), + tipoServico : "kml" }) }); i3geoOL.addLayer(l); - temp = l.div; - temp.onclick = - function(e) { - var targ = "", id, temp, features, n, i, j = "", html = ""; - if (!e) { - e = window.event; - } - if (e.target) { - targ = e.target; - } else if (e.srcElement) { - targ = e.srcElement; - } - if (targ.id) { - temp = targ.id.split("_Point"); - if (temp[0] === "OpenLayers_Geometry") { - id = targ.id; - temp = i3geoOL.getLayer(this.id); - features = temp.features; - n = features.length; - for (i = 0; i < n; i++) { - if (features[i].geometry.id === id) { - for (j in features[i].attributes) { - html += j + ": " + features[i].attributes[j]; - } - g = features[i].geometry; - i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud( - "kml", - new OpenLayers.LonLat(g.x, g.y), - null, - html, - null, - true)); + temp = function(pixel) { + var feature, chaves, c, i = 0, html = "", prop, g; - } - } + feature = i3geoOL.forEachFeatureAtPixel(pixel, function(feature, layer) { + return feature; + }); + if (feature) { + i3GEO.Interface.openlayers.BALAOPROP.removeAoAdicionar = false; + i3GEO.Interface.openlayers.BALAOPROP.classeCadeado = "i3GEOiconeFechado"; + chaves = feature.getKeys(); + prop = feature.getProperties(); + c = chaves.length; + for (i = 0; i < c; i++) { + if (chaves[i] != "geometry" && chaves[i] != "styleUrl") { + html += chaves[i] + ": " + prop[chaves[i]]; } } - }; + g = feature.getGeometry().getCoordinates(); + i3GEO.Interface.openlayers.balao(html, "", g[0], g[1], "kml"); + } + }; + i3geoOL.on('click', function(evt) { + evt.stopPropagation(); + evt.preventDefault(); + if (evt.dragging) { + return; + } + temp(i3geoOL.getEventPixel(evt.originalEvent)); + }); }, ativaDesativaCamadaKml : function(obj, url) { if (!obj.checked) { @@ -1378,7 +1354,7 @@ i3GEO.Interface = && camada.wmsurl !== "" && camada.usasld.toLowerCase() != "sim") { urllayer = camada.wmsurl; - if (camada.wmstile == 10){ + if (camada.wmstile == 10) { // TODO testar isso source = new ol.source.WMTS({ url : urllayer, @@ -1470,7 +1446,9 @@ i3GEO.Interface = opcoes.name = camada.name; } source.set("name", camada.name); - source.set("parametrosUrl", {par : ""}); + source.set("parametrosUrl", { + par : "" + }); opcoes.source = source; opcoes.isBaseLayer = false; opcoes.visible = true; @@ -1571,15 +1549,15 @@ i3GEO.Interface = param[parametro] = valor; chaves = i3GEO.util.listaTodasChaves(param); n = chaves.length; - for(j = 0; j < n; j++){ + for (j = 0; j < n; j++) { k = chaves[j]; - if(param[k] != "" && k != "par"){ + if (param[k] != "" && k != "par") { url += "&" + k + "=" + param[k]; } } param.par = url; console.info(url); - source.set("parametrosUrl",param); + source.set("parametrosUrl", param); } } }, @@ -1713,10 +1691,9 @@ i3GEO.Interface = */ atualizaTema : function(retorno, tema) { var layer = i3geoOL.getLayersByName(tema), objtemas, funcaoLoad, servico, source; - if(layer.length == 0){ + if (layer.length == 0) { return ""; - } - else{ + } else { layer = layer[0]; } if (layer && layer != undefined) { @@ -1778,11 +1755,11 @@ i3GEO.Interface = // i3geoOL.on("pointerdrag", function(e) { i3GEO.Interface.STATUS.pan = true; - var xy; + //var xy; modoAtual = "move"; i3GEO.barraDeBotoes.BOTAOCLICADO = "pan"; - xy = i3GEO.navega.centroDoMapa(); - i3GEO.navega.marcaCentroDoMapa(xy); + //xy = i3GEO.navega.centroDoMapa(); + //i3GEO.navega.marcaCentroDoMapa(xy); }); i3geoOL.on("click", function(e) { e.stopPropagation(); @@ -2594,10 +2571,10 @@ i3GEO.Interface = i3GEOtouchesPosMapa = ""; modoAtual = ""; google.maps.event.addListener(i3GeoMap, "dragstart", function() { - var xy; + //var xy; modoAtual = "move"; - xy = i3GEO.navega.centroDoMapa(); - i3GEO.navega.marcaCentroDoMapa(xy); + //xy = i3GEO.navega.centroDoMapa(); + //i3GEO.navega.marcaCentroDoMapa(xy); i3GEO.eventos.cliquePerm.status = false; }); google.maps.event.addListener(i3GeoMap, "dragend", function() { diff --git a/js/mapa.js b/js/mapa.js index 354a1de..3c51376 100644 --- a/js/mapa.js +++ b/js/mapa.js @@ -1389,7 +1389,12 @@ i3GEO.mapa = return; } var ntemas, etiquetas, j, retorna, x = objposicaocursor.ddx, y = objposicaocursor.ddy; - + if(x === -1 || y === -1){ + return; + } + //para evitar duplo clique + objposicaocursor.ddx = -1; + objposicaocursor.ddy = -1; ntemas = i3GEO.arvoreDeCamadas.CAMADAS.length; etiquetas = false; for (j = 0; j < ntemas; j += 1) { diff --git a/js/plugini3geo.js b/js/plugini3geo.js index 6da0b91..7f2e254 100644 --- a/js/plugini3geo.js +++ b/js/plugini3geo.js @@ -894,66 +894,51 @@ i3GEO.pluginI3geo = return []; }, inicia : function(camada, objMapa) { - var layerkml; + var layerkml, url, temp; url = i3GEO.configura.locaplic + "/classesphp/proxy.php?url=" + camada.plugini3geo.parametros.url; - layerkml = new OpenLayers.Layer.Vector(camada.name, { - displayOutsideMaxExtent : true, - displayInLayerSwitcher : false, - visibility : true, - strategies : [ - new OpenLayers.Strategy.Fixed() - ], - protocol : new OpenLayers.Protocol.HTTP({ + layerkml = new ol.layer.Vector({ + name : camada.name, + isBaseLayer : false, + source : new ol.source.Vector({ url : url, - format : new OpenLayers.Format.KML({ - extractStyles : true, - extractAttributes : true, - maxDepth : 5 - }) + format : new ol.format.KML({ + extractStyles : true + }), + tipoServico : "kml" }) }); i3geoOL.addLayer(layerkml); - if (!objMapa) { objMapa = i3geoOL; } - layerkml.div.onclick = - function(e) { - var targ = "", id, temp, features, n, i, j = "", html = ""; - if (!e) { - e = window.event; - } - if (e.target) { - targ = e.target; - } else if (e.srcElement) { - targ = e.srcElement; - } - if (targ.id) { - temp = targ.id.split("_Point"); - if (temp[0] === "OpenLayers_Geometry") { - id = targ.id; - temp = i3geoOL.getLayer(this.id); - features = temp.features; - n = features.length; - for (i = 0; i < n; i++) { - if (features[i].geometry.id === id) { - for (j in features[i].attributes) { - html += j + ": " + features[i].attributes[j]; - } - g = features[i].geometry; - i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud( - "kml", - new OpenLayers.LonLat(g.x, g.y), - null, - html, - null, - true)); - - } - } + temp = function(pixel) { + var feature, chaves, c, i = 0, html = "", prop, g; + feature = i3geoOL.forEachFeatureAtPixel(pixel, function(feature, layer) { + return feature; + }); + if (feature) { + i3GEO.Interface.openlayers.BALAOPROP.removeAoAdicionar = false; + i3GEO.Interface.openlayers.BALAOPROP.classeCadeado = "i3GEOiconeFechado"; + chaves = feature.getKeys(); + prop = feature.getProperties(); + c = chaves.length; + for (i = 0; i < c; i++) { + if (chaves[i] != "geometry" && chaves[i] != "styleUrl") { + html += chaves[i] + ": " + prop[chaves[i]]; } } - }; + g = feature.getGeometry().getCoordinates(); + i3GEO.Interface.openlayers.balao(html, "", g[0], g[1], "kml"); + } + }; + i3geoOL.on('click', function(evt) { + evt.stopPropagation(); + evt.preventDefault(); + if (evt.dragging) { + return; + } + temp(i3geoOL.getEventPixel(evt.originalEvent)); + }); i3GEO.janela.fechaAguarde("aguardePlugin"); i3GEO.eventos.cliquePerm.ativo = false; diff --git a/temas/_lmapakml.map b/temas/_lmapakml.map index e2aed3d..5468eb5 100644 --- a/temas/_lmapakml.map +++ b/temas/_lmapakml.map @@ -2,7 +2,6 @@ MAP FONTSET "../symbols/fontes.txt" SYMBOLSET "../symbols/simbolosv6.sym" LAYER - METADATA "CLASSE" "SIM" "PLUGINI3GEO" '{"plugin":"layerkml","parametros":{"url":"http://dev.openlayers.org/examples/kml/sundials.kml"}}' @@ -22,6 +21,4 @@ MAP END # STYLE END # CLASS END # LAYER - -END # MAP - +END # MAP \ No newline at end of file -- libgit2 0.21.2