From 3122380f3653d1eb398564842f0d2520fbb49b3d Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 9 Feb 2011 20:08:47 +0000 Subject: [PATCH] Validação dos programas JS de classesjs com o JSLINT --- classesjs/atlas.js | 2 +- classesjs/classe_ajuda.js | 19 ++++++++++--------- classesjs/classe_analise.js | 61 +++++++++++++++++++++++++++++++------------------------------ classesjs/classe_arvoredecamadas.js | 397 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ classesjs/classe_arvoredetemas.js | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------ classesjs/classe_barradebotoes.js | 79 ++++++++++++++++++++++++++++++++++++++----------------------------------------- classesjs/classe_calculo.js | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------- classesjs/classe_configura.js | 75 ++++++++++++++++++++++++++++++++++++++------------------------------------- classesjs/classe_coordenadas.js | 73 ++++++++++++++++++++++++++++++++++++++----------------------------------- classesjs/classe_desenho.js | 30 +++++++++++++++--------------- classesjs/classe_eventos.js | 20 +++++++++----------- classesjs/classe_gadgets.js | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------- classesjs/classe_guias.js | 4 ++-- classesjs/classe_i3geo.js | 31 +++++++++++++------------------ classesjs/classe_interface.js | 314 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------- classesjs/classe_janela.js | 258 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------- classesjs/classe_mapa.js | 8 ++++---- classesjs/classe_maparef.js | 18 +++++++++--------- classesjs/classe_navega.js | 28 ++++++++++++++-------------- classesjs/classe_php.js | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------- classesjs/classe_selecao.js | 2 +- classesjs/classe_social.js | 18 +++++++++--------- classesjs/classe_tema.js | 2 +- classesjs/classe_util.js | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------- classesjs/datadownload.js | 2 +- classesjs/depreciados.js | 2 +- classesjs/geradordelinks.js | 2 +- 27 files changed, 1170 insertions(+), 1142 deletions(-) diff --git a/classesjs/atlas.js b/classesjs/atlas.js index 248ef62..bfc7ada 100644 --- a/classesjs/atlas.js +++ b/classesjs/atlas.js @@ -176,7 +176,7 @@ function pegaListaDeAtlas() { texto += ""; } - texto += ""; + texto += ""; texto += "
"; texto += " "; if(listaAtlas[i].PUBLICADO) diff --git a/classesjs/classe_ajuda.js b/classesjs/classe_ajuda.js index 35e7be3..499b87c 100644 --- a/classesjs/classe_ajuda.js +++ b/classesjs/classe_ajuda.js @@ -29,7 +29,7 @@ GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. */ -if(typeof(i3GEO) == 'undefined'){ +if(typeof(i3GEO) === 'undefined'){ i3GEO = []; } /* @@ -150,7 +150,7 @@ i3GEO.ajuda = { abreJanela: function(){ if(typeof(console) !== 'undefined'){console.info("i3GEO.ajuda.abreJanela()");} try { - var nx,ny,pos,corpo,texto,janela,largura=262; + var nx,ny,pos,corpo,texto,janela,largura=262; if(i3GEO.ajuda.ATIVAJANELA === false){return;} if($i("contemFerramentas")){ @@ -213,18 +213,18 @@ i3GEO.ajuda = { {clearTimeout(i3GEO.ajuda.tempoLetreiro);} catch(e){i3GEO.ajuda.tempoLetreiro = "";} l = $i(i3GEO.ajuda.DIVLETREIRO); - if(l.style.display=="none"){return;} + if(l.style.display==="none"){return;} l.style.cursor="pointer"; if(mensagem === ""){ l.value = ""; return; } - if (l.size == 1) + if (l.size === 1) {l.size = i3GEO.parametros.w / 8;} BMessage = mensagem + " ---Clique para parar--- "; l.onclick = function() {l.style.display = "none";}; - if (BMessage != " ---Clique para parar--- "){ + if (BMessage !== " ---Clique para parar--- "){ BQuantas = 0; BSize = l.size; BPos=BSize; @@ -255,7 +255,7 @@ i3GEO.ajuda = { fechaJanela: function(){ if(typeof(console) !== 'undefined'){console.info("i3GEO.ajuda.fechaJanela()");} i3GEO.ajuda.desativaCookie(); - i3GEO.util.removeChild("i3geo_janelaMensagens_c",document.body) + i3GEO.util.removeChild("i3geo_janelaMensagens_c",document.body); }, /* Function: mostraJanela @@ -271,7 +271,8 @@ i3GEO.ajuda = { var j = $i(i3GEO.ajuda.DIVAJUDA), k = $i("janelaMenTexto"), jm = $i("i3geo_janelaMensagens"), - h = parseInt(YAHOO.util.Dom.getStyle(jm,"height"),10); + h = parseInt(YAHOO.util.Dom.getStyle(jm,"height"),10), + temp; if(j){ j.innerHTML = texto === "" ? "-" : texto; } @@ -279,7 +280,7 @@ i3GEO.ajuda = { YAHOO.util.Dom.setY("i3geo_janelaMensagens",YAHOO.util.Dom.getY(jm) + h); if(k){k.innerHTML = texto;} if(i3GEO.ajuda.TRANSICAOSUAVE){ - texto !== "" ? YAHOO.util.Dom.setStyle(jm,"opacity","1") : YAHOO.util.Dom.setStyle(jm,"opacity",i3GEO.ajuda.OPACIDADE / 100); + temp = texto !== "" ? YAHOO.util.Dom.setStyle(jm,"opacity","1") : YAHOO.util.Dom.setStyle(jm,"opacity",(i3GEO.ajuda.OPACIDADE / 100)); } h = parseInt(YAHOO.util.Dom.getStyle(jm,"height"),10); YAHOO.util.Dom.setY(jm,YAHOO.util.Dom.getY(jm) - h); @@ -295,7 +296,7 @@ i3GEO.ajuda = { */ mostraLetreiro: function(){ if(typeof(console) !== 'undefined'){console.info("i3GEO.ajuda.mostraLetreiro()");} - for (count=0; count   "); atualizaLinhaDoTempo = function(){ - var doc; + var doc,temp; try{ if (navn){ if ($i("wdocai")) @@ -79,13 +79,13 @@ i3GEO.analise = { if(document.frames("wdocai")) {doc = document.frames("wdocai").document;} } - doc.getElementById("tl") ? window.parent.wdocai.carregaDados() : i3GEO.eventos.NAVEGAMAPA.remove("atualizaLinhaDoTempo()"); + temp = doc.getElementById("tl") ? window.parent.wdocai.carregaDados() : i3GEO.eventos.NAVEGAMAPA.remove("atualizaLinhaDoTempo()"); } catch(e){ i3GEO.eventos.NAVEGAMAPA.remove("atualizaLinhaDoTempo()"); if(typeof(console) !== 'undefined'){console.error(e);} } - }; + }; if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaLinhaDoTempo()") < 0) {i3GEO.eventos.NAVEGAMAPA.push("atualizaLinhaDoTempo()");} }, @@ -135,7 +135,7 @@ i3GEO.analise = { Abre a janela de diálogo da ferramenta pontosdistri */ pontosdistri: function(){ - i3GEO.parametros.r == "nao" ? alert("Opção não disponível") : i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.pontosdistri()","pontosdistri","pontosDistri"); + var temp = i3GEO.parametros.r === "nao" ? alert("Opção não disponível") : i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.pontosdistri()","pontosdistri","pontosDistri"); }, /* Function: pontoempoligono @@ -235,7 +235,7 @@ i3GEO.analise = { linhas: [] }; i3GEO.analise.medeDistancia.criaJanela(); - if (g_tipoacao != "mede"){ + if (g_tipoacao !== "mede"){ if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.analise.medeDistancia.clique()") < 0) {i3GEO.eventos.MOUSECLIQUE.push("i3GEO.analise.medeDistancia.clique()");} if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.analise.medeDistancia.movimento()") < 0) @@ -243,7 +243,7 @@ i3GEO.analise = { if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.analise.medeDistancia.fechaJanela()") < 0) {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.analise.medeDistancia.fechaJanela()");} $i("mostradistancia").style.display="block"; - if(i3GEO.Interface.ATUAL != "googleearth"){ + if(i3GEO.Interface.ATUAL !== "googleearth"){ i3GEO.desenho.criaContainerRichdraw(); i3GEO.desenho.richdraw.lineColor = "black"; i3GEO.desenho.richdraw.lineWidth = "1px"; @@ -251,7 +251,7 @@ i3GEO.analise = { g_tipoacao = "mede"; } else{ - if(i3GEO.Interface.ATUAL != "googleearth") + if(i3GEO.Interface.ATUAL !== "googleearth") {i3GEO.desenho.richdraw.fecha();} YAHOO.util.Dom.setStyle("mostradistancia","display","none"); YAHOO.util.Dom.setStyle("pontosins","display","none"); @@ -263,7 +263,7 @@ i3GEO.analise = { Cria a janela para mostrar os resultados da medição */ criaJanela: function(){ - var novoel,ins,imagemxy; + var novoel,ins,imagemxy,temp; if (!$i("mostradistancia")){ novoel = document.createElement("div"); novoel.id = "mostradistancia"; @@ -297,7 +297,7 @@ i3GEO.analise = { //botao que abre a ferramenta de cálculo de perfis. //pontosdistobj contém as coordenadas dos pontos // - new YAHOO.widget.Button( + temp = new YAHOO.widget.Button( "i3GEObotaoPerfil", {onclick:{fn: function(){ var js = i3GEO.configura.locaplic+"/ferramentas/perfil/index.js.php"; @@ -311,7 +311,7 @@ i3GEO.analise = { Fecha a janela e os elementos gráficos criados para a ferramenta de medição */ fechaJanela: function(){ - i3GEO.Interface.ATUAL !== "googleearth" ? i3GEO.desenho.richdraw.fecha() : i3GEO.Interface.googleearth.removePlacemark("divGeometriasTemp"); + var temp = i3GEO.Interface.ATUAL !== "googleearth" ? i3GEO.desenho.richdraw.fecha() : i3GEO.Interface.googleearth.removePlacemark("divGeometriasTemp"); i3GEO.util.removeChild("pontosins"); i3GEO.util.removeChild("mostradistancia_c"); if($i("divGeometriasTemp")) @@ -329,7 +329,7 @@ i3GEO.analise = { */ clique: function(){ var n,d,decimal,dd,dV; - if (g_tipoacao == "mede"){ + if (g_tipoacao === "mede"){ n = pontosdistobj.xpt.length; pontosdistobj.xpt[n] = objposicaocursor.ddx; pontosdistobj.ypt[n] = objposicaocursor.ddy; @@ -391,9 +391,9 @@ i3GEO.analise = { Para o cálculo de distâncias e ativa o botão "pan" */ paraCalculo: function(){ - g_tipoacao == ""; - var botaoPan = $i("pan"); - botaoPan ? botaoPan.onclick.call() : i3GEO.barraDeBotoes.ativaBotoes(); + var temp,botaoPan = $i("pan"); + g_tipoacao = ""; + temp = botaoPan ? botaoPan.onclick.call() : i3GEO.barraDeBotoes.ativaBotoes(); }, /* Function: movimento @@ -402,7 +402,7 @@ i3GEO.analise = { */ movimento: function(){ var n,d,r,decimal,da,mostra,texto; - if (g_tipoacao == "mede"){ + if (g_tipoacao === "mede"){ YAHOO.util.Dom.setStyle("mostradistancia","display","block"); n = pontosdistobj.xpt.length; try{ @@ -430,7 +430,7 @@ i3GEO.analise = { texto += "
Método cálculo de distâncias: "+i3GEO.calculo.metododistancia; mostra.innerHTML = texto; } - if(i3GEO.Interface.ATUAL != "googleearth") + if(i3GEO.Interface.ATUAL !== "googleearth") {i3GEO.desenho.aplica("resizeLinha",pontosdistobj.linhas[n-1],n);} } } @@ -466,7 +466,7 @@ i3GEO.analise = { g_tipoacao = "area"; i3GEO.desenho.criaContainerRichdraw(); i3GEO.desenho.richdraw.lineColor = "green"; - i3GEO.desenho.richdraw.lineWidth = "2px"; + i3GEO.desenho.richdraw.lineWidth = "2px"; }; pontosdistobj = { xpt: [], @@ -479,7 +479,7 @@ i3GEO.analise = { linhas: [] }; i3GEO.analise.medeArea.criaJanela(); - if (g_tipoacao != "area"){ + if (g_tipoacao !== "area"){ $i("mostraarea_calculo").innerHTML = ""; if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.analise.medeArea.clique()") < 0) {i3GEO.eventos.MOUSECLIQUE.push("i3GEO.analise.medeArea.clique()");} @@ -492,10 +492,10 @@ i3GEO.analise = { //é necessário pegar a resolução de cada pixel do servidor //via mapscript // - if(i3GEO.Interface.ATUAL == "padrao"){ + if(i3GEO.Interface.ATUAL === "padrao"){ temp = function(retorno){ i3GEO.janela.fechaAguarde("i3GEO.atualiza"); - retorno.data < 0 ? alert("Nao e possivel calcular a area. Entre em contato com o administrador do sistema.") : montacontainer(); + var temp = retorno.data < 0 ? alert("Nao e possivel calcular a area. Entre em contato com o administrador do sistema.") : montacontainer(); }; i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); i3GEO.php.areaPixel(temp,i3GEO.parametros.pixelsize); @@ -504,7 +504,7 @@ i3GEO.analise = { //a API do Openlayers e GoogleMaps tem uma função própria de obtenção da resolução de cada pixel //essa função é embutida em i3GEO.calculo.tela2dd // - if(i3GEO.Interface.ATUAL == "googlemaps" || i3GEO.Interface.ATUAL == "openlayers"){ + if(i3GEO.Interface.ATUAL === "googlemaps" || i3GEO.Interface.ATUAL === "openlayers"){ x = parseInt(i3GEO.parametros.w / 2,10); y = parseInt(i3GEO.parametros.h / 2,10); ll1 = i3GEO.calculo.tela2dd(x,y,"",""); @@ -512,7 +512,7 @@ i3GEO.analise = { d = i3GEO.calculo.distancia(ll1[0],ll1[1],ll2[0],ll2[1]); d = d * 1000; g_areapixel = d * d; - g_areapixel < 0 ? alert("Nao e possivel calcular a area. Entre em contato com o administrador do sistema.") : montacontainer(); + temp = g_areapixel < 0 ? alert("Nao e possivel calcular a area. Entre em contato com o administrador do sistema.") : montacontainer(); } } else{i3GEO.desenho.richdraw.fecha();} @@ -564,7 +564,7 @@ i3GEO.analise = { */ clique: function(){ var n,m; - if (g_tipoacao == "area"){ + if (g_tipoacao === "area"){ n = pontosdistobj.xpt.length; pontosdistobj.xpt[n] = objposicaocursor.ddx; pontosdistobj.ypt[n] = objposicaocursor.ddy; @@ -591,8 +591,8 @@ i3GEO.analise = { if (navn) {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1);} } - catch(e){ - if(typeof(console) !== 'undefined'){console.error(e);} + catch(men){ + if(typeof(console) !== 'undefined'){console.error(men);} } m = i3GEO.calculo.area(pontosdistobj,g_areapixel); @@ -609,9 +609,10 @@ i3GEO.analise = { Para o cálculo de área e ativa o botão "pan" */ paraCalculo: function(){ - g_tipoacao == ""; - var botaoPan = $i("pan"); - botaoPan ? botaoPan.onclick.call() : i3GEO.barraDeBotoes.ativaBotoes(); + var botaoPan = $i("pan"), + temp; + g_tipoacao = ""; + temp = botaoPan ? botaoPan.onclick.call() : i3GEO.barraDeBotoes.ativaBotoes(); }, /* Function: movimento @@ -620,7 +621,7 @@ i3GEO.analise = { */ movimento: function(){ var n,d,decimal,da,m; - if (g_tipoacao == "area"){ + if (g_tipoacao === "area"){ n = pontosdistobj.xpt.length; if (n > 0){ i3GEO.desenho.aplica("resizePoligono",pontosdistobj.linhastemp,1); diff --git a/classesjs/classe_arvoredecamadas.js b/classesjs/classe_arvoredecamadas.js index 9c0dac7..c5cc6e6 100644 --- a/classesjs/classe_arvoredecamadas.js +++ b/classesjs/classe_arvoredecamadas.js @@ -354,7 +354,7 @@ i3GEO.arvoreDeCamadas = { if(YAHOO.lang.isUndefined(temas)) {return;} this.atualiza(temas); - if(this.finaliza != ""){ + if(this.finaliza !== ""){ eval(this.finaliza); } }, @@ -401,13 +401,14 @@ i3GEO.arvoreDeCamadas = { {currentIconMode = newVal;} buildTree(); } - function buildTree(){ + function buildTree(){ i3GEO.arvoreDeCamadas.ARVORE = new YAHOO.widget.TreeView(i3GEO.arvoreDeCamadas.IDHTML); root = i3GEO.arvoreDeCamadas.ARVORE.getRoot(); //tempNode = new YAHOO.widget.TextNode({isLeaf:false,enableHighlight:false}, root, false); - } - buildTree(); - }(); + } + buildTree(); + }; + YAHOO.example.treeExample(); root = i3GEO.arvoreDeCamadas.ARVORE.getRoot(); titulo = ""; @@ -473,9 +473,9 @@ i3GEO.arvoreDeTemas = { i3GEO.arvoreDeTemas.MENUS = []; c = retorno.data.length; m = i3GEO.arvoreDeTemas.IDSMENUS.length; - for (i=0, j=c; i fonte";} if(ngSgrupo[sg].subgrupo) {d += "";} @@ -660,7 +660,7 @@ i3GEO.arvoreDeTemas = { {d += "";} tempNode = new YAHOO.widget.HTMLNode({html:d,expanded:false,isLeaf:true,enableHighlight:false}, node); } - conta++; + conta += 1; } } }; @@ -669,7 +669,7 @@ i3GEO.arvoreDeTemas = { else{ retorno = retorno.data; conta = 0; - if ((retorno != "erro") && (retorno !== undefined)){ + if ((retorno !== "erro") && (typeof(retorno) !== 'undefined')){ ig = retorno.length-1; if(ig >= 0){ do{ @@ -684,8 +684,8 @@ i3GEO.arvoreDeTemas = { } } node.loadComplete(); - }; - i3GEO.php.procurartemasestrela(temp,node.data.nivel,i3GEO.arvoreDeTemas.FATORESTRELA*1); + }; + i3GEO.php.procurartemasestrela(temp,node.data.nivel,i3GEO.arvoreDeTemas.FATORESTRELA*1); }, /* Function: cria @@ -715,19 +715,19 @@ i3GEO.arvoreDeTemas = { if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeTemas.cria()");} if(this.ARVORE){return;} if(!idhtml) - {var idhtml = "";} + {idhtml = "";} if(idhtml !== "") {i3GEO.arvoreDeTemas.IDHTML = idhtml;} if(!funcaoTema) - {var funcaoTema = "";} + {funcaoTema = "";} if(funcaoTema !== "") {i3GEO.arvoreDeTemas.ATIVATEMA = funcaoTema;} if(!objOpcoes) - {var objOpcoes = "";} + {objOpcoes = "";} if(objOpcoes !== "") {i3GEO.arvoreDeTemas.OPCOESADICIONAIS = objOpcoes;} if(!tipoBotao) - {var tipoBotao = "";} + {tipoBotao = "";} if(tipoBotao !== "") {i3GEO.arvoreDeTemas.TIPOBOTAO = tipoBotao;} @@ -759,16 +759,17 @@ i3GEO.arvoreDeTemas = { YAHOO.example.treeExample = function(){ function changeIconMode(){ newVal = parseInt(this.value,10); - if (newVal != currentIconMode) + if (newVal !== currentIconMode) {currentIconMode = newVal;} buildTree(); } - function buildTree(){ + function buildTree(){ i3GEO.arvoreDeTemas.ARVORE = new YAHOO.widget.TreeView(i3GEO.arvoreDeTemas.IDHTML); tempNode = new YAHOO.widget.TextNode({html:'',expanded:false,isLeaf:false,enableHighlight:false},root); - } - buildTree(); - }(); + } + buildTree(); + }; + YAHOO.example.treeExample(); //opção de busca de temas root = i3GEO.arvoreDeTemas.ARVORE.getRoot(); if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluibusca === true){ @@ -815,7 +816,7 @@ i3GEO.arvoreDeTemas = { tempNode ); drive.setDynamicLoad(i3GEO.arvoreDeTemas.montaDir, 1); - ig++; + ig+=1; } while(ig";} else {editor = "";} @@ -878,9 +879,9 @@ i3GEO.arvoreDeTemas = { tempNode1 = new YAHOO.widget.HTMLNode( {expanded:false,html:"",enableHighlight: false,nivel:ig}, tempNode - ); - tempNode1.setDynamicLoad(i3GEO.arvoreDeTemas.listaEstrelas,1); - ig--; + ); + tempNode1.setDynamicLoad(i3GEO.arvoreDeTemas.listaEstrelas,1); + ig -= 1; } while(ig > 0); } @@ -889,16 +890,16 @@ i3GEO.arvoreDeTemas = { // dados = i3GEO.arvoreDeTemas.MENUS; c = dados.length; - for (i=0, j=c; i";} else {editor = "";} if(!dados[i].publicado){dados[i].publicado = "sim";} - if(dados[i].publicado.toLowerCase() != "nao") + if(dados[i].publicado.toLowerCase() !== "nao") {conteudo = " "+dados[i].nomemenu+""+editor;} else {conteudo = " "+dados[i].nomemenu+""+editor;} @@ -907,7 +908,7 @@ i3GEO.arvoreDeTemas = { root ); tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.montaGrupos, currentIconMode); - if(dados[i].status == "aberto") + if(dados[i].status === "aberto") {tempNode.expand();} } if(i3GEO.arvoreDeTemas.INCLUISISTEMAS){ @@ -928,7 +929,7 @@ i3GEO.arvoreDeTemas = { do{ nomeSis = sis[ig].NOME; if(sis[ig].PUBLICADO){ - if(sis[ig].PUBLICADO == "NAO" || sis[ig].PUBLICADO == "nao") + if(sis[ig].PUBLICADO === "NAO" || sis[ig].PUBLICADO === "nao") {nomeSis = ""+sis[ig].NOME+"";} } sisNode = new YAHOO.widget.HTMLNode( @@ -937,7 +938,7 @@ i3GEO.arvoreDeTemas = { ); funcoes = sis[ig].FUNCOES; tempf = funcoes.length; - for (ig2=0;ig2"+funcoes[ig2].NOME+""; funcNode = new YAHOO.widget.HTMLNode( @@ -945,7 +946,7 @@ i3GEO.arvoreDeTemas = { sisNode ); } - ig++; + ig+=1; } while(ig";} else {editor = "";} @@ -1000,7 +1001,7 @@ i3GEO.arvoreDeTemas = { //no caso do uso de menu de temas com base em arquivos xml, o id não existe //sendo necessário o uso da ordem dos grupos como identificador if(grupos[i].publicado){ - if(grupos[i].publicado == "NAO"){ + if(grupos[i].publicado === "NAO"){ grupos[i].nome = ""+grupos[i].nome+""; } } @@ -1032,11 +1033,11 @@ i3GEO.arvoreDeTemas = { c = subgrupos.length; raiz = i3GEO.arvoreDeTemas.SUBGRUPOS.temasgrupo; nraiz = raiz.length; - for (i=0;i";} else {editor = "";} @@ -1073,7 +1074,7 @@ i3GEO.arvoreDeTemas = { //no caso do uso de menu de temas com base em arquivos xml, o id não existe //sendo necessário o uso da ordem dos grupos como identificador if(subgrupos[i].publicado){ - if(subgrupos[i].publicado == "NAO"){ + if(subgrupos[i].publicado === "NAO"){ subgrupos[i].nome = ""+subgrupos[i].nome+""; } } @@ -1102,15 +1103,15 @@ i3GEO.arvoreDeTemas = { temas = i3GEO.arvoreDeTemas.TEMAS.temas; c = temas.length; cor = "rgb(51, 102, 102)"; - for (i=0;i"; } } @@ -1130,7 +1131,7 @@ i3GEO.arvoreDeTemas = { node ); tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.propTemas, 1); - cor = (cor == "rgb(51, 102, 102)") ? "rgb(47, 70, 50)" : "rgb(51, 102, 102)"; + cor = (cor === "rgb(51, 102, 102)") ? "rgb(47, 70, 50)" : "rgb(51, 102, 102)"; } } node.loadComplete(); @@ -1152,7 +1153,7 @@ i3GEO.arvoreDeTemas = { { var ig,d,conteudo,dirs,tempNode,arquivos,nodeSHP; dirs = retorno.data.diretorios; - for (ig=0;ig 1 || conteudo.search(".tif") > 1 || conteudo.search(".TIF") > 1 || conteudo.search(".shp") > 1 || conteudo.search(".SHP") > 1) @@ -1229,7 +1230,7 @@ i3GEO.arvoreDeTemas = { propTemas: function(node){ if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeTemas.propTemas()");} var d,tempNode,html,lkmini,lkmini1,lkgrcode,lkgrcode1,n,ogc; - if(node.data.fonte !== "" && node.data.fonte != " "){ + if(node.data.fonte !== "" && node.data.fonte !== " "){ tempNode = new YAHOO.widget.HTMLNode( {isLeaf:true,enableHighlight:false,expanded:false,html:"Fonte"}, node @@ -1243,24 +1244,24 @@ i3GEO.arvoreDeTemas = { node ); } - if (node.data.ogc != "nao"){ + if (node.data.ogc !== "nao"){ if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.kml === true){ - html = "Kml"; - if (node.data.kmz == "sim") + html = "Kml"; + if (node.data.kmz === "sim") {html = "Kml";} tempNode = new YAHOO.widget.HTMLNode( {isLeaf:true,enableHighlight:false,expanded:false,html:html}, node ); } - ogc = i3GEO.arvoreDeTemas.LOCAPLIC+"/ogc.php?tema="+node.data.idtema+"&service=wms&request=getcapabilities"; + ogc = i3GEO.arvoreDeTemas.LOCAPLIC+"/ogc.php?tema="+node.data.idtema+"&service=wms&request=getcapabilities"; tempNode = new YAHOO.widget.HTMLNode( {isLeaf:true,enableHighlight:false,expanded:false,html:"WMS - OGC"}, node ); } - if (node.data.permitecomentario != "nao" && i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios === true){ - html = "Comentário"; + if (node.data.permitecomentario !== "nao" && i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios === true){ + html = "Comentário"; tempNode = new YAHOO.widget.HTMLNode( {isLeaf:true,enableHighlight:false,expanded:false,html:html}, node @@ -1275,7 +1276,7 @@ i3GEO.arvoreDeTemas = { ); } if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.estrelas === true){ - n = parseInt(node.data.nacessos / (i3GEO.arvoreDeTemas.FATORESTRELA*1),10); + n = parseInt(node.data.nacessos / (i3GEO.arvoreDeTemas.FATORESTRELA*1),10); if(n >= 5){n = 5;} html = (n > 0) ? "" : ""; tempNode = new YAHOO.widget.HTMLNode({isLeaf:true,enableHighlight:false,expanded:false,html:html}, node); @@ -1358,7 +1359,7 @@ i3GEO.arvoreDeTemas = { i=0; do{ inputs[i].checked = false; - i++; + i+=1; } while(i= 0){ do{ ngSgrupo = retorno[ig].subgrupos; tempn = ngSgrupo.length; - for (sg=0;sg fonte";} d += ""; tempNode = new YAHOO.widget.HTMLNode(d, nodePalavra, false,true); tempNode.isLeaf = true; tempNode.enableHighlight = false; } - conta++; + conta+=1; } } } @@ -1495,21 +1496,21 @@ i3GEO.arvoreDeTemas = { montaTexto = function(ngSgrupo){ var tempn,ngTema,tempng,mostra,d,lk,tempNode,st,sg; tempn = ngSgrupo.length; - for(sg=0;sg fonte";} if(ngSgrupo[sg].subgrupo) {d += "";} @@ -1517,7 +1518,7 @@ i3GEO.arvoreDeTemas = { {d += "";} tempNode = new YAHOO.widget.HTMLNode({enableHighlight:false,isLeaf:true,html:d,expanded:false}, nodePalavra); } - conta++; + conta+=1; } } }; @@ -1526,7 +1527,7 @@ i3GEO.arvoreDeTemas = { else{ retorno = retorno.data; conta = 0; - if ((retorno != "erro") && (retorno !== undefined)){ + if ((retorno !== "erro") && (typeof(retorno) !== 'undefined')){ ig = retorno.length-1; if(ig >= 0){ do{ @@ -1610,7 +1611,7 @@ i3GEO.arvoreDeTemas = { //verifica se deve ser ativada uma outra guia que não a atual // if(i3GEO.arvoreDeTemas.RETORNAGUIA !== ""){ - if(i3GEO.arvoreDeTemas.RETORNAGUIA != i3GEO.guias.ATUAL){ + if(i3GEO.arvoreDeTemas.RETORNAGUIA !== i3GEO.guias.ATUAL){ i3GEO.guias.mostra(i3GEO.arvoreDeTemas.RETORNAGUIA); } } @@ -1658,8 +1659,8 @@ i3GEO.arvoreDeTemas = { var ob,ins,ig; ob = retorno.data; ins = ""; - for (ig=0;ig"+obGrupos.grupos[ig].nome+"";} i3GEO.arvoreDeTemas.temasRaizGrupos[obGrupos.grupos[ig].id_n1] = obGrupos.grupos[ig].temasgrupo; @@ -1739,7 +1740,7 @@ i3GEO.arvoreDeTemas = { ins = ""; - if(retorno.data != undefined) + if(typeof(retorno.data) !== 'undefined') {retorno = retorno.data.temas;} sg = retorno.length; - for (ig=0;ig"+retorno[ig].nome+""; } $i(idDestino).innerHTML = ins+""; }; - if(temas == undefined) + if(typeof(temas) === 'undefined') {i3GEO.php.pegalistadetemas(combo,id_menu,idGrupo,idSubGrupo);} else {combo(temas);} @@ -1895,8 +1896,7 @@ i3GEO.arvoreDeTemas = { Abre o aplicativo datadownload */ downloadbase: function() - {window.open(i3GEO.configura.locaplic+"/datadownload.htm");} - , + {window.open(i3GEO.configura.locaplic+"/datadownload.htm");}, /* Function: uploadgpx diff --git a/classesjs/classe_barradebotoes.js b/classesjs/classe_barradebotoes.js index 491354c..9ff2355 100644 --- a/classesjs/classe_barradebotoes.js +++ b/classesjs/classe_barradebotoes.js @@ -29,7 +29,7 @@ GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. */ -if(typeof(i3GEO) == 'undefined'){ +if(typeof(i3GEO) === 'undefined'){ i3GEO = []; } /* @@ -273,7 +273,7 @@ i3GEO.barraDeBotoes = { Tipo: {string} */ - TEMPLATEBOTAO: "", + TEMPLATEBOTAO: "", /* Propriedade: BOTAOPADRAO @@ -353,11 +353,11 @@ i3GEO.barraDeBotoes = { var estilo,temp,ist,cor,ko; i3GEO.barraDeBotoes.BOTAOCLICADO = icone; ko = i3GEO.barraDeBotoes.LISTABOTOES.length-1; - if(i3GEO.barraDeBotoes.COMPORTAMENTO == "padrao"){ + if(i3GEO.barraDeBotoes.COMPORTAMENTO === "padrao"){ if(ko >= 0){ do{ temp = $i(i3GEO.barraDeBotoes.LISTABOTOES[ko].iddiv); - if (i3GEO.barraDeBotoes.LISTABOTOES[ko].tipo=="dinamico" && temp){ + if (i3GEO.barraDeBotoes.LISTABOTOES[ko].tipo==="dinamico" && temp){ ist = temp.style; ist.borderWidth="1px"; ist.borderColor='white'; @@ -378,7 +378,7 @@ i3GEO.barraDeBotoes = { } } } - if(i3GEO.barraDeBotoes.COMPORTAMENTO == "destacado"){ + if(i3GEO.barraDeBotoes.COMPORTAMENTO === "destacado"){ if(ko >= 0){ do{ temp = $i(i3GEO.barraDeBotoes.LISTABOTOES[ko].iddiv); @@ -399,7 +399,7 @@ i3GEO.barraDeBotoes = { } } } - if(i3GEO.barraDeBotoes.COMPORTAMENTO == "laranja" || i3GEO.barraDeBotoes.COMPORTAMENTO == "vermelho" || i3GEO.barraDeBotoes.COMPORTAMENTO == "cinza"){ + if(i3GEO.barraDeBotoes.COMPORTAMENTO === "laranja" || i3GEO.barraDeBotoes.COMPORTAMENTO === "vermelho" || i3GEO.barraDeBotoes.COMPORTAMENTO === "cinza"){ if(ko >= 0){ do{ temp = $i(i3GEO.barraDeBotoes.LISTABOTOES[ko].iddiv); @@ -416,9 +416,9 @@ i3GEO.barraDeBotoes = { } while(ko--); } - if(i3GEO.barraDeBotoes.COMPORTAMENTO == "laranja"){cor = "orange";} - if(i3GEO.barraDeBotoes.COMPORTAMENTO == "vermelho"){cor = "red";} - if(i3GEO.barraDeBotoes.COMPORTAMENTO == "cinza"){cor = "gray";} + if(i3GEO.barraDeBotoes.COMPORTAMENTO === "laranja"){cor = "orange";} + if(i3GEO.barraDeBotoes.COMPORTAMENTO === "vermelho"){cor = "red";} + if(i3GEO.barraDeBotoes.COMPORTAMENTO === "cinza"){cor = "gray";} //ativa o icone if($i(icone)){ estilo = $i(icone).style; @@ -464,7 +464,7 @@ i3GEO.barraDeBotoes = { } if(l[b].funcaoonclick){ $i(l[b].iddiv).onclick = l[b].funcaoonclick; - if(l[b].iddiv == padrao) + if(l[b].iddiv === padrao) {l[b].funcaoonclick();} } if(l[b].constroiconteudo) @@ -473,7 +473,7 @@ i3GEO.barraDeBotoes = { } while (b--); } - if(padrao == "") + if(padrao === "") {i3GEO.barraDeBotoes.ativaIcone("");} }, /* @@ -538,12 +538,12 @@ i3GEO.barraDeBotoes = { temp = ""; chaves = i3GEO.util.listaChaves(i3GEO.barraDeBotoes.INCLUIBOTAO); n = chaves.length; - for(i=0;i 0){ mostra = elementos[0]; @@ -695,7 +692,7 @@ i3GEO.barraDeBotoes = { tipo = "inline"; if($i(idconteudonovo+"_")){ elementos = $i(idconteudonovo+"_").getElementsByTagName("div"); - if(elementos[elementos.length - 1].style.display == tipo) + if(elementos[elementos.length - 1].style.display === tipo) {return;} nelementos = elementos.length; if(nelementos > 0){ @@ -704,7 +701,7 @@ i3GEO.barraDeBotoes = { do{ e = elementos[i]; if(e.style){ - if((e.style.display == "block") || (e.style.display == "inline") || (e.style.display === "")){ + if((e.style.display === "block") || (e.style.display === "inline") || (e.style.display === "")){ if(e.id === "") {e.style.display="none";break;} } @@ -718,9 +715,9 @@ i3GEO.barraDeBotoes = { do{ e = elementos[i]; if(e.style){ - if(e.style.display == tipo) + if(e.style.display === tipo) {break;} - if(e.style.display == "none") + if(e.style.display === "none") {mostra = e;} } i = i - 1; @@ -795,11 +792,11 @@ i3GEO.barraDeBotoes = { var abre = function(){ var i, n = i3GEO.barraDeBotoes.BARRAS.length; - for(i=0;i
"+$trad("a7")+""; if(i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true) @@ -429,7 +430,7 @@ i3GEO.arvoreDeCamadas = { // if (i3GEO.configura.grupoLayers === ""){ c = temas.length; - for (i=0, j=c; i "; } temp += ""+i3GEO.configura.grupoLayers[i].nome+"

