diff --git a/ferramentas/area/dicionario.js b/ferramentas/area/dicionario.js
index 1509de5..e3ec7b1 100755
--- a/ferramentas/area/dicionario.js
+++ b/ferramentas/area/dicionario.js
@@ -1,7 +1,7 @@
//+$trad(1,i3GEOF.area.dicionario)+
i3GEOF.area.dicionario = {
'incorporar' : [{
- pt : "Incorporar figura ao mapa",
+ pt : "Incorporar figura",
en : "Add picture to the map",
es : "Agregar figura al mapa"
}],
@@ -9,5 +9,10 @@ i3GEOF.area.dicionario = {
pt : "Clique em diferentes pontos do mapa para traçar um polígono",
en : "Click on different points on the map to draw a polygon",
es : "Haga clic en diferentes puntos del mapa para dibujar un polígono"
- }]
+ }],
+ 'remover' : [{
+ pt : "Remover figura",
+ en : "",
+ es : ""
+ }]
};
diff --git a/ferramentas/area/index.js b/ferramentas/area/index.js
index 9bb7829..5b2a1c7 100755
--- a/ferramentas/area/index.js
+++ b/ferramentas/area/index.js
@@ -37,6 +37,13 @@ i3GEOF.area =
$i(iddiv).innerHTML = i3GEOF.area.html();
i3GEOF.area[i3GEO.Interface["ATUAL"]].inicia();
},
+ isOn : function() {
+ if($i("i3GEOF.area")){
+ return true;
+ } else {
+ return false;
+ }
+ },
/*
* Function: html
*
@@ -89,7 +96,8 @@ i3GEOF.area =
i3GEOF.area.inicia(divid);
temp =
function() {
- var janela;
+ i3GEOF.area.pontos = {};
+ var janela;
i3GEO.eventos.cliquePerm.ativa();
janela = YAHOO.i3GEO.janela.manager.find("area");
if (janela) {
@@ -121,6 +129,9 @@ i3GEOF.area =
pontos.push(x[0] + " " + y[0]);
return "POLYGON((" + pontos.join(",") + "))";
},
+ removeFiguras : function(){
+ i3GEOF.area[i3GEO.Interface["ATUAL"]].removeFiguras();
+ },
/**
* Funcoes especificas da interface openlayers
*/
@@ -171,6 +182,10 @@ i3GEOF.area =
ypt : [],
dist : []
};
+ i3GEO.analise.pontos = {
+ xpt : [],
+ ypt : []
+ };
var m = i3GEOF.area.openlayers,
sketch = evt.feature;
m.estilo = sketch.getStyle();
@@ -240,7 +255,8 @@ i3GEOF.area =
},
point : function(point,geom) {
- var wgs84Sphere,area,coordinates,sourceProj,n, x1, y1, x2, y2, trecho, temp,
+ i3GEO.eventos.cliquePerm.desativa();
+ var wgs84Sphere,area,coordinates,sourceProj,n, x1, y1, x2, y2, trecho, temp,
coord = point.getCoordinates(),
total = 0;
i3GEOF.area.pontos.xpt.push(coord[0]);
@@ -300,24 +316,26 @@ i3GEOF.area =
m.removeControle();
m.numpontos = 0;
i3GEO.eventos.cliquePerm.ativa();
-
- var features, n, f, i, remover = [], temp;
- features = i3GEO.desenho.layergrafico.getSource().getFeatures();
- n = features.length;
- for (i = 0; i < n; i++) {
- f = features[i];
- if (f.getProperties().origem === "i3GeoMedeArea" || f.getProperties().origem === "medeAreaExcluir") {
- remover.push(f);
- }
- }
- if (remover.length > 0) {
- temp = window.confirm($trad("x94"));
- if (temp) {
- for (r in remover) {
- i3GEO.desenho.layergrafico.getSource().removeFeature(remover[r]);
- }
- }
- }
+ i3GEOF.area.openlayers.removeFiguras();
+ },
+ removeFiguras : function(){
+ var features, n, f, i, remover = [], temp;
+ features = i3GEO.desenho.layergrafico.getSource().getFeatures();
+ n = features.length;
+ for (i = 0; i < n; i++) {
+ f = features[i];
+ if (f.getProperties().origem === "i3GeoMedeArea" || f.getProperties().origem === "medeAreaExcluir") {
+ remover.push(f);
+ }
+ }
+ if (remover.length > 0) {
+ temp = window.confirm($trad("x94"));
+ if (temp) {
+ for (r in remover) {
+ i3GEO.desenho.layergrafico.getSource().removeFeature(remover[r]);
+ }
+ }
+ }
},
/**
* Mostra a totalizacao das linhas ja digitalizadas
@@ -425,7 +443,8 @@ i3GEOF.area =
i3GEOF.area.ultimoWkt = i3GEOF.area.pontos2wkt();
};
evtclick = google.maps.event.addListener(i3GeoMap, "click", function(evt) {
- var area = 0, per;
+ i3GEO.eventos.cliquePerm.desativa();
+ var area = 0, per;
// When the map is clicked, pass the LatLng obect to the
// measureAdd function
pontos.mvcLine.push(evt.latLng);
@@ -525,17 +544,20 @@ i3GEOF.area =
i3GeoMap.setOptions({
draggableCursor : undefined
});
- var f = i3GEO.desenho.googlemaps.getFeaturesByAttribute("origem", "medeArea");
- if (f && f.length > 0) {
- temp = window.confirm($trad("x94"));
- if (temp) {
- i3GEO.desenho.googlemaps.destroyFeatures(f);
- }
- }
- f = i3GEO.desenho.googlemaps.getFeaturesByAttribute("origem", "medeAreaExcluir");
- if (f && f.length > 0) {
- i3GEO.desenho.googlemaps.destroyFeatures(f);
- }
+ i3GEOF.area.googlemaps.removeFiguras();
+ },
+ removeFiguras: function(){
+ var temp, f = i3GEO.desenho.googlemaps.getFeaturesByAttribute("origem", "medeArea");
+ if (f && f.length > 0) {
+ temp = window.confirm($trad("x94"));
+ if (temp) {
+ i3GEO.desenho.googlemaps.destroyFeatures(f);
+ }
+ }
+ f = i3GEO.desenho.googlemaps.getFeaturesByAttribute("origem", "medeAreaExcluir");
+ if (f && f.length > 0) {
+ i3GEO.desenho.googlemaps.destroyFeatures(f);
+ }
},
/**
* Mostra a totalizacao das linhas ja digitalizadas
diff --git a/ferramentas/area/template_mst.html b/ferramentas/area/template_mst.html
index b7af958..8db5e3d 100755
--- a/ferramentas/area/template_mst.html
+++ b/ferramentas/area/template_mst.html
@@ -2,4 +2,5 @@
{{{inicia}}}
+
\ No newline at end of file
diff --git a/ferramentas/distancia/dicionario.js b/ferramentas/distancia/dicionario.js
index fb339d3..63e821d 100755
--- a/ferramentas/distancia/dicionario.js
+++ b/ferramentas/distancia/dicionario.js
@@ -1,7 +1,7 @@
//+$trad(1,i3GEOF.distancia.dicionario)+
i3GEOF.distancia.dicionario = {
'incorporar' : [{
- pt : "Incorporar figura ao mapa",
+ pt : "Incorporar figura",
en : "Add shape to map",
es : "Agregar figura al mapa"
}],
@@ -14,5 +14,10 @@ i3GEOF.distancia.dicionario = {
pt : "Clique em diferentes pontos do mapa para traçar uma linha",
en : "Click on different points on the map to draw a line",
es : "Haga clic en diferentes puntos del mapa para trazar una línea"
- }]
+ }],
+ 'remover' : [{
+ pt : "Remover figura",
+ en : "",
+ es : ""
+ }]
};
diff --git a/ferramentas/distancia/index.js b/ferramentas/distancia/index.js
index 9208c1f..9e85bde 100755
--- a/ferramentas/distancia/index.js
+++ b/ferramentas/distancia/index.js
@@ -58,6 +58,13 @@ i3GEOF.distancia =
var ins = Mustache.render(i3GEOF.distancia.MUSTACHE, i3GEOF.distancia.mustacheHash());
return ins;
},
+ isOn : function() {
+ if($i("i3GEOF.distancia")){
+ return true;
+ } else {
+ return false;
+ }
+ },
/*
* Function: iniciaJanelaFlutuante
*
@@ -95,8 +102,8 @@ i3GEOF.distancia =
);
divid = janela[2].id;
i3GEOF.distancia.inicia(divid);
- temp =
- function() {
+ temp = function() {
+ i3GEO.distancia.pontos = {};
var janela;
i3GEO.eventos.cliquePerm.ativa();
janela = YAHOO.i3GEO.janela.manager.find("distancia");
@@ -105,6 +112,7 @@ i3GEOF.distancia =
janela.destroy();
}
i3GEOF.distancia[i3GEO.Interface["ATUAL"]].fechaJanela();
+
i3GEO.analise.pontos = {
xpt : [],
ypt : []
@@ -131,6 +139,9 @@ i3GEOF.distancia =
}
return "LINESTRING(" + pontos.join(",") + ")";
},
+ removeFiguras : function(){
+ i3GEOF.distancia[i3GEO.Interface["ATUAL"]].removeFiguras();
+ },
/**
* Funcoes especificas da interface openlayers
*/
@@ -246,6 +257,7 @@ i3GEOF.distancia =
}
},
point : function(point) {
+ i3GEO.eventos.cliquePerm.desativa();
var n, x1, y1, x2, y2, trecho, temp, circ, label, raio,
estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao],
coord = point.getCoordinates(),
@@ -360,7 +372,9 @@ i3GEOF.distancia =
m.removeControle();
m.numpontos = 0;
i3GEO.eventos.cliquePerm.ativa();
-
+ i3GEOF.distancia.openlayers.removeFiguras();
+ },
+ removeFiguras: function(){
var features, n, f, i, remover = [], temp;
features = i3GEO.desenho.layergrafico.getSource().getFeatures();
n = features.length;
@@ -470,6 +484,7 @@ i3GEOF.distancia =
}
};
evtclick = google.maps.event.addListener(i3GeoMap, "click", function(evt) {
+ i3GEO.eventos.cliquePerm.desativa();
var x1, x2, y1, y2, trecho = 0, total, n;
// When the map is clicked, pass the LatLng obect to the
// measureAdd function
@@ -592,6 +607,9 @@ i3GEOF.distancia =
i3GeoMap.setOptions({
draggableCursor : undefined
});
+ i3GEOF.distancia.googlemaps.removeFiguras();
+ },
+ removeFiguras: function(){
var f = i3GEO.desenho.googlemaps.getFeaturesByAttribute("origem", "medeDistancia");
if (f && f.length > 0) {
temp = window.confirm($trad("x94"));
diff --git a/ferramentas/distancia/template_mst.html b/ferramentas/distancia/template_mst.html
index f609018..095ec7b 100755
--- a/ferramentas/distancia/template_mst.html
+++ b/ferramentas/distancia/template_mst.html
@@ -1,45 +1,35 @@
-
-
{{{inicia}}}
-
-
-
+
+
{{{inicia}}}
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
{{{caixaDeEstilos}}}
-
-
-
+
+
+
+
+
+
+
{{{caixaDeEstilos}}}
+
+
+
\ No newline at end of file
diff --git a/js/compactados/editor_compacto.js b/js/compactados/editor_compacto.js
index adf656f..5855b8f 100644
--- a/js/compactados/editor_compacto.js
+++ b/js/compactados/editor_compacto.js
@@ -1 +1 @@
-if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.editor={botoes:{'zoomin':false,'zoomout':false,'pan':false,'zoombox':false,'zoomtot':false,'legenda':false,'distancia':false,'area':false,'identifica':false,'linha':true,'ponto':true,'poligono':true,'texto':true,'corta':true,'edita':true,'listag':true,'selecao':true,'selecaotudo':true,'apaga':true,'procura':false,'propriedades':true,'salva':true,'ajuda':true,'fecha':true,'tools':true,'undo':true,'frente':true},inicia:function(){i3GEO.eventos.cliquePerm.desativa();i3GEO.editor[i3GEO.Interface.ATUAL].inicia("janelaEditorVetorial")},googlemaps:{inicia:function(idjanela){}},openlayers:{inicia:function(idjanela){if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/editorol/editorol.js","i3GEO.editor.openlayers.ativaPainel('"+idjanela+"')","editorol.js",true)}else{if(!i3GEO.desenho.layergrafico){i3GEO.desenho.openlayers.criaLayerGrafico();i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico])}if(!i3GEO.editorOL.backup){i3GEO.editorOL.backup=new ol.layer.Vector({source:new ol.source.Vector({features:new ol.Collection(),useSpatialIndex:false,name:"Backup"}),visible:false});i3GEO.editorOL.backup.setMap(i3geoOL);i3GEO.editorOL.backup.getFeatures=function(){return i3GEO.editorOL.backup.getSource().getFeatures()}}i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes)}},criaJanela:function(){if($i("i3GEOjanelaEditor")){return"i3GEOjanelaEditor"}var janela,divid,titulo,cabecalho,minimiza;cabecalho=function(){};minimiza=function(){i3GEO.janela.minimiza("i3GEOjanelaEditor")};titulo="
"+$trad("u29")+"
";janela=i3GEO.janela.cria("300px","200px","","","",titulo,"i3GEOjanelaEditor",false,"hd",cabecalho,minimiza);divid=janela[2].id;$i("i3GEOjanelaEditor_corpo").style.backgroundColor="white";$i("i3GEOjanelaEditor_corpo").style.textAlign="left";return divid},ativaPainel:function(idjanela){i3GEO.editorOL.fundo="";i3GEO.editorOL.mapa=i3geoOL;i3GEO.editorOL.maxext="";i3GEO.editorOL.controles=[];if(!i3GEO.desenho.layergrafico){i3GEO.desenho.openlayers.criaLayerGrafico()}if(idjanela&&i3GEO.editor.botoes!=""){i3GEO.editorOL.criaBotoes(i3GEO.editor.botoes)}}}};
\ No newline at end of file
+if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.editor={botoes:{'zoomin':false,'zoomout':false,'pan':false,'zoombox':false,'zoomtot':false,'legenda':false,'distancia':false,'area':false,'identifica':false,'linha':true,'ponto':true,'poligono':true,'texto':true,'corta':true,'edita':true,'listag':true,'selecao':true,'selecaotudo':true,'apaga':true,'procura':false,'propriedades':true,'salva':true,'ajuda':true,'fecha':true,'tools':true,'undo':true,'frente':true},inicia:function(){if(i3GEOF){if(i3GEOF.area&&i3GEOF.area.isOn()){return}if(i3GEOF.distancia&&i3GEOF.distancia.isOn()){return}}i3GEO.eventos.cliquePerm.desativa();i3GEO.editor[i3GEO.Interface.ATUAL].inicia("janelaEditorVetorial")},googlemaps:{inicia:function(idjanela){}},openlayers:{inicia:function(idjanela){if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/editorol/editorol.js","i3GEO.editor.openlayers.ativaPainel('"+idjanela+"')","editorol.js",true)}else{if(!i3GEO.desenho.layergrafico){i3GEO.desenho.openlayers.criaLayerGrafico();i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico])}if(!i3GEO.editorOL.backup){i3GEO.editorOL.backup=new ol.layer.Vector({source:new ol.source.Vector({features:new ol.Collection(),useSpatialIndex:false,name:"Backup"}),visible:false});i3GEO.editorOL.backup.setMap(i3geoOL);i3GEO.editorOL.backup.getFeatures=function(){return i3GEO.editorOL.backup.getSource().getFeatures()}}i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes)}},criaJanela:function(){if($i("i3GEOjanelaEditor")){return"i3GEOjanelaEditor"}var janela,divid,titulo,cabecalho,minimiza;cabecalho=function(){};minimiza=function(){i3GEO.janela.minimiza("i3GEOjanelaEditor")};titulo="
"+$trad("u29")+"
";janela=i3GEO.janela.cria("300px","200px","","","",titulo,"i3GEOjanelaEditor",false,"hd",cabecalho,minimiza);divid=janela[2].id;$i("i3GEOjanelaEditor_corpo").style.backgroundColor="white";$i("i3GEOjanelaEditor_corpo").style.textAlign="left";return divid},ativaPainel:function(idjanela){i3GEO.editorOL.fundo="";i3GEO.editorOL.mapa=i3geoOL;i3GEO.editorOL.maxext="";i3GEO.editorOL.controles=[];if(!i3GEO.desenho.layergrafico){i3GEO.desenho.openlayers.criaLayerGrafico()}if(idjanela&&i3GEO.editor.botoes!=""){i3GEO.editorOL.criaBotoes(i3GEO.editor.botoes)}}}};
\ No newline at end of file
diff --git a/js/editor.js b/js/editor.js
index b4d89e9..0758b1d 100755
--- a/js/editor.js
+++ b/js/editor.js
@@ -1,115 +1,123 @@
if (typeof (i3GEO) === 'undefined') {
- var i3GEO = {};
+ var i3GEO = {};
}
i3GEO.editor =
{
- //se for vazio, nao cria os botoes
- botoes : {
- 'zoomin' : false,
- 'zoomout' : false,
- 'pan' : false,
- 'zoombox' : false,
- 'zoomtot' : false,
- 'legenda' : false,
- 'distancia' : false,
- 'area' : false,
- 'identifica' : false,
- 'linha' : true,
- 'ponto' : true,
- 'poligono' : true,
- 'texto' : true,
- 'corta' : true,
- 'edita' : true,
- 'listag' : true,
- 'selecao' : true,
- 'selecaotudo' : true,//inclui tambem o botao de unseltodos
- 'apaga' : true,
- 'procura' : false,
- 'propriedades' : true,
- 'salva' : true,
- 'ajuda' : true,
- 'fecha' : true,
- 'tools' : true,
- 'undo' : true,
- 'frente' : true
- },
- /**
- * Function: inicia
- *
- * Abre as opções do editor conforme a interface em uso
- */
- inicia : function() {
- i3GEO.eventos.cliquePerm.desativa();
- i3GEO.editor[i3GEO.Interface.ATUAL].inicia("janelaEditorVetorial");
- },
- // carrega as opcoes de edicao se a interface for do googlemaps
- googlemaps : {
- //removido em funcao da politica do google de impedir engenharia reversa em sua base de dados
- inicia : function(idjanela) {
+ //se for vazio, nao cria os botoes
+ botoes : {
+ 'zoomin' : false,
+ 'zoomout' : false,
+ 'pan' : false,
+ 'zoombox' : false,
+ 'zoomtot' : false,
+ 'legenda' : false,
+ 'distancia' : false,
+ 'area' : false,
+ 'identifica' : false,
+ 'linha' : true,
+ 'ponto' : true,
+ 'poligono' : true,
+ 'texto' : true,
+ 'corta' : true,
+ 'edita' : true,
+ 'listag' : true,
+ 'selecao' : true,
+ 'selecaotudo' : true,//inclui tambem o botao de unseltodos
+ 'apaga' : true,
+ 'procura' : false,
+ 'propriedades' : true,
+ 'salva' : true,
+ 'ajuda' : true,
+ 'fecha' : true,
+ 'tools' : true,
+ 'undo' : true,
+ 'frente' : true
+ },
+ /**
+ * Function: inicia
+ *
+ * Abre as opções do editor conforme a interface em uso
+ */
+ inicia : function() {
+ if(i3GEOF){
+ if(i3GEOF.area && i3GEOF.area.isOn()){
+ return;
+ }
+ if(i3GEOF.distancia && i3GEOF.distancia.isOn()){
+ return;
+ }
+ }
+ i3GEO.eventos.cliquePerm.desativa();
+ i3GEO.editor[i3GEO.Interface.ATUAL].inicia("janelaEditorVetorial");
+ },
+ // carrega as opcoes de edicao se a interface for do googlemaps
+ googlemaps : {
+ //removido em funcao da politica do google de impedir engenharia reversa em sua base de dados
+ inicia : function(idjanela) {
- }
- },
- openlayers : {
- inicia : function(idjanela) {
- if (!i3GEO.editorOL) {
- //a barra de botoes utiliza codigo do Opelayers2
- i3GEO.util.scriptTag(
- i3GEO.configura.locaplic + "/ferramentas/editorol/editorol.js",
- "i3GEO.editor.openlayers.ativaPainel('" + idjanela + "')",
- "editorol.js",
- true);
- } else {
- if (!i3GEO.desenho.layergrafico) {
- i3GEO.desenho.openlayers.criaLayerGrafico();
- i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico]);
- }
- if (!i3GEO.editorOL.backup) {
- i3GEO.editorOL.backup = new ol.layer.Vector({
- source : new ol.source.Vector({
- features : new ol.Collection(),
- useSpatialIndex : false,
- name : "Backup"
- }),
- visible: false
- });
- i3GEO.editorOL.backup.setMap(i3geoOL);
- i3GEO.editorOL.backup.getFeatures = function(){
- return i3GEO.editorOL.backup.getSource().getFeatures();
- };
- }
- i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes);
- }
- },
- criaJanela : function() {
- if ($i("i3GEOjanelaEditor")) {
- return "i3GEOjanelaEditor";
- }
- var janela, divid, titulo, cabecalho, minimiza;
- cabecalho = function() {
- };
- minimiza = function() {
- i3GEO.janela.minimiza("i3GEOjanelaEditor");
- };
- // cria a janela flutuante
- titulo = "