diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index 5d1f7eb..fd1b119 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -2282,7 +2282,7 @@ switch (strtoupper($funcao)) /* Valor: LISTAEPSG - Pega os c�digos de projeção EPSG. + Pega os codigos de projeção EPSG. */ case "LISTAEPSG": diff --git a/ferramentas/editorol/editorol.js b/ferramentas/editorol/editorol.js index 3ac39ec..1ebd46b 100755 --- a/ferramentas/editorol/editorol.js +++ b/ferramentas/editorol/editorol.js @@ -213,6 +213,8 @@ i3GEO.editorOL = maxext : "", mapext : [-76.5125927, -39.3925675209, -29.5851853, 9.49014852081], mapa : "", + //ids das features graficas selecionadas + idsSelecionados : [], //utilizado pelo mashup inicia : function() { // ativabotoes e boolean @@ -986,7 +988,9 @@ i3GEO.editorOL = n = botoes.length; for(i = 0; i < n; i++){ botoes[i].className = botoes[i].className.replace("ItemActive","ItemInactive"); - botoes[i].className = botoes[i].className.replace(classeBotao+"ItemInactive",classeBotao+"ItemActive"); + if(classeBotao){ + botoes[i].className = botoes[i].className.replace(classeBotao+"ItemInactive",classeBotao+"ItemActive"); + } } i3GEO.editorOL.removeInteracoes(); }, @@ -1006,7 +1010,7 @@ i3GEO.editorOL = $i("i3GEObarraEdicao").style.display = "block"; return; } - var temp, controles = [], adiciona = true; + var temp; //cria o painel onde entrarão os icones i3GEOpanelEditor = document.createElement("div"); i3GEOpanelEditor.id = "i3GEObarraEdicao"; @@ -1098,7 +1102,7 @@ i3GEO.editorOL = temp.onclick = function(){ i3GEO.editorOL.marcaBotao("editorOLarea"); i3GEO.barraDeBotoes.defBotao("area").funcaoonclick; - } + }; i3GEOpanelEditor.appendChild(temp); } if (botoes.linha === true) { @@ -1183,7 +1187,7 @@ i3GEO.editorOL = i3GEO.eventos.cliquePerm.desativa(); temp = document.createElement("div"); temp.className = "editorOLpoligonoItemInactive olButton"; - temp.title = $trad("dpoligono"); + temp.title = $trad("dpol"); temp.onclick = function(){ i3GEO.editorOL.marcaBotao("editorOLpoligono"); var draw = new ol.interaction.Draw({ @@ -1200,7 +1204,7 @@ i3GEO.editorOL = width: i3GEO.editorOL.simbologia.strokeWidth }), fill: new ol.style.Fill({ - color: 'rgba(' + i3GEO.editorOL.simbologia.fillColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')' + color: 'rgba(' + i3GEO.editorOL.simbologia.fillColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')' }) }) ); @@ -1215,43 +1219,137 @@ i3GEO.editorOL = }; i3GEOpanelEditor.appendChild(temp); } - + + if (botoes.texto === true) { + i3GEO.eventos.cliquePerm.desativa(); + temp = document.createElement("div"); + temp.className = "editorOLtextoItemInactive olButton"; + temp.title = $trad("dtexto"); + temp.onclick = function(){ + i3GEO.eventos.cliquePerm.desativa(); + i3GEO.editorOL.marcaBotao("editorOLtexto"); + var draw = new ol.interaction.Draw({ + type : "Point" + }); + //adiciona a interacao para poder ser removida + i3GEO.editorOL.interacoes.push(draw); + i3GEO.Interface.openlayers.interacoes[0].setActive(false); + draw.on("drawend", function(evt) { + var texto = window.prompt("Texto", ""); + evt.feature.setStyle( + new ol.style.Style({ + text: new ol.style.Text({ + text: texto, + font: 'Bold ' + i3GEO.editorOL.simbologia.fontSize + 'px Arial', + textAlign: 'left', + stroke: new ol.style.Stroke({ + color: 'white', + width: i3GEO.editorOL.simbologia.strokeWidth + }), + fill: new ol.style.Fill({ + color: i3GEO.editorOL.simbologia.fontColor + }), + zIndex: 2000 + }) + }) + ); + i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); + draw.setActive(false); + draw.setActive(true); + i3GEO.editorOL.marcaBotao(); + }); + i3geoOL.addInteraction(draw); + }; + i3GEOpanelEditor.appendChild(temp); + } + + if (botoes.selecao === true) { + i3GEO.eventos.cliquePerm.desativa(); + temp = document.createElement("div"); + temp.className = "editorOLselecaoItemInactive olButton"; + temp.title = $trad("d24t"); + temp.onclick = function(){ + i3GEO.editorOL.marcaBotao("editorOLselecao"); + var sel = new ol.interaction.Select(); + //adiciona a interacao para poder ser removida + i3GEO.editorOL.interacoes.push(sel); + i3GEO.Interface.openlayers.interacoes[0].setActive(false); + sel.on("select", function(evt) { + var i, n, id, f; + n = evt.selected.length; + for(i=0; i 0) { + var x = window.confirm($trad("excsel") + "?"); + if (x) { + i3GEO.editorOL.guardaBackup(); + i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures); + if (document.getElementById("panellistagEditor")) { + i3GEO.editorOL.listaGeometrias(); + } + if (typeof i3geoOL !== "undefined") { + i3GEO.janela.tempoMsg($trad("meneditor1")); + } } - i3GEO.editorOL.sobeLayersGraficos(); + } else { + i3GEO.janela.tempoMsg($trad("seluma")); } - } + }, + title : $trad("excsel"), + type : OpenLayers.Control.TYPE_BUTTON }); controles.push(button); adiciona = true; @@ -1361,70 +1459,7 @@ i3GEO.editorOL = } // botao de seleção - if (botoes.selecao === true) { - - i3GEO.editorOL.selbutton = new OpenLayers.Control.SelectFeature(i3GEO.desenho.layergrafico, { - displayClass : "editorOLselecao", - title : $trad("d24t"), - type : OpenLayers.Control.TYPE_TOOL, - clickout : true, - toggle : true, - multiple : false, - hover : false, - toggleKey : "ctrlKey", // ctrl key removes from selection - multipleKey : "shiftKey", // shift key adds to selection - box : false - }); - controles.push(i3GEO.editorOL.selbutton); - adiciona = true; - - } - // botao de selecionar tudo - if (botoes.selecaotudo === true) { - - button = new OpenLayers.Control.Button({ - displayClass : "editorOLselecaoTudo", - trigger : function() { - var fs = i3GEO.desenho.layergrafico.features, n = fs.length, i; - for (i = 0; i < n; i++) { - i3GEO.editorOL.selbutton.select(fs[i]); - } - }, - title : $trad("studo"), - type : OpenLayers.Control.TYPE_BUTTON - }); - controles.push(button); - adiciona = true; - - } - if (botoes.apaga === true) { - - button = new OpenLayers.Control.Button({ - displayClass : "editorOLapaga", - trigger : function() { - if (i3GEO.desenho.layergrafico.selectedFeatures.length > 0) { - var x = window.confirm($trad("excsel") + "?"); - if (x) { - i3GEO.editorOL.guardaBackup(); - i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures); - if (document.getElementById("panellistagEditor")) { - i3GEO.editorOL.listaGeometrias(); - } - if (typeof i3geoOL !== "undefined") { - i3GEO.janela.tempoMsg($trad("meneditor1")); - } - } - } else { - i3GEO.janela.tempoMsg($trad("seluma")); - } - }, - title : $trad("excsel"), - type : OpenLayers.Control.TYPE_BUTTON - }); - controles.push(button); - adiciona = true; - - } + // não disponível ainda if (botoes.propriedades === true) { @@ -2138,12 +2173,18 @@ i3GEO.editorOL = // i3GEO.editorOL.backup.addFeatures(i3GEO.desenho.layergrafico.features); }, unselTodos : function() { - var n, i; - n = i3GEO.desenho.layergrafico.features.length; - for (i = 0; i < n; i++) { - i3GEO.desenho.layergrafico.features[i].renderIntent = "default"; - i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[i]); + var i, n, f, s; + s = i3GEO.desenho.layergrafico.getSource(); + n = i3GEO.editorOL.idsSelecionados.length; + for(i=0; i 0) { i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features); @@ -2238,9 +2290,6 @@ i3GEO.editorOL = selFeature : function(index) { i3GEO.editorOL.selbutton.select(i3GEO.desenho.layergrafico.features[index]); }, - unselFeature : function(index) { - i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[index]); - }, carregajts : function(funcao) { if (i3GEO.configura) { i3GEO.util.scriptTag(i3GEO.configura.locaplic + "/pacotes/jsts/lib/jsts.js", funcao, "i3GEOjts", true); diff --git a/js/barradebotoes.js b/js/barradebotoes.js index 5a35eda..97c3ebf 100755 --- a/js/barradebotoes.js +++ b/js/barradebotoes.js @@ -826,9 +826,9 @@ i3GEO.barraDeBotoes = eval(l[b].constroiconteudo); } } - YAHOO.util.Event.addListener($i(l[b].iddiv), "click", YAHOO.util.Event.preventDefault); - YAHOO.util.Event.addListener($i(l[b].iddiv), "click", YAHOO.util.Event.stopPropagation); - YAHOO.util.Event.addFocusListener($i(l[b].iddiv), YAHOO.util.Event.preventDefault); + //YAHOO.util.Event.addListener($i(l[b].iddiv), "click", YAHOO.util.Event.preventDefault); + //YAHOO.util.Event.addListener($i(l[b].iddiv), "click", YAHOO.util.Event.stopPropagation); + //YAHOO.util.Event.addFocusListener($i(l[b].iddiv), YAHOO.util.Event.preventDefault); } while (b--); } if (padrao === "") { diff --git a/js/ini_i3geo.js b/js/ini_i3geo.js index 2fbc40d..baa2dac 100644 --- a/js/ini_i3geo.js +++ b/js/ini_i3geo.js @@ -942,6 +942,7 @@ var i3GEO = { + "px"; temp.style.width = w + "px"; + /* YAHOO.util.Event.addListener( temp, "click", @@ -949,6 +950,7 @@ var i3GEO = { YAHOO.util.Event.addFocusListener( temp, YAHOO.util.Event.preventDefault); + */ } temp = $i(i3GEO.Interface.IDCORPO); if (temp) { diff --git a/js/util.js b/js/util.js index afea58f..5359e13 100755 --- a/js/util.js +++ b/js/util.js @@ -3397,6 +3397,14 @@ i3GEO.util = m = Mustache.render(templateMustache, hashMustache); m = m.replace(re, '&'); return m; + }, + /** + * Function: uid + * + * Retorna um ID unico baseado no tempo + */ + uid : function(){ + return (new Date().getTime()).toString(36); } }; -- libgit2 0.21.2