"; d = i3GEO.arvoreDeCamadas.EXPANDIDA; - if(i3GEO.configura.grupoLayers[i].expandido && i3GEO.configura.grupoLayers[i].expandido==true) + if(i3GEO.configura.grupoLayers[i].expandido && i3GEO.configura.grupoLayers[i].expandido === true) {d = true;} grupoNode = new YAHOO.widget.HTMLNode({enableHighlight:false,html:temp,expanded:d}, tempNode); n = i3GEO.configura.grupoLayers[i].layers.length; //layers de um grupo - for(j=0;jOutros"}, tempNode); c = incluidos.length; - for(k=0;k= 0){ - do{ - ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; - if($i("arrastar_"+ltema.name)) - {ddlist = new YAHOO.example.DDList("arrastar_"+ltema.name);} - } - while(i--); - } - } + init: function() + { + var ddtarget,i,ltema,ddlist; + if($i("i3geo_lixeira") && i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true) + {ddtarget = new YAHOO.util.DDTarget("i3geo_lixeira");} + i = i3GEO.arvoreDeCamadas.CAMADAS.length-1; + if (i3GEO.arvoreDeCamadas.CAMADAS.length-1 >= 0){ + do{ + ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; + if($i("arrastar_"+ltema.name)) + {ddlist = new YAHOO.example.DDList("arrastar_"+ltema.name);} + } + while(i--); + } + } }; YAHOO.example.DDList = function(id, sGroup, config) { - YAHOO.example.DDList.superclass.constructor.call(this, id, sGroup, config); - this.logger = this.logger || YAHOO; - Dom.setStyle(this.getDragEl(), "opacity", 0.67); // The proxy is slightly transparent - this.goingUp = false; - this.lastY = 0; + YAHOO.example.DDList.superclass.constructor.call(this, id, sGroup, config); + this.logger = this.logger || YAHOO; + Dom.setStyle(this.getDragEl(), "opacity", 0.67); // The proxy is slightly transparent + this.goingUp = false; + this.lastY = 0; }; YAHOO.extend( YAHOO.example.DDList, YAHOO.util.DDProxy, { - startDrag: function(x, y){ - var dragEl,clickEl; - this.logger.log(this.id + " startDrag"); - // make the proxy look like the source element - dragEl = this.getDragEl(); - clickEl = this.getEl(); - Dom.setStyle(clickEl, "visibility", "hidden"); - dragEl.innerHTML = clickEl.innerHTML; - Dom.setStyle(dragEl, "color", Dom.getStyle(clickEl, "color")); - Dom.setStyle(dragEl, "backgroundColor", Dom.getStyle(clickEl, "backgroundColor")); - Dom.setStyle(dragEl, "border", "4px solid gray"); - Dom.setStyle(dragEl, "z-index", "5000"); - }, - endDrag: function(e){ - var srcEl,proxy,a,thisid,proxyid; - srcEl = this.getEl(); - proxy = this.getDragEl(); - // Show the proxy element and animate it to the src element's location - Dom.setStyle(proxy, "visibility", ""); - a = new YAHOO.util.Motion( - proxy,{ - points: - {to: Dom.getXY(srcEl)} - }, - 0.2, - YAHOO.util.Easing.easeOut - ); - proxyid = proxy.id; - thisid = this.id; - // Hide the proxy and show the source element when finished with the animation - a.onComplete.subscribe( - function(){ - Dom.setStyle(proxyid, "visibility", "hidden"); - Dom.setStyle(thisid, "visibility", ""); - } - ); - a.animate(); + startDrag: function(x, y){ + var dragEl,clickEl; + this.logger.log(this.id + " startDrag"); + // make the proxy look like the source element + dragEl = this.getDragEl(); + clickEl = this.getEl(); + Dom.setStyle(clickEl, "visibility", "hidden"); + dragEl.innerHTML = clickEl.innerHTML; + Dom.setStyle(dragEl, "color", Dom.getStyle(clickEl, "color")); + Dom.setStyle(dragEl, "backgroundColor", Dom.getStyle(clickEl, "backgroundColor")); + Dom.setStyle(dragEl, "border", "4px solid gray"); + Dom.setStyle(dragEl, "z-index", "5000"); + }, + endDrag: function(e){ + var srcEl,proxy,a,thisid,proxyid; + srcEl = this.getEl(); + proxy = this.getDragEl(); + // Show the proxy element and animate it to the src element's location + Dom.setStyle(proxy, "visibility", ""); + a = new YAHOO.util.Motion( + proxy,{ + points: + {to: Dom.getXY(srcEl)} + }, + 0.2, + YAHOO.util.Easing.easeOut + ); + proxyid = proxy.id; + thisid = this.id; + // Hide the proxy and show the source element when finished with the animation + a.onComplete.subscribe( + function(){ + Dom.setStyle(proxyid, "visibility", "hidden"); + Dom.setStyle(thisid, "visibility", ""); + } + ); + a.animate(); YAHOO.util.Dom.setStyle('i3geo_lixeira', 'border', '0px solid blue'); - }, - onDragDrop: function(e, id){ - var pt,region,tema,destEl,els,lista,noid,temp; - if (DDM.interactionInfo.drop.length === 1){ - pt = DDM.interactionInfo.point; - region = DDM.interactionInfo.sourceRegion; - if (!region.intersect(pt)){ - DDM.refreshCache(); - //exclui tema - if(DDM.getDDById(id).id === "i3geo_lixeira"){ - if(i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true){ - tema = (this.getEl()).id.split("arrastar_")[1]; + }, + onDragDrop: function(e, id){ + var pt,region,tema,destEl,els,lista,noid,temp; + if (DDM.interactionInfo.drop.length === 1){ + pt = DDM.interactionInfo.point; + region = DDM.interactionInfo.sourceRegion; + if (!region.intersect(pt)){ + DDM.refreshCache(); + //exclui tema + if(DDM.getDDById(id).id === "i3geo_lixeira"){ + if(i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true){ + tema = (this.getEl()).id.split("arrastar_")[1]; i3GEO.tema.exclui(tema); /* i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o1")); - tema = (this.getEl()).id.split("arrastar_")[1]; + tema = (this.getEl()).id.split("arrastar_")[1]; i3GEO.contadorAtualiza++; - i3GEO.php.excluitema(i3GEO.atualiza,tema); + i3GEO.php.excluitema(i3GEO.atualiza,tema); i3GEO.mapa.ativaTema(""); */ } @@ -646,47 +647,47 @@ i3GEO.arvoreDeCamadas = { //muda ordem de desenho do tema else{ if(i3GEO.arvoreDeCamadas.ARRASTARORDEM === true){ - i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); - destEl = Dom.get(id); - noid = id.split("arrastar_")[1]; - destEl.appendChild(this.getEl()); - els = i3GEO.arvoreDeCamadas.listaLigadosDesligados(); - lista = els[2].join(","); - //i3GEO.contadorAtualiza++; + i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); + destEl = Dom.get(id); + noid = id.split("arrastar_")[1]; + destEl.appendChild(this.getEl()); + els = i3GEO.arvoreDeCamadas.listaLigadosDesligados(); + lista = els[2].join(","); + //i3GEO.contadorAtualiza++; temp = function(retorno){ i3GEO.atualiza(retorno); if(i3GEO.Interface.ATUAL === "openlayers") {i3GEO.Interface.openlayers.ordenaLayers();} }; - i3GEO.php.reordenatemas(temp,lista); - } + i3GEO.php.reordenatemas(temp,lista); + } } - } - } - }, - onDrag: function(e){ - // Keep track of the direction of the drag for use during onDragOver - var y; - y = Event.getPageY(e); - if (y < this.lastY) - {this.goingUp = true;} - else - if (y > this.lastY) - {this.goingUp = false;} - this.lastY = y; - }, - onDragOver: function(e, id){ - var srcEl,destEl; - srcEl = this.getEl(); - destEl = Dom.get(id); - // We are only concerned with list items, we ignore the dragover - // notifications for the list. - if ($i("i3geo_lixeira") && id === "i3geo_lixeira") - {$i("i3geo_lixeira").style.border = "1px solid red";} - else{destEl.style.textDecoration="underline";} - }, - onDragOut: function(e, id) - {$i(id).style.textDecoration="none";} + } + } + }, + onDrag: function(e){ + // Keep track of the direction of the drag for use during onDragOver + var y; + y = Event.getPageY(e); + if (y < this.lastY) + {this.goingUp = true;} + else + if (y > this.lastY) + {this.goingUp = false;} + this.lastY = y; + }, + onDragOver: function(e, id){ + var srcEl,destEl; + srcEl = this.getEl(); + destEl = Dom.get(id); + // We are only concerned with list items, we ignore the dragover + // notifications for the list. + if ($i("i3geo_lixeira") && id === "i3geo_lixeira") + {$i("i3geo_lixeira").style.border = "1px solid red";} + else{destEl.style.textDecoration="underline";} + }, + onDragOut: function(e, id) + {$i(id).style.textDecoration="none";} } ); Event.onDOMReady(YAHOO.example.DDApp.init, YAHOO.example.DDApp, true); @@ -715,15 +716,15 @@ i3GEO.arvoreDeCamadas = { farol = "maisamarelo.png"; mfarol = ""; if (ltema.escala*1 < i3GEO.parametros.mapscale*1){ - farol = "maisverde.png"; - mfarol = $trad("t9"); + farol = "maisverde.png"; + mfarol = $trad("t9"); } if (ltema.escala*1 > i3GEO.parametros.mapscale*1){ - farol = "maisvermelho.png"; + farol = "maisvermelho.png"; mfarol = $trad("t10"); } if (ltema.escala === 0){ - farol = "maisamarelo.png"; + farol = "maisamarelo.png"; mfarol = $trad("t11"); } tnome = " " + @@ -735,10 +736,10 @@ i3GEO.arvoreDeCamadas = { if( (ltema.zoomtema === "sim") && (i3GEO.Interface.ATUAL !== "flamingo")) {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) + if(ltema.permitecomentario.toLowerCase() !== "nao" && i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios === true) { temp = i3GEO.configura.locaplic+"/ms_criamapa.php?layers="+ltema.name; - tnome = i3GEO.social.compartilhar("",temp,temp,"semtotal"); + tnome = i3GEO.social.compartilhar("",temp,temp,"semtotal"); iconesNode = new YAHOO.widget.HTMLNode({html:tnome,enableHighlight:false,isLeaf:true,expanded:false},node); } } @@ -782,7 +783,7 @@ i3GEO.arvoreDeCamadas = { if(i3GEO.Interface.ATUAL !== "flamingo") {i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t22"),$trad("t23"),'i3GEO.tema.dialogo.procuraratrib(\"'+ltema.name+'\")',node);} i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t24"),$trad("t25"),'i3GEO.tema.dialogo.toponimia(\"'+ltema.name+'\")',node); - if(ltema.identifica == "sim" || ltema.identifica == "SIM" || ltema.identifica == "") + if(ltema.identifica === "sim" || ltema.identifica === "SIM" || ltema.identifica === "") {i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t26"),$trad("t27"),'i3GEO.tema.dialogo.etiquetas(\"'+ltema.name+'\")',node);} i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t28"),$trad("t29"),'i3GEO.tema.dialogo.filtro(\"'+ltema.name+'\")',node); i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t30"),$trad("t31"),'i3GEO.tema.dialogo.tabela(\"'+ltema.name+'\")',node); @@ -802,11 +803,11 @@ i3GEO.arvoreDeCamadas = { //as opções SLD foram migradas para a ferramenta de edição de legenda //i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t38"),$trad("t39"),'i3GEO.tema.dialogo.sld(\"'+ltema.name+'\")',node); //i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t43"),$trad("t43"),'i3GEO.tema.dialogo.aplicarsld(\"'+ltema.name+'\")',node); - if(ltema.editorsql == "sim" || ltema.editorsql == "SIM") + if(ltema.editorsql === "sim" || ltema.editorsql === "SIM") {i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t40"),$trad("t41"),'i3GEO.tema.dialogo.editorsql(\"'+ltema.name+'\")',node);} - if(ltema.permitecomentario.toLowerCase() !== "nao" && i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios == true) + if(ltema.permitecomentario.toLowerCase() !== "nao" && i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios === true) {i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t45"),$trad("t45"),'i3GEO.tema.dialogo.comentario(\"'+ltema.name+'\")',node);} - if(i3GEO.parametros.editor == "sim") + if(i3GEO.parametros.editor === "sim") {i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t44"),""+$trad("t44")+"",'i3GEO.tema.dialogo.salvaMapfile(\"'+ltema.name+'\")',node);} node.loadComplete(); }, @@ -826,8 +827,8 @@ i3GEO.arvoreDeCamadas = { node {String} - objeto node da árvore (YUI) que receberá o novo nó */ adicionaOpcaoTema:function(dica,titulo,onclick,node){ - var tnome = ""+titulo+" "; - new YAHOO.widget.HTMLNode({html:tnome,enableHighlight:false,isLeaf:true,expanded:false}, node); + var tnome = ""+titulo+" ", + temp = new YAHOO.widget.HTMLNode({html:tnome,enableHighlight:false,isLeaf:true,expanded:false}, node); }, /* Function: mostraLegenda @@ -1037,7 +1038,7 @@ i3GEO.arvoreDeCamadas = { } if ((tema.download === "sim") || (tema.download === "SIM")) {html += " ";} - estilo = navm ? "cursor:move;vertical-align:35%;padding-top:0px;" : "cursor:move;vertical-align:top;"; + estilo = navm ? "cursor:move;vertical-align:35%;padding-top:0px;" : "cursor:move;vertical-align:top;"; if(i3GEO.arvoreDeCamadas.AGUARDALEGENDA) {html += " "+tema.tema+"";} else @@ -1088,7 +1089,7 @@ i3GEO.arvoreDeCamadas = { tipo {String} - tipo de operação normal|ligartodos|desligartodos a opção 'normal' irá desligar/ligar o que estiver marcado */ aplicaTemas: function(tipo){ - if(arguments.length == 0) + if(arguments.length === 0) {tipo = "normal";} if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.aplicaTemas()");} var t,temp,ligar,desligar; @@ -1152,7 +1153,7 @@ i3GEO.arvoreDeCamadas = { if(arguments.length === 0) {tipo = "manter";} if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.listaLigadosDesligados()");} - var nos,ligados,desligados,todos,n,i,no,cs,csn,j,c; + var nos,ligados,desligados,todos,n,i,no,cs,csn,j,c,temp; nos = i3GEO.arvoreDeCamadas.ARVORE.getNodesByProperty("tipo","tema"); ligados = []; desligados = []; @@ -1164,10 +1165,10 @@ i3GEO.arvoreDeCamadas = { no = nos[i].getEl(); cs = no.getElementsByTagName("input"); csn = cs.length; - for(j=0;j 0){ - do{ - ltema = camadas[i]; + if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.filtraCamadas()");} + var resultado = [], + i = 0, + temp, + nelementos = camadas.length, + ltema; + if (nelementos > 0){ + do{ + ltema = camadas[i]; if(ltema.escondido !== "sim"){ temp = eval("ltema."+propriedade); if(operador === "igual"){ - if(temp == valor) + if(temp === valor) {resultado.push(ltema);} } if(operador === "diferente"){ @@ -1334,11 +1335,11 @@ i3GEO.arvoreDeCamadas = { {resultado.push(ltema);} } } - i++; - } - while(i < nelementos); - } - return resultado; + i += 1; + } + while(i < nelementos); + } + return resultado; }, /* Function: alteraPropCamadas @@ -1354,22 +1355,22 @@ i3GEO.arvoreDeCamadas = { camada {string} - código da camada */ alteraPropCamadas: function(propriedade,valor,camada){ - if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.alteraPropCamadas()");} - var resultado = [], - i = 0, - temp, - nelementos = i3GEO.arvoreDeCamadas.CAMADAS.length, - ltema; - if (nelementos > 0){ - do{ - ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; - if(ltema.name == camada){ + if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.alteraPropCamadas()");} + var resultado = [], + i = 0, + temp, + nelementos = i3GEO.arvoreDeCamadas.CAMADAS.length, + ltema; + if (nelementos > 0){ + do{ + ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; + if(ltema.name === camada){ eval("ltema."+propriedade+"='"+valor+"';"); } - i++; - } - while(i < nelementos); - } + i += 1; + } + while(i < nelementos); + } }, /* Function: verificaAbrangenciaTemas @@ -1377,9 +1378,9 @@ i3GEO.arvoreDeCamadas = { Verifica se um tema está ou não na abrangência espacial do mapa atual modificando a cor com que o nome é mostrado na árvore */ verificaAbrangenciaTemas: function(){ - if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()");} - if(i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS == false) - {return} + if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()");} + if(i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS === false) + {return;} try{ var resultado = [], i = 0, @@ -1392,15 +1393,15 @@ i3GEO.arvoreDeCamadas = { do{ ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; temp = ltema.exttema; - if(temp != ""){ - if(i3GEO.util.intersectaBox(temp,i3GEO.parametros.mapexten) == false){ + if(temp !== ""){ + if(i3GEO.util.intersectaBox(temp,i3GEO.parametros.mapexten) === false){ $i("ArvoreTituloTema"+ltema.name).style.color = "gray"; } else{ $i("ArvoreTituloTema"+ltema.name).style.color = "black"; } } - i++; + i += 1; } while(i < nelementos); } @@ -1417,19 +1418,19 @@ i3GEO.arvoreDeCamadas = { {string} código do tema ou "" */ verificaAplicaExtensao: function(){ - if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.verificaAplicaExtensao()");} + if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.verificaAplicaExtensao()");} + var i = 0, + temp = "", + nelementos = i3GEO.arvoreDeCamadas.CAMADAS.length, + ltema; try{ - var i = 0, - temp = "", - nelementos = i3GEO.arvoreDeCamadas.CAMADAS.length, - ltema; if (nelementos > 0){ do{ ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; - if(ltema.aplicaextensao == "sim"){ + if(ltema.aplicaextensao === "sim"){ temp = ltema.name; } - i++; + i += 1; } while(i < nelementos); } diff --git a/classesjs/classe_arvoredetemas.js b/classesjs/classe_arvoredetemas.js index b8e2bfd..69eadf4 100644 --- a/classesjs/classe_arvoredetemas.js +++ b/classesjs/classe_arvoredetemas.js @@ -29,7 +29,7 @@ GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. */ -if(typeof(i3GEO) == 'undefined'){ +if(typeof(i3GEO) === 'undefined'){ i3GEO = []; } /* @@ -334,7 +334,7 @@ i3GEO.arvoreDeTemas = { node = i3GEO.arvoreDeTemas.ARVORE.getNodeByProperty("idwms","raiz"); raiz = retorno.data.canais; nraiz = raiz.length; - for (i=0;i "+raiz[i].title; if(raiz[i].nacessos > 0){ html += " ("+((raiz[i].nacessosok * 100) / (raiz[i].nacessos*1))+"%)"; @@ -367,9 +367,9 @@ i3GEO.arvoreDeTemas = { catch(m){node.loadComplete();return;} cor = "rgb(51, 102, 102)"; html = ""; - for(i=0;i"+cabeca, @@ -386,7 +386,7 @@ i3GEO.arvoreDeTemas = { {tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.listaLayersWMS, 1);} if(retorno.data[i].estilos){ ns = retorno.data[i].estilos.length; - for (j=0;j"; html += layer+" - "+titulo; html += "
("+(ngSgrupo[sg].subgrupo)+") "+lk+" ("+(ngSgrupo[sg].grupo)+")"+lk+" ("+(ngSgrupo[sg].subgrupo)+") "+lk+" ("+(ngSgrupo[sg].subgrupo)+") "+lk+" ("+(ngSgrupo[sg].grupo)+")"+lk+"fecha
";} - if(i3GEO.barraDeBotoes.TIPOAJUDA == "vertical") + if(i3GEO.barraDeBotoes.TIPOAJUDA === "vertical") {divmensagem.innerHTML = "
fecha
";} } - if(mensagem != ""){ - if(i3GEO.barraDeBotoes.TIPOAJUDA == "horizontal"){ + if(mensagem !== ""){ + if(i3GEO.barraDeBotoes.TIPOAJUDA === "horizontal"){ divmensagem.style.left = parseInt(YAHOO.util.Dom.getStyle(objeto,"width"),10)+pos[0]+10+"px"; divmensagem.style.top = pos[1]-2+(parseInt(YAHOO.util.Dom.getStyle(objeto,"height"),10) / 2)+"px"; } - if(i3GEO.barraDeBotoes.TIPOAJUDA == "vertical"){ + if(i3GEO.barraDeBotoes.TIPOAJUDA === "vertical"){ divmensagem.style.left = (parseInt(YAHOO.util.Dom.getStyle(objeto,"width"),10)/2)+pos[0]-5+"px"; divmensagem.style.top = pos[1]+5+parseInt(YAHOO.util.Dom.getStyle(objeto,"height"),10)+"px"; } diff --git a/classesjs/classe_calculo.js b/classesjs/classe_calculo.js index 470726f..380ed1b 100644 --- a/classesjs/classe_calculo.js +++ b/classesjs/classe_calculo.js @@ -29,7 +29,7 @@ GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. */ -if(typeof(i3GEO) == 'undefined'){ +if(typeof(i3GEO) === 'undefined'){ i3GEO = []; } /* @@ -82,7 +82,7 @@ i3GEO.calculo = { spm = cs / 3600; mpg = cm / 60; dd = (cd * 1) + (mpg * 1) + (spm * 1); - if (sinal == 'negativo') + if (sinal === 'negativo') {dd = dd * -1;} return (dd); } @@ -112,27 +112,27 @@ i3GEO.calculo = { dd2tela: function (vx,vy,docmapa,ext,cellsize){ try{ var pos,latlng,xyn,dc,imgext,c,xy; - if(i3GEO.Interface.ATUAL == "googlemaps" && docmapa.id != "mapaReferencia"){ + if(i3GEO.Interface.ATUAL === "googlemaps" && docmapa.id !== "mapaReferencia"){ pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); xyn = i3GeoMapOverlay.getProjection().fromLatLngToContainerPixel(new google.maps.LatLng(vy,vx)); xy = []; return [(xyn.x)+pos[0],(xyn.y)+pos[1]]; } - if(i3GEO.Interface.ATUAL == "openlayers" && docmapa.id != "mapaReferencia"){ + if(i3GEO.Interface.ATUAL === "openlayers" && docmapa.id !== "mapaReferencia"){ pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); xy = i3geoOL.getViewPortPxFromLonLat(new OpenLayers.LonLat(vx,vy)); return [(xy.x)+pos[0],(xy.y)+pos[1]]; } - if(arguments.length == 3){ + if(arguments.length === 3){ ext = i3GEO.parametros.mapexten; cellsize = i3GEO.parametros.pixelsize; } - if(arguments.length == 4){ + if(arguments.length === 4){ cellsize = i3GEO.parametros.pixelsize; } if(!docmapa) {docmapa = window.document;} - dc = docmapa; + dc = docmapa; pos = i3GEO.util.pegaPosicaoObjeto(dc); imgext = ext.split(" "); vx = (vx * 1) - (imgext[0] * 1); @@ -225,11 +225,11 @@ i3GEO.calculo = { try { var amext,longdd,latdd; - if(i3GEO.Interface.ATUAL == "googlemaps" && arguments.length == 4){ + if(i3GEO.Interface.ATUAL === "googlemaps" && arguments.length === 4){ amext = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(xfign,yfign)); return [amext.lng(),amext.lat()]; } - if(i3GEO.Interface.ATUAL == "openlayers" && arguments.length == 4){ + if(i3GEO.Interface.ATUAL === "openlayers" && arguments.length === 4){ amext = i3geoOL.getLonLatFromPixel(new OpenLayers.Pixel(xfign,yfign)); return [amext.lon,amext.lat]; } @@ -279,7 +279,7 @@ i3GEO.calculo = { pontos.xtela.push(pontos.xtela[0]); pontos.ytela.push(pontos.ytela[0]); $polygon_area = 0; - for ($i=0;$i < $array_length;$i++) + for ($i=0;$i < $array_length;$i+=1) {$polygon_area += ((pontos.xtela[$i] * pontos.ytela[$i+1])-(pontos.ytela[$i] * pontos.xtela[$i+1]));} $polygon_area = Math.abs($polygon_area) / 2; } @@ -347,8 +347,8 @@ i3GEO.calculo = { dLat = ((lat2-lat1))* Math.PI / 180; dLon = ((lon2-lon1)) * Math.PI / 180; a = Math.sin(dLat/2) * Math.sin(dLat/2) + - Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * - Math.sin(dLon/2) * Math.sin(dLon/2); + Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * + Math.sin(dLon/2) * Math.sin(dLon/2); c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); d = 6378.137 * c; return d; @@ -379,55 +379,71 @@ i3GEO.calculo = { coordinates (decimal degrees) and the return distance is in kilometers. */ distVincenty: function(lon1,lat1,lon2,lat2) { - var rad = function(x) {return x*Math.PI/180;}; - var ct = { - a: 6378137, - b: 6356752.3142, - f: 1/298.257223563 - }; - var p1 = { - lat: lat1, - lon: lon1 - }; - var p2 = { - lat: lat2, - lon: lon2 - }; - var a = ct.a, b = ct.b, f = ct.f; - var L = rad(p2.lon - p1.lon); - var U1 = Math.atan((1-f) * Math.tan(rad(p1.lat))); - var U2 = Math.atan((1-f) * Math.tan(rad(p2.lat))); - var sinU1 = Math.sin(U1), cosU1 = Math.cos(U1); - var sinU2 = Math.sin(U2), cosU2 = Math.cos(U2); - var lambda = L, lambdaP = 2*Math.PI; - var iterLimit = 20; + var rad = function(x) {return x*Math.PI/180;}, + ct = { + a: 6378137, + b: 6356752.3142, + f: 1/298.257223563 + }, + p1 = { + lat: lat1, + lon: lon1 + }, + p2 = { + lat: lat2, + lon: lon2 + }, + a = ct.a, b = ct.b, f = ct.f, + L = rad(p2.lon - p1.lon), + U1 = Math.atan((1-f) * Math.tan(rad(p1.lat))), + U2 = Math.atan((1-f) * Math.tan(rad(p2.lat))), + sinU1 = Math.sin(U1), cosU1 = Math.cos(U1), + sinU2 = Math.sin(U2), cosU2 = Math.cos(U2), + lambda = L, lambdaP = 2*Math.PI, + iterLimit = 20, + sinLambda, + cosLambda, + sinSigma, + cosSigma, + sigma, + alpha, + cosSqAlpha, + cos2SigmaM, + C, + uSq, + A, + B, + s, + d, + deltaSigma; while (Math.abs(lambda-lambdaP) > 1e-12 && --iterLimit>0) { - var sinLambda = Math.sin(lambda), cosLambda = Math.cos(lambda); - var sinSigma = Math.sqrt((cosU2*sinLambda) * (cosU2*sinLambda) + + sinLambda = Math.sin(lambda); + cosLambda = Math.cos(lambda); + sinSigma = Math.sqrt((cosU2*sinLambda) * (cosU2*sinLambda) + (cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda)); - if (sinSigma==0) { + if (sinSigma===0) { return 0; // co-incident points } - var cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda; - var sigma = Math.atan2(sinSigma, cosSigma); - var alpha = Math.asin(cosU1 * cosU2 * sinLambda / sinSigma); - var cosSqAlpha = Math.cos(alpha) * Math.cos(alpha); - var cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha; - var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha)); + cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda; + sigma = Math.atan2(sinSigma, cosSigma); + alpha = Math.asin(cosU1 * cosU2 * sinLambda / sinSigma); + cosSqAlpha = Math.cos(alpha) * Math.cos(alpha); + cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha; + C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha)); lambdaP = lambda; lambda = L + (1-C) * f * Math.sin(alpha) * (sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM))); } - if (iterLimit==0) { + if (iterLimit===0) { return NaN; // formula failed to converge } - var uSq = cosSqAlpha * (a*a - b*b) / (b*b); - var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq))); - var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq))); - var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- + uSq = cosSqAlpha * (a*a - b*b) / (b*b); + A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq))); + B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq))); + deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM))); - var s = b*A*(sigma-deltaSigma); - var d = s.toFixed(3)/1000; // round to 1mm precision + s = b*A*(sigma-deltaSigma); + d = s.toFixed(3)/1000; // round to 1mm precision return d; }, /* @@ -498,9 +514,9 @@ i3GEO.calculo = { if(typeof(console) !== 'undefined'){console.info("i3GEO.calculo.destinoDD()");} var R,lat1,lon1,brng,lat2,lon2; R = 6371; // earth's mean radius in km - lat1 = lat * (Math.PI / 180); - lon1 = lon * (Math.PI / 180); - brng = direcao * (Math.PI / 180); + lat1 = lat * (Math.PI / 180); + lon1 = lon * (Math.PI / 180); + brng = direcao * (Math.PI / 180); lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) + Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) ); lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2)); lon2 = (lon2+Math.PI)%(2*Math.PI) - Math.PI; // normalise to -180...+180 @@ -528,8 +544,8 @@ i3GEO.calculo = { rect2ext: function(idrect,mapext,pixel){ if(typeof(console) !== 'undefined'){console.info("i3GEO.calculo.rect2ext()");} var bx,bxs,xfig,yfig,nx,ny,pix,piy,pos,amext,dx,dy,x1,y1,x2,y2; - eval ('pix = parseInt(document.getElementById("'+idrect+'").style.' + g_tipoleft + ")"); - eval ('piy = parseInt(document.getElementById("'+idrect+'").style.' + g_tipotop + ")"); + eval('pix = parseInt(document.getElementById("'+idrect+'").style.' + g_tipoleft + ',10);'); + eval('piy = parseInt(document.getElementById("'+idrect+'").style.' + g_tipotop + ',10);'); if($i(idrect)){ bx = $i(idrect); bxs = bx.style; @@ -580,15 +596,15 @@ i3GEO.calculo = { {Array} - width,heigth,top,left */ ext2rect: function(idrect,mapext,boxext,pixel,documento){ - if(typeof(console) !== 'undefined'){console.info("i3GEO.calculo.ext2rect()");} - var rectbox,rectmap,xyMin,xyMax,w,h,tl,pos,t,l,d,box; - rectbox = boxext.split(" "); - rectmap = mapext.split(" "); - xyMin = i3GEO.calculo.dd2tela(rectbox[0],rectbox[1],documento,boxext,pixel); - xyMax = i3GEO.calculo.dd2tela(rectbox[2],rectbox[3],documento,boxext,pixel); + if(typeof(console) !== 'undefined'){console.info("i3GEO.calculo.ext2rect()");} + var rectbox,rectmap,xyMin,xyMax,w,h,tl,pos,t,l,d,box; + rectbox = boxext.split(" "); + rectmap = mapext.split(" "); + xyMin = i3GEO.calculo.dd2tela(rectbox[0],rectbox[1],documento,boxext,pixel); + xyMax = i3GEO.calculo.dd2tela(rectbox[2],rectbox[3],documento,boxext,pixel); w = xyMax[0]-xyMin[0]; h = xyMin[1]-xyMax[1]; - tl = i3GEO.calculo.dd2tela(rectbox[0],rectbox[3],documento,mapext,pixel); + tl = i3GEO.calculo.dd2tela(rectbox[0],rectbox[3],documento,mapext,pixel); pos = i3GEO.util.pegaPosicaoObjeto(documento); t = tl[1] - pos[1]; @@ -600,8 +616,8 @@ i3GEO.calculo = { box.style.height = h; box.style.top = t + "px"; box.style.left = l + "px"; - box.style.display=d; - } + box.style.display=d; + } return [w,h,xyMax[1],xyMin[0]]; } }; diff --git a/classesjs/classe_configura.js b/classesjs/classe_configura.js index 25bad27..b74f114 100644 --- a/classesjs/classe_configura.js +++ b/classesjs/classe_configura.js @@ -92,7 +92,7 @@ i3GEO.configura = { {nome:$trad("s1"),id:"ajudas"} - ], + ], submenus:{ @@ -115,10 +115,10 @@ i3GEO.configura = { menu:[ {nome:$trad("s1"),id:"ajudaMenu"}, {nome:$trad("s2"),id:"analise"}, - {nome:$trad("s3"),id:"janelas"}, - {nome:$trad("s4"),id:"arquivos"}, - {nome:$trad("d32"),id:"interface"} - ], + {nome:$trad("s3"),id:"janelas"}, + {nome:$trad("s4"),id:"arquivos"}, + {nome:$trad("d32"),id:"interface"} + ], submenus:{ "ajudaMenu": [ { id:"omenudataAjudamenu1",text: $trad("u1"), url: "http://www.softwarepublico.gov.br/spb/ver-comunidade?community_id=1444332", target:"_blank" }, @@ -130,19 +130,19 @@ i3GEO.configura = { { id:"omenudataAjudamenu8",text: $trad("u5c"), url: "javascript:i3GEO.ajuda.redesSociais()" } ], "analise": [ - { id:"omenudataAnalise1",text: ''+$trad("u22")+'',url: "#"}, + { id:"omenudataAnalise1",text: ''+$trad("u22")+'',url: "#"}, { id:"omenudataAnalise2",text: $trad("u7"), url: "javascript:i3GEO.analise.dialogo.gradePol()"}, { id:"omenudataAnalise3",text: $trad("u8"), url: "javascript:i3GEO.analise.dialogo.gradePontos()" }, { id:"omenudataAnalise4",text: $trad("u9"), url: "javascript:i3GEO.analise.dialogo.gradeHex()" }, - { id:"omenudataAnalise5",text: ''+$trad("u23")+'',url: "#"}, + { id:"omenudataAnalise5",text: ''+$trad("u23")+'',url: "#"}, { id:"omenudataAnalise6",text: $trad("u11a"), url: "javascript:i3GEO.analise.dialogo.distanciaptpt()" }, { id:"omenudataAnalise7",text: $trad("u12"), url: "javascript:i3GEO.analise.dialogo.nptPol()" }, { id:"omenudataAnalise8",text: $trad("u13"), url: "javascript:i3GEO.analise.dialogo.pontoempoligono()" }, { id:"omenudataAnalise9",text: $trad("u14"), url: "javascript:i3GEO.analise.dialogo.pontosdistri()" }, { id:"omenudataAnalise9a",text: $trad("u28"), url: "javascript:i3GEO.analise.dialogo.centromassa()" }, - { id:"omenudataAnalise10",text: ''+$trad("u24")+'',url: "#"}, + { id:"omenudataAnalise10",text: ''+$trad("u24")+'',url: "#"}, { id:"omenudataAnalise11",text: $trad("u25"), url: "javascript:i3GEO.analise.dialogo.dissolve()" }, - { id:"omenudataAnalise12",text: ''+$trad("u27")+'',url: "#"}, + { id:"omenudataAnalise12",text: ''+$trad("u27")+'',url: "#"}, { id:"omenudataAnalise13",text: $trad("u6"), url: "javascript:i3GEO.analise.dialogo.analisaGeometrias()" }, { id:"omenudataAnalise14",text: $trad("u10"), url: "javascript:i3GEO.analise.dialogo.buffer()" }, { id:"omenudataAnalise15",text: $trad("u26"), url: "javascript:i3GEO.analise.dialogo.agrupaElementos()" }, @@ -152,7 +152,7 @@ i3GEO.configura = { ], "janelas": [ { id:"omenudataJanelas1",text: $trad("u15"), url: "javascript:i3GEO.barraDeBotoes.reativa(0);i3GEO.barraDeBotoes.reativa(1)" }, - { id:"omenudataJanelas2",text: $trad("u16"), url: "javascript:i3GEO.ajuda.abreJanela()" } + { id:"omenudataJanelas2",text: $trad("u16"), url: "javascript:i3GEO.ajuda.abreJanela()" } ], "arquivos": [ { id:"omenudataArquivos1",text: $trad("u17"), url: "javascript:i3GEO.mapa.dialogo.salvaMapa()" }, @@ -638,7 +638,7 @@ i3GEO.configura = { {alert("Pressione a tecla CTRL junto com o botão esquerdo do mouse");return;} var temp; temp = "zoom"; - if(i3GEO.Interface.ATIVAMENUCONTEXTO && i3GEO.Interface.ATUAL == "padrao") + if(i3GEO.Interface.ATIVAMENUCONTEXTO && i3GEO.Interface.ATUAL === "padrao") {temp = "zoom_contexto";} i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); g_operacao='navega'; @@ -831,10 +831,11 @@ i3GEO.configura = { } var temp = function(){ $i("i3GEOmarcaIdentifica").style.display = "none"; - }; + }, + i; i3GEO.util.criaPin("i3GEOmarcaIdentifica",i3GEO.configura.locaplic+"/imagens/marcaidentify.png",48,48,temp); i3GEO.util.posicionaImagemNoMapa("i3GEOmarcaIdentifica"); - var i = $i("i3GEOmarcaIdentifica"); + i = $i("i3GEOmarcaIdentifica"); if(i){ i.style.display = "block"; } @@ -854,7 +855,7 @@ i3GEO.configura = { dica:$trad("d7a"), funcaoonclick:function() { - if(i3GEO.arvoreDeCamadas.filtraCamadas("etiquetas","","diferente",i3GEO.arvoreDeCamadas.CAMADAS) == "") + if(i3GEO.arvoreDeCamadas.filtraCamadas("etiquetas","","diferente",i3GEO.arvoreDeCamadas.CAMADAS) === "") {alert($trad("d31"));return;} var temp; if($i(i3GEO.Interface.IDMAPA)){ @@ -989,8 +990,8 @@ i3GEO.configura = { if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizascielo()") < 0){ i3GEO.eventos.NAVEGAMAPA.push("atualizascielo()"); if(i3GEO.Interface.ATUAL === "googlemaps"){ - scieloDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizascielo();}); - scieloZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizascielo();}); + scieloDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizascielo();}); + scieloZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizascielo();}); } } } @@ -1120,33 +1121,33 @@ i3GEO.configura = { funcaoonclick:function(){ if(i3GEO.Interface.ATUAL !== "googlemaps") {alert("Operacao disponivel apenas na interface Google Maps");return;} - counterClick = 1; - var parametrosRota = function(overlay,latlng){ - var temp,janela; - if(counterClick === 1){ - counterClick++; - alert("Clique o ponto de destino da rota"); - pontoRota1 = latlng; - return; - } - if(counterClick === 2){ - pontoRota2 = latlng; - counterClick = 0; - GEvent.removeListener(rotaEvento); - janela = i3GEO.janela.cria("300px","300px","","center","","Rota"); - janela[2].style.overflow = "auto"; - janela[2].style.height = "300px"; + counterClick = 1; + var parametrosRota = function(overlay,latlng){ + var temp,janela; + if(counterClick === 1){ + counterClick++; + alert("Clique o ponto de destino da rota"); + pontoRota1 = latlng; + return; + } + if(counterClick === 2){ + pontoRota2 = latlng; + counterClick = 0; + GEvent.removeListener(rotaEvento); + janela = i3GEO.janela.cria("300px","300px","","center","","Rota"); + janela[2].style.overflow = "auto"; + janela[2].style.height = "300px"; directions = new GDirections(i3GeoMap,janela[2]); temp = function(){ $i("wdoca_corpo").innerHTML = "Não foi possível criar a rota"; }; GEvent.addListener(directions, "error", temp); directions.load("from: "+pontoRota1.lat()+","+pontoRota1.lng()+" to: "+pontoRota2.lat()+","+pontoRota2.lng()); - //i3GeoMap.removeOverlay(directions) - } - }; - rotaEvento = GEvent.addListener(i3GeoMap, "click", parametrosRota); - alert("Clique o ponto de origem da rota"); + //i3GeoMap.removeOverlay(directions) + } + }; + rotaEvento = GEvent.addListener(i3GeoMap, "click", parametrosRota); + alert("Clique o ponto de origem da rota"); } } ]} diff --git a/classesjs/classe_coordenadas.js b/classesjs/classe_coordenadas.js index 91e2a74..db53278 100644 --- a/classesjs/classe_coordenadas.js +++ b/classesjs/classe_coordenadas.js @@ -225,18 +225,18 @@ i3GEO.coordenadas = { mostraCoordenadasUTM: function(id){ if(typeof(console) !== 'undefined'){console.info("i3GEO.coordenadas.mostraCoordenadasUTM()");} try{ - if(arguments.length === 0 || id === "" || id == undefined) + if(arguments.length === 0 || id === "" || typeof(id) === 'undefined') {id = i3GEO.coordenadas.PARAMETROS.mostraCoordenadasUTM.idhtml;} else {i3GEO.coordenadas.PARAMETROS.mostraCoordenadasUTM.idhtml = id;} - if (!$i(id) || i3GEO.coordenadas.PARAMETROS.mostraCoordenadasUTM.idhtml == ""){ + if (!$i(id) || i3GEO.coordenadas.PARAMETROS.mostraCoordenadasUTM.idhtml === ""){ if(i3GEO.eventos.MOUSEPARADO.toString().search("atualizaCoordenadasUTM()") >= 0) {i3GEO.eventos.MOUSEPARADO.remove("atualizaCoordenadasUTM()");} return; } atualizaCoordenadasUTM = function() { - if(i3GEO.coordenadas.PARAMETROS.mostraCoordenadasUTM.idhtml == ""){ + if(i3GEO.coordenadas.PARAMETROS.mostraCoordenadasUTM.idhtml === ""){ if(i3GEO.eventos.MOUSEPARADO.toString().search("atualizaCoordenadasUTM()") >= 0) {i3GEO.eventos.MOUSEPARADO.remove("atualizaCoordenadasUTM()");} return; @@ -291,7 +291,7 @@ i3GEO.coordenadas = { if(typeof(console) !== 'undefined'){console.info("i3GEO.coordenadas.mostraCoordenadasGEO()");} try{ var ins,temp; - if(arguments.length === 0 || id === "" || id == undefined) + if(arguments.length === 0 || id === "" || typeof(id) === 'undefined') {id = i3GEO.coordenadas.PARAMETROS.mostraCoordenadasGEO.idhtml;} else {i3GEO.coordenadas.PARAMETROS.mostraCoordenadasGEO.idhtml = id;} @@ -354,7 +354,7 @@ i3GEO.coordenadas = { ""+$inputText("","",prefixo+"ys","segundo","5","00.00")+""; temp = 'var '+prefixo+'xxx = i3GEO.calculo.dms2dd($i("'+prefixo+'xg").value,$i("'+prefixo+'xm").value,$i("'+prefixo+'xs").value);' + 'var '+prefixo+'yyy = i3GEO.calculo.dms2dd($i("'+prefixo+'yg").value,$i("'+prefixo+'ym").value,$i("'+prefixo+'ys").value);' + - 'i3GEO.navega.zoomponto(i3GEO.configura.locaplic,i3GEO.configura.sid,'+prefixo+'xxx,'+prefixo+'yyy);'; + 'i3GEO.navega.zoomponto(i3GEO.configura.locaplic,i3GEO.configura.sid,'+prefixo+'xxx,'+prefixo+'yyy);'; ins += '' + ""+caixa+"" + ""; @@ -424,6 +424,7 @@ i3GEO.coordenadas = { */ atualizaProj4: function(onde,configProj,x,y){ + var destino,zona,temp,p; try{ if(!$i(onde+configProj+"ZN")) {return;} @@ -431,31 +432,31 @@ i3GEO.coordenadas = { catch(e){return;} eval("temp = i3GEO.coordenadas.config."+configProj+";"); try{ - if($i(onde+configProj).style.display == "none") + if($i(onde+configProj).style.display === "none") {return;} } - catch(e){} + catch(men){} if(temp.tipo === "metrica"){ - var destino = temp.defepsg; + destino = temp.defepsg; } - if(x == undefined) + if(typeof(x) === 'undefined') {x = objposicaocursor.ddx;} - if(y == undefined) + if(typeof(y) === 'undefined') {y = objposicaocursor.ddy;} if(temp.tipo === "utm"){ - var zona = i3GEO.coordenadas.geo2zonaUtm(x); - $i(onde+configProj+"ZN").value = zona + zona = i3GEO.coordenadas.geo2zonaUtm(x); + $i(onde+configProj+"ZN").value = zona; if(objposicaocursor.ddy*1 > 0) - {var destino = temp.zona[zona+"N"];} + {destino = temp.zona[zona+"N"];} else - {var destino = temp.zona[zona+"S"];} - if(destino == undefined){ + {destino = temp.zona[zona+"S"];} + if(typeof(destino) === 'undefined'){ i3GEO.util.defineValor(onde+configProj+"X","value","?"); i3GEO.util.defineValor(onde+configProj+"Y","value","?"); return; } } - var p = i3GEO.coordenadas.calculaProj4(i3GEO.coordenadas.defOrigem,destino,x,y); + p = i3GEO.coordenadas.calculaProj4(i3GEO.coordenadas.defOrigem,destino,x,y); i3GEO.util.defineValor(onde+configProj+"X","value",p.x); i3GEO.util.defineValor(onde+configProj+"Y","value",p.y); }, @@ -507,7 +508,7 @@ i3GEO.coordenadas = { for(i=0;i"; + caixa = ""+$trad("p13")+"
","listaPropriedades",i3GEO.configura.listaDePropriedadesDoMapa); i3GEO.barraDeBotoes.INCLUIBOTAO.zoomli = false; i3GEO.barraDeBotoes.INCLUIBOTAO.pan = false; - i3GEO.barraDeBotoes.INCLUIBOTAO.zoomtot = false; + i3GEO.barraDeBotoes.INCLUIBOTAO.zoomtot = false; i3GEO.Interface.IDMAPA = "i3GeoMap3d"; i3GEO.arvoreDeCamadas.ATIVATEMA = "i3GEO.Interface.googleearth.ligaDesliga(this)"; i = $i(i3GEO.Interface.IDCORPO); @@ -1829,7 +1826,7 @@ i3GEO.Interface = { google.earth.createInstance("i3GeoMap3d", i3GEO.Interface.googleearth.iniciaGE, i3GEO.Interface.googleearth.falha); }, iniciaGE: function(object){ - function montaMapa(retorno){ + function montaMapa(retorno){ i3GeoMap = object; i3GeoMap.getWindow().setVisibility(true); i3GEO.Interface.googleearth.zoom2extent(i3GEO.parametros.mapexten); @@ -1840,7 +1837,7 @@ i3GEO.Interface = { evento = function(e){ i3GEO.Interface.googleearth.recalcPar(); g_operacao = ""; - g_tipoacao = ""; + g_tipoacao = ""; }; options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled); @@ -1854,7 +1851,7 @@ i3GEO.Interface = { layerRoot.enableLayerById(i3GeoMap.LAYER_BUILDINGS, i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS); layerRoot.enableLayerById(i3GeoMap.LAYER_ROADS, i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS); layerRoot.enableLayerById(i3GeoMap.LAYER_TERRAIN, i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN); - i3GeoMap.getSun().setVisibility(i3GEO.Interface.googleearth.GADGETS.getSun); + i3GeoMap.getSun().setVisibility(i3GEO.Interface.googleearth.GADGETS.getSun); i3GeoMap.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW); i3GEO.Interface.googleearth.POSICAOTELA = YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO)); @@ -1867,7 +1864,7 @@ i3GEO.Interface = { i3GEO.gadgets.mostraInserirKml("inserirKml"); i3GEO.Interface.googleearth.adicionaListaKml(); i3GEO.Interface.googleearth.registraEventos(); - }; + } i3GEO.php.googleearth(montaMapa); }, criaLayers: function(){ @@ -1895,19 +1892,19 @@ i3GEO.Interface = { insereLayer: function(nomeLayer){ var kmlUrl = i3GEO.configura.locaplic+"/classesphp/mapa_googleearth.php?REQUEST=GetKml&map="+i3GEO.parametros.mapfile+"&layer="+nomeLayer+i3GEO.Interface.googleearth.PARAMETROSLAYER, linki3geo = i3GeoMap.createLink(''); - linki3geo.setHref(kmlUrl+i3GEO.Interface.googleearth.posfixo); - nl = i3GeoMap.createNetworkLink(''); - nl.setLink(linki3geo); - nl.setFlyToView(false); + linki3geo.setHref(kmlUrl+i3GEO.Interface.googleearth.posfixo); + nl = i3GeoMap.createNetworkLink(''); + nl.setLink(linki3geo); + nl.setFlyToView(false); nl.setName(nomeLayer); - i3GeoMap.getFeatures().appendChild(nl); + i3GeoMap.getFeatures().appendChild(nl); return nl; }, retornaIndiceLayer: function(nomeLayer){ var n = i3GeoMap.getFeatures().getChildNodes().getLength(), indice = false; for(i=0;i
 '; i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id); i3GEO.barraDeBotoes.ativaBotoes(); @@ -1995,26 +1992,26 @@ i3GEO.Interface = { i3GEO.ajuda.abreJanela(); }, balao: function(texto,ddx,ddy){ - var placemark = i3GeoMap.createPlacemark(''); - var point = i3GeoMap.createPoint(''); + var placemark = i3GeoMap.createPlacemark(''), + point = i3GeoMap.createPoint(''), + b; point.setLatitude(ddy); point.setLongitude(ddx); placemark.setGeometry(point); - var b = i3GeoMap.createHtmlStringBalloon(''); + b = i3GeoMap.createHtmlStringBalloon(''); b.setContentString("
