From 6cc3a621d24bba70cd60a96af5bf2170dd84e05a Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 16 May 2018 18:07:39 -0300 Subject: [PATCH] Posicionamento dos botões de edição vetorial na árvore de camadas. Refatoração do código do editor vetorial. Remoção da opção Editor Vetorial da caixa de ferramentas --- css/img/openlayers.png | Bin 0 -> 30904 bytes ferramentas/area/index.js | 1218 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ferramentas/editorol/editorol.js | 1115 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- imagens/gisicons/eudock/area-measure.png | Bin 2800 -> 0 bytes imagens/gisicons/eudock/confluence.png | Bin 2679 -> 0 bytes imagens/gisicons/eudock/editopen.png | Bin 3188 -> 0 bytes imagens/gisicons/eudock/fotos.png | Bin 3124 -> 0 bytes imagens/gisicons/eudock/google-map.png | Bin 3591 -> 0 bytes imagens/gisicons/eudock/grafico.png | Bin 3011 -> 0 bytes imagens/gisicons/eudock/identify.png | Bin 3414 -> 0 bytes imagens/gisicons/eudock/length-measure.png | Bin 2008 -> 0 bytes imagens/gisicons/eudock/lente.png | Bin 1916 -> 0 bytes imagens/gisicons/eudock/map-extent-info.png | Bin 2239 -> 0 bytes imagens/gisicons/eudock/map-reference.png | Bin 2822 -> 0 bytes imagens/gisicons/eudock/metar.png | Bin 2829 -> 0 bytes imagens/gisicons/eudock/monitor.png | Bin 1745 -> 0 bytes imagens/gisicons/eudock/pan.png | Bin 1406 -> 0 bytes imagens/gisicons/eudock/point-create.png | Bin 2826 -> 0 bytes imagens/gisicons/eudock/print.png | Bin 1683 -> 0 bytes imagens/gisicons/eudock/redraw.png | Bin 3546 -> 0 bytes imagens/gisicons/eudock/search.png | Bin 2003 -> 0 bytes imagens/gisicons/eudock/select.png | Bin 2111 -> 0 bytes imagens/gisicons/eudock/show-legend.png | Bin 2512 -> 0 bytes imagens/gisicons/eudock/sobe1.png | Bin 192 -> 0 bytes imagens/gisicons/eudock/text-add.png | Bin 1491 -> 0 bytes imagens/gisicons/eudock/tips.png | Bin 2640 -> 0 bytes imagens/gisicons/eudock/v3d.png | Bin 3151 -> 0 bytes imagens/gisicons/eudock/wiki.png | Bin 3390 -> 0 bytes imagens/gisicons/eudock/zoom-extent.png | Bin 4421 -> 0 bytes imagens/gisicons/eudock/zoom-in.png | Bin 3551 -> 0 bytes imagens/gisicons/eudock/zoom-last.png | Bin 2305 -> 0 bytes imagens/gisicons/eudock/zoom-next.png | Bin 2234 -> 0 bytes imagens/gisicons/eudock/zoom-out.png | Bin 3395 -> 0 bytes imagens/gisicons/eudock/zoom-region.png | Bin 3745 -> 0 bytes interface/openlayersdebug.htm | 36 +----------------------------------- interface/templates/camadaGr.html | 46 +++++++++++++++++++++++++++++++++++++++++----- js/analise.js | 6 +++++- js/arvoredecamadas.js | 16 +++++++++++----- js/arvoredetemas.js | 3 +++ js/calculo.js | 15 ++++++++++++++- js/desenho.js | 1055 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- js/editor.js | 699 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------- js/guias.js | 1190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- js/i3geonaocompacto.js | 17 ----------------- js/ini_i3geo.js | 26 ++++++++++++++++---------- js/interface.js | 1 + js/listaDeFerramentas.js | 6 ------ 47 files changed, 2403 insertions(+), 3046 deletions(-) create mode 100644 css/img/openlayers.png delete mode 100755 imagens/gisicons/eudock/area-measure.png delete mode 100755 imagens/gisicons/eudock/confluence.png delete mode 100755 imagens/gisicons/eudock/editopen.png delete mode 100755 imagens/gisicons/eudock/fotos.png delete mode 100755 imagens/gisicons/eudock/google-map.png delete mode 100755 imagens/gisicons/eudock/grafico.png delete mode 100755 imagens/gisicons/eudock/identify.png delete mode 100755 imagens/gisicons/eudock/length-measure.png delete mode 100755 imagens/gisicons/eudock/lente.png delete mode 100755 imagens/gisicons/eudock/map-extent-info.png delete mode 100755 imagens/gisicons/eudock/map-reference.png delete mode 100755 imagens/gisicons/eudock/metar.png delete mode 100755 imagens/gisicons/eudock/monitor.png delete mode 100755 imagens/gisicons/eudock/pan.png delete mode 100755 imagens/gisicons/eudock/point-create.png delete mode 100755 imagens/gisicons/eudock/print.png delete mode 100755 imagens/gisicons/eudock/redraw.png delete mode 100755 imagens/gisicons/eudock/search.png delete mode 100755 imagens/gisicons/eudock/select.png delete mode 100755 imagens/gisicons/eudock/show-legend.png delete mode 100755 imagens/gisicons/eudock/sobe1.png delete mode 100755 imagens/gisicons/eudock/text-add.png delete mode 100755 imagens/gisicons/eudock/tips.png delete mode 100755 imagens/gisicons/eudock/v3d.png delete mode 100755 imagens/gisicons/eudock/wiki.png delete mode 100755 imagens/gisicons/eudock/zoom-extent.png delete mode 100755 imagens/gisicons/eudock/zoom-in.png delete mode 100755 imagens/gisicons/eudock/zoom-last.png delete mode 100755 imagens/gisicons/eudock/zoom-next.png delete mode 100755 imagens/gisicons/eudock/zoom-out.png delete mode 100755 imagens/gisicons/eudock/zoom-region.png diff --git a/css/img/openlayers.png b/css/img/openlayers.png new file mode 100644 index 0000000..9f55553 Binary files /dev/null and b/css/img/openlayers.png differ diff --git a/ferramentas/area/index.js b/ferramentas/area/index.js index 42e7edb..d0fb15c 100755 --- a/ferramentas/area/index.js +++ b/ferramentas/area/index.js @@ -1,630 +1,630 @@ if (typeof (i3GEOF) === 'undefined') { - var i3GEOF = {}; + var i3GEOF = {}; } i3GEOF.area = - { - position: [150,0], - /** - * Armazena os pontos clicados para realizar os calculos - */ - pontos : {}, - /** - * Armazena o WKT da ultima linha - */ - ultimoWkt : "", - /** - * Armazena a ultima medida - */ - ultimaMedida : "", - MUSTACHE : "", - /** - * Susbtitutos para o template - */ - mustacheHash : function() { - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.area.dicionario); - dicionario["sid"] = i3GEO.configura.sid; - dicionario["locaplic"] = i3GEO.configura.locaplic; - return dicionario; - }, - inicia : function(iddiv) { - if(i3GEOF.area.MUSTACHE == ""){ - $.get(i3GEO.configura.locaplic + "/ferramentas/area/template_mst.html", function(template) { - i3GEOF.area.MUSTACHE = template; - i3GEOF.area.inicia(iddiv); - }); - return; - } - i3GEO.eventos.cliquePerm.desativa(); - $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 - * - * Gera o código html para apresentação das opções da ferramenta - * - * Retorno: - * - * String com o código html - */ - html : function() { - var ins = Mustache.render(i3GEOF.area.MUSTACHE, i3GEOF.area.mustacheHash()); - return ins; - }, - /* - * Function: iniciaJanelaFlutuante - * - * Cria a janela flutuante para controle da ferramenta. - */ - iniciaJanelaFlutuante : function() { - var minimiza, cabecalho, janela, divid, temp, titulo,imagemxy; - if ($i("i3GEOF.area")) { - return; +{ + position: [150,0], + /** + * Armazena os pontos clicados para realizar os calculos + */ + pontos : {}, + /** + * Armazena o WKT da ultima linha + */ + ultimoWkt : "", + /** + * Armazena a ultima medida + */ + ultimaMedida : "", + MUSTACHE : "", + /** + * Susbtitutos para o template + */ + mustacheHash : function() { + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.area.dicionario); + dicionario["sid"] = i3GEO.configura.sid; + dicionario["locaplic"] = i3GEO.configura.locaplic; + return dicionario; + }, + inicia : function(iddiv) { + if(i3GEOF.area.MUSTACHE == ""){ + $.get(i3GEO.configura.locaplic + "/ferramentas/area/template_mst.html", function(template) { + i3GEOF.area.MUSTACHE = template; + i3GEOF.area.inicia(iddiv); + }); + return; + } + i3GEO.eventos.cliquePerm.desativa(); + $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 + * + * Gera o código html para apresentação das opções da ferramenta + * + * Retorno: + * + * String com o código html + */ + html : function() { + var ins = Mustache.render(i3GEOF.area.MUSTACHE, i3GEOF.area.mustacheHash()); + return ins; + }, + /* + * Function: iniciaJanelaFlutuante + * + * Cria a janela flutuante para controle da ferramenta. + */ + iniciaJanelaFlutuante : function() { + var minimiza, cabecalho, janela, divid, temp, titulo,imagemxy; + if ($i("i3GEOF.area")) { + return; + } + cabecalho = ""; + minimiza = ""; + // cria a janela flutuante + titulo = "" + $trad("areaAprox") + ""; + janela = + i3GEO.janela.cria( + "250px", + "auto", + "", + "", + "", + titulo, + "i3GEOF.area", + false, + "hd", + cabecalho, + minimiza, + "", + true, + "", + "", + "nao", + "", + "51" + ); + divid = janela[2].id; + i3GEOF.area.inicia(divid); + temp = + function() { + i3GEOF.area.pontos = {}; + var janela; + i3GEO.eventos.cliquePerm.ativa(); + janela = YAHOO.i3GEO.janela.manager.find("area"); + if (janela) { + YAHOO.i3GEO.janela.manager.remove(janela); + janela.destroy(); + } + i3GEOF.area[i3GEO.Interface["ATUAL"]].fechaJanela(); + i3GEO.analise.pontos = {}; + }; + YAHOO.util.Event.addListener(janela[0].close, "click", temp); + imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); + janela[0].moveTo(i3GEOF.area.position[0],i3GEOF.area.position[1]); + }, + /* + * Function: ativaFoco + * + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado + */ + ativaFoco : function() { + }, + /** + * Converte a lista de pontos em WKT + */ + pontos2wkt : function() { + var pontos = [], x = i3GEOF.area.pontos.xpt, y = i3GEOF.area.pontos.ypt, n = x.length, i; + for (i = 0; i < n; i++) { + pontos.push(x[i] + " " + y[i]); + } + pontos.push(x[0] + " " + y[0]); + return "POLYGON((" + pontos.join(",") + "))"; + }, + removeFiguras : function(){ + i3GEOF.area[i3GEO.Interface["ATUAL"]].removeFiguras(); + }, + /** + * Funcoes especificas da interface openlayers + */ + openlayers : { + draw : "", + estilo: "", + featureListener : null, + //numero de pontos da geometria atual + //utilizado para saber se houve um clique ou nao + numpontos : 0, + removeControle : function() { + i3geoOL.removeInteraction(i3GEOF.area.openlayers.draw); + i3GEOF.area.openlayers.draw = ""; + }, + /** + * Inicializa o processo Cria a variavel para guardar os pontos Executa a funcao de inicializacao do desenho, que cria o + * layer para receber os graficos + */ + inicia : function() { + var m = i3GEOF.area.openlayers; + + i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); + m.removeControle(); + m.draw = new ol.interaction.Draw({ + type : "Polygon" + }); + i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); + m.draw.on("drawend", function(evt) { + evt.feature.setProperties({ + origem : "i3GeoMedeArea" + }); + evt.feature.setStyle(new ol.style.Style({ + stroke: new ol.style.Stroke({ + color: '#ffcc33', + width: 2 + }), + fill: new ol.style.Fill({ + color: 'rgba(255, 153, 0, 0.4)' + }) + } )); + evt.feature.setId(i3GEO.util.uid()); + var m = i3GEOF.area.openlayers; + i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); + }); + m.draw.on('drawstart', function(evt) { + i3GEOF.area.pontos = { + xpt : [], + ypt : [], + dist : [] + }; + i3GEO.analise.pontos = { + xpt : [], + ypt : [] + }; + var m = i3GEOF.area.openlayers, + sketch = evt.feature; + m.estilo = sketch.getStyle(); + m.numpontos = 2; + m.featureListener = sketch.getGeometry().on('change', function(evt) { + var ponto, + geom = evt.target, + coords = geom.getLinearRing(0).getCoordinates(), + n = coords.length, + m = i3GEOF.area.openlayers; + ponto = new ol.geom.Point(coords[n-2]); + //console.info(coords) + if(m.numpontos === n-1){ + //clicou + m.numpontos = n; + m.point(ponto,geom); } - cabecalho = ""; - minimiza = ""; - // cria a janela flutuante - titulo = "" + $trad("areaAprox") + ""; - janela = - i3GEO.janela.cria( - "250px", - "auto", - "", - "", - "", - titulo, - "i3GEOF.area", - false, - "hd", - cabecalho, - minimiza, - "", - true, - "", - "", - "nao", - "", - "51" - ); - divid = janela[2].id; - i3GEOF.area.inicia(divid); - temp = - function() { - i3GEOF.area.pontos = {}; - var janela; - i3GEO.eventos.cliquePerm.ativa(); - janela = YAHOO.i3GEO.janela.manager.find("area"); - if (janela) { - YAHOO.i3GEO.janela.manager.remove(janela); - janela.destroy(); - } - i3GEOF.area[i3GEO.Interface["ATUAL"]].fechaJanela(); - i3GEO.analise.pontos = {}; - }; - YAHOO.util.Event.addListener(janela[0].close, "click", temp); - imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); - janela[0].moveTo(i3GEOF.area.position[0],i3GEOF.area.position[1]); - }, - /* - * Function: ativaFoco - * - * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado - */ - ativaFoco : function() { - }, - /** - * Converte a lista de pontos em WKT - */ - pontos2wkt : function() { - var pontos = [], x = i3GEOF.area.pontos.xpt, y = i3GEOF.area.pontos.ypt, n = x.length, i; - for (i = 0; i < n; i++) { - pontos.push(x[i] + " " + y[i]); + else{ + m.modify(ponto,geom); } - pontos.push(x[0] + " " + y[0]); - return "POLYGON((" + pontos.join(",") + "))"; - }, - removeFiguras : function(){ - i3GEOF.area[i3GEO.Interface["ATUAL"]].removeFiguras(); - }, - /** - * Funcoes especificas da interface openlayers - */ - openlayers : { - draw : "", - estilo: "", - featureListener : null, - //numero de pontos da geometria atual - //utilizado para saber se houve um clique ou nao - numpontos : 0, - removeControle : function() { - i3geoOL.removeInteraction(i3GEOF.area.openlayers.draw); - i3GEOF.area.openlayers.draw = ""; - }, - /** - * Inicializa o processo Cria a variavel para guardar os pontos Executa a funcao de inicializacao do desenho, que cria o - * layer para receber os graficos - */ - inicia : function() { - var m = i3GEOF.area.openlayers; - m.estilo = new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: '#ffcc33', - width: 5 - }), - fill: new ol.style.Fill({ - color: 'rgba(255, 153, 0, 0.8)' - }) - }); - i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); - m.removeControle(); - m.draw = new ol.interaction.Draw({ - type : "Polygon" - }); - i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); - m.draw.on("drawend", function(evt) { - evt.feature.setProperties({ - origem : "i3GeoMedeArea" - }); - var m = i3GEOF.area.openlayers; - i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); - m.draw.setActive(false); - m.draw.setActive(true); - }); - m.draw.on('drawstart', function(evt) { - i3GEOF.area.pontos = { - xpt : [], - ypt : [], - dist : [] - }; - i3GEO.analise.pontos = { - xpt : [], - ypt : [] - }; - var m = i3GEOF.area.openlayers, - sketch = evt.feature; - m.estilo = sketch.getStyle(); - m.numpontos = 2; - m.featureListener = sketch.getGeometry().on('change', function(evt) { - var ponto, - geom = evt.target, - coords = geom.getLinearRing(0).getCoordinates(), - n = coords.length, - m = i3GEOF.area.openlayers; - ponto = new ol.geom.Point(coords[n-2]); - //console.info(coords) - if(m.numpontos === n-1){ - //clicou - m.numpontos = n; - m.point(ponto,geom); - } - else{ - m.modify(ponto,geom); - } - }); - }); - i3geoOL.addInteraction(m.draw); - }, - modify : function(point,geom) { - var temp,sourceProj,coordinates,wgs84Sphere, per, area, n, x1, y1, x2, y2, trecho, direcao, - coord = point.getCoordinates(); + }); + }); + i3geoOL.addInteraction(m.draw); + }, + modify : function(point,geom) { + var temp,sourceProj,coordinates,wgs84Sphere, per, area, n, x1, y1, x2, y2, trecho, direcao, + coord = point.getCoordinates(); - n = i3GEOF.area.pontos.ypt.length; - if (n > 1) { - x1 = i3GEOF.area.pontos.xpt[n - 1]; - y1 = i3GEOF.area.pontos.ypt[n - 1]; - x2 = coord[0]; - y2 = coord[1]; - // projeta - if (i3GEO.Interface.openlayers.googleLike) { - temp = i3GEO.util.extOSM2Geo(x1 + " " + y1 + " " + x2 + " " + y2); - temp = temp.split(" "); - x1 = temp[0]; - y1 = temp[1]; - x2 = temp[2]; - y2 = temp[3]; - } - trecho = i3GEO.calculo.distancia(x1, y1, x2, y2); - //parcial = i3GEOF.area.openlayers.somaDist(); - direcao = i3GEO.calculo.direcao(x1, y1, x2, y2); - direcao = i3GEO.calculo.dd2dms(direcao, direcao); - direcao = direcao[0]; - per = i3GEOF.area.openlayers.somaDist(); - // soma ate o primeiro ponto - x1 = i3GEOF.area.pontos.xpt[0]; - y1 = i3GEOF.area.pontos.ypt[0]; - // projeta - if (i3GEO.Interface.openlayers.googleLike) { - temp = i3GEO.util.extOSM2Geo(x1 + " " + y1); - temp = temp.split(" "); - x1 = temp[0]; - y1 = temp[1]; - } + n = i3GEOF.area.pontos.ypt.length; + if (n > 1) { + x1 = i3GEOF.area.pontos.xpt[n - 1]; + y1 = i3GEOF.area.pontos.ypt[n - 1]; + x2 = coord[0]; + y2 = coord[1]; + // projeta + if (i3GEO.Interface.openlayers.googleLike) { + temp = i3GEO.util.extOSM2Geo(x1 + " " + y1 + " " + x2 + " " + y2); + temp = temp.split(" "); + x1 = temp[0]; + y1 = temp[1]; + x2 = temp[2]; + y2 = temp[3]; + } + trecho = i3GEO.calculo.distancia(x1, y1, x2, y2); + //parcial = i3GEOF.area.openlayers.somaDist(); + direcao = i3GEO.calculo.direcao(x1, y1, x2, y2); + direcao = i3GEO.calculo.dd2dms(direcao, direcao); + direcao = direcao[0]; + per = i3GEOF.area.openlayers.somaDist(); + // soma ate o primeiro ponto + x1 = i3GEOF.area.pontos.xpt[0]; + y1 = i3GEOF.area.pontos.ypt[0]; + // projeta + if (i3GEO.Interface.openlayers.googleLike) { + temp = i3GEO.util.extOSM2Geo(x1 + " " + y1); + temp = temp.split(" "); + x1 = temp[0]; + y1 = temp[1]; + } - per += i3GEO.calculo.distancia(x1, y1, x2, y2); + 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(); - wgs84Sphere = new ol.Sphere(6378137); - area = Math.abs(wgs84Sphere.geodesicArea(coordinates)); - i3GEOF.area.openlayers.mostraParcial(trecho, per, area, direcao); - } + //getGeodesicArea + sourceProj = i3geoOL.getView().getProjection(); + geom = (geom.clone().transform(sourceProj, 'EPSG:4326')); + coordinates = geom.getLinearRing(0).getCoordinates(); + wgs84Sphere = new ol.Sphere(6378137); + area = Math.abs(wgs84Sphere.geodesicArea(coordinates)); + i3GEOF.area.openlayers.mostraParcial(trecho, per, area, direcao); + } - }, - point : function(point,geom) { - 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]); - i3GEOF.area.pontos.ypt.push(coord[1]); - i3GEO.analise.pontos.xpt.push(coord[0]); - i3GEO.analise.pontos.ypt.push(coord[1]); - n = i3GEOF.area.pontos.ypt.length; - if (n > 1) { - x1 = i3GEOF.area.pontos.xpt[n - 2]; - y1 = i3GEOF.area.pontos.ypt[n - 2]; - x2 = coord[0]; - y2 = coord[1]; - raio = new ol.geom.LineString([[x1, y1],[x2, y2]]).getLength(); - // projeta - if (i3GEO.Interface.openlayers.googleLike) { - temp = i3GEO.util.extOSM2Geo(x1 + " " + y1 + " " + x2 + " " + y2); - temp = temp.split(" "); - x1 = temp[0]; - y1 = temp[1]; - x2 = temp[2]; - y2 = temp[3]; - } - trecho = i3GEO.calculo.distancia(x1, y1, x2, y2); - i3GEOF.area.pontos.dist.push(trecho); - total = i3GEOF.area.openlayers.somaDist(); + }, + point : function(point,geom) { + 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]); + i3GEOF.area.pontos.ypt.push(coord[1]); + i3GEO.analise.pontos.xpt.push(coord[0]); + i3GEO.analise.pontos.ypt.push(coord[1]); + n = i3GEOF.area.pontos.ypt.length; + if (n > 1) { + x1 = i3GEOF.area.pontos.xpt[n - 2]; + y1 = i3GEOF.area.pontos.ypt[n - 2]; + x2 = coord[0]; + y2 = coord[1]; + raio = new ol.geom.LineString([[x1, y1],[x2, y2]]).getLength(); + // projeta + if (i3GEO.Interface.openlayers.googleLike) { + temp = i3GEO.util.extOSM2Geo(x1 + " " + y1 + " " + x2 + " " + y2); + temp = temp.split(" "); + x1 = temp[0]; + y1 = temp[1]; + x2 = temp[2]; + y2 = temp[3]; + } + trecho = i3GEO.calculo.distancia(x1, y1, x2, y2); + i3GEOF.area.pontos.dist.push(trecho); + total = i3GEOF.area.openlayers.somaDist(); - sourceProj = i3geoOL.getView().getProjection(); - geom = (geom.clone().transform(sourceProj, 'EPSG:4326')); - coordinates = geom.getLinearRing(0).getCoordinates(); - wgs84Sphere = new ol.Sphere(6378137); - area = Math.abs(wgs84Sphere.geodesicArea(coordinates)); + sourceProj = i3geoOL.getView().getProjection(); + geom = (geom.clone().transform(sourceProj, 'EPSG:4326')); + coordinates = geom.getLinearRing(0).getCoordinates(); + wgs84Sphere = new ol.Sphere(6378137); + area = Math.abs(wgs84Sphere.geodesicArea(coordinates)); - i3GEOF.area.openlayers.mostraTotal(total, area); - i3GEOF.area.ultimoWkt = i3GEOF.area.pontos2wkt(); - } - }, - /** - * Soma os valores de distancia guardados em pontos.dist - */ - somaDist : function() { - var n, i, total = 0; - n = i3GEOF.area.pontos.dist.length; - for (i = 0; i < n; i++) { - total += i3GEOF.area.pontos.dist[i]; - } - return total; - }, - /** - * Fecha a janela que mostra os dados Pergunta ao usuario se os graficos devem ser removidos Os graficos sao marcados com o - * atributo "origem" Os raios e pontos sao sempre removidos - */ - fechaJanela : function() { - i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(true); - var m = i3GEOF.area.openlayers; - ol.Observable.unByKey(m.featureListener); - m.featureListener = null; - m.removeControle(); - m.numpontos = 0; - i3GEO.eventos.cliquePerm.ativa(); - 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 - */ - mostraTotal : function(per, area) { - var mostra = $i("mostraarea_calculo"), texto; - if (mostra) { - texto = - "total
" + $trad("d21at") - + " km2: " - + format("#.###,000", (area / 1000000).toFixed(3)) - + "
" - + $trad("d21at") - + " ha: " - + format("#.###,00",(area / 10000).toFixed(2)) - + "
" - + $trad("x98") - + " km: " - + format("#.###,00",(per).toFixed(2)) - + "
" - + $trad("x25") - + ": " - + i3GEO.calculo.metododistancia; - mostra.innerHTML = texto + "
"; - i3GEOF.area.ultimaMedida = format("#.###,000",(area / 1000000).toFixed(3)) + " km2"; - } + i3GEOF.area.openlayers.mostraTotal(total, area); + i3GEOF.area.ultimoWkt = i3GEOF.area.pontos2wkt(); + } + }, + /** + * Soma os valores de distancia guardados em pontos.dist + */ + somaDist : function() { + var n, i, total = 0; + n = i3GEOF.area.pontos.dist.length; + for (i = 0; i < n; i++) { + total += i3GEOF.area.pontos.dist[i]; + } + return total; + }, + /** + * Fecha a janela que mostra os dados Pergunta ao usuario se os graficos devem ser removidos Os graficos sao marcados com o + * atributo "origem" Os raios e pontos sao sempre removidos + */ + fechaJanela : function() { + i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(true); + var m = i3GEOF.area.openlayers; + ol.Observable.unByKey(m.featureListener); + m.featureListener = null; + m.removeControle(); + m.numpontos = 0; + i3GEO.eventos.cliquePerm.ativa(); + 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 + */ + mostraTotal : function(per, area) { + var mostra = $i("mostraarea_calculo"), texto; + if (mostra) { + texto = + "total
" + $trad("d21at") + + " km2: " + + format("#.###,000", (area / 1000000).toFixed(3)) + + "
" + + $trad("d21at") + + " ha: " + + format("#.###,00",(area / 10000).toFixed(2)) + + "
" + + $trad("x98") + + " km: " + + format("#.###,00",(per).toFixed(2)) + + "
" + + $trad("x25") + + ": " + + i3GEO.calculo.metododistancia; + mostra.innerHTML = texto + "
"; + i3GEOF.area.ultimaMedida = format("#.###,000",(area / 1000000).toFixed(3)) + " km2"; + } + }, + /** + * Mostra o valor do trecho entre o ultimo ponto clicado e a posicao do mouse + */ + mostraParcial : function(trecho, per, area, direcao) { + var mostra = $i("mostraarea_calculo_parcial"), texto; + if (mostra) { + texto = + "parcial
" + $trad("d21at") + + " km2:" + + format("#.###,000",(area / 1000000).toFixed(3)) + + "
" + + $trad("d21at") + + " ha: " + + format("#.###,00",(area / 10000).toFixed(2)) + + "
" + + $trad("x95") + + " km: " + + format("#.###,000",trecho.toFixed(3)) + + "
" + + $trad("x98") + + " km: " + + format("#.###,000",(per).toFixed(3)) + + "
" + + $trad("x23") + + " (DMS):" + + direcao; + mostra.innerHTML = texto; + } + } + }, + googlemaps : { + /** + * Inicializa o processo Cria a variavel para guardar os pontos Executa a funcao de inicializacao do desenho, que cria o + * layer para receber os graficos + */ + inicia : function() { + i3GEOF.area.pontos = { + xpt : [], + ypt : [], + dist : [] + }; + if (!google.maps.geometry) { + alert($trad("x99")); + return; + } + i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); + i3GeoMap.setOptions({ + disableDoubleClickZoom : true + }); + i3GeoMap.setOptions({ + draggableCursor : 'crosshair' + }); + var evtdblclick = null, evtclick = null, evtmousemove = null, pontos = { + xpt : [], + ypt : [], + dist : [], + mvcLine : new google.maps.MVCArray(), + mvcMarkers : new google.maps.MVCArray(), + line : null, + polygon : null + }, termina = function() { + google.maps.event.removeListener(evtdblclick); + google.maps.event.removeListener(evtclick); + google.maps.event.removeListener(evtmousemove); + pontos.line.setOptions({ + clickable : true + }); + google.maps.event.addListener(pontos.line, 'click', function(shape) { + if (shape.setEditable) { + shape.setEditable(!shape.editable); + } + }); + if (pontos) { + i3GEO.desenho.googlemaps.shapes.push(pontos.mvcLine); + i3GEO.desenho.googlemaps.shapes.push(pontos.line); + pontos = null; + } + i3GEOF.area.ultimoWkt = i3GEOF.area.pontos2wkt(); + }; + evtclick = google.maps.event.addListener(i3GeoMap, "click", function(evt) { + 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); + pontos.xpt.push(evt.latLng.lng()); + pontos.ypt.push(evt.latLng.lat()); + i3GEOF.area.pontos.xpt.push(evt.latLng.lng()); + i3GEOF.area.pontos.ypt.push(evt.latLng.lat()); + // desenha um circulo + if (pontos.mvcLine.getLength() > 0) { + per = google.maps.geometry.spherical.computeLength(pontos.mvcLine); + area = google.maps.geometry.spherical.computeArea(pontos.mvcLine); + i3GEOF.area.googlemaps.mostraTotal(per, area); + } + // desenha uma marca no ponto + i3GEO.desenho.googlemaps.shapes.push(new google.maps.Marker({ + map : i3GeoMap, + fillOpacity : 0, + clickable : false, + position : evt.latLng, + icon : { + path : google.maps.SymbolPath.CIRCLE, + scale : 2.5, + strokeColor : "#ffffff" }, - /** - * Mostra o valor do trecho entre o ultimo ponto clicado e a posicao do mouse - */ - mostraParcial : function(trecho, per, area, direcao) { - var mostra = $i("mostraarea_calculo_parcial"), texto; - if (mostra) { - texto = - "parcial
" + $trad("d21at") - + " km2:" - + format("#.###,000",(area / 1000000).toFixed(3)) - + "
" - + $trad("d21at") - + " ha: " - + format("#.###,00",(area / 10000).toFixed(2)) - + "
" - + $trad("x95") - + " km: " - + format("#.###,000",trecho.toFixed(3)) - + "
" - + $trad("x98") - + " km: " - + format("#.###,000",(per).toFixed(3)) - + "
" - + $trad("x23") - + " (DMS):" - + direcao; - mostra.innerHTML = texto; - } + origem : "medeAreaExcluir" + })); + // mais um ponto para criar uma linha movel + pontos.mvcLine.push(evt.latLng); + }); + evtmousemove = + google.maps.event.addListener(i3GeoMap, "mousemove", function(evt) { + if (!$i("mostraarea_calculo")) { + termina.call(); + return; } - }, - googlemaps : { - /** - * Inicializa o processo Cria a variavel para guardar os pontos Executa a funcao de inicializacao do desenho, que cria o - * layer para receber os graficos - */ - inicia : function() { - i3GEOF.area.pontos = { - xpt : [], - ypt : [], - dist : [] - }; - if (!google.maps.geometry) { - alert($trad("x99")); - return; - } - i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); - i3GeoMap.setOptions({ - disableDoubleClickZoom : true - }); - i3GeoMap.setOptions({ - draggableCursor : 'crosshair' - }); - var evtdblclick = null, evtclick = null, evtmousemove = null, pontos = { - xpt : [], - ypt : [], - dist : [], - mvcLine : new google.maps.MVCArray(), - mvcMarkers : new google.maps.MVCArray(), - line : null, - polygon : null - }, termina = function() { - google.maps.event.removeListener(evtdblclick); - google.maps.event.removeListener(evtclick); - google.maps.event.removeListener(evtmousemove); - pontos.line.setOptions({ - clickable : true - }); - google.maps.event.addListener(pontos.line, 'click', function(shape) { - if (shape.setEditable) { - shape.setEditable(!shape.editable); - } - }); - if (pontos) { - i3GEO.desenho.googlemaps.shapes.push(pontos.mvcLine); - i3GEO.desenho.googlemaps.shapes.push(pontos.line); - pontos = null; - } - i3GEOF.area.ultimoWkt = i3GEOF.area.pontos2wkt(); - }; - evtclick = google.maps.event.addListener(i3GeoMap, "click", function(evt) { - 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); - pontos.xpt.push(evt.latLng.lng()); - pontos.ypt.push(evt.latLng.lat()); - i3GEOF.area.pontos.xpt.push(evt.latLng.lng()); - i3GEOF.area.pontos.ypt.push(evt.latLng.lat()); - // desenha um circulo - if (pontos.mvcLine.getLength() > 0) { - per = google.maps.geometry.spherical.computeLength(pontos.mvcLine); - area = google.maps.geometry.spherical.computeArea(pontos.mvcLine); - i3GEOF.area.googlemaps.mostraTotal(per, area); - } - // desenha uma marca no ponto - i3GEO.desenho.googlemaps.shapes.push(new google.maps.Marker({ - map : i3GeoMap, - fillOpacity : 0, - clickable : false, - position : evt.latLng, - icon : { - path : google.maps.SymbolPath.CIRCLE, - scale : 2.5, - strokeColor : "#ffffff" - }, - origem : "medeAreaExcluir" - })); - // mais um ponto para criar uma linha movel - pontos.mvcLine.push(evt.latLng); - }); - evtmousemove = - google.maps.event.addListener(i3GeoMap, "mousemove", function(evt) { - if (!$i("mostraarea_calculo")) { - termina.call(); - return; - } - var x1, y1, x2, y2, direcao, per, area, estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao], n = - pontos.xpt.length; + var x1, y1, x2, y2, direcao, per, area, estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao], n = + pontos.xpt.length; - // If there is more than one vertex on the line - if (pontos.mvcLine.getLength() > 0) { - // If the line hasn't been created yet - if (!pontos.line) { - // Create the line (google.maps.Polyline) - pontos.line = new google.maps.Polygon({ - map : i3GeoMap, - clickable : false, - strokeColor : estilo.linecolor, - strokeOpacity : 1, - strokeWeight : estilo.linewidth, - path : pontos.mvcLine, - origem : "medeArea" - }); - } - pontos.mvcLine.pop(); - pontos.mvcLine.push(evt.latLng); - per = google.maps.geometry.spherical.computeLength(pontos.mvcLine); - x1 = pontos.xpt[n - 1]; - y1 = pontos.ypt[n - 1]; - x2 = evt.latLng.lng(); - y2 = evt.latLng.lat(); - trecho = i3GEO.calculo.distancia(x1, y1, x2, y2); - direcao = i3GEO.calculo.direcao(x1, y1, x2, y2); - direcao = i3GEO.calculo.dd2dms(direcao, direcao); - direcao = direcao[0]; - area = google.maps.geometry.spherical.computeArea(pontos.mvcLine); - i3GEOF.area.googlemaps.mostraParcial(trecho, per, area, direcao); - } - }); - evtdblclick = - google.maps.event.addListener(i3GeoMap, "dblclick", function(evt) { - pontos.mvcLine.push(new google.maps.LatLng(pontos.ypt[0], pontos.xpt[0])); - var per = google.maps.geometry.spherical.computeLength(pontos.mvcLine), area = - google.maps.geometry.spherical.computeArea(pontos.mvcLine); - i3GEOF.area.googlemaps.mostraTotal(per, area); - termina.call(); - }); - }, - /** - * Soma os valores de distancia guardados em pontos.dist - */ - somaDist : function(pontos) { - var n, i, total = 0; - n = pontos.dist.length; - for (i = 0; i < n; i++) { - total += pontos.dist[i]; - } - return total; - }, - /** - * Fecha a janela que mostra os dados Pergunta ao usuario se os graficos devem ser removidos Os graficos sao marcados com o - * atributo "origem" Os raios e pontos sao sempre removidos - */ - fechaJanela : function() { - i3GeoMap.setOptions({ - disableDoubleClickZoom : false - }); - i3GeoMap.setOptions({ - draggableCursor : undefined + // If there is more than one vertex on the line + if (pontos.mvcLine.getLength() > 0) { + // If the line hasn't been created yet + if (!pontos.line) { + // Create the line (google.maps.Polyline) + pontos.line = new google.maps.Polygon({ + map : i3GeoMap, + clickable : false, + strokeColor : estilo.linecolor, + strokeOpacity : 1, + strokeWeight : estilo.linewidth, + path : pontos.mvcLine, + origem : "medeArea" }); - 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 - */ - mostraTotal : function(per, area) { - var mostra = $i("mostraarea_calculo"), texto; - if (mostra) { - texto = - "total
" + $trad("d21at") - + " km2: " - + (area / 1000000).toFixed(3) - + "
" - + $trad("d21at") - + " ha: " - + (area / 10000).toFixed(2) - + "
" - + $trad("x98") - + " km: " - + (per).toFixed(2) - + "
" - + $trad("x25") - + ": " - + i3GEO.calculo.metododistancia; - mostra.innerHTML = texto + "
"; - i3GEOF.area.ultimaMedida = (area / 1000000).toFixed(3) + " km2"; - } - }, - /** - * Mostra o valor do trecho entre o ultimo ponto clicado e a posicao do mouse - */ - mostraParcial : function(trecho, per, area, direcao) { - var mostra = $i("mostraarea_calculo_parcial"), texto; - if (mostra) { - texto = - "parcial
" + $trad("d21at") - + " km2: " - + (area / 1000000).toFixed(3) - + "
" - + $trad("d21at") - + " ha: " - + (area / 10000).toFixed(2) - + "
" - + $trad("x95") - + " km: " - + trecho.toFixed(3) - + "
" - + $trad("x98") - + " km: " - + (per).toFixed(3) - + "
" - + $trad("x23") - + " (DMS): " - + direcao; - mostra.innerHTML = texto; - } + } + pontos.mvcLine.pop(); + pontos.mvcLine.push(evt.latLng); + per = google.maps.geometry.spherical.computeLength(pontos.mvcLine); + x1 = pontos.xpt[n - 1]; + y1 = pontos.ypt[n - 1]; + x2 = evt.latLng.lng(); + y2 = evt.latLng.lat(); + trecho = i3GEO.calculo.distancia(x1, y1, x2, y2); + direcao = i3GEO.calculo.direcao(x1, y1, x2, y2); + direcao = i3GEO.calculo.dd2dms(direcao, direcao); + direcao = direcao[0]; + area = google.maps.geometry.spherical.computeArea(pontos.mvcLine); + i3GEOF.area.googlemaps.mostraParcial(trecho, per, area, direcao); } + }); + evtdblclick = + google.maps.event.addListener(i3GeoMap, "dblclick", function(evt) { + pontos.mvcLine.push(new google.maps.LatLng(pontos.ypt[0], pontos.xpt[0])); + var per = google.maps.geometry.spherical.computeLength(pontos.mvcLine), area = + google.maps.geometry.spherical.computeArea(pontos.mvcLine); + i3GEOF.area.googlemaps.mostraTotal(per, area); + termina.call(); + }); + }, + /** + * Soma os valores de distancia guardados em pontos.dist + */ + somaDist : function(pontos) { + var n, i, total = 0; + n = pontos.dist.length; + for (i = 0; i < n; i++) { + total += pontos.dist[i]; + } + return total; + }, + /** + * Fecha a janela que mostra os dados Pergunta ao usuario se os graficos devem ser removidos Os graficos sao marcados com o + * atributo "origem" Os raios e pontos sao sempre removidos + */ + fechaJanela : function() { + i3GeoMap.setOptions({ + disableDoubleClickZoom : false + }); + i3GeoMap.setOptions({ + draggableCursor : undefined + }); + 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 + */ + mostraTotal : function(per, area) { + var mostra = $i("mostraarea_calculo"), texto; + if (mostra) { + texto = + "total
" + $trad("d21at") + + " km2: " + + (area / 1000000).toFixed(3) + + "
" + + $trad("d21at") + + " ha: " + + (area / 10000).toFixed(2) + + "
" + + $trad("x98") + + " km: " + + (per).toFixed(2) + + "
" + + $trad("x25") + + ": " + + i3GEO.calculo.metododistancia; + mostra.innerHTML = texto + "
"; + i3GEOF.area.ultimaMedida = (area / 1000000).toFixed(3) + " km2"; + } + }, + /** + * Mostra o valor do trecho entre o ultimo ponto clicado e a posicao do mouse + */ + mostraParcial : function(trecho, per, area, direcao) { + var mostra = $i("mostraarea_calculo_parcial"), texto; + if (mostra) { + texto = + "parcial
" + $trad("d21at") + + " km2: " + + (area / 1000000).toFixed(3) + + "
" + + $trad("d21at") + + " ha: " + + (area / 10000).toFixed(2) + + "
" + + $trad("x95") + + " km: " + + trecho.toFixed(3) + + "
" + + $trad("x98") + + " km: " + + (per).toFixed(3) + + "
" + + $trad("x23") + + " (DMS): " + + direcao; + mostra.innerHTML = texto; } - }; + } + } +}; //aplica ao codigo i3GEOF definicoes feitas na interface do mapa //isso permite a substituicao de funcoes e parametros if(i3GEO.configura.ferramentas.hasOwnProperty("area")){ -jQuery.each( i3GEO.configura.ferramentas.area, function(index, value) { - i3GEOF.area[index] = i3GEO.configura.ferramentas.area[index]; -}); + jQuery.each( i3GEO.configura.ferramentas.area, function(index, value) { + i3GEOF.area[index] = i3GEO.configura.ferramentas.area[index]; + }); } \ No newline at end of file diff --git a/ferramentas/editorol/editorol.js b/ferramentas/editorol/editorol.js index 60e34a7..6c17550 100755 --- a/ferramentas/editorol/editorol.js +++ b/ferramentas/editorol/editorol.js @@ -237,52 +237,6 @@ i3GEO.editorOL = { }); } }, - criaJanelaBusca : function() { - var layers = i3GEO.editorOL.layersLigados(), nlayers = layers.length, i, ins, combo = - ""; - ins = "
" + $trad("a7") + ":
" + combo; - ins += "
" + $trad("x64") + ":
"; - ins += "
" + $trad("t23") + ":
"; - ins += "

"; - ins += "
'" + $trad("result") + "':
"; - - YAHOO.namespace("procura.container"); - YAHOO.procura.container.panel = new YAHOO.widget.Panel("panelprocura", { - zIndex : 2000, - iframe : false, - width : "250px", - visible : false, - draggable : true, - close : true, - strings: {close: "cancel"} - }); - YAHOO.procura.container.panel.setHeader("Encontre no mapa"); - YAHOO.procura.container.panel.setBody(ins); - YAHOO.procura.container.panel.setFooter(""); - YAHOO.procura.container.panel.render(document.body); - YAHOO.procura.container.panel.center(); - - document.getElementById("i3GEOOLbotaoBusca").onclick = - function() { - var layer = i3GEO.editorOL.layerAtivo(), item = document.getElementById("i3GEOOLbuscaItem").value, palavra = - document.getElementById("i3GEOOLpalavraBusca").value; - if (item === "" || palavra === "") { - alert("Escolha o item e o texto de busca"); - return; - } - i3GEO.editorOL.busca(layer, item, palavra, "i3GEOOLcomboresultado"); - }; - document.getElementById("i3GEOOLlistaTemasBusca").onchange = function() { - i3GEO.editorOL.ativaTema(this.value); - document.getElementById("i3GEOOLcomboitens").innerHTML = "..."; - i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(), "i3GEOOLcomboitens", "i3GEOOLbuscaItem"); - }; - - }, criaComboTemas : function() { var layers = i3GEO.editorOL.layersLigados(), nlayers = layers.length, i, nometema = "", combo = "