From 09ff5ae52cc9bb865457204e5b66fd4e3743768c Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Sat, 19 Feb 2011 12:23:38 +0000 Subject: [PATCH] --- classesjs/classe_analise.js | 25 ++++++++++++++----------- classesjs/classe_arvoredecamadas.js | 35 ++++++++++++++++++++--------------- classesjs/classe_arvoredetemas.js | 26 ++++++++++++++------------ classesjs/classe_barradebotoes.js | 5 +++-- classesjs/classe_coordenadas.js | 11 ++++++----- classesjs/classe_idioma.js | 5 +++-- classesjs/classe_interface.js | 75 +++++++++++++++++++++++++++++++++++++++++---------------------------------- classesjs/classe_janela.js | 28 ++++++++++++++++------------ classesjs/classe_mapa.js | 16 +++++++++------- interface/googlemaps.phtml | 6 +++--- interface/openlayers.htm | 9 +++++---- 11 files changed, 134 insertions(+), 107 deletions(-) diff --git a/classesjs/classe_analise.js b/classesjs/classe_analise.js index 8853fe3..1365d8e 100644 --- a/classesjs/classe_analise.js +++ b/classesjs/classe_analise.js @@ -407,15 +407,16 @@ i3GEO.analise = { */ movimento: function(){ var n,d,r,decimal,da,mostra,texto, - pontosdistobj = i3GEO.analise.medeDistancia.pontosdistobj; + pontosdistobj = i3GEO.analise.medeDistancia.pontosdistobj, + calculo = i3GEO.calculo; if (g_tipoacao === "mede"){ YAHOO.util.Dom.setStyle("mostradistancia","display","block"); n = pontosdistobj.xpt.length; try{ if (n > 0){ - d = i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); - r = i3GEO.calculo.direcao(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); - r = i3GEO.calculo.dd2dms(r,r); + d = calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); + r = calculo.direcao(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); + r = calculo.dd2dms(r,r); r = r[0]; d = d + ""; @@ -433,7 +434,7 @@ i3GEO.analise = { mostra = $i("mostradistancia_calculo"); if (mostra){ texto = " Dist acum.= "+da+" km
atual= "+d+" km
Direção (DMS)= "+r; - texto += "
Método cálculo de distâncias: "+i3GEO.calculo.metododistancia; + texto += "
Método cálculo de distâncias: "+calculo.metododistancia; mostra.innerHTML = texto; } if(i3GEO.Interface.ATUAL !== "googleearth") @@ -476,13 +477,15 @@ i3GEO.analise = { inicia: function(){ if(typeof(console) !== 'undefined'){console.info("i3GEO.analise.medeArea.inicia()");} var temp,x,y,ll1,ll2,d, + calculo = i3GEO.calculo, montacontainer = function(){ + var desenho = i3GEO.desenho; $i("mostraarea_calculo").innerHTML = "Clique no mapa para desenhar o poligono. Clique duas vezes para concluir"; i3GEO.barraDeBotoes.ativaIcone("area"); g_tipoacao = "area"; - i3GEO.desenho.criaContainerRichdraw(); - i3GEO.desenho.richdraw.lineColor = "green"; - i3GEO.desenho.richdraw.lineWidth = "2px"; + desenho.criaContainerRichdraw(); + desenho.richdraw.lineColor = "green"; + desenho.richdraw.lineWidth = "2px"; }; i3GEO.analise.medeArea.criaJanela(); if (g_tipoacao !== "area"){ @@ -513,9 +516,9 @@ i3GEO.analise = { if(i3GEO.util.in_array(i3GEO.Interface.ATUAL,["openlayers","googlemaps"])){ x = parseInt(i3GEO.parametros.w / 2,10); y = parseInt(i3GEO.parametros.h / 2,10); - ll1 = i3GEO.calculo.tela2dd(x,y,"",""); - ll2 = i3GEO.calculo.tela2dd(x + 1,y,"",""); - d = i3GEO.calculo.distancia(ll1[0],ll1[1],ll2[0],ll2[1]); + ll1 = calculo.tela2dd(x,y,"",""); + ll2 = calculo.tela2dd(x + 1,y,"",""); + d = calculo.distancia(ll1[0],ll1[1],ll2[0],ll2[1]); d = d * 1000; g_areapixel = d * d; temp = g_areapixel < 0 ? alert("Nao e possivel calcular a area. Entre em contato com o administrador do sistema.") : montacontainer(); diff --git a/classesjs/classe_arvoredecamadas.js b/classesjs/classe_arvoredecamadas.js index 7bf7dbb..ea6291f 100644 --- a/classesjs/classe_arvoredecamadas.js +++ b/classesjs/classe_arvoredecamadas.js @@ -741,7 +741,8 @@ i3GEO.arvoreDeCamadas = { montaOpcoes: function(node){ if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.montaOpcoes()");} //YAHOO.log("Montando as opções da árvore de camadas", "i3geo"); - var d,conteudo,opcoesNode,idtema,ltema,farol,mfarol,tnome,iconesNode; + var d,conteudo,opcoesNode,idtema,ltema,farol,mfarol,tnome,iconesNode + imb = i3GEO.util.$im("branco.gif"); idtema = node.data.id; ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema); if(i3GEO.arvoreDeCamadas.OPCOESICONES === true){ @@ -763,13 +764,13 @@ i3GEO.arvoreDeCamadas = { mfarol = $trad("t11"); } tnome = " " + - " " + - " " + - " " + - " "; + " " + + " " + + " " + + " "; //a operação de zoom para o tema não funciona na interface flamingo if( (ltema.zoomtema === "sim") && (i3GEO.Interface.ATUAL !== "flamingo")) - {tnome += " ";} + {tnome += " ";} iconesNode = new YAHOO.widget.HTMLNode({html:tnome,enableHighlight: false,isLeaf:true,expanded:false}, node); if(ltema.permitecomentario.toLowerCase() !== "nao" && i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios === true) { @@ -1043,7 +1044,8 @@ i3GEO.arvoreDeCamadas = { {String} - texto formatado */ montaTextoTema: function(tema){ - var ck,html,display="none",estilo; + var ck,html,display="none",estilo, + iu = i3GEO.util; if(tema.status*1 === 2) {ck = ' CHECKED ';} else @@ -1084,13 +1086,13 @@ i3GEO.arvoreDeCamadas = { //inclui icone indicando que o tema muda conforme a escala // if (tema.contextoescala === "sim") - {html += " ";} + {html += " ";} if (tema.sel === "sim"){ - html += " "; - html += " "; + html += " "; + html += " "; } if (tema.download.toLowerCase() === "sim") - {html += " ";} + {html += " ";} estilo = navm ? "cursor:move;vertical-align:35%;padding-top:0px;color:black;" : "cursor:move;vertical-align:top;color:black;"; if(i3GEO.arvoreDeCamadas.AGUARDALEGENDA) {html += " "+tema.tema+"";} @@ -1114,12 +1116,15 @@ i3GEO.arvoreDeCamadas = { { if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.atualizaFarol()");} //YAHOO.log("Atualizando o farol da árvore de camadas", "i3geo"); - var farol,l,ltema,escala; + var farol,l,ltema,escala, + iu = i3GEO.util, + im = i3GEO.configura.locaplic+"/imagens/", + camadas = i3GEO.arvoreDeCamadas.CAMADAS; farol = "maisamarelo.png"; - l = i3GEO.arvoreDeCamadas.CAMADAS.length-1; + l = camadas.length-1; if (l >= 0){ do{ - ltema = i3GEO.arvoreDeCamadas.CAMADAS[l]; + ltema = camadas[l]; escala = ltema.escala; if (escala*1 < mapscale*1) {farol = "maisverde.png";} @@ -1127,7 +1132,7 @@ i3GEO.arvoreDeCamadas = { {farol = "maisvermelho.png";} if (escala*1 === 0) {farol = "maisamarelo.png";} - i3GEO.util.defineValor("farol"+ltema.name,"src",i3GEO.configura.locaplic+"/imagens/"+farol); + iu.defineValor("farol"+ltema.name,"src",im+farol); } while(l--); } diff --git a/classesjs/classe_arvoredetemas.js b/classesjs/classe_arvoredetemas.js index bef3108..3fc2913 100644 --- a/classesjs/classe_arvoredetemas.js +++ b/classesjs/classe_arvoredetemas.js @@ -1298,49 +1298,51 @@ i3GEO.arvoreDeTemas = { */ outrasOpcoesHTML: function(){ if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeTemas.outrasOpcoesHTML()");} - var ins = "",t = 0; + var ins = "", + t = 0, + imb = i3GEO.util.$im("branco.gif"); if(this.OPCOESADICIONAIS.refresh === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.uploadgpx === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.uploaddbf === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.uploadlocal === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.downloadbase === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.conectarwms === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.conectarwmst === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.conectargeorss === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.nuvemTags === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.nuvemTagsFlash === true){ - ins += ""; + ins += ""; t += 20; } if(this.OPCOESADICIONAIS.carousel === true){ - ins += ""; + ins += ""; t += 20; } return(""+ins+"
"); diff --git a/classesjs/classe_barradebotoes.js b/classesjs/classe_barradebotoes.js index e823864..6d5355c 100644 --- a/classesjs/classe_barradebotoes.js +++ b/classesjs/classe_barradebotoes.js @@ -836,12 +836,13 @@ i3GEO.barraDeBotoes = { */ recria: function(id){ if(typeof(console) !== 'undefined'){console.info("i3GEO.barraDeBotoes.recria()");} - var n,temp,novoel,barraZoom,x,y; + var n,temp,novoel,barraZoom,x,y, + iu = i3GEO.util; n = this.BARRAS.length; for(i=0;i"; }, /* diff --git a/classesjs/classe_idioma.js b/classesjs/classe_idioma.js index 4d2fe61..f1f7d02 100644 --- a/classesjs/classe_idioma.js +++ b/classesjs/classe_idioma.js @@ -281,7 +281,8 @@ i3GEO.idioma = { // //monta o elemento HTML com as bandeiras // - var ins,n,w,i,pos,novoel,temp; + var ins,n,w,i,pos,novoel,temp, + iu = i3GEO.util; ins = ""; n = this.SELETORES.length; if($i("i3geo") && i3GEO.parametros.w < 550) @@ -289,7 +290,7 @@ i3GEO.idioma = { else {w = "";} for(i=0;i"+$trad("p13")+"","listaPropriedades",i3GEO.configura.listaDePropriedadesDoMapa); + gadgets.mostraEscalaNumerica(); + gadgets.mostraEscalaGrafica(); + gadgets.visual.inicia(); + iu.arvore(""+$trad("p13")+"","listaPropriedades",configura.listaDePropriedadesDoMapa); // //i3GEO.arvoreDeCamadas.CAMADAS é definido na inicialização (classe_i3geo) // - i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic); + i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,configura.sid,configura.locaplic); - i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens); + i3GEO.ajuda.ativaLetreiro(parametros.mensagens); i3GEO.Interface.padrao.ativaBotoes(); i3GEO.idioma.mostraSeletor(); - if (i3GEO.configura.mapaRefDisplay !== "none"){ - if (i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")) - {i3GEO.configura.mapaRefDisplay = i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay");} - if (i3GEO.configura.mapaRefDisplay === "block") + if (configura.mapaRefDisplay !== "none"){ + if (iu.pegaCookie("i3GEO.configura.mapaRefDisplay")) + {configura.mapaRefDisplay = iu.pegaCookie("i3GEO.configura.mapaRefDisplay");} + if (configura.mapaRefDisplay === "block") {i3GEO.maparef.inicia();} } }, ativaBotoes: function(){ if(typeof(console) !== 'undefined'){console.info("i3GEO.Interface.padrao.ativaBotoes()");} var x1,y1,x2,y2, - imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); - if ($i("barraDeBotoes1") || i3GEO.barraDeBotoes.AUTO === true){ + imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)), + barraDeBotoes = i3GEO.barraDeBotoes; + if ($i("barraDeBotoes1") || barraDeBotoes.AUTO === true){ x1 = imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT; y1 = imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP; } - if ($i("barraDeBotoes2") || i3GEO.barraDeBotoes.AUTO === true){ + if ($i("barraDeBotoes2") || barraDeBotoes.AUTO === true){ x2 = imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT; y2 = imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP; } - if (($i("barraDeBotoes1") && $i("barraDeBotoes2")) || i3GEO.barraDeBotoes.AUTO === true){ + if (($i("barraDeBotoes1") && $i("barraDeBotoes2")) || barraDeBotoes.AUTO === true){ x1 = imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+40; } - if ($i("barraDeBotoes1") || i3GEO.barraDeBotoes.AUTO === true) - {i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes1","i3geo_barra1",true,x1,y1);} - if ($i("barraDeBotoes2") || i3GEO.barraDeBotoes.AUTO === true) - {i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2);} + if ($i("barraDeBotoes1") || barraDeBotoes.AUTO === true) + {barraDeBotoes.inicializaBarra("barraDeBotoes1","i3geo_barra1",true,x1,y1);} + if ($i("barraDeBotoes2") || barraDeBotoes.AUTO === true) + {barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2);} //ativa as funções dos botões - i3GEO.barraDeBotoes.ativaBotoes(); + barraDeBotoes.ativaBotoes(); if (document.getElementById("botao3d")){ if (i3GEO.configura.map3d === "") {document.getElementById("botao3d").style.display="none";} @@ -663,9 +669,10 @@ i3GEO.Interface = { //são criados apenas os layers que ainda não existirem no mapa //mas que existem na arvore de camadas // - i3GEO.Interface.openlayers.criaLayers(); - i3GEO.Interface.openlayers.ordenaLayers(); - i3GEO.Interface.openlayers.recalcPar(); + var openlayers = i3GEO.Interface.openlayers; + openlayers.criaLayers(); + openlayers.ordenaLayers(); + openlayers.recalcPar(); i3GEO.janela.fechaAguarde(); }, cria: function(w,h){ diff --git a/classesjs/classe_janela.js b/classesjs/classe_janela.js index e507c04..c0ae7fd 100644 --- a/classesjs/classe_janela.js +++ b/classesjs/classe_janela.js @@ -163,8 +163,9 @@ i3GEO.janela = { // //esconde o box de zoom e outros objetos temporários se estiverem visíveis // - i3GEO.util.escondePin(); - i3GEO.util.escondeBox(); + var iu = i3GEO.util; + iu.escondePin(); + iu.escondeBox(); }, /* Function: cria @@ -386,10 +387,11 @@ i3GEO.janela = { */ fecha: function(event){ if(typeof(console) !== 'undefined'){console.info("i3GEO.janela.fecha()");} - var i,old,id; + var i,old,id, + iu = i3GEO.util; //esconde elementos gráficos q a ferramenta pode ter aberto - i3GEO.util.escondePin(); - i3GEO.util.escondeBox(); + iu.escondePin(); + iu.escondeBox(); //fecha o container de desenho de elementos na tela //if($i("divGeometriasTemp")) //{i3GEO.desenho.richdraw.fecha();} @@ -403,13 +405,13 @@ i3GEO.janela = { {id = this.id;} else {id = event.id;} - i3GEO.util.removeChild(id+"_c"); - i3GEO.util.removeChild(id); - i3GEO.util.removeChild(id+"_mask"); + iu.removeChild(id+"_c"); + iu.removeChild(id); + iu.removeChild(id+"_mask"); // //remove script tag se houver // - i3GEO.util.removeScriptTag(id+"_script"); + iu.removeScriptTag(id+"_script"); }, /* Function: alteraTamanho @@ -689,13 +691,15 @@ i3GEO.janela = { } else{ try{ - var id,i,n = this.JANELASAGUARDE.length; + var id,i, + n = this.JANELASAGUARDE.length, + iu = i3GEO.util; for(i=0;i
";} else {titulo = "";} @@ -629,7 +631,7 @@ i3GEO.mapa = { eval("var valor = ds[s]."+tips[r]+".valor"); eval("var link = ds[s]."+tips[r]+".link"); eval("var img = ds[s]."+tips[r]+".img"); - if (i3GEO.configura.tipotip === "completo" || i3GEO.configura.tipotip === "balao"){ + if (tipotip === "completo" || tipotip === "balao"){ if(valor !== "" && link === "") {ins += "" + alias + " :" + valor + "
";} if(valor !== "" && link !== "") @@ -660,7 +662,7 @@ i3GEO.mapa = { {$i("tip").style.display="none";} } else{ - if(i3GEO.configura.tipotip !== "balao"){ + if(tipotip !== "balao"){ n = i3GEO.janela.tip(); $i(n).style.textAlign="left"; $i(n).innerHTML += res; @@ -671,11 +673,11 @@ i3GEO.mapa = { i3GEO.Interface.googleearth.aguarde.visibility = "hidden"; } else{ - i3GEO.util.criaPin('marcaIdentifica',i3GEO.configura.locaplic+"/imagens/grabber.gif","12px","12px"); + i3GEO.util.criaPin('marcaIdentifica',configura.locaplic+"/imagens/grabber.gif","12px","12px"); i3GEO.util.posicionaImagemNoMapa("marcaIdentifica"); balloon = new Balloon(); balloon.delayTime = 0; - res = "
"+res+"
"; + res = "
"+res+"
"; balloon.showTooltip($i("marcaIdentifica"),res); $i('marcaIdentifica').onclick = $i("closeButton").onclick; } @@ -687,7 +689,7 @@ i3GEO.mapa = { temp = "identifica"; if(i3GEO.Interface.ATIVAMENUCONTEXTO) {temp = "identifica_contexto";} - i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); + i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic); } } catch(e){ diff --git a/interface/googlemaps.phtml b/interface/googlemaps.phtml index 0ffa73a..9ca8484 100644 --- a/interface/googlemaps.phtml +++ b/interface/googlemaps.phtml @@ -15,8 +15,6 @@ include_once("../ms_configura.php"); } i3GEO - GoogleMaps - -
@@ -95,7 +93,7 @@ include_once("../ms_configura.php");

- + @@ -106,6 +104,8 @@ include_once("../ms_configura.php");

i3Geo - Software livre para criação de mapas interativos e geoprocessamento

Baseado no Mapserver, é licenciado sob GPL e integra o Portal do Software Público Brasileiro

i3Geo - Software livre para criação de mapas interativos e geoprocessamento

Baseado no Mapserver, é licenciado sob GPL e integra o Portal do Software Público Brasileiro

logomarca
+ + - + @@ -133,7 +132,7 @@

- + @@ -146,7 +145,9 @@

i3Geo - Software livre para criação de mapas interativos e geoprocessamento

Baseado no Mapserver, é licenciado sob GPL e integra o Portal do Software Público Brasileiro

i3Geo - Software livre para criação de mapas interativos e geoprocessamento

Baseado no Mapserver, é licenciado sob GPL e integra o Portal do Software Público Brasileiro

logomarca
- + +