"+texto+"
"); b.setFeature(placemark); i3GeoMap.setBalloon(b); - //i3GEO.Interface.googleearth.aguarde.visibility = "hidden"; }, insereMarca: function(description,ddx,ddy,name,snippet){ if(typeof(console) !== 'undefined'){console.info("i3GEO.Interface.googleearth.insereMarca()");} - var placemark = i3GeoMap.createPlacemark(''); + var placemark = i3GeoMap.createPlacemark(''), + point = i3GeoMap.createPoint(''); placemark.setName(name); - var point = i3GeoMap.createPoint(''); point.setLatitude(ddy); point.setLongitude(ddx); placemark.setGeometry(point); - if(description != "") + if(description !== "") {placemark.setDescription(description);} placemark.setSnippet(snippet); i3GeoMap.getFeatures().appendChild(placemark); @@ -2024,33 +2021,40 @@ i3GEO.Interface = { // insereCirculo: function(centerLng,centerLat,radius,name,snippet){ function makeCircle(centerLat, centerLng, radius) { - var ring = i3GeoMap.createLinearRing(''); - var steps = 25; - var pi2 = Math.PI * 2; - for (var i = 0; i < steps; i++) { - var lat = centerLat + radius * Math.cos(i / steps * pi2); - var lng = centerLng + radius * Math.sin(i / steps * pi2); + var ring = i3GeoMap.createLinearRing(''), + steps = 25, + i, + pi2 = Math.PI * 2, + lat, + lng; + for (i = 0; i < steps; i++) { + lat = centerLat + radius * Math.cos(i / steps * pi2); + lng = centerLng + radius * Math.sin(i / steps * pi2); ring.getCoordinates().pushLatLngAlt(lat, lng, 0); } return ring; } - var polygonPlacemark = i3GeoMap.createPlacemark(''); - var poly = i3GeoMap.createPolygon(''); + var polygonPlacemark = i3GeoMap.createPlacemark(''), + poly = i3GeoMap.createPolygon(''), + outer, + polyStyle; poly.setAltitudeMode(i3GeoMap.ALTITUDE_RELATIVE_TO_GROUND); polygonPlacemark.setGeometry(poly); - var outer = i3GeoMap.createLinearRing(''); + outer = i3GeoMap.createLinearRing(''); polygonPlacemark.getGeometry().setOuterBoundary(makeCircle(centerLat, centerLng, radius)); polygonPlacemark.setName(name); polygonPlacemark.setSnippet(snippet); polygonPlacemark.setStyleSelector(i3GeoMap.createStyle('')); - var polyStyle = polygonPlacemark.getStyleSelector().getPolyStyle(); + polyStyle = polygonPlacemark.getStyleSelector().getPolyStyle(); polyStyle.setFill(0); i3GeoMap.getFeatures().appendChild(polygonPlacemark); }, insereLinha: function(xi,yi,xf,yf,name,snippet){ - var lineStringPlacemark = i3GeoMap.createPlacemark(''); + var lineStringPlacemark = i3GeoMap.createPlacemark(''), + lineString, + lineStyle; lineStringPlacemark.setName(name); - var lineString = i3GeoMap.createLineString(''); + lineString = i3GeoMap.createLineString(''); lineString.setAltitudeMode(i3GeoMap.ALTITUDE_RELATIVE_TO_GROUND); lineStringPlacemark.setGeometry(lineString); lineString.getCoordinates().pushLatLngAlt(yi, xi, 0); @@ -2058,10 +2062,10 @@ i3GEO.Interface = { lineStringPlacemark.setStyleSelector(i3GeoMap.createStyle('')); lineStringPlacemark.setSnippet(snippet); - var lineStyle = lineStringPlacemark.getStyleSelector().getLineStyle(); + lineStyle = lineStringPlacemark.getStyleSelector().getLineStyle(); lineStyle.setWidth(3); - i3GeoMap.getFeatures().appendChild(lineStringPlacemark); + i3GeoMap.getFeatures().appendChild(lineStringPlacemark); }, removePlacemark: function(nome){ var features = i3GeoMap.getFeatures(), @@ -2070,7 +2074,7 @@ i3GEO.Interface = { nfeatures = []; for(i=0;i"; d = {html:html}; nodekml = new YAHOO.widget.HTMLNode(d, node, true,true); - nodekml.enableHighlight = false; + nodekml.enableHighlight = false; nodekml.isleaf = true; i3GEO.Interface.googleearth.ARVORE.draw(); i3GEO.Interface.googleearth.ARVORE.collapseAll(); @@ -2215,7 +2219,7 @@ i3GEO.Interface = { i; for(i=0;i '+contador+'")');} - eval ('YAHOO.aguarde.'+id+'.render(document.body)'); + {eval('YAHOO.aguarde.'+id+'.setHeader(" '+contador+'")');} + eval('YAHOO.aguarde.'+id+'.render(document.body)'); if(i3GEO.parametros.w > 0) - {eval ('YAHOO.aguarde.'+id+'.moveTo('+(pos[0] + (i3GEO.parametros.w / 2) - 120)+','+pos[1]+')');} + {eval('YAHOO.aguarde.'+id+'.moveTo('+(pos[0] + (i3GEO.parametros.w / 2) - 120)+','+pos[1]+')');} else - {eval ('YAHOO.aguarde.'+id+'.moveTo('+pos[0]+','+pos[1]+')');} - eval ('YAHOO.aguarde.'+id+'.show()'); + {eval('YAHOO.aguarde.'+id+'.moveTo('+pos[0]+','+pos[1]+')');} + eval('YAHOO.aguarde.'+id+'.show()'); if($i(id+"_mask")) {$i(id+"_mask").style.zIndex=25000;} if($i(id+"_c")){ @@ -588,42 +588,42 @@ i3GEO.janela = { novoel.tabindex = "-1"; novoel.innerHTML = '
'; janela[2].appendChild(novoel); - Event = YAHOO.util.Event; - Dom = YAHOO.util.Dom; - lang = YAHOO.lang; - bg="slider-bg"; - thumb="slider-thumb"; - valuearea="slider-value"; - textfield="slider-converted-value"; + Event = YAHOO.util.Event; + Dom = YAHOO.util.Dom; + lang = YAHOO.lang; + bg="slider-bg"; + thumb="slider-thumb"; + valuearea="slider-value"; + textfield="slider-converted-value"; novoel.style.position = "relative"; - novoel.style.background= 'url('+i3GEO.configura.locaplic+'/imagens/bg-fader.gif) 5px 0 no-repeat'; - novoel.style.height = "28px"; - novoel.style.width= "228px"; - // The slider can move 0 pixels up - topConstraint = 0; - // The slider can move 200 pixels down - bottomConstraint = 200; - // Custom scale factor for converting the pixel offset into a real value - scaleFactor = 1; - // The amount the slider moves when the value is changed with the arrow - // keys - keyIncrement = 20; - tickSize = 20; - Event.onDOMReady(function() { - slider = YAHOO.widget.Slider.getHorizSlider(bg,thumb, topConstraint, bottomConstraint, 20); - slider.setValue(parseInt(inicial,10)); - slider.getRealValue = function() { - return Math.round(this.getValue() * scaleFactor); - }; - slider.subscribe("slideEnd", function(offsetFromStart) { - var actualValue = slider.getRealValue(); - eval(funcao+"("+actualValue+")"); + novoel.style.background= 'url('+i3GEO.configura.locaplic+'/imagens/bg-fader.gif) 5px 0 no-repeat'; + novoel.style.height = "28px"; + novoel.style.width= "228px"; + // The slider can move 0 pixels up + topConstraint = 0; + // The slider can move 200 pixels down + bottomConstraint = 200; + // Custom scale factor for converting the pixel offset into a real value + scaleFactor = 1; + // The amount the slider moves when the value is changed with the arrow + // keys + keyIncrement = 20; + tickSize = 20; + Event.onDOMReady(function() { + slider = YAHOO.widget.Slider.getHorizSlider(bg,thumb, topConstraint, bottomConstraint, 20); + slider.setValue(parseInt(inicial,10)); + slider.getRealValue = function() { + return Math.round(this.getValue() * scaleFactor); + }; + slider.subscribe("slideEnd", function(offsetFromStart) { + var actualValue = slider.getRealValue(); + eval(funcao+"("+actualValue+")"); }); - }); - // Use setValue to reset the value to white: - Event.on("putval", "click", function(e) { - slider.setValue(100, false); //false here means to animate if possible - }); + }); + // Use setValue to reset the value to white: + Event.on("putval", "click", function(e) { + slider.setValue(100, false); //false here means to animate if possible + }); }, /* Function: fechaAguarde @@ -687,100 +687,100 @@ try{ //controle dos painéis que podem ser redimensionados YAHOO.widget.ResizePanel = function(el, userConfig) { - if (arguments.length > 0) - {YAHOO.widget.ResizePanel.superclass.constructor.call(this, el, userConfig);} + if (arguments.length > 0) + {YAHOO.widget.ResizePanel.superclass.constructor.call(this, el, userConfig);} }; YAHOO.widget.ResizePanel.CSS_PANEL_RESIZE = "yui-resizepanel"; YAHOO.widget.ResizePanel.CSS_RESIZE_HANDLE = "resizehandle"; YAHOO.extend( YAHOO.widget.ResizePanel, YAHOO.widget.Panel,{ - init: function(el, userConfig){ - YAHOO.widget.ResizePanel.superclass.init.call(this, el); - this.beforeInitEvent.fire(YAHOO.widget.ResizePanel); - var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - oInnerElement = this.innerElement, - oResizeHandle = document.createElement("DIV"), - sResizeHandleId = this.id + "_resizehandle"; - oResizeHandle.id = sResizeHandleId; - oResizeHandle.className = YAHOO.widget.ResizePanel.CSS_RESIZE_HANDLE; - Dom.addClass(oInnerElement, YAHOO.widget.ResizePanel.CSS_PANEL_RESIZE); - this.resizeHandle = oResizeHandle; - function initResizeFunctionality(){ - var me = this, - oHeader = this.header, - oBody = this.body, - oFooter = this.footer, - nStartWidth, - nStartHeight, - aStartPos, - nBodyBorderTopWidth, - nBodyBorderBottomWidth, - nBodyTopPadding, - nBodyBottomPadding, - nBodyOffset; - oInnerElement.appendChild(oResizeHandle); - this.ddResize = new YAHOO.util.DragDrop(sResizeHandleId, this.id); - this.ddResize.setHandleElId(sResizeHandleId); - this.ddResize.onMouseDown = function(e){ - nStartWidth = oInnerElement.offsetWidth; - nStartHeight = oInnerElement.offsetHeight; - if (YAHOO.env.ua.ie && document.compatMode === "BackCompat") - {nBodyOffset = 0;} - else{ - nBodyBorderTopWidth = parseInt(Dom.getStyle(oBody, "borderTopWidth"), 10); - nBodyBorderBottomWidth = parseInt(Dom.getStyle(oBody, "borderBottomWidth"), 10); - nBodyTopPadding = parseInt(Dom.getStyle(oBody, "paddingTop"), 10); - nBodyBottomPadding = parseInt(Dom.getStyle(oBody, "paddingBottom"), 10); - nBodyOffset = nBodyBorderTopWidth + nBodyBorderBottomWidth + nBodyTopPadding + nBodyBottomPadding; - } + init: function(el, userConfig){ + YAHOO.widget.ResizePanel.superclass.init.call(this, el); + this.beforeInitEvent.fire(YAHOO.widget.ResizePanel); + var Dom = YAHOO.util.Dom, + Event = YAHOO.util.Event, + oInnerElement = this.innerElement, + oResizeHandle = document.createElement("DIV"), + sResizeHandleId = this.id + "_resizehandle"; + oResizeHandle.id = sResizeHandleId; + oResizeHandle.className = YAHOO.widget.ResizePanel.CSS_RESIZE_HANDLE; + Dom.addClass(oInnerElement, YAHOO.widget.ResizePanel.CSS_PANEL_RESIZE); + this.resizeHandle = oResizeHandle; + function initResizeFunctionality(){ + var me = this, + oHeader = this.header, + oBody = this.body, + oFooter = this.footer, + nStartWidth, + nStartHeight, + aStartPos, + nBodyBorderTopWidth, + nBodyBorderBottomWidth, + nBodyTopPadding, + nBodyBottomPadding, + nBodyOffset; + oInnerElement.appendChild(oResizeHandle); + this.ddResize = new YAHOO.util.DragDrop(sResizeHandleId, this.id); + this.ddResize.setHandleElId(sResizeHandleId); + this.ddResize.onMouseDown = function(e){ + nStartWidth = oInnerElement.offsetWidth; + nStartHeight = oInnerElement.offsetHeight; + if (YAHOO.env.ua.ie && document.compatMode === "BackCompat") + {nBodyOffset = 0;} + else{ + nBodyBorderTopWidth = parseInt(Dom.getStyle(oBody, "borderTopWidth"), 10); + nBodyBorderBottomWidth = parseInt(Dom.getStyle(oBody, "borderBottomWidth"), 10); + nBodyTopPadding = parseInt(Dom.getStyle(oBody, "paddingTop"), 10); + nBodyBottomPadding = parseInt(Dom.getStyle(oBody, "paddingBottom"), 10); + nBodyOffset = nBodyBorderTopWidth + nBodyBorderBottomWidth + nBodyTopPadding + nBodyBottomPadding; + } // //ajusta o tamanho do body no IE qd a janela é redimensionada // me.cfg.setProperty("width", nStartWidth + "px"); - aStartPos = [Event.getPageX(e), Event.getPageY(e)]; - }; - this.ddResize.onDrag = function(e){ - var aNewPos = [Event.getPageX(e), Event.getPageY(e)], - nOffsetX = aNewPos[0] - aStartPos[0], - nOffsetY = aNewPos[1] - aStartPos[1], - nNewWidth = Math.max(nStartWidth + nOffsetX, 10), - nNewHeight = Math.max(nStartHeight + nOffsetY, 10), - nBodyHeight = (nNewHeight - (oFooter.offsetHeight + oHeader.offsetHeight + nBodyOffset)); + aStartPos = [Event.getPageX(e), Event.getPageY(e)]; + }; + this.ddResize.onDrag = function(e){ + var aNewPos = [Event.getPageX(e), Event.getPageY(e)], + nOffsetX = aNewPos[0] - aStartPos[0], + nOffsetY = aNewPos[1] - aStartPos[1], + nNewWidth = Math.max(nStartWidth + nOffsetX, 10), + nNewHeight = Math.max(nStartHeight + nOffsetY, 10), + nBodyHeight = (nNewHeight - (oFooter.offsetHeight + oHeader.offsetHeight + nBodyOffset)); me.cfg.setProperty("width", nNewWidth + "px"); if(navm) {nNewWidth = nNewWidth - 2;} - oBody.style.width = nNewWidth - 2 +"px"; - if (nBodyHeight < 0) - {nBodyHeight = 0;} - oBody.style.height = nBodyHeight + "px"; - if ($i("wdocai")){ + oBody.style.width = nNewWidth - 2 +"px"; + if (nBodyHeight < 0) + {nBodyHeight = 0;} + oBody.style.height = nBodyHeight + "px"; + if ($i("wdocai")){ $i("wdocai").style.height = nBodyHeight; $i("wdocai").style.width = oBody.style.width; } - }; - this.ddResize.onMouseUp = this.ddResize.onDrag.call(); - } - function onBeforeShow(){ - initResizeFunctionality.call(this); - this.unsubscribe("beforeShow", onBeforeShow); - } - function onBeforeRender(){ - if (!this.footer) - {this.setFooter("");} - if (this.cfg.getProperty("visible")) - {initResizeFunctionality.call(this);} - else - {this.subscribe("beforeShow", onBeforeShow);} - this.unsubscribe("beforeRender", onBeforeRender); - } - this.subscribe("beforeRender", onBeforeRender); - if (userConfig) - {this.cfg.applyConfig(userConfig, true);} - this.initEvent.fire(YAHOO.widget.ResizePanel); - }, - toString: function() - {return "ResizePanel " + this.id;} + }; + this.ddResize.onMouseUp = this.ddResize.onDrag.call(); + } + function onBeforeShow(){ + initResizeFunctionality.call(this); + this.unsubscribe("beforeShow", onBeforeShow); + } + function onBeforeRender(){ + if (!this.footer) + {this.setFooter("");} + if (this.cfg.getProperty("visible")) + {initResizeFunctionality.call(this);} + else + {this.subscribe("beforeShow", onBeforeShow);} + this.unsubscribe("beforeRender", onBeforeRender); + } + this.subscribe("beforeRender", onBeforeRender); + if (userConfig) + {this.cfg.applyConfig(userConfig, true);} + this.initEvent.fire(YAHOO.widget.ResizePanel); + }, + toString: function() + {return "ResizePanel " + this.id;} } ); } diff --git a/classesjs/classe_mapa.js b/classesjs/classe_mapa.js index 519af9a..ce6ecfc 100644 --- a/classesjs/classe_mapa.js +++ b/classesjs/classe_mapa.js @@ -240,7 +240,7 @@ i3GEO.mapa = { permitindo que seja criada a janela flutuante apenas, por exemplo: i3GEO.mapa.legendaHTML.cria(""); - i3GEO.mapa.legendaHTML.libera(); + i3GEO.mapa.legendaHTML.libera(); Parametros: @@ -253,7 +253,7 @@ i3GEO.mapa = { i3GEO.mapa.legendaHTML.ID = id; if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()") < 0) {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()");} - i3GEO.mapa.legendaHTML.atualiza(); + i3GEO.mapa.legendaHTML.atualiza(); }, /* Function: atualiza @@ -600,7 +600,7 @@ i3GEO.mapa = { {return;} if(i3GEO.Interface.ATUAL==="padrao") {$i("img").style.cursor = "wait";} - if(i3GEO.Interface.ATUAL == "googleearth") + if(i3GEO.Interface.ATUAL === "googleearth") {i3GEO.Interface.googleearth.aguarde.visibility = "visible";} retorna = function(retorno){ var temp,rfes,n,balloon,i,mostra,res,temas,ntemas,titulo,tips,j,ntips,ins,r,ds,nds,s; @@ -703,7 +703,7 @@ i3GEO.mapa = { {temp = "identifica_contexto";} i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic); } - if(i3GEO.Interface.ATUAL == "googleearth") + if(i3GEO.Interface.ATUAL === "googleearth") {i3GEO.Interface.googleearth.aguarde.visibility = "hidden";} if(typeof(console) !== 'undefined'){console.error(e);} } diff --git a/classesjs/classe_maparef.js b/classesjs/classe_maparef.js index ce81e06..45677a6 100644 --- a/classesjs/classe_maparef.js +++ b/classesjs/classe_maparef.js @@ -159,7 +159,7 @@ i3GEO.maparef = { temp = "javascript:if(i3GEO.maparef.fatorZoomDinamico == -1){i3GEO.maparef.fatorZoomDinamico = 1};i3GEO.maparef.fatorZoomDinamico = i3GEO.maparef.fatorZoomDinamico + 1 ;$i(\"refDinamico\").checked = true;i3GEO.maparef.atualiza();"; ins += ""; temp = "javascript:if(i3GEO.maparef.fatorZoomDinamico == 1){i3GEO.maparef.fatorZoomDinamico = -1};i3GEO.maparef.fatorZoomDinamico = i3GEO.maparef.fatorZoomDinamico - 1 ;$i(\"refDinamico\").checked = true;i3GEO.maparef.atualiza();"; - ins += " "; + ins += " "; if(i3GEO.maparef.SELETORTIPO){ ins += ""; - return(combo); + return(combo); }, /* Function: checkItensEditaveis @@ -1888,7 +1886,7 @@ i3GEO.util = { var ins = [], i, temp, - n; + n; if (retorno.data !== undefined) { ins.push(""); @@ -1928,14 +1926,14 @@ i3GEO.util = { if (arguments.length === 2) {$i(onde).innerHTML="buscando...";} var cp,monta = function(retorno){ - var ins = new Array(), + var ins = [], i,n,temp; if (retorno.data !== undefined){ ins.push("
"); ins.push(""); ins.push(""); ins.push(""); - ins.push(""); + ins.push(""); n = retorno.data.length; for (i=2;i"); @@ -1976,7 +1974,8 @@ i3GEO.util = { ndiv = document.createElement("div"), nids, i, - fundo; + fundo, + b; if(temp){$i(container).removeChild(temp);} if (!document.getElementById(idatual)) @@ -1992,13 +1991,13 @@ i3GEO.util = { $i(container).appendChild(ndiv); - new YAHOO.widget.Button(idatual+"anterior_",{ + b = new YAHOO.widget.Button(idatual+"anterior_",{ onclick:{fn: function(){ eval(anterior+"()"); }, lazyloadmenu:true }}); - new YAHOO.widget.Button(idatual+"proxima_", + b = new YAHOO.widget.Button(idatual+"proxima_", {onclick:{fn: function(){ eval(proxima+"()"); }, @@ -2062,18 +2061,19 @@ i3GEO.util = { boolean */ intersectaBox: function(box1,box2){ - var box1 = box1.split(" "), - box2 = box2.split(" "), - box1i = box2, + box1 = box1.split(" "); + box2 = box2.split(" "); + var box1i = box2, box2i = box1, coordx, coordy, i; coordx = box1[0]*1; coordy = box1[1]*1; - if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) - coordx = box1[0]*1; - coordy = box1[3]*1; + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1){ + coordx = box1[0]*1; + coordy = box1[3]*1; + } if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) {return true;} coordx = box1[2]*1; @@ -2090,9 +2090,10 @@ i3GEO.util = { coordx = box1[0]*1; coordy = box1[1]*1; - if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) - coordx = box1[0]*1; - coordy = box1[3]*1; + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1){ + coordx = box1[0]*1; + coordy = box1[3]*1; + } if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) {return true;} coordx = box1[2]*1; @@ -2180,18 +2181,19 @@ i3GEO.util = { scripts = document.getElementsByTagName('script'), i = 0, index, - ns = scripts.length; + ns = scripts.length, + src; for (i = 0; i < ns; i++) { - var src = scripts[i].getAttribute('src'); + src = scripts[i].getAttribute('src'); if (src) { - var index = src.lastIndexOf("/classesjs/i3geo.js"); + index = src.lastIndexOf("/classesjs/i3geo.js"); // is it found, at the end of the URL? - if ((index > -1) && (index + "/classesjs/i3geo.js".length == src.length)) { + if ((index > -1) && (index + "/classesjs/i3geo.js".length === src.length)) { scriptLocation = src.slice(0, -"/classesjs/i3geo.js".length); break; } - var index = src.lastIndexOf("/classesjs/i3geonaocompacto.js"); - if ((index > -1) && (index + "/classesjs/i3geonaocompacto.js".length == src.length)) { + index = src.lastIndexOf("/classesjs/i3geonaocompacto.js"); + if ((index > -1) && (index + "/classesjs/i3geonaocompacto.js".length === src.length)) { scriptLocation = src.slice(0, -"/classesjs/i3geonaocompacto.js".length); break; } @@ -2284,36 +2286,40 @@ try{ if(ativa) { this.properties.ativa = ativa; } - var accordionObject = document.getElementById(this.properties.Id); + var accordionObject = document.getElementById(this.properties.Id), + headers, + bodies; if(accordionObject) { - if(accordionObject.nodeName == "DL") { - var headers = accordionObject.getElementsByTagName("dt"); - var bodies = headers[0].parentNode.getElementsByTagName("dd"); + if(accordionObject.nodeName === "DL") { + headers = accordionObject.getElementsByTagName("dt"); + bodies = headers[0].parentNode.getElementsByTagName("dd"); } this.attachEvents(headers,0); } }, attachEvents : function(headers,nr) { - for(var i=0; i
"+retorno.data[0].nome+"
"+retorno.data[1].nome+"
"+retorno.data[1].nome+"