Commit b5e5bcfd447569b46b9642ef3d621ccf96053ff5
1 parent
a587dfae
Exists in
master
Atualização do código das ferramentas
Showing
19 changed files
with
96 additions
and
113 deletions
Show diff stats
classesjs/classe_mapa.js
... | ... | @@ -526,6 +526,10 @@ i3GEO.mapa = |
526 | 526 | */ |
527 | 527 | CAMADASSEMLEGENDA : [], |
528 | 528 | /** |
529 | + * posicao apos mover | |
530 | + */ | |
531 | + POSICAO: "", | |
532 | + /** | |
529 | 533 | * Function: cria |
530 | 534 | * |
531 | 535 | * Cria a legenda HTML |
... | ... | @@ -748,6 +752,10 @@ i3GEO.mapa = |
748 | 752 | altura = 300; |
749 | 753 | } |
750 | 754 | var cabecalho, minimiza, janela, titulo; |
755 | + if(i3GEO.mapa.legendaHTML.POSICAO != ""){ | |
756 | + topo = i3GEO.mapa.legendaHTML.POSICAO[1]; | |
757 | + esquerda = i3GEO.mapa.legendaHTML.POSICAO[0]; | |
758 | + } | |
751 | 759 | // |
752 | 760 | // remove se a legenda ja esta aberta em outro lugar |
753 | 761 | // |
... | ... | @@ -783,6 +791,10 @@ i3GEO.mapa = |
783 | 791 | i3GEO.eventos.adicionaEventos("NAVEGAMAPA", [ |
784 | 792 | "i3GEO.mapa.legendaHTML.atualiza()" |
785 | 793 | ]); |
794 | + janela[0].moveEvent.subscribe(function(o,p){ | |
795 | + i3GEO.mapa.legendaHTML.POSICAO = p[0]; | |
796 | + } | |
797 | + ); | |
786 | 798 | i3GEO.mapa.legendaHTML.atualiza(); |
787 | 799 | if (topo && esquerda) { |
788 | 800 | janela = YAHOO.i3GEO.janela.manager.find("wlegenda"); | ... | ... |
classesjs/compactados/classe_mapa_compacto.js
1 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",AUTORESIZE:false,RESOLUCAOTIP:8,GEOXML:[],insereDobraPagina:function(tipo,imagem){if(i3GEO.parametros.w<700){return}var novoel=$i("i3GEOdobraPagina");if(!novoel){novoel=document.createElement("img")}novoel.src=imagem;novoel.id="i3GEOdobraPagina";if(tipo==="googlemaps"){novoel.onclick=function(evt){i3GEO.Interface.atual2gm.inicia()}}if(tipo==="openlayers"){novoel.onclick=function(evt){if(i3GEO.Interface.ATUAL==="googlemaps"&&i3GeoMap.getStreetView().getVisible()===true){i3GeoMap.getStreetView().setVisible(false)}else{i3GEO.Interface.atual2ol.inicia()}}}novoel.style.cursor="pointer";novoel.style.position="absolute";novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.zIndex="5000000";novoel.style.left=i3GEO.parametros.w-35+"px";$i(i3GEO.Interface.IDMAPA).appendChild(novoel);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.stopPropagation);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.preventDefault)},reposicionaDobraPagina:function(){var novoel=$i("i3GEOdobraPagina");if(!novoel){return}novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.left=i3GEO.parametros.w-35+"px"},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=YAHOO.util.Dom.getViewportWidth();Dh=YAHOO.util.Dom.getViewportHeight();i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.barraDeBotoes.recria("i3geo_barra2");if(i3GEO.Interface.TABLET===true){i3GEO.guias.escondeGuias();return}if(i3GEO.guias.TIPO==="movel"){i3GEO.guias.guiaMovel.reposiciona();i3GEO.guias.guiaMovel.abreFecha("fecha")}else{i3GEO.guias.ajustaAltura()}i3GEO.mapa.reposicionaDobraPagina();ativo=true},2000)}ativo=false}},ajustaPosicao:function(elemento){if(arguments.length===0){return}var imagemxi=0,imagemyi=0,dc=$i(elemento),c;if(!dc){return}try{while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi+=dc.offsetLeft;imagemyi+=dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi)}i3GEO.util.$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){if(codigo){if(codigo===""){return}if(i3GEO.temaAtivo!==""){i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","")}i3GEO.temaAtivo=codigo;i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown")}},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert($trad("x21"));return}i3GEO.php.ativalogo(i3GEO.atualiza);var cr=$i("i3GEOcopyright");if(cr){if(cr.style.display==="block"){cr.style.display="none"}else{cr.style.display="block"}}},verifica:function(retorno){try{if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},compactaLayerGrafico:function(){var geos=false,geometrias=[],n=0,i,g;if(i3GEO.editorOL&&i3GEO.desenho.layergrafico&&i3GEO.desenho.layergrafico.features){geos=i3GEO.desenho.layergrafico.features;n=geos.length;for(i=0;i<n;i++){g={"atributos":geos[i].attributes,"geometria":geos[i].geometry.toString()};geometrias.push(g)}}g=YAHOO.lang.JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=YAHOO.lang.JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.barraDeBotoes.editor[i3GEO.Interface.ATUAL].ativaPainel();var n=geometrias.length,i;for(i=0;i<n;i++){i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos)}i3GEO.editorOL.sobeLayersGraficos()};if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/classesjs/compactados/classe_editorol_compacto.js",inicia,"editorol.js",true)}}},restauraGraficos:function(graficos){if(graficos.length>0){var inicia=function(){i3GEOF.graficointerativo1.restauraGraficos(graficos)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",inicia,"graficointerativo1",true)}},restauraTabelas:function(tabelas){if(tabelas.length>0){var inicia=function(){i3GEOF.tabela.restauraTabelas(tabelas)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/tabela/dependencias.php",inicia,"tabela",true)}},aplicaPreferencias:function(cookies){var props,nprops,i,temp=[],pint;if(!cookies){cookies=i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo")}if(cookies){props=cookies.split("::");nprops=props.length;for(i=0;i<nprops;i++){try{temp=props[i].split("|");pint=parseInt(temp[1],10);if(temp[1]==='true'||temp[1]==='false'){if(temp[1]==='true'){temp[1]=true}if(temp[1]==='false'){temp[1]=false}eval(temp[0]+" = "+temp[1]+";")}else if(pint+"px"==temp[1]){eval(temp[0]+" = '"+temp[1]+"';")}else if(YAHOO.lang.isNumber(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}if(temp[0]=="i3GEO.configura.mapaRefDisplay"){i3GEO.util.insereCookie("i3GEO.configura.mapaRefDisplay",temp[1])}}catch(e){}}}},legendaHTML:{incluiBotaoLibera:false,ID:"",CAMADASSEMLEGENDA:[],cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var idleg=$i("wlegenda_corpo"),temp=function(retorno){var legenda="",ins,re,desativar,tema="",classe="",b;re=new RegExp();if(retorno.data!=="erro"&&retorno.data!==undefined){re=new RegExp("legendack_","g");retorno.data.legenda=retorno.data.legenda.replace(re,"liblegendack_");legenda="<div class='botoesLegendaFlutuante'>"+"<input type='button' value='"+$trad("mostraTodosLegenda")+"' id='legendaMostraTodos' />"+"<input type='button' value='"+$trad("mostraSoLegenda")+"' id='legendaMostraSo' />"+"<input type='button' value='PNG' id='legendaExpImagem' />"+"</div>"+"<div id='i3GEOconteudoLegenda' class='i3GEOconteudoLegendaClass' style='width:100%;height:100%;'><div>"+retorno.data.legenda+"</div>"}if(legenda!=""&&idleg){ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+='<div style="cursor: pointer; text-align: left; font-size: 10px; display: block; height: 35px;" onclick="i3GEO.mapa.legendaHTML.libera()"><img id="soltaLeg" src="../imagens/branco.gif" title="clique para liberar" style="margin: 5px; position: relative;"> <p style="position: relative; left: -35px; top: -22px;">'+$trad("x11")+'</p></div>'}re=new RegExp("<img src='' />","g");legenda=legenda.replace(re,"");ins+="<div id='corpoLegi' >"+legenda+"</div>";idleg.innerHTML="<div style='padding:5px;' >"+ins+"</div>";if($i("legendaMostraTodos")){b=new YAHOO.widget.Button("legendaMostraTodos",{onclick:{fn:function(){i3GEO.mapa.legendaHTML.mostraTodosOsTemas()}}});b.addClass("legendaMostraTodosTemas");b=new YAHOO.widget.Button("legendaMostraSo",{onclick:{fn:function(){var n,i,temp,raiz=$i("corpoLegi").parentNode;temp=raiz.getElementsByClassName("i3GEOLegendaExcluiTema");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}temp=raiz.getElementsByTagName("input");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}}}});b.addClass("legendaMostraSoTemas");b=new YAHOO.widget.Button("legendaExpImagem",{onclick:{fn:function(){var obj=$i("i3GEOconteudoLegenda");obj.style.width=$i("wlegenda").style.width;obj.style.height=$i("wlegenda_corpo").style.height;i3GEO.mapa.dialogo.html2canvas(obj)}}});b.addClass("legendaExpImagemPng")}}i3GEO.mapa.legendaHTML.escondeTemasMarcados();desativar=retorno.data.desativar;for(tema in desativar){for(classe in desativar[tema]){ins=$i("liblegendack_"+tema+"_"+desativar[tema][classe]);if(ins){ins.checked=false}}}};if(idleg&&idleg.style.display==="block"){if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg){idleg.innerHTML=""}}i3GEO.mapa.legendaHTML.obtem(temp)}else{if(idleg){idleg.innerHTML=""}if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg&&idleg.style.display==="block"){i3GEO.mapa.legendaHTML.obtem(temp)}}}},obtem:function(funcao){i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda)},ativaDesativaTema:function(inputbox){var temp=function(){i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem);i3GEO.arvoreDeCamadas.atualiza("");i3GEO.janela.fechaAguarde("redesenha")};if(!inputbox.checked){i3GEO.php.ligatemas(temp,inputbox.value,"")}else{i3GEO.php.ligatemas(temp,"",inputbox.value)}},escondeTema:function(tema){var d=$i("legendaLayer_"+tema);if(d){d.style.display="none";i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA.push(tema)}},escondeTemasMarcados:function(){var temas=i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA,n=temas.length,i,temp;for(i=0;i<n;i++){temp=$i(temas[i]);if(temp){temp.style.display="none"}}},mostraTodosOsTemas:function(){i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA=[];i3GEO.mapa.legendaHTML.atualiza()},libera:function(ck,largura,altura,topo,esquerda){if(!ck){ck="nao"}if(!largura){largura=340}if(!altura){altura=300}var cabecalho,minimiza,janela,titulo;i3GEO.util.removeChild("corpoLegi");i3GEO.util.defineValor(i3GEO.mapa.legendaHTML.ID,"innerHTML","");janela=YAHOO.i3GEO.janela.manager.find("wlegenda");if(janela){i3GEO.janela.destroi("wlegenda")}cabecalho=function(){};minimiza=function(){var t=i3GEO.janela.minimiza("wlegenda","100px");if(t==="min"){$i("legendaTituloI").style.display="none"}else{$i("legendaTituloI").style.display="block"}};titulo="<span class='i3GEOiconeFerramenta i3GEOiconeLegenda' title='"+$trad("P3")+"'></span>"+"<div class='i3GeoTituloJanela' id='legendaTituloI'>"+$trad("p3")+"</div>";janela=i3GEO.janela.cria(largura+"px",altura+"px","","","",titulo,"wlegenda",false,"hd",cabecalho,minimiza,"","","","","nao");$i("wlegenda_corpo").style.backgroundColor="white";i3GEO.mapa.legendaHTML.ID="wlegenda_corpo";i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza();if(topo&&esquerda){janela=YAHOO.i3GEO.janela.manager.find("wlegenda");janela.moveTo(esquerda,topo)}}},dialogo:{listaLayersWms:function(servico){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwms/listalayers.php?servico="+servico,"","","<div class='i3GeoTituloJanela'>"+$trad("a4")+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=28' ><b> </b></a></div>","i3GEO.conectarwms",false,"hd","","","",true)},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.iniciaJanelaFlutuante()")},ferramentas:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.ferramentas()","atalhosmapa","atalhosmapa","dependencias.php","i3GEOF.atalhosmapa.iniciaJanelaFlutuante()")},html2canvas:function(obj){var temp=function(){i3GEOF.html2canvas.iniciaJanelaFlutuante(obj)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.html2canvas()","html2canvas","html2canvas","dependencias.php",temp)},wkt2layer:function(wkt,texto){var temp=function(){i3GEOF.wkt2layer.iniciaJanelaFlutuante(wkt,texto)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wkt2layer()","wkt2layer","wkt2layer","dependencias.php",temp)},atalhosedicao:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.atalhosedicao()","atalhosedicao","atalhosedicao","dependencias.php","i3GEOF.atalhosedicao.iniciaJanelaFlutuante()")},geolocal:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal","dependencias.php","i3GEOF.geolocal.iniciaJanelaFlutuante()")},listaDeMapasBanco:function(idonde){if(idonde){i3GEO.guias.CONFIGURA["mapas"].click.call(this,idonde);return}if(i3GEO.guias.CONFIGURA["mapas"]){var janela,divid;if($i("i3GEOFsalvaMapaLista")){return}janela=i3GEO.janela.cria("600px","350px","","","","","i3GEOFsalvaMapaLista",false,"hd");divid=janela[2].id;i3GEO.guias.CONFIGURA["mapas"].click.call(this,divid)}else{window.open(i3GEO.configura.locaplic+"/admin/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=YAHOO.util.Dom.generateId(),cabecalho=function(){},titulo,minimiza=function(){i3GEO.janela.minimiza(idjanela)};if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){url=i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<div class='i3GeoTituloJanela'><span class='i3GEOiconeFerramenta i3GEOiconeCongela'></span>"+"Mapa"+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=123' ><b> </b></a></div>";i3GEO.janela.cria("500px","350px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza)}},metaestat:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;i3GEOF.metaestat.comum.iniciaDicionario(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js",temp)},metaestatListaMapas:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()")},preferencias:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias")},locregiao:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.locregiao.iniciaDicionario(largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js",temp)},filtraregiao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa")},telaRemota:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.telaremota()","telaremota","telaremota")},t3d:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d")},imprimir:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir","dependencias.php","i3GEOF.imprimir.iniciaJanelaFlutuante()")},mostraExten:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten","dependencias.php","i3GEOF.mostraExten.iniciaJanelaFlutuante()")},outputformat:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat","dependencias.php","i3GEOF.outputformat.iniciaJanelaFlutuante()")},autoredesenha:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo","dependencias.php","i3GEOF.opcoesTempo.iniciaJanelaFlutuante()")},salvaMapa:function(){if(i3GEO.parametros===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa","dependencias.php","i3GEOF.salvaMapa.iniciaJanelaFlutuante()")},carregaMapa:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.carregaMapa()","carregamapa","carregaMapa","dependencias.php","i3GEOF.carregaMapa.iniciaJanelaFlutuante()")},convertews:function(){if(i3GEO.parametros.mapfile===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml","dependencias.php","i3GEOF.converteMapaKml.iniciaJanelaFlutuante()")},queryMap:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery","dependencias.php","i3GEOF.opcoesQuery.iniciaJanelaFlutuante()")},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","<div class='i3GeoTituloJanela'>Template<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' ><b> </b></a></div>")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho","dependencias.php","i3GEOF.opcoesTamanho.iniciaJanelaFlutuante()")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem","dependencias.php","i3GEOF.tipoimagem.iniciaJanelaFlutuante()")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo","dependencias.php","i3GEOF.opcoesFundo.iniciaJanelaFlutuante()")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala","dependencias.php","i3GEOF.opcoesEscala.iniciaJanelaFlutuante()")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda","dependencias.php","i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord","dependencias.php","i3GEOF.gradeCoord.iniciaJanelaFlutuante()")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt","dependencias.php","i3GEOF.inseretxt.iniciaJanelaFlutuante()")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy","dependencias.php","i3GEOF.inserexy.iniciaJanelaFlutuante()")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico","dependencias.php","i3GEOF.insereGrafico.iniciaJanelaFlutuante()")},cliqueIdentificaDefault:function(x,y){if(objposicaocursor.imgx<70){return}if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identifica"&&i3GEO.eventos.cliquePerm.ativo===false){return}i3GEO.eventos.removeEventos("MOUSEPARADO",["verificaTip()"]);if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php",temp=function(){if(x){i3GEOF.identifica.criaJanelaFlutuante(x,y)}else{i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy)}};i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{if(x){i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y)}else{i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy)}return}},verificaTipDefault:function(e){if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identificaBalao"&&i3GEO.eventos.cliquePerm.ativo===false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}var ntemas,etiquetas,j,retorna,x=objposicaocursor.ddx,y=objposicaocursor.ddy;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.aguarde.visibility="visible"}retorna=function(retorno){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",classeCor,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,tipotip=configura.tipotip;i3GEO.eventos.cliquePerm.status=true;mostra=false;retorno=retorno.data;if(retorno!==""){res="";temas=retorno;if(!temas){return}ntemas=temas.length;for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;if(tipotip!="simples"){titulo="<span class='toolTipBalaoTitulo'><b>"+titulo+"</b></span><br>"}else{titulo=""}tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempCompleto="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;classeCor="toolTipBalaoTexto";for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='"+classeCor+"'>";textoTempSimples+="<div class='"+classeCor+"'>";for(r=0;r<ntips;r+=1){try{temp="";var alias=ds[s][tips[r]].alias;var valor=ds[s][tips[r]].valor;var link=ds[s][tips[r]].link;var img=ds[s][tips[r]].img;if(valor!==""&&link===""){temp+="<span>"+alias+" :"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span>"+alias+" : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(tipotip!="completo"&&ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}if(classeCor==="toolTipBalaoTexto"){classeCor="toolTipBalaoTexto1"}else{classeCor="toolTipBalaoTexto"}textoTempCompleto+="</div>";textoTempSimples+="</div>"}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(tipotip!="simples"){res=textoSimples}else{res=textoCompleto}if(tipotip==="balao"){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y)}else{n=$i(tipotip);if(!n){n=i3GEO.janela.tip();n=$i(n);n.style.textAlign="left";n.innerHTML+=res}else{n.innerHTML=textoSimples}}}}if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).title="";temp="identifica";i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic)}};i3GEO.php.identifica3(retorna,x,y,i3GEO.mapa.RESOLUCAOTIP,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten)}}}; | |
2 | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",AUTORESIZE:false,RESOLUCAOTIP:8,GEOXML:[],insereDobraPagina:function(tipo,imagem){if(i3GEO.parametros.w<700){return}var novoel=$i("i3GEOdobraPagina");if(!novoel){novoel=document.createElement("img")}novoel.src=imagem;novoel.id="i3GEOdobraPagina";if(tipo==="googlemaps"){novoel.onclick=function(evt){i3GEO.Interface.atual2gm.inicia()}}if(tipo==="openlayers"){novoel.onclick=function(evt){if(i3GEO.Interface.ATUAL==="googlemaps"&&i3GeoMap.getStreetView().getVisible()===true){i3GeoMap.getStreetView().setVisible(false)}else{i3GEO.Interface.atual2ol.inicia()}}}novoel.style.cursor="pointer";novoel.style.position="absolute";novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.zIndex="5000000";novoel.style.left=i3GEO.parametros.w-35+"px";$i(i3GEO.Interface.IDMAPA).appendChild(novoel);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.stopPropagation);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.preventDefault)},reposicionaDobraPagina:function(){var novoel=$i("i3GEOdobraPagina");if(!novoel){return}novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.left=i3GEO.parametros.w-35+"px"},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=YAHOO.util.Dom.getViewportWidth();Dh=YAHOO.util.Dom.getViewportHeight();i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.barraDeBotoes.recria("i3geo_barra2");if(i3GEO.Interface.TABLET===true){i3GEO.guias.escondeGuias();return}if(i3GEO.guias.TIPO==="movel"){i3GEO.guias.guiaMovel.reposiciona();i3GEO.guias.guiaMovel.abreFecha("fecha")}else{i3GEO.guias.ajustaAltura()}i3GEO.mapa.reposicionaDobraPagina();ativo=true},2000)}ativo=false}},ajustaPosicao:function(elemento){if(arguments.length===0){return}var imagemxi=0,imagemyi=0,dc=$i(elemento),c;if(!dc){return}try{while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi+=dc.offsetLeft;imagemyi+=dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi)}i3GEO.util.$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){if(codigo){if(codigo===""){return}if(i3GEO.temaAtivo!==""){i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","")}i3GEO.temaAtivo=codigo;i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown")}},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert($trad("x21"));return}i3GEO.php.ativalogo(i3GEO.atualiza);var cr=$i("i3GEOcopyright");if(cr){if(cr.style.display==="block"){cr.style.display="none"}else{cr.style.display="block"}}},verifica:function(retorno){try{if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},compactaLayerGrafico:function(){var geos=false,geometrias=[],n=0,i,g;if(i3GEO.editorOL&&i3GEO.desenho.layergrafico&&i3GEO.desenho.layergrafico.features){geos=i3GEO.desenho.layergrafico.features;n=geos.length;for(i=0;i<n;i++){g={"atributos":geos[i].attributes,"geometria":geos[i].geometry.toString()};geometrias.push(g)}}g=YAHOO.lang.JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=YAHOO.lang.JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.barraDeBotoes.editor[i3GEO.Interface.ATUAL].ativaPainel();var n=geometrias.length,i;for(i=0;i<n;i++){i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos)}i3GEO.editorOL.sobeLayersGraficos()};if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/classesjs/compactados/classe_editorol_compacto.js",inicia,"editorol.js",true)}}},restauraGraficos:function(graficos){if(graficos.length>0){var inicia=function(){i3GEOF.graficointerativo1.restauraGraficos(graficos)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",inicia,"graficointerativo1",true)}},restauraTabelas:function(tabelas){if(tabelas.length>0){var inicia=function(){i3GEOF.tabela.restauraTabelas(tabelas)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/tabela/dependencias.php",inicia,"tabela",true)}},aplicaPreferencias:function(cookies){var props,nprops,i,temp=[],pint;if(!cookies){cookies=i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo")}if(cookies){props=cookies.split("::");nprops=props.length;for(i=0;i<nprops;i++){try{temp=props[i].split("|");pint=parseInt(temp[1],10);if(temp[1]==='true'||temp[1]==='false'){if(temp[1]==='true'){temp[1]=true}if(temp[1]==='false'){temp[1]=false}eval(temp[0]+" = "+temp[1]+";")}else if(pint+"px"==temp[1]){eval(temp[0]+" = '"+temp[1]+"';")}else if(YAHOO.lang.isNumber(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}if(temp[0]=="i3GEO.configura.mapaRefDisplay"){i3GEO.util.insereCookie("i3GEO.configura.mapaRefDisplay",temp[1])}}catch(e){}}}},legendaHTML:{incluiBotaoLibera:false,ID:"",CAMADASSEMLEGENDA:[],POSICAO:"",cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var idleg=$i("wlegenda_corpo"),temp=function(retorno){var legenda="",ins,re,desativar,tema="",classe="",b;re=new RegExp();if(retorno.data!=="erro"&&retorno.data!==undefined){re=new RegExp("legendack_","g");retorno.data.legenda=retorno.data.legenda.replace(re,"liblegendack_");legenda="<div class='botoesLegendaFlutuante'>"+"<input type='button' value='"+$trad("mostraTodosLegenda")+"' id='legendaMostraTodos' />"+"<input type='button' value='"+$trad("mostraSoLegenda")+"' id='legendaMostraSo' />"+"<input type='button' value='PNG' id='legendaExpImagem' />"+"</div>"+"<div id='i3GEOconteudoLegenda' class='i3GEOconteudoLegendaClass' style='width:100%;height:100%;'><div>"+retorno.data.legenda+"</div>"}if(legenda!=""&&idleg){ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+='<div style="cursor: pointer; text-align: left; font-size: 10px; display: block; height: 35px;" onclick="i3GEO.mapa.legendaHTML.libera()"><img id="soltaLeg" src="../imagens/branco.gif" title="clique para liberar" style="margin: 5px; position: relative;"> <p style="position: relative; left: -35px; top: -22px;">'+$trad("x11")+'</p></div>'}re=new RegExp("<img src='' />","g");legenda=legenda.replace(re,"");ins+="<div id='corpoLegi' >"+legenda+"</div>";idleg.innerHTML="<div style='padding:5px;' >"+ins+"</div>";if($i("legendaMostraTodos")){b=new YAHOO.widget.Button("legendaMostraTodos",{onclick:{fn:function(){i3GEO.mapa.legendaHTML.mostraTodosOsTemas()}}});b.addClass("legendaMostraTodosTemas");b=new YAHOO.widget.Button("legendaMostraSo",{onclick:{fn:function(){var n,i,temp,raiz=$i("corpoLegi").parentNode;temp=raiz.getElementsByClassName("i3GEOLegendaExcluiTema");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}temp=raiz.getElementsByTagName("input");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}}}});b.addClass("legendaMostraSoTemas");b=new YAHOO.widget.Button("legendaExpImagem",{onclick:{fn:function(){var obj=$i("i3GEOconteudoLegenda");obj.style.width=$i("wlegenda").style.width;obj.style.height=$i("wlegenda_corpo").style.height;i3GEO.mapa.dialogo.html2canvas(obj)}}});b.addClass("legendaExpImagemPng")}}i3GEO.mapa.legendaHTML.escondeTemasMarcados();desativar=retorno.data.desativar;for(tema in desativar){for(classe in desativar[tema]){ins=$i("liblegendack_"+tema+"_"+desativar[tema][classe]);if(ins){ins.checked=false}}}};if(idleg&&idleg.style.display==="block"){if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg){idleg.innerHTML=""}}i3GEO.mapa.legendaHTML.obtem(temp)}else{if(idleg){idleg.innerHTML=""}if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg&&idleg.style.display==="block"){i3GEO.mapa.legendaHTML.obtem(temp)}}}},obtem:function(funcao){i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda)},ativaDesativaTema:function(inputbox){var temp=function(){i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem);i3GEO.arvoreDeCamadas.atualiza("");i3GEO.janela.fechaAguarde("redesenha")};if(!inputbox.checked){i3GEO.php.ligatemas(temp,inputbox.value,"")}else{i3GEO.php.ligatemas(temp,"",inputbox.value)}},escondeTema:function(tema){var d=$i("legendaLayer_"+tema);if(d){d.style.display="none";i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA.push(tema)}},escondeTemasMarcados:function(){var temas=i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA,n=temas.length,i,temp;for(i=0;i<n;i++){temp=$i(temas[i]);if(temp){temp.style.display="none"}}},mostraTodosOsTemas:function(){i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA=[];i3GEO.mapa.legendaHTML.atualiza()},libera:function(ck,largura,altura,topo,esquerda){if(!ck){ck="nao"}if(!largura){largura=340}if(!altura){altura=300}var cabecalho,minimiza,janela,titulo;if(i3GEO.mapa.legendaHTML.POSICAO!=""){topo=i3GEO.mapa.legendaHTML.POSICAO[1];esquerda=i3GEO.mapa.legendaHTML.POSICAO[0]}i3GEO.util.removeChild("corpoLegi");i3GEO.util.defineValor(i3GEO.mapa.legendaHTML.ID,"innerHTML","");janela=YAHOO.i3GEO.janela.manager.find("wlegenda");if(janela){i3GEO.janela.destroi("wlegenda")}cabecalho=function(){};minimiza=function(){var t=i3GEO.janela.minimiza("wlegenda","100px");if(t==="min"){$i("legendaTituloI").style.display="none"}else{$i("legendaTituloI").style.display="block"}};titulo="<span class='i3GEOiconeFerramenta i3GEOiconeLegenda' title='"+$trad("P3")+"'></span>"+"<div class='i3GeoTituloJanela' id='legendaTituloI'>"+$trad("p3")+"</div>";janela=i3GEO.janela.cria(largura+"px",altura+"px","","","",titulo,"wlegenda",false,"hd",cabecalho,minimiza,"","","","","nao");$i("wlegenda_corpo").style.backgroundColor="white";i3GEO.mapa.legendaHTML.ID="wlegenda_corpo";i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);janela[0].moveEvent.subscribe(function(o,p){i3GEO.mapa.legendaHTML.POSICAO=p[0]});i3GEO.mapa.legendaHTML.atualiza();if(topo&&esquerda){janela=YAHOO.i3GEO.janela.manager.find("wlegenda");janela.moveTo(esquerda,topo)}}},dialogo:{listaLayersWms:function(servico){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwms/listalayers.php?servico="+servico,"","","<div class='i3GeoTituloJanela'>"+$trad("a4")+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=28' ><b> </b></a></div>","i3GEO.conectarwms",false,"hd","","","",true)},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.iniciaJanelaFlutuante()")},ferramentas:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.ferramentas()","atalhosmapa","atalhosmapa","dependencias.php","i3GEOF.atalhosmapa.iniciaJanelaFlutuante()")},html2canvas:function(obj){var temp=function(){i3GEOF.html2canvas.iniciaJanelaFlutuante(obj)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.html2canvas()","html2canvas","html2canvas","dependencias.php",temp)},wkt2layer:function(wkt,texto){var temp=function(){i3GEOF.wkt2layer.iniciaJanelaFlutuante(wkt,texto)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wkt2layer()","wkt2layer","wkt2layer","dependencias.php",temp)},atalhosedicao:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.atalhosedicao()","atalhosedicao","atalhosedicao","dependencias.php","i3GEOF.atalhosedicao.iniciaJanelaFlutuante()")},geolocal:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal","dependencias.php","i3GEOF.geolocal.iniciaJanelaFlutuante()")},listaDeMapasBanco:function(idonde){if(idonde){i3GEO.guias.CONFIGURA["mapas"].click.call(this,idonde);return}if(i3GEO.guias.CONFIGURA["mapas"]){var janela,divid;if($i("i3GEOFsalvaMapaLista")){return}janela=i3GEO.janela.cria("600px","350px","","","","","i3GEOFsalvaMapaLista",false,"hd");divid=janela[2].id;i3GEO.guias.CONFIGURA["mapas"].click.call(this,divid)}else{window.open(i3GEO.configura.locaplic+"/admin/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=YAHOO.util.Dom.generateId(),cabecalho=function(){},titulo,minimiza=function(){i3GEO.janela.minimiza(idjanela)};if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){url=i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<div class='i3GeoTituloJanela'><span class='i3GEOiconeFerramenta i3GEOiconeCongela'></span>"+"Mapa"+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=123' ><b> </b></a></div>";i3GEO.janela.cria("500px","350px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza)}},metaestat:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;i3GEOF.metaestat.comum.iniciaDicionario(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js",temp)},metaestatListaMapas:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()")},preferencias:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias")},locregiao:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.locregiao.iniciaDicionario(largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js",temp)},filtraregiao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa")},telaRemota:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.telaremota()","telaremota","telaremota")},t3d:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d")},imprimir:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir","dependencias.php","i3GEOF.imprimir.iniciaJanelaFlutuante()")},mostraExten:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten","dependencias.php","i3GEOF.mostraExten.iniciaJanelaFlutuante()")},outputformat:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat","dependencias.php","i3GEOF.outputformat.iniciaJanelaFlutuante()")},autoredesenha:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo","dependencias.php","i3GEOF.opcoesTempo.iniciaJanelaFlutuante()")},salvaMapa:function(){if(i3GEO.parametros===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa","dependencias.php","i3GEOF.salvaMapa.iniciaJanelaFlutuante()")},carregaMapa:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.carregaMapa()","carregamapa","carregaMapa","dependencias.php","i3GEOF.carregaMapa.iniciaJanelaFlutuante()")},convertews:function(){if(i3GEO.parametros.mapfile===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml","dependencias.php","i3GEOF.converteMapaKml.iniciaJanelaFlutuante()")},queryMap:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery","dependencias.php","i3GEOF.opcoesQuery.iniciaJanelaFlutuante()")},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","<div class='i3GeoTituloJanela'>Template<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' ><b> </b></a></div>")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho","dependencias.php","i3GEOF.opcoesTamanho.iniciaJanelaFlutuante()")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem","dependencias.php","i3GEOF.tipoimagem.iniciaJanelaFlutuante()")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo","dependencias.php","i3GEOF.opcoesFundo.iniciaJanelaFlutuante()")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala","dependencias.php","i3GEOF.opcoesEscala.iniciaJanelaFlutuante()")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda","dependencias.php","i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord","dependencias.php","i3GEOF.gradeCoord.iniciaJanelaFlutuante()")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt","dependencias.php","i3GEOF.inseretxt.iniciaJanelaFlutuante()")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy","dependencias.php","i3GEOF.inserexy.iniciaJanelaFlutuante()")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico","dependencias.php","i3GEOF.insereGrafico.iniciaJanelaFlutuante()")},cliqueIdentificaDefault:function(x,y){if(objposicaocursor.imgx<70){return}if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identifica"&&i3GEO.eventos.cliquePerm.ativo===false){return}i3GEO.eventos.removeEventos("MOUSEPARADO",["verificaTip()"]);if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php",temp=function(){if(x){i3GEOF.identifica.criaJanelaFlutuante(x,y)}else{i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy)}};i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{if(x){i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y)}else{i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy)}return}},verificaTipDefault:function(e){if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identificaBalao"&&i3GEO.eventos.cliquePerm.ativo===false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}var ntemas,etiquetas,j,retorna,x=objposicaocursor.ddx,y=objposicaocursor.ddy;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.aguarde.visibility="visible"}retorna=function(retorno){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",classeCor,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,tipotip=configura.tipotip;i3GEO.eventos.cliquePerm.status=true;mostra=false;retorno=retorno.data;if(retorno!==""){res="";temas=retorno;if(!temas){return}ntemas=temas.length;for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;if(tipotip!="simples"){titulo="<span class='toolTipBalaoTitulo'><b>"+titulo+"</b></span><br>"}else{titulo=""}tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempCompleto="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;classeCor="toolTipBalaoTexto";for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='"+classeCor+"'>";textoTempSimples+="<div class='"+classeCor+"'>";for(r=0;r<ntips;r+=1){try{temp="";var alias=ds[s][tips[r]].alias;var valor=ds[s][tips[r]].valor;var link=ds[s][tips[r]].link;var img=ds[s][tips[r]].img;if(valor!==""&&link===""){temp+="<span>"+alias+" :"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span>"+alias+" : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(tipotip!="completo"&&ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}if(classeCor==="toolTipBalaoTexto"){classeCor="toolTipBalaoTexto1"}else{classeCor="toolTipBalaoTexto"}textoTempCompleto+="</div>";textoTempSimples+="</div>"}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(tipotip!="simples"){res=textoSimples}else{res=textoCompleto}if(tipotip==="balao"){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y)}else{n=$i(tipotip);if(!n){n=i3GEO.janela.tip();n=$i(n);n.style.textAlign="left";n.innerHTML+=res}else{n.innerHTML=textoSimples}}}}if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).title="";temp="identifica";i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic)}};i3GEO.php.identifica3(retorna,x,y,i3GEO.mapa.RESOLUCAOTIP,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten)}}}; | |
3 | 3 | \ No newline at end of file | ... | ... |
classesjs/compactajs.php
... | ... | @@ -365,7 +365,7 @@ function packer($src,$out,$tipo="None") |
365 | 365 | $time = sprintf('%.4f', ($t2 - $t1) ); |
366 | 366 | echo 'script ', $src, ' packed in ' , $out, ', in ', $time, ' s.', "\n"; |
367 | 367 | file_put_contents($out, $packed); |
368 | - chmod($out,0744); | |
368 | + chmod($out,0777); | |
369 | 369 | } |
370 | 370 | function salvatudojs($jsfiles,$buffer,$final,$tipo) |
371 | 371 | { |
... | ... | @@ -409,7 +409,7 @@ function salvatudojs($jsfiles,$buffer,$final,$tipo) |
409 | 409 | $fecha = fclose ($abre); |
410 | 410 | |
411 | 411 | |
412 | - chmod($final,0744); | |
412 | + chmod($final,0777); | |
413 | 413 | //gzip |
414 | 414 | $abre = fopen($final, "r"); |
415 | 415 | if ($tipo == "js") |
... | ... | @@ -424,7 +424,7 @@ function salvatudojs($jsfiles,$buffer,$final,$tipo) |
424 | 424 | $abre = fopen($final.".php", "wt"); |
425 | 425 | $escreve = fwrite ($abre,$buffer); |
426 | 426 | $fecha = fclose ($abre); |
427 | - chmod($final.".php",0744); | |
427 | + chmod($final.".php",0777); | |
428 | 428 | } |
429 | 429 | ?> |
430 | 430 | <p>Notas importantes:</p> | ... | ... |
classesjs/compactajs_closurecompiler.php
... | ... | @@ -106,7 +106,7 @@ foreach($lista as $l){ |
106 | 106 | $saida = shell_exec("java -jar {$java} --warning_level DEFAULT --js {$input} --js_output_file {$output}"); |
107 | 107 | echo "<pre>".$saida."</pre>"; |
108 | 108 | unlink($input); |
109 | - chmod($output,0744); | |
109 | + chmod($output,0777); | |
110 | 110 | } |
111 | 111 | |
112 | 112 | |
... | ... | @@ -235,7 +235,7 @@ foreach ($cssfiles as $f) |
235 | 235 | $abre = fopen("../css/i3geo_ferramentas6.css", "wt"); |
236 | 236 | $escreve = fwrite ($abre,$buffer); |
237 | 237 | $fecha = fclose ($abre); |
238 | -chmod("../css/i3geo_ferramentas6.css",0744); | |
238 | +chmod("../css/i3geo_ferramentas6.css",0777); | |
239 | 239 | // |
240 | 240 | //compacta os codigos para o Mashup do OpenLayers |
241 | 241 | // |
... | ... | @@ -322,7 +322,7 @@ function packer($src,$out,$tipo="None") |
322 | 322 | $time = sprintf('%.4f', ($t2 - $t1) ); |
323 | 323 | echo 'script ', $src, ' packed in ' , $out, ', in ', $time, ' s.', "\n"; |
324 | 324 | file_put_contents($out, $packed); |
325 | - chmod($out,0744); | |
325 | + chmod($out,0777); | |
326 | 326 | } |
327 | 327 | function removeconsole($src,$out,$tipo="None") |
328 | 328 | { |
... | ... | @@ -372,7 +372,7 @@ function salvatudojs($jsfiles,$buffer,$final,$tipo) |
372 | 372 | $fecha = fclose ($abre); |
373 | 373 | |
374 | 374 | |
375 | - chmod($final,0744); | |
375 | + chmod($final,0777); | |
376 | 376 | //gzip |
377 | 377 | $abre = fopen($final, "r"); |
378 | 378 | if ($tipo == "js") |
... | ... | @@ -387,6 +387,6 @@ function salvatudojs($jsfiles,$buffer,$final,$tipo) |
387 | 387 | $abre = fopen($final.".php", "wt"); |
388 | 388 | $escreve = fwrite ($abre,$buffer); |
389 | 389 | $fecha = fclose ($abre); |
390 | - chmod($final.".php",0744); | |
390 | + chmod($final.".php",0777); | |
391 | 391 | } |
392 | 392 | ?> | ... | ... |
classesjs/i3geo_tudo_compacto6.js
... | ... | @@ -234,7 +234,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.desenho={layergrafico:null,es |
234 | 234 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.Interface={TABLET:false,ALTTABLET:"",OUTPUTFORMAT:"AGG_Q",BARRABOTOESTOP:12,BARRABOTOESLEFT:3,BARRADEZOOMRIGHT:0,BARRADEZOOMTOP:20,BARRADEZOOMLEFT:10,ATUAL:"openlayers",IDCORPO:"corpoMapa",ATIVAMENUCONTEXTO:false,IDMAPA:"",STATUS:{atualizando:[],trocando:false,pan:false},atual2gm:{insereIcone:true,inicia:function(){i3GEO.Interface.STATUS.trocando=true;i3GEO.janela.ESTILOAGUARDE="normal";try{if(google){i3GEO.Interface.atual2gm.initemp()}}catch(e){i3GEO.util.scriptTag("http://www.google.com/jsapi?callback=i3GEO.Interface.atual2gm.loadMaps","","",false)}},loadMaps:function(){google.load("maps","3",{callback:"i3GEO.Interface.atual2gm.initemp",other_params:"sensor=false"})},initemp:function(){var temp=function(){$i(i3GEO.Interface.IDCORPO).innerHTML="";i3GEO.Interface.ATUAL="googlemaps";i3GEO.Interface.cria(i3GEO.parametros.w,i3GEO.parametros.h);i3GEO.Interface.googlemaps.inicia();i3GEO.janela.fechaAguarde("googleMapsAguarde");i3GEO.arvoreDeCamadas.CAMADAS=[];i3GEO.atualiza();if(i3GEO.Interface.atual2gm.insereIcone===true){i3GEO.mapa.insereDobraPagina("openlayers",i3GEO.configura.locaplic+"/imagens/dobraopenlayers.png")}};i3GEO.php.converte2googlemaps(temp)}},atual2ol:{insereIcone:true,inicia:function(){i3GEO.Interface.STATUS.trocando=true;i3GEO.janela.ESTILOAGUARDE="normal";try{if(OpenLayers){i3GEO.Interface.atual2ol.initemp()}}catch(e){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/openlayers/OpenLayers2131.js.php","i3GEO.Interface.atual2ol.initemp()","",false)}},initemp:function(){i3GEO.Interface.openlayers.fundoDefault();var temp=function(){OpenLayers.ImgPath="../pacotes/openlayers/img/";$i(i3GEO.Interface.IDCORPO).innerHTML="";i3GEO.Interface.ATUAL="openlayers";i3GEO.Interface.cria(i3GEO.parametros.w,i3GEO.parametros.h);i3GEO.Interface.openlayers.inicia();i3GEO.janela.fechaAguarde("OpenLayersAguarde");i3GEO.arvoreDeCamadas.CAMADAS=[];i3GEO.atualiza();if(i3GEO.Interface.atual2ol.insereIcone===true){i3GEO.mapa.insereDobraPagina("googlemaps",i3GEO.configura.locaplic+"/imagens/dobragooglemaps.png")}i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten)};i3GEO.php.converte2openlayers(temp)}},aposAdicNovaCamada:function(camada){i3GEO.tema.ativaFerramentas(camada)},redesenha:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].redesenha()},aplicaOpacidade:function(opacidade,layer){i3GEO.Interface[i3GEO.Interface.ATUAL].aplicaOpacidade(opacidade,layer)},atualizaMapa:function(){switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;default:i3GEO.Interface[i3GEO.Interface.ATUAL].redesenha()}},atualizaTema:function(retorno,tema){i3GEO.Interface[i3GEO.Interface.ATUAL].atualizaTema(retorno,tema)},ligaDesliga:function(obj){i3GEO.Interface[i3GEO.Interface.ATUAL].ligaDesliga(obj);if(obj.value&&obj.value!=""){var ck=i3GEO.arvoreDeTemas.buscaCheckbox(obj.value);if(ck){ck.checked=obj.checked}}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.adicionaKml("foo")}},cria:function(w,h){i3GEO.Interface[i3GEO.Interface.ATUAL].cria(w,h)},inicia:function(w,h){var temp=window.location.href.split("?")[0],gadgets=i3GEO.gadgets;if($i("i3GEOcompartilhar")){i3GEO.social.compartilhar("i3GEOcompartilhar",temp,temp,"semtotal")}gadgets.mostraBuscaRapida();gadgets.mostraVersao();gadgets.mostraEmail();i3GEO.guias.cria();if($i("mst")){$i("mst").style.display="block"}i3GEO.navega.autoRedesenho.ativa();i3GEO.util.defineValor("i3geo_escalanum","value",i3GEO.parametros.mapscale);if((i3GEO.parametros.geoip==="nao")&&($i("ondeestou"))){$i("ondeestou").style.display="none"}i3GEO.Interface[i3GEO.Interface.ATUAL].inicia();if($i(i3GEO.login.divnomelogin)&&i3GEO.util.pegaCookie("i3geousuarionome")){$i(i3GEO.login.divnomelogin).innerHTML=i3GEO.util.pegaCookie("i3geousuarionome")}},alteraParametroLayers:function(parametro,valor){i3GEO.Interface[i3GEO.Interface.ATUAL].alteraParametroLayers(parametro,valor)},ativaBotoes:function(){if(i3GEO.Interface.STATUS.trocando===false){if(i3GEO.barraDeBotoes.TIPO==="olhodepeixe"||i3GEO.barraDeBotoes.TIPO==="olhodepeixe1"){i3GEO.barraDeBotoes.inicializaBarra()}else if(i3GEO.barraDeBotoes.TIPO==="yui"){i3GEO.Interface[i3GEO.Interface.ATUAL].ativaBotoes()}}},openlayers:{parametrosMap:{controls:[],resolutions:[0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.000021457672119140625,0.000010728836059570312,0.000005364418029785156,0.000002682209014892578]},FUNDOTEMA:"yellow",TILES:true,BUFFER:0,GADGETS:{PanZoomBar:true,PanZoom:false,LayerSwitcher:true,ScaleLine:true,OverviewMap:false},MINEXTENT:[-0.0003,-0.0003,0.0003,0.0003],MAXEXTENT:[-180,-90,180,90],LAYERSADICIONAIS:[],LAYERFUNDO:"",googleLike:false,BALAOPROP:{removeAoAdicionar:true,classeCadeado:"i3GEOiconeAberto"},balao:function(texto,completo,x,y){var e,b,c,temp,p=i3GEO.Interface.openlayers.BALAOPROP;c="<div class='i3GEOCabecalhoInfoWindow' ></div>";texto=c+texto;b=new OpenLayers.Popup.FramedCloud(null,i3GEO.util.projGeo2OSM(new OpenLayers.LonLat(x,y)),null,texto,null,true);b.maxsize=new OpenLayers.Size(parseInt(i3GEO.parametros.w/2,10),parseInt(i3GEO.parametros.h/2,10));i3geoOL.addPopup(b,p.removeAoAdicionar);e=document.createElement("div");e.className=p.classeCadeado;e.onclick=function(){if(p.classeCadeado==="i3GEOiconeAberto"){p.classeCadeado="i3GEOiconeFechado"}else{p.classeCadeado="i3GEOiconeAberto"}this.className=p.classeCadeado;p.removeAoAdicionar=!p.removeAoAdicionar};temp=$i(b.id).getElementsByClassName("i3GEOCabecalhoInfoWindow")[0];temp.appendChild(e);e=document.createElement("div");e.className="i3GEOiconeFerramentas";e.style.left="3px";e.onclick=function(){i3GEO.janela.prompt($trad("tolerancia"),function(){i3GEO.mapa.RESOLUCAOTIP=$i("i3GEOjanelaprompt").value},i3GEO.mapa.RESOLUCAOTIP)};temp.appendChild(e);e=document.createElement("div");e.className="i3GEOiconeMais";e.style.left="9px";e.onclick=function(){i3GEO.janela.mensagemSimples("<div style='overflow:auto;height:100%'>"+completo+"</div>","")};temp.appendChild(e)},redesenha:function(){var openlayers=i3GEO.Interface.openlayers;openlayers.criaLayers();openlayers.ordenaLayers();openlayers.recalcPar();i3GEO.janela.fechaAguarde();openlayers.sobeLayersGraficos()},fundoDefault:function(){var eng,oce,ims,wsm,bra,tms;eng=new OpenLayers.Layer.ArcGIS93Rest("ESRI National Geographic","http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:true,attribution:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer">ArcGIS</a>'});oce=new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer">ArcGIS</a>'});ims=new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer">ArcGIS</a>'});wsm=new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer">ArcGIS</a>'});bra=new OpenLayers.Layer.WMS("Base carto MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map",{layers:"baseraster",srs:"EPSG:4618",format:"image/png",isBaseLayer:false},{isBaseLayer:true,visibility:false});tms=new OpenLayers.Layer.TMS("OSGEO","http://tilecache.osgeo.org/wms-c/Basic.py/",{layername:"basic",type:"png",tileOrigin:new OpenLayers.LonLat(-180,-90),isBaseLayer:true,visibility:false,attribution:'© <a href="http://www.tilecache.org/">2006-2010, TileCache Contributors</a>'});i3GEO.Interface.openlayers.LAYERSADICIONAIS=[eng,oce,ims,wsm,tms,bra]},cria:function(w,h){var f,ins,temp,j,r,mi=i3GEO.Interface.openlayers.MINEXTENT,ma=i3GEO.Interface.openlayers.MAXEXTENT,i=$i(i3GEO.Interface.IDCORPO),bb=i3GEO.barraDeBotoes;if(typeof(OpenLayers)=='undefined'){return}OpenLayers.DOTS_PER_INCH=i3GEO.util.calculaDPI();OpenLayers._getScriptLocation=function(){return i3GEO.configura.locaplic+"/pacotes/openlayers/"};if(i){f=$i("openlayers");if(!f){ins='<div id=openlayers style="width:0px;height:0px;text-align:left;"></div>';i.innerHTML=ins}f=$i("openlayers");f.style.width=w+"px";f.style.height=h+"px"}i3GEO.Interface.IDMAPA="openlayers";i3GEO.Interface.openlayers.parametrosMap.fractionalZoom=false;if(!i3GEO.Interface.openlayers.parametrosMap.minResolution){i3GEO.Interface.openlayers.parametrosMap.minResolution="auto"}if(!i3GEO.Interface.openlayers.parametrosMap.minExtent){i3GEO.Interface.openlayers.parametrosMap.minExtent=new OpenLayers.Bounds(mi[0],mi[1],mi[2],mi[3])}if(!i3GEO.Interface.openlayers.parametrosMap.maxResolution){i3GEO.Interface.openlayers.parametrosMap.maxResolution="auto"}if(i3GEO.Interface.openlayers.parametrosMap.numZoomLevels){if(i3GEO.Interface.openlayers.parametrosMap.minResolution=="auto"){temp=0.703125}else{temp=i3GEO.Interface.openlayers.parametrosMap.minResolution}r=[temp];for(j=0;j<(i3GEO.Interface.openlayers.parametrosMap.numZoomLevels-1);j++){temp=temp/2;r.push(temp)}i3GEO.Interface.openlayers.parametrosMap.resolutions=r}if(!i3GEO.Interface.openlayers.parametrosMap.maxExtent){i3GEO.Interface.openlayers.parametrosMap.maxExtent=new OpenLayers.Bounds(ma[0],ma[1],ma[2],ma[3])}if(!i3GEO.Interface.openlayers.parametrosMap.allOverlays){i3GEO.Interface.openlayers.parametrosMap.allOverlays=false}if(i3GEO.Interface.TABLET===true){i3GEO.Interface.openlayers.parametrosMap.theme=null;i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.TouchNavigation({dragPanOptions:{interval:100,enableKinetic:true}}));i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.ZoomPanel())}else if(i3GEO.parametros.w>700){bb.INCLUIBOTAO.zoomli=true;bb.INCLUIBOTAO.pan=true;bb.INCLUIBOTAO.zoomtot=true}if(i3GEO.Interface.openlayers.googleLike===true){i3GEO.Interface.openlayers.parametrosMap={numZoomLevels:18,maxResolution:156543.0339,units:'m',projection:new OpenLayers.Projection("EPSG:3857"),displayProjection:new OpenLayers.Projection("EPSG:4326"),fractionalZoom:false}}i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.Attribution());i3geoOL=new OpenLayers.Map('openlayers',i3GEO.Interface.openlayers.parametrosMap)},inicia:function(){if(typeof(OpenLayers)=='undefined'){return}var montaMapa=function(){var pz,temp,layers,i,texto,estilo,layersn,openlayers=i3GEO.Interface.openlayers;i3GEO.util.multiStep([openlayers.registraEventos,openlayers.zoom2ext],[null,[i3GEO.parametros.mapexten]],function(){});if(openlayers.GADGETS.PanZoom===true){pz=new OpenLayers.Control.PanZoom();i3geoOL.addControl(pz);pz.div.style.zIndex=5000}openlayers.criaLayers();temp=$i("listaLayersBase");if(temp&&i3GEO.arvoreDeCamadas.INCLUILFUNDO===false){i3GEO.arvoreDeCamadas.INCLUILFUNDO=false;estilo="cursor:pointer;vertical-align:top;padding-top:5px;";if(navm){estilo="border:0px solid white;cursor:pointer;vertical-align:middle;padding-top:0px;"}temp={"propriedades":[]};layers=i3geoOL.getLayersBy("isBaseLayer",true);layersn=layers.length;for(i=0;i<layersn;i++){texto="<input type=radio style='"+estilo+"' onclick='i3GEO.Interface.openlayers.ativaFundo(this.value)' name=i3GEObaseLayer value='"+layers[i].name+"' />"+layers[i].name;temp.propriedades.push({text:texto,url:""})}i3GEO.util.arvore("<b>"+$trad("p16")+"</b>","listaLayersBase",temp)}else{if(openlayers.GADGETS.LayerSwitcher===true&&i3GEO.arvoreDeCamadas.INCLUILFUNDO===false){i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher())}}if(i3GEO.parametros.h<550){openlayers.GADGETS.PanZoomBar=false;openlayers.GADGETS.ScaleLine=false}if(openlayers.GADGETS.ScaleLine===true){pz=new OpenLayers.Control.ScaleLine();i3geoOL.addControl(pz);pz.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+5+"px"}if(openlayers.GADGETS.OverviewMap===true){i3geoOL.addControl(new OpenLayers.Control.OverviewMap())}if(i3GEO.Interface.TABLET===false){i3GEO.Interface.openlayers.OLpan=new OpenLayers.Control.Navigation();i3GEO.Interface.openlayers.OLzoom=new OpenLayers.Control.ZoomBox();i3GEO.Interface.openlayers.OLpanel=new OpenLayers.Control.Panel();i3GEO.Interface.openlayers.OLpanel.addControls([i3GEO.Interface.openlayers.OLpan,i3GEO.Interface.openlayers.OLzoom]);i3geoOL.addControl(i3GEO.Interface.openlayers.OLpanel)}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"){i3GEO.maparef.inicia()}}if(i3GEO.Interface.TABLET===false&&i3GEO.Interface.openlayers.OLpanel){i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}if(i3GEO.Interface.openlayers.googleLike===true){i3GEO.barraDeBotoes.INCLUIBOTAO.lentei=false}if(openlayers.GADGETS.PanZoomBar===true){i3GEO.Interface.openlayers.OLpanzoombar=new OpenLayers.Control.PanZoomBar();i3geoOL.addControl(i3GEO.Interface.openlayers.OLpanzoombar);i3GEO.Interface.openlayers.OLpanzoombar.div.style.zIndex=5000;i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px";if(i3GEO.Interface.BARRADEZOOMLEFT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}}};if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this);i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS);"}i3GEO.coordenadas.mostraCoordenadas();montaMapa();i3GEO.gadgets.mostraMenuSuspenso();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.idioma.mostraSeletor();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.util.arvore("<b>"+$trad("p13")+"</b>","listaPropriedades",i3GEO.configura.listaDePropriedadesDoMapa);i3GEO.gadgets.mostraMenuLista();i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic);if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===true){i3GEO.Interface.openlayers.adicionaListaKml()}if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.openlayers.adicionaKml(true,i3GEO.parametros.kmlurl)}if($i("mst")){$i("mst").style.visibility="visible"}i3GEO.Interface.ativaBotoes();if(YAHOO.lang.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}i3GEO.configura.iniciaFerramentas.executa();i3GEO.Interface.openlayers.sobeLayersGraficos()},aplicaOpacidade:function(opacidade,layer){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,l,i,camada;if(!layer){layer=""}for(i=nlayers-1;i>=0;i--){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];l=i3geoOL.getLayersByName(camada.name)[0];if(l&&l.isBaseLayer===false){if(layer==""||layer==camada.name){l.setOpacity(opacidade)}}}},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.openlayers.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i;if(!$i("arvoreCamadasKml")){i3GEO.Interface.openlayers.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=true}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===false){i3GEO.arvoreDeCamadas.MOSTRALISTAKML=true;i3GEO.Interface.openlayers.criaArvoreKML()}i3GEO.Interface.openlayers.adicionaNoArvoreKml(url,titulo,ativo,ngeoxml)},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{return}}i3GEO.Interface.openlayers.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.openlayers.ARVORE.getRoot();titulo="<table><tr><td><b>Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false;if(i3GEO.parametros.editor==="sim"){d=new YAHOO.widget.HTMLNode({html:"<a style='color:red' title='opção visível apenas para editores' href='../admin/html/webservices.html' target=blank >Editar cadastro</a>",idmenu:"",enableHighlight:false,expanded:false},node)}},adicionaNoArvoreKml:function(url,nomeOverlay,ativo,id){var node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.openlayers.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}node=i3GEO.Interface.openlayers.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.openlayers.ativaDesativaCamadaKml(this,\""+url+"\")' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";if(navm){estilo="cursor:default;vertical-align:35%;padding-top:0px;"}else{estilo="cursor:default;vertical-align:top;"}html+=" <span style='"+estilo+"'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.openlayers.ARVORE.draw();i3GEO.Interface.openlayers.ARVORE.collapseAll();node.expand();if(ativo===true){i3GEO.Interface.openlayers.insereLayerKml(id,url)}},insereLayerKml:function(id,url){var l,temp;url=i3GEO.configura.locaplic+"/classesphp/proxy.php?url="+url;l=new OpenLayers.Layer.Vector(id,{displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:url,format:new OpenLayers.Format.KML({extractStyles:true,extractAttributes:true,maxDepth:5})})});i3geoOL.addLayer(l);temp=l.div;temp.onclick=function(e){var targ="",id,temp,features,n,i,j="",html="";if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.id){temp=targ.id.split("_Point");if(temp[0]==="OpenLayers_Geometry"){id=targ.id;temp=i3geoOL.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}}},ativaDesativaCamadaKml:function(obj,url){if(!obj.checked){i3geoOL.getLayersByName(obj.value)[0].setVisibility(false)}else{if(!(i3geoOL.getLayersByName(obj.value)[0])){i3GEO.Interface.openlayers.insereLayerKml(obj.value,url)}else{i3geoOL.getLayersByName(obj.value)[0].setVisibility(true)}}},criaLayers:function(){var configura=i3GEO.configura,url=configura.locaplic+"/classesphp/mapa_openlayers.php?g_sid="+i3GEO.configura.sid+"&TIPOIMAGEM="+configura.tipoimagem,nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,layer,camada,urllayer,opcoes,i,n,temp=$i("i3GEOprogressoDiv"),fundoIsBase=true;if(temp){i3GEO.Interface.STATUS.atualizando=[];temp.style.display="none"}if(i3GEO.Interface.openlayers.googleLike===true){url=configura.locaplic+"/classesphp/mapa_googlemaps.php?g_sid="+i3GEO.configura.sid+"&TIPOIMAGEM="+configura.tipoimagem}try{temp=i3GEO.Interface.openlayers.LAYERSADICIONAIS;n=temp.length;for(i=0;i<n;i++){if(temp[i].isBaseLayer===true&&temp[i].visibility===true){fundoIsBase=false}}}catch(e){}if(i3geoOL.getLayersByName("Nenhum").length===0&&fundoIsBase===true){layer=new OpenLayers.Layer.Vector("Nenhum",{displayInLayerSwitcher:true,visibility:false,isBaseLayer:true,singleTile:true});i3geoOL.addLayer(layer);if($i(i3geoOL.id+"_OpenLayers_ViewPort")){$i(i3geoOL.id+"_OpenLayers_ViewPort").style.backgroundColor="rgb("+i3GEO.parametros.cordefundo+")"}}opcoes={gutter:0,isBaseLayer:false,displayInLayerSwitcher:false,opacity:1,visibility:false,singleTile:!(i3GEO.Interface.openlayers.TILES),ratio:1,buffer:i3GEO.Interface.openlayers.BUFFER,wrapDateLine:true,transitionEffect:"resize",eventListeners:{"loadstart":i3GEO.Interface.openlayers.loadStartLayer,"loadend":i3GEO.Interface.openlayers.loadStopLayer}};for(i=nlayers-1;i>=0;i--){layer="";camada=i3GEO.arvoreDeCamadas.CAMADAS[i];opcoes.singleTile=!(i3GEO.Interface.openlayers.TILES);if(camada.exttema&&camada.exttema!=""){opcoes.maxExtent=camada.exttema.split(" ")}else{opcoes.maxExtent=null}if(i3geoOL.getLayersByName(camada.name).length===0&&camada.name.toLowerCase()!="copyright"){if(camada.plugini3geo&&camada.plugini3geo!=""&&camada.plugini3geo.parametros!=undefined){i3GEO.pluginI3geo.inicia(camada);continue}else{if(camada.cache){urllayer=url+"&cache="+camada.cache+"&layer="+camada.name+"&r="+Math.random()}else{urllayer=url+"&cache=&layer="+camada.name+"&r="+Math.random()}try{temp=camada.transitioneffect==="nao"?opcoes.transitionEffect="null":opcoes.transitionEffect="resize";if(i3GEO.Interface.openlayers.googleLike===false&&camada.connectiontype===7&&camada.wmsurl!==""&&camada.usasld.toLowerCase()!="sim"){urllayer=camada.wmsurl+"&r="+Math.random();if(camada.wmstile==1){layer=new OpenLayers.Layer.TMS(camada.name,camada.wmsurl,{isBaseLayer:false,layername:camada.wmsname,type:'png',maxExtent:opcoes.maxExtent})}else{layer=new OpenLayers.Layer.WMS(camada.name,urllayer,{LAYERS:camada.name,format:camada.wmsformat,transparent:true},opcoes)}if(camada.wmssrs!=""&&layer.url){layer.url=layer.url+"&SRS="+camada.wmssrs+"&CRS="+camada.wmssrs}}else{if(camada.tiles==="nao"||camada.escondido.toLowerCase()==="sim"||camada.connectiontype===10||(camada.type===0&&camada.cache==="nao")||camada.type===8){opcoes.singleTile=true}else{temp=camada.type===3?opcoes.singleTile=false:opcoes.singleTile=!(i3GEO.Interface.openlayers.TILES)}if(camada.tiles==="nao"){opcoes.singleTile=true}if(camada.tiles==="sim"||camada.cache==="sim"||(camada.cortepixels&&camada.cortepixels>0)){opcoes.singleTile=false}if(opcoes.singleTile===true){if(i3GEO.Interface.openlayers.googleLike===true){opcoes.projection=new OpenLayers.Projection("EPSG:3857")}layer=new OpenLayers.Layer.WMS(camada.name,urllayer,{LAYERS:camada.name,format:camada.wmsformat,transparent:true},opcoes)}else{if(i3GEO.Interface.openlayers.googleLike===true){layer=new OpenLayers.Layer.OSM(camada.name,urllayer+"&Z=${z}&X=${x}&Y=${y}",{isBaseLayer:false})}else{layer=new OpenLayers.Layer.TMS(camada.name,urllayer,{isBaseLayer:false,serviceVersion:"&tms=",type:"png",layername:camada.name,map_imagetype:i3GEO.Interface.OUTPUTFORMAT,maxExtent:opcoes.maxExtent},opcoes)}}}}catch(e){}}if(layer&&layer!=""){if(camada.escondido.toLowerCase()==="sim"){layer.transitionEffect="null"}i3geoOL.addLayer(layer);i3GEO.Interface.aposAdicNovaCamada(camada)}}else{layer=i3geoOL.getLayersByName(camada.name)[0]}if(layer&&layer!=""){temp=camada.status==0?layer.setVisibility(false):layer.setVisibility(true)}}try{i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS)}catch(e){}if(i3GEO.parametros.copyright!=""&&!$i("i3GEOcopyright")){temp=document.createElement("div");temp.id="i3GEOcopyright";temp.style.display="block";temp.style.top="0px";temp.style.left="0px";temp.style.zIndex=5000;temp.style.position="absolute";temp.innerHTML="<p class=paragrafo >"+i3GEO.parametros.copyright+"</p>";if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).appendChild(temp)}}if(i3GEO.Interface.openlayers.LAYERFUNDO!=""){i3GEO.Interface.openlayers.ativaFundo(i3GEO.Interface.openlayers.LAYERFUNDO)}i3GEO.Interface.openlayers.sobeLayersGraficos()},sobeLayersGraficos:function(){var nlayers=i3geoOL.getNumLayers(),layers=i3geoOL.layers,i;for(i=0;i<nlayers;i++){if(layers[i].CLASS_NAME=="OpenLayers.Layer.Vector"&&layers[i].name!="Nenhum"){i3geoOL.raiseLayer(i3geoOL.layers[i],nlayers)}}},inverteModoTile:function(){if(i3GEO.Interface.openlayers.TILES===true){i3GEO.Interface.openlayers.TILES=false}else{i3GEO.Interface.openlayers.TILES=true}i3GEO.Interface.openlayers.removeTodosOsLayers();i3GEO.Interface.openlayers.criaLayers()},removeTodosOsLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,layer,i,camada;for(i=nlayers-1;i>=0;i--){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];layer=i3geoOL.getLayersByName(camada.name)[0];if(layer){i3geoOL.removeLayer(layer,false);i3GEO.pluginI3geo.removeCamada(camada.name)}}},alteraParametroLayers:function(parametro,valor){var layers=i3geoOL.layers,nlayers=layers.length,i,url,reg;for(i=0;i<nlayers;i+=1){if(layers[i].url){url=layers[i].url;if(url.search("\\?")>0){reg=new RegExp(parametro+"([=])+([a-zA-Z0-9_]*)");layers[i].url=url.replace(reg,"");layers[i].url=layers[i].url+"&"+parametro+"="+valor;layers[i].redraw()}}}},loadStartLayer:function(event){var p=$i("i3GEOprogressoDiv");if($i("ArvoreTituloTema"+event.object.name)){i3GEO.Interface.STATUS.atualizando.push(event.object.name);YAHOO.util.Dom.setStyle("ArvoreTituloTema"+event.object.name,"background",i3GEO.Interface.openlayers.FUNDOTEMA);if(p){p.style.display="block";i3GEO.arvoreDeCamadas.progressBar.set('maxValue',i3GEO.Interface.STATUS.atualizando.length);i3GEO.arvoreDeCamadas.progressBar.set('value',i3GEO.arvoreDeCamadas.progressBar.get('value')-1)}}},loadStopLayer:function(event){var p=$i("i3GEOprogressoDiv");i3GEO.Interface.STATUS.atualizando.remove(event.object.name);if($i("ArvoreTituloTema"+event.object.name)){YAHOO.util.Dom.setStyle("ArvoreTituloTema"+event.object.name,"background","");if(p){p.style.display="block";if(i3GEO.Interface.STATUS.atualizando.length>0){i3GEO.arvoreDeCamadas.progressBar.set('value',i3GEO.arvoreDeCamadas.progressBar.get('value')+1)}else{i3GEO.arvoreDeCamadas.progressBar.set('value',0);p.style.display="none"}}}},ordenaLayers:function(){var ordem=i3GEO.arvoreDeCamadas.CAMADAS,nordem=ordem.length,layer,layers,i,maiorindice;layers=i3geoOL.layers;maiorindice=i3geoOL.getLayerIndex(layers[(layers.length)-1]);for(i=nordem-1;i>=0;i--){layers=i3geoOL.getLayersByName(ordem[i].name);layer=layers[0];if(layer){i3geoOL.setLayerIndex(layer,maiorindice+i)}}i3GEO.Interface.openlayers.sobeLayersGraficos()},sobeDesceLayer:function(tema,tipo){var layer=i3geoOL.getLayersByName(tema)[0],indice;if(layer){indice=i3geoOL.getLayerIndex(layer);if(tipo==="sobe"){i3geoOL.setLayerIndex(layer,indice+1)}else{i3geoOL.setLayerIndex(layer,indice-1)}}i3GEO.Interface.openlayers.sobeLayersGraficos()},ligaDesliga:function(obj){var layers=i3geoOL.getLayersByName(obj.value),desligar="",ligar="",b;if(layers.length>0){layers[0].setVisibility(obj.checked);if(obj.checked===true){layers[0].div.style.display="block";i3GEO.pluginI3geo.ligaCamada(obj.value)}else{layers[0].div.style.display="none";i3GEO.pluginI3geo.desligaCamada(obj.value)}}if(obj.checked){ligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value)}else{desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value)}b=new Image();b.src=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=ligatemasbeacon&desligar="+desligar+"&ligar="+ligar+"&adicionar=nao&g_sid="+i3GEO.configura.sid;b.onerror=function(){i3GEO.mapa.legendaHTML.atualiza()}},ativaFundo:function(nome){var t,temp=i3geoOL.getLayersBy("name",nome),layers,layersn,i,status;if(temp.length>0){i3geoOL.setBaseLayer(temp[0]);if(i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px"}if(i3GEO.Interface.BARRADEZOOMLEFT===0&&i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0&&i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}i3GEO.Interface.openlayers.LAYERFUNDO=nome}else{i3GEO.Interface.openlayers.LAYERFUNDO=""}t=$i("CK"+temp[0].id);if(t){status=true;if(t.checked===false){status=false}layers=i3GEO.Interface.openlayers.LAYERSADICIONAIS;layersn=layers.length;for(i=0;i<layersn;i++){if(layers[i].name!=nome){layers[i].setVisibility(false);$i("CK"+layers[i].id).checked=false}}temp[0].setVisibility(!status);t.checked=!status}},atualizaMapa:function(){var layers=i3geoOL.layers,nlayers=layers.length,i;for(i=0;i<nlayers;i++){if(layers[i].url){layers[i].mergeNewParams({r:Math.random()});if(layers[i].url.search("\\?")>=0){layers[i].url=layers[i].url.replace("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&","&foo=");layers[i].url=layers[i].url+"&&"}layers[i].url=layers[i].url.replace("&cache=sim","&cache=nao");if(layers[i].visibility===true){layers[i].redraw()}}}i3GEO.Interface.openlayers.sobeLayersGraficos()},atualizaTema:function(retorno,tema){var layer=i3geoOL.getLayersByName(tema)[0],objtemas;if(layer&&layer!=undefined){if(layer.url){layer.mergeNewParams({r:Math.random()});layer.url=layer.url.replace("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&","&foo=");layer.url=layer.url+"&&";layer.url=layer.url.replace("&cache=sim","&cache=nao");layer.redraw()}}if(retorno===""){return}objtemas=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);i3GEO.Interface.openlayers.recalcPar();try{i3GEO.arvoreDeCamadas.atualiza(objtemas)}catch(e){i3GEO.arvoreDeCamadas.atualiza()}i3GEO.janela.fechaAguarde()},registraEventos:function(){i3GEOtouchesPosMapa="";var calcCoord,modoAtual="";calcCoord=function(e){var point,p=false,lonlat=false,d,pos="",projWGS84,proj900913;if(e.xy){p=e.xy}if(e.changedTouches){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO))}pos=i3GEOtouchesPosMapa;p=new OpenLayers.Pixel(e.changedTouches[0].clientX-pos[0],e.changedTouches[0].clientY-pos[1]);e=null}if(p===false){return}lonlat=i3geoOL.getLonLatFromPixel(p);if(i3GEO.Interface.openlayers.googleLike===true){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");if(lonlat){point=new OpenLayers.LonLat(lonlat.lon,lonlat.lat);lonlat=point.transform(proj900913,projWGS84)}}try{d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);objposicaocursor.ddx=lonlat.lon;objposicaocursor.ddy=lonlat.lat;objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];objposicaocursor.imgx=p.x;objposicaocursor.imgy=p.y;if(pos!=""){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO))}objposicaocursor.telax=p.x+pos[0];objposicaocursor.telay=p.y+pos[1]}catch(e){}};i3GEO.eventos.ativa($i(i3geoOL.id+"_OpenLayers_Container"));i3geoOL.events.register("movestart",i3geoOL,function(e){if(e.changedTouches){return}i3GEO.Interface.STATUS.pan=true;modoAtual="move";i3GEO.barraDeBotoes.BOTAOCLICADO="pan";if(i3GEO.configura.mostraCentroDoMapa===true&&$i("localizarxygeoProjxg")){i3GEO.navega.marcaCentroDoMapa(i3GEO.navega.centroDoMapa())}});i3geoOL.events.register("moveend",i3geoOL,function(e){if(e.changedTouches){return}var xy;modoAtual="";i3GEO.Interface.openlayers.recalcPar();i3GEO.Interface.STATUS.pan=false;i3GEO.eventos.navegaMapa();i3GEO.util.escondePin();xy=i3GEO.navega.centroDoMapa();xy=i3GEO.calculo.dd2dms(xy[0],xy[1]);i3GEO.coordenadas.atualizaGeo(xy[0],xy[1],"localizarxygeoProj");i3GEO.eventos.cliquePerm.status=false;i3GEO.navega.registraExt(i3GEO.parametros.mapexten);i3GEO.Interface.STATUS.pan=false});i3geoOL.events.register("mousemove",i3geoOL,function(e){if(e.changedTouches){return}if(modoAtual==="move"){return}calcCoord(e)});i3geoOL.events.register("touchend",i3geoOL,function(e){e.preventDefault();calcCoord(e);if(i3GEO.eventos.cliquePerm.status===true&&i3GEO.eventos.CONTATOUCH<10){i3GEO.eventos.mouseupMapa(e)}i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.CONTATOUCH=0;i3GEO.Interface.STATUS.pan=false})},ativaBotoes:function(){var imagemxy,x2=0,y2=0;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},recalcPar:function(){i3GEOtouchesPosMapa="";var bounds=i3geoOL.getExtent().toBBOX().split(","),escalaAtual=i3geoOL.getScale();if(i3GEO.parametros.mapscale!==escalaAtual){i3GEO.arvoreDeCamadas.atualizaFarol(escalaAtual)}i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];i3GEO.parametros.mapscale=escalaAtual;i3GEO.parametros.pixelsize=i3geoOL.getResolution();i3GEO.gadgets.atualizaEscalaNumerica(parseInt(escalaAtual,10))},zoom2ext:function(ext){var m,b;ext=i3GEO.util.extGeo2OSM(ext);m=ext.split(" ");b=new OpenLayers.Bounds(m[0],m[1],m[2],m[3]);i3geoOL.zoomToExtent(b,true);i3GEO.eventos.cliquePerm.status=true},pan2ponto:function(x,y){if(i3GEO.Interface.openlayers.googleLike===true){var projWGS84,proj900913,point,metrica;if(x<180&&x>-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(x,y);metrica=point.transform(projWGS84,proj900913);x=metrica.lon;y=metrica.lat}}i3geoOL.panTo(new OpenLayers.LonLat(x,y))}},googlemaps:{ESTILOS:{'Red':[{featureType:'all',stylers:[{hue:'#ff0000'}]}],'Countries':[{featureType:'all',stylers:[{visibility:'off'}]},{featureType:'water',stylers:[{visibility:'on'},{lightness:-100}]}],'Night':[{featureType:'all',stylers:[{invert_lightness:'true'}]}],'Blue':[{featureType:'all',elementType:'geometry',stylers:[{hue:'#0000b0'},{invert_lightness:'true'},{saturation:-30}]}],'Greyscale':[{featureType:'all',stylers:[{saturation:-100},{gamma:0.50}]}],'No roads':[{featureType:'road',stylers:[{visibility:'off'}]}],'Mixed':[{featureType:'landscape',stylers:[{hue:'#00dd00'}]},{featureType:'road',stylers:[{hue:'#dd0000'}]},{featureType:'water',stylers:[{hue:'#000040'}]},{featureType:'poi.park',stylers:[{visibility:'off'}]},{featureType:'road.arterial',stylers:[{hue:'#ffff00'}]},{featureType:'road.local',stylers:[{visibility:'off'}]}],'Chilled':[{featureType:'road',elementType:'geometry',stylers:[{'visibility':'simplified'}]},{featureType:'road.arterial',stylers:[{hue:149},{saturation:-78},{lightness:0}]},{featureType:'road.highway',stylers:[{hue:-31},{saturation:-40},{lightness:2.8}]},{featureType:'poi',elementType:'label',stylers:[{'visibility':'off'}]},{featureType:'landscape',stylers:[{hue:163},{saturation:-26},{lightness:-1.1}]},{featureType:'transit',stylers:[{'visibility':'off'}]},{featureType:'water',stylers:[{hue:3},{saturation:-24.24},{lightness:-38.57}]}]},ESTILOPADRAO:"",MAPOPTIONS:{scaleControl:true,mapTypeControlOptions:{position:1}},OPACIDADE:0.8,TIPOMAPA:"terrain",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],PARAMETROSLAYER:"&TIPOIMAGEM="+i3GEO.configura.tipoimagem,posfixo:0,BALAOPROP:{removeAoAdicionar:true,classeCadeado:"i3GEOiconeAberto",baloes:[]},removeBaloes:function(){var p=i3GEO.Interface.googlemaps.BALAOPROP.baloes,n=p.length,i;for(i=0;i<n;i++){p[i].close()}p=[]},balao:function(texto,completo,x,y){var temp,elem,b,c,p;if(x===null||y===null){return}p=i3GEO.Interface.googlemaps.BALAOPROP;if(p.removeAoAdicionar===true){i3GEO.Interface.googlemaps.removeBaloes()}temp=document.createElement("div");temp.className="i3GEOCabecalhoInfoWindow";temp.style.top="0px";elem=document.createElement("img");elem.src=i3GEO.configura.locaplic+"/imagens/branco.gif";elem.className=p.classeCadeado;elem.onclick=function(){if(p.classeCadeado==="i3GEOiconeAberto"){p.classeCadeado="i3GEOiconeFechado"}else{p.classeCadeado="i3GEOiconeAberto"}this.className=p.classeCadeado;p.removeAoAdicionar=!p.removeAoAdicionar};temp.appendChild(elem);elem=document.createElement("img");elem.src=i3GEO.configura.locaplic+"/imagens/branco.gif";elem.className="i3GEOiconeFerramentas";elem.style.marginLeft="5px";elem.onclick=function(){i3GEO.janela.prompt($trad("tolerancia"),function(){i3GEO.mapa.RESOLUCAOTIP=$i("i3GEOjanelaprompt").value},i3GEO.mapa.RESOLUCAOTIP)};temp.appendChild(elem);elem=document.createElement("img");elem.src=i3GEO.configura.locaplic+"/imagens/branco.gif";elem.className="i3GEOiconeMais";elem.style.marginLeft="7px";elem.onclick=function(){i3GEO.janela.mensagemSimples("<div style='overflow:auto;height:100%'>"+completo+"</div>","");return false};temp.appendChild(elem);c=document.createElement("div");c.innerHTML=texto;e=document.createElement("div");e.appendChild(temp);e.appendChild(c);b=new google.maps.InfoWindow({content:e,position:new google.maps.LatLng(y,x),pixelOffset:new google.maps.Size(0,-24)});b.open(i3GeoMap);p.baloes.push(b)},atualizaTema:function(retorno,tema){var indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(tema),objtemas;i3GeoMap.overlayMapTypes.removeAt(indice);i3GEO.Interface.googlemaps.posfixo+=1;i3GEO.Interface.googlemaps.insereLayer(tema,indice);if(retorno===""){return}objtemas=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);i3GEO.Interface.googlemaps.recalcPar();try{i3GEO.arvoreDeCamadas.atualiza(objtemas)}catch(e){i3GEO.arvoreDeCamadas.atualiza()}i3GEO.janela.fechaAguarde()},removeTodosLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,indice;for(i=0;i<nlayers;i++){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(camada.name);if(indice!==false){try{i3GeoMap.overlayMapTypes.removeAt(indice);i3GEO.pluginI3geo.removeCamada(camada.name)}catch(e){}}}},redesenha:function(){i3GEO.Interface.googlemaps.posfixo+=1;i3GEO.Interface.googlemaps.removeTodosLayers();i3GEO.Interface.googlemaps.criaLayers()},cria:function(w,h){var i,f,ins;google.maps.visualRefresh=true;posfixo="&nd=0";i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("googlemapsdiv");if(!f){ins='<div id=googlemapsdiv style="width:0px;height:0px;text-align:left;background-image:url('+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg)"></div>';i.innerHTML=ins}f=$i("googlemapsdiv");if(w){f.style.width=w+"px";f.style.height=h+"px"}}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv";if(i3GEO.Interface.TABLET===false){i3GEO.barraDeBotoes.INCLUIBOTAO.zoomli=true;i3GEO.barraDeBotoes.INCLUIBOTAO.pan=true;i3GEO.barraDeBotoes.INCLUIBOTAO.zoomtot=true}},ativaZoomBox:function(){i3GeoMap.enableKeyDragZoom({key:'ctrl'})},inicia:function(){var pol,ret,montaMapa;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");if($i("i3GEOprogressoDiv")){$i("i3GEOprogressoDiv").style.display="block"}montaMapa=function(retorno){var sw,ne,estilo,dobra=$i("i3GEOdobraPagina");if(i3GEO.Interface.googlemaps.ESTILOS&&i3GEO.Interface.googlemaps.ESTILOPADRAO!=""){i3GEO.Interface.googlemaps.MAPOPTIONS.mapTypeId=i3GEO.Interface.googlemaps.ESTILOPADRAO}if(i3GEO.Interface.BARRADEZOOMRIGHT!=0){i3GEO.Interface.googlemaps.MAPOPTIONS.zoomControlOptions={position:google.maps.ControlPosition.RIGHT_TOP};i3GEO.Interface.googlemaps.MAPOPTIONS.panControlOptions={position:google.maps.ControlPosition.RIGHT_TOP}}try{i3GeoMap=new google.maps.Map($i(i3GEO.Interface.IDMAPA),i3GEO.Interface.googlemaps.MAPOPTIONS)}catch(e){return}if(i3GEO.Interface.googlemaps.ESTILOS&&i3GEO.Interface.googlemaps.ESTILOPADRAO!=""){estilo=i3GEO.Interface.googlemaps.ESTILOS[i3GEO.Interface.googlemaps.ESTILOPADRAO];i3GeoMap.mapTypes.set(i3GEO.Interface.googlemaps.ESTILOPADRAO,new google.maps.StyledMapType(estilo,{name:i3GEO.Interface.googlemaps.ESTILOPADRAO}))}else{i3GeoMap.setMapTypeId(i3GEO.Interface.googlemaps.TIPOMAPA)}if(dobra){$i(i3GEO.Interface.IDMAPA).appendChild(dobra)}if(!i3GEO.Interface.googlemaps.MAPOPTIONS.center&&!i3GEO.Interface.googlemaps.MAPOPTIONS.zoom){sw=new google.maps.LatLng(ret[1],ret[0]);ne=new google.maps.LatLng(ret[3],ret[2]);i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne))}if(!$i("keydragzoom_script")){js=i3GEO.configura.locaplic+"/pacotes/google/keydragzoom.js";i3GEO.util.scriptTag(js,"i3GEO.Interface.googlemaps.ativaZoomBox()","keydragzoom_script")}i3GeoMapOverlay=new google.maps.OverlayView();i3GeoMapOverlay.draw=function(){};i3GEO.Interface.googlemaps.criaLayers();i3GeoMapOverlay.setMap(i3GeoMap);i3GEO.Interface.googlemaps.registraEventos();if(i3GEO.Interface.STATUS.trocando===false){i3GEO.gadgets.mostraInserirKml()}i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));if(i3GEO.Interface.STATUS.trocando===false){i3GEO.coordenadas.mostraCoordenadas();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.gadgets.mostraMenuLista();i3GEO.idioma.mostraSeletor()}i3GEO.gadgets.mostraMenuSuspenso();if(i3GEO.Interface.STATUS.trocando===true&&$i(i3GEO.arvoreDeCamadas.IDHTML)){$i(i3GEO.arvoreDeCamadas.IDHTML).innerHTML=""}if(i3GEO.Interface.STATUS.trocando===false){i3GEO.util.arvore("<b>"+$trad("p13")+"</b>","listaPropriedades",i3GEO.configura.listaDePropriedadesDoMapa)}if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this)"}i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic);if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===true){i3GEO.Interface.googlemaps.adicionaListaKml()}if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.googlemaps.adicionaKml(true,i3GEO.parametros.kmlurl)}if(YAHOO.lang.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}i3GEO.configura.iniciaFerramentas.executa();i3GEO.Interface.ativaBotoes();google.maps.event.addListenerOnce(i3GeoMap,'idle',function(){var z=i3GeoMap.getZoom();if(z!=undefined){i3GeoMap.setZoom(parseInt(z,10)+1)}})};i3GEO.php.googlemaps(montaMapa)},criaLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,indice;for(i=0;i<nlayers;i++){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(camada.name);if(!indice){if(camada.status!=0){if(camada.plugini3geo&&camada.plugini3geo!=""&&camada.plugini3geo.parametros!=undefined){i3GEO.pluginI3geo.inicia(camada);continue}else{i3GEO.Interface.googlemaps.insereLayer(camada.name,0,camada.cache)}}i3GEO.Interface.aposAdicNovaCamada(camada)}}i3GEO.Interface.googlemaps.recalcPar()},criaImageMap:function(nomeLayer,cache){var i3GEOTileO="";if(cache=="undefined"||cache==undefined){cache=""}i3GEOTileO=new google.maps.ImageMapType({getTileUrl:function(coord,zoom){var url=i3GEO.configura.locaplic+"/classesphp/mapa_googlemaps.php?g_sid="+i3GEO.configura.sid+"&cache="+cache+"&Z="+zoom+"&X="+coord.x+"&Y="+coord.y+"&layer="+nomeLayer+i3GEO.Interface.googlemaps.PARAMETROSLAYER+'&r='+Math.random();return url+'&nd='+i3GEO.Interface.googlemaps.posfixo},tileSize:new google.maps.Size(256,256),isPng:true,name:nomeLayer});return i3GEOTileO},bbox2mercator:function(bbox){var c=bbox.split(" "),p1,p2;p1=i3GEO.Interface.googlemaps.geo2mercator(c[0],c[1]);p2=i3GEO.Interface.googlemaps.geo2mercator(c[2],c[3]);return p1.x+" "+p1.y+" "+p2.x+" "+p2.y},geo2mercator:function(x,y){var source="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",dest="+title= Google Mercator EPSG:900913 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",p=new Proj4js.Point(parseInt(x,10),parseInt(y,10));Proj4js.defs["WGS84"]=source;Proj4js.defs["EPSG:900913"]=dest;source=new Proj4js.Proj('WGS84');dest=new Proj4js.Proj('EPSG:900913');Proj4js.transform(source,dest,p);return p},insereLayer:function(nomeLayer,indice,cache){if(i3GEO.pluginI3geo.existeObjeto(nomeLayer)===false){var i=i3GEO.Interface.googlemaps.criaImageMap(nomeLayer,cache);i3GeoMap.overlayMapTypes.insertAt(indice,i)}},registraEventos:function(){i3GEOtouchesPosMapa="";modoAtual="";google.maps.event.addListener(i3GeoMap,"dragstart",function(){modoAtual="move";if(i3GEO.configura.mostraCentroDoMapa===true&&$i("localizarxygeoProjxg")){i3GEO.navega.marcaCentroDoMapa(i3GEO.navega.centroDoMapa())}i3GEO.eventos.cliquePerm.status=false});google.maps.event.addListener(i3GeoMap,"dragend",function(){var xy;i3GEO.Interface.googlemaps.recalcPar();i3GEO.eventos.navegaMapa();i3GEO.util.escondePin();xy=i3GEO.navega.centroDoMapa();xy=i3GEO.calculo.dd2dms(xy[0],xy[1]);i3GEO.coordenadas.atualizaGeo(xy[0],xy[1],"localizarxygeoProj");i3GEO.navega.registraExt(i3GEO.parametros.mapexten)});google.maps.event.addListener(i3GeoMap,"tilesloaded",function(){i3GEO.Interface.googlemaps.recalcPar();i3GEO.navega.registraExt(i3GEO.parametros.mapexten)});google.maps.event.addListener(i3GeoMap,"bounds_changed",function(){i3GEO.Interface.googlemaps.recalcPar();i3GEO.eventos.navegaMapa()});google.maps.event.addListener(i3GeoMap,"mousemove",function(ponto){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}var teladms,tela,pos=i3GEOtouchesPosMapa;if(modoAtual==="move"){return}ponto=ponto.latLng;teladms=i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());tela=i3GeoMapOverlay.getProjection().fromLatLngToContainerPixel(ponto);objposicaocursor={ddx:ponto.lng(),ddy:ponto.lat(),dmsx:teladms[0],dmsy:teladms[1],imgx:tela.x,imgy:tela.y,telax:tela.x+pos[0],telay:tela.y+pos[1]}})},retornaIndiceLayer:function(nomeLayer){var i=false;try{i3GeoMap.overlayMapTypes.forEach(function(elemento,number){if(elemento.name===nomeLayer){i=number}});return i}catch(e){return false}},retornaObjetoLayer:function(nomeLayer){var i=false;try{i3GeoMap.overlayMapTypes.forEach(function(elemento,number){if(elemento.name===nomeLayer){i=elemento}});return i}catch(e){return false}},retornaDivLayer:function(nomeLayer){var i,divmapa=$i("googlemapsdiv"),divimg,n;divimg=divmapa.getElementsByTagName("img");n=divimg.length;if(divimg&&n>0){for(i=0;i<n;i++){if(divimg[i].src.search("&layer="+nomeLayer+"&")>0){return divimg[i].parentNode.parentNode.parentNode}}}return false},ligaDesliga:function(obj){var plugin,indice,temp,desligar="",ligar="",n,i,lista=[],listatemp;indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(obj.value);temp=function(){i3GEO.mapa.legendaHTML.atualiza()};plugin=i3GEO.pluginI3geo.existeObjeto(obj.value);if(obj.checked&&(!indice||plugin===true)){ligar=obj.value;listatemp=i3GEO.arvoreDeCamadas.listaLigadosDesligados()[0];n=i3GEO.arvoreDeCamadas.CAMADAS.length;for(i=0;i<n;i++){if(i3GEO.util.in_array(i3GEO.arvoreDeCamadas.CAMADAS[i].name,listatemp)){lista.push(i3GEO.arvoreDeCamadas.CAMADAS[i].name)}}lista.reverse();if(plugin===false){n=lista.length;indice=0;for(i=0;i<n;i++){if(lista[i]==obj.value){indice=i}}i3GEO.Interface.googlemaps.insereLayer(obj.value,(indice))}else{i3GEO.pluginI3geo.ligaCamada(obj.value)}i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value)}else{if(plugin===true){desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);i3GEO.pluginI3geo.desligaCamada(obj.value)}else if(indice!==false){desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);i3GeoMap.overlayMapTypes.removeAt(indice)}}if(desligar!==""||ligar!==""){i3GEO.php.ligatemas(temp,desligar,ligar)}},bbox:function(){var bd,so,ne,bbox;bd=i3GeoMap.getBounds();so=bd.getSouthWest();ne=bd.getNorthEast();bbox=so.lng()+" "+so.lat()+" "+ne.lng()+" "+ne.lat();return(bbox)},ativaBotoes:function(){var imagemxy,x2=0,y2=0;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},aplicaOpacidade:function(opacidade,layer){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,div;if(!layer){layer=""}for(i=0;i<nlayers;i++){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];if(camada&&camada.name){div=i3GEO.Interface.googlemaps.retornaDivLayer(camada.name);if(div){if(layer==""||layer==camada.name){YAHOO.util.Dom.setStyle(div,"opacity",opacidade)}}}}},mudaOpacidade:function(valor){i3GEO.Interface.googlemaps.OPACIDADE=valor;i3GEO.Interface.googlemaps.redesenha()},recalcPar:function(){i3GEOtouchesPosMapa="";try{var sw,ne,escalaAtual=i3GEO.parametros.mapscale;sw=i3GeoMap.getBounds().getSouthWest();ne=i3GeoMap.getBounds().getNorthEast();i3GEO.parametros.mapexten=sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala();sw=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(0,1));ne=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(1,0));i3GEO.parametros.pixelsize=sw.lng()-ne.lng();if(i3GEO.parametros.pixelsize<0){i3GEO.parametros.pixelsize=i3GEO.parametros.pixelsize*-1}if(i3GEO.parametros.mapscale!==escalaAtual&&escalaAtual!==0){i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale)}}catch(e){i3GEO.parametros.mapexten="0 0 0 0";i3GEO.parametros.mapscale=0}},calcescala:function(){var zoom=i3GeoMap.getZoom();return(i3GEO.Interface.googlemaps.ZOOMSCALE[zoom])},escala2nzoom:function(escala){var n,i;n=i3GEO.Interface.googlemaps.ZOOMSCALE.length;for(i=0;i<n;i++){if(i3GEO.Interface.googlemaps.ZOOMSCALE[i]<escala){return(i)}}},zoom2extent:function(mapexten){var re=new RegExp(",","g"),pol=mapexten.replace(re," "),ret=pol.split(" "),sw=new google.maps.LatLng(ret[1],ret[0]),ne=new google.maps.LatLng(ret[3],ret[2]);i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne))},pan2ponto:function(x,y){i3GeoMap.panTo(new google.maps.LatLng(y,x))},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=true}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===false){i3GEO.arvoreDeCamadas.MOSTRALISTAKML=true;i3GEO.Interface.googlemaps.criaArvoreKML()}i3GEO.Interface.googlemaps.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googlemaps.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}node=i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this,\""+url+"\")' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";if(navm){estilo="cursor:default;vertical-align:35%;padding-top:0px;"}else{estilo="cursor:default;vertical-align:top;"}html+=" <span style='"+estilo+"'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand();if(ativo===true){eval(id+" = new google.maps.KmlLayer('"+url+"',{map:i3GeoMap,preserveViewport:true});")}},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="<table><tr><td><b>Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false;if(i3GEO.parametros.editor==="sim"){d=new YAHOO.widget.HTMLNode({html:"<a style='color:red' title='opção visível apenas para editores' href='../admin/html/webservices.html' target=blank >Editar cadastro</a>",idmenu:"",enableHighlight:false,expanded:false},node)}},ativaDesativaCamadaKml:function(obj,url){if(!obj.checked){eval(obj.value+".setMap(null);")}else{eval(obj.value+" = new google.maps.KmlLayer(url,{map:i3GeoMap,preserveViewport:true});")}},alteraParametroLayers:function(parametro,valor){parametro=parametro.toUpperCase();var reg=new RegExp(parametro+"([=])+([a-zA-Z0-9_]*)");i3GEO.Interface.googlemaps.PARAMETROSLAYER=i3GEO.Interface.googlemaps.PARAMETROSLAYER.replace(reg,"");i3GEO.Interface.googlemaps.PARAMETROSLAYER+="&"+parametro+"="+valor;i3GEO.Interface.googlemaps.redesenha()}},googleearth:{PARAMETROSLAYER:"&TIPOIMAGEM="+i3GEO.configura.tipoimagem,posfixo:"",GADGETS:{setMouseNavigationEnabled:true,setStatusBarVisibility:true,setOverviewMapVisibility:true,setScaleLegendVisibility:true,setAtmosphereVisibility:true,setGridVisibility:false,getSun:false,LAYER_BORDERS:true,LAYER_BUILDINGS:false,LAYER_ROADS:false,LAYER_TERRAIN:true},POSICAOTELA:[0,0],aguarde:"",ligaDesliga:function(obj){var layer=i3GEO.Interface.googleearth.retornaObjetoLayer(obj.value),temp=function(){i3GEO.mapa.legendaHTML.atualiza()},desligar="",ligar="";if(obj.checked){i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value);ligar=obj.value}else{i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);desligar=obj.value}layer.setVisibility(obj.checked);if(desligar!==""||ligar!==""){i3GEO.php.ligatemas(temp,desligar,ligar)}},atualizaTema:function(retorno,tema){var layer=i3GEO.Interface.googleearth.retornaObjetoLayer(tema),hr=layer.getLink().getHref(),objtemas;hr=hr.replace("&&&&&&&&&&&&&&&&&&&","");layer.getLink().setHref(hr+"&");if(retorno===""){return}objtemas=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);i3GEO.Interface.googleearth.recalcPar();try{i3GEO.arvoreDeCamadas.atualiza(objtemas)}catch(e){i3GEO.arvoreDeCamadas.atualiza()}i3GEO.janela.fechaAguarde()},redesenha:function(){i3GEO.Interface.googleearth.posfixo+="&";var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,indice;for(i=0;i<nlayers;i++){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];indice=i3GEO.Interface.googleearth.retornaObjetoLayer(camada.name);if(indice!==false){try{i3GeoMap.getFeatures().removeChild(indice)}catch(e){}}}i3GEO.Interface.googleearth.criaLayers()},cria:function(w,h){var i,i3GeoMap3d,texto;i3GEO.configura.listaDePropriedadesDoMapa={"propriedades":[{text:"p2",url:"javascript:i3GEO.mapa.dialogo.tipoimagem()"},{text:"p3",url:"javascript:i3GEO.mapa.dialogo.opcoesLegenda()"},{text:"p4",url:"javascript:i3GEO.mapa.dialogo.opcoesEscala()"},{text:"p8",url:"javascript:i3GEO.mapa.dialogo.queryMap()"},{text:"p9",url:"javascript:i3GEO.mapa.dialogo.corFundo()"},{text:"p10",url:"javascript:i3GEO.mapa.dialogo.gradeCoord()"}]};texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setMouseNavigationEnabled(this.checked)'";texto+="> "+$trad("ge1");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setStatusBarVisibility(this.checked)'";texto+="> "+$trad("ge2");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setOverviewMapVisibility(this.checked)'";texto+="> "+$trad("ge3");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setScaleLegendVisibility(this.checked)'";texto+="> "+$trad("ge4");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setAtmosphereVisibility(this.checked)'";texto+="> "+$trad("ge5");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setGridVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setGridVisibility(this.checked)'";texto+="> "+$trad("ge6");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.getSun===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getSun().setVisibility(this.checked)'";texto+="> "+$trad("ge7");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BORDERS, this.checked)'";texto+="> "+$trad("ge8");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BUILDINGS, this.checked)'";texto+="> "+$trad("ge9");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_ROADS, this.checked)'";texto+="> "+$trad("ge10");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_TERRAIN, this.checked)'";texto+="> "+$trad("ge11");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});i3GEO.util.arvore("<b>"+$trad("p13")+"</b>","listaPropriedades",i3GEO.configura.listaDePropriedadesDoMapa);i3GEO.barraDeBotoes.INCLUIBOTAO.zoomli=false;i3GEO.barraDeBotoes.INCLUIBOTAO.pan=false;i3GEO.barraDeBotoes.INCLUIBOTAO.zoomtot=false;i3GEO.barraDeBotoes.INCLUIBOTAO.zoomproximo=false;i3GEO.barraDeBotoes.INCLUIBOTAO.zoomanterior=false;i3GEO.Interface.IDMAPA="i3GeoMap3d";if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.googleearth.ligaDesliga(this)"}i=$i(i3GEO.Interface.IDCORPO);if(i){i3GeoMap3d=document.createElement("div");i3GeoMap3d.style.width=w+"px";i3GeoMap3d.style.height=h+"px";i.style.height=h;i3GeoMap3d.id="i3GeoMap3d";i3GeoMap3d.style.zIndex=0;i.appendChild(i3GeoMap3d)}google.load("earth","1")},inicia:function(){google.earth.createInstance("i3GeoMap3d",i3GEO.Interface.googleearth.iniciaGE,i3GEO.Interface.googleearth.falha)},iniciaGE:function(object){var montaMapa=function(retorno){i3GeoMap=object;i3GeoMap.getWindow().setVisibility(true);i3GEO.Interface.googleearth.zoom2extent(i3GEO.parametros.mapexten);i3GEO.Interface.googleearth.criaLayers();var options=i3GeoMap.getOptions(),layerRoot=i3GeoMap.getLayerRoot();options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled);options.setStatusBarVisibility(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility);options.setOverviewMapVisibility(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility);options.setScaleLegendVisibility(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility);options.setAtmosphereVisibility(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility);options.setGridVisibility(i3GEO.Interface.googleearth.GADGETS.setGridVisibility);layerRoot.enableLayerById(i3GeoMap.LAYER_BORDERS,i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS);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.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW);i3GEO.Interface.googleearth.POSICAOTELA=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO));i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic);i3GEO.gadgets.mostraMenuSuspenso();i3GEO.gadgets.mostraMenuLista();i3GEO.Interface.googleearth.ativaBotoes();i3GEO.gadgets.mostraInserirKml("inserirKml");if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===true){i3GEO.Interface.googleearth.adicionaListaKml()}i3GEO.Interface.googleearth.registraEventos();if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.googleearth.adicionaKml(true,i3GEO.parametros.kmlurl,i3GEO.parametros.kmlurl,false)}if(YAHOO.lang.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}i3GEO.configura.iniciaFerramentas.executa()};i3GEO.php.googleearth(montaMapa)},criaLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length-1,i,camada,indice,layer;for(i=nlayers;i>=0;i--){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];indice=i3GEO.Interface.googleearth.retornaIndiceLayer(camada.name);layer=i3GEO.Interface.googleearth.retornaObjetoLayer(camada.name);if(indice==false){layer=i3GEO.Interface.googleearth.insereLayer(camada.name)}try{if(camada.status!=0){layer.setVisibility(true)}else{layer.setVisibility(false)}}catch(e){}}},insereLayer:function(nomeLayer){var kmlUrl=i3GEO.configura.locaplic+"/classesphp/mapa_googleearth.php?REQUEST=GetKml&g_sid="+i3GEO.configura.sid+"&layer="+nomeLayer+i3GEO.Interface.googleearth.PARAMETROSLAYER+"&r="+Math.random(),linki3geo=i3GeoMap.createLink(''),nl=i3GeoMap.createNetworkLink('');linki3geo.setHref(kmlUrl+i3GEO.Interface.googleearth.posfixo);nl.setLink(linki3geo);nl.setFlyToView(false);nl.setName(nomeLayer);i3GeoMap.getFeatures().appendChild(nl);return nl},retornaIndiceLayer:function(nomeLayer){var n=i3GeoMap.getFeatures().getChildNodes().getLength(),indice=0,i=0;if(n>0){for(i=0;i<n;i++){if(i3GeoMap.getFeatures().getChildNodes().item(i).getName()===nomeLayer){indice=i}}return indice}else{return false}},aplicaOpacidade:function(opacidade){var n=i3GeoMap.getFeatures().getChildNodes().getLength(),i;for(i=0;i<n;i++){i3GeoMap.getFeatures().getChildNodes().item(i).setOpacity(opacidade)}},retornaObjetoLayer:function(nomeLayer){var n=i3GeoMap.getFeatures().getChildNodes().getLength(),indice=false,i;for(i=0;i<n;i++){if(i3GeoMap.getFeatures().getChildNodes().item(i).getName()===nomeLayer){indice=i3GeoMap.getFeatures().getChildNodes().item(i)}}return indice},registraEventos:function(){google.earth.addEventListener(i3GeoMap.getView(),"viewchangeend",function(e){i3GEO.Interface.googleearth.recalcPar();i3GEO.eventos.cliquePerm.status=false;i3GEO.navega.registraExt(i3GEO.parametros.mapexten)});google.earth.addEventListener(i3GeoMap.getGlobe(),'mousemove',function(event){d=i3GEO.calculo.dd2dms(event.getLongitude(),event.getLatitude());objposicaocursor={ddx:event.getLongitude(),ddy:event.getLatitude(),dmsx:d[0],dmsy:d[1],imgx:event.getClientX(),imgy:event.getClientY(),telax:event.getClientX()+i3GEO.Interface.googleearth.POSICAOTELA[0],telay:event.getClientY()+i3GEO.Interface.googleearth.POSICAOTELA[1]};i3GEO.eventos.mousemoveMapa()});google.earth.addEventListener(i3GeoMap.getGlobe(),'click',function(event){if(i3GEO.Interface.googleearth.aguarde.visibility==="hidden"){i3GEO.eventos.mousecliqueMapa()}else{i3GEO.Interface.googleearth.aguarde.visibility="hidden"}})},recalcPar:function(){var bounds;bounds=i3GeoMap.getView().getViewportGlobeBounds();i3GEO.parametros.mapexten=bounds.getWest()+" "+bounds.getSouth()+" "+bounds.getEast()+" "+bounds.getNorth()},falha:function(){alert("Falhou. Vc precisa do plugin instalado")},ativaBotoes:function(){var cabecalho=function(){i3GEO.barraDeBotoes.ativaIcone("")},minimiza=function(){i3GEO.janela.minimiza("i3GEOF.ferramentasGE")},janela=i3GEO.janela.cria("230px","110px","","","",$trad("u15a"),"i3GEOF.ferramentasGE",false,"hd",cabecalho,minimiza);$i("i3GEOF.ferramentasGE_c").style.zIndex=100;i3GEO.barraDeBotoes.TEMPLATEBOTAO='<div style="display:inline;background-color:rgb(250,250,250);"><img src="'+i3GEO.configura.locaplic+'/imagens/branco.gif" id="$$"/></div> ';i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id);i3GEO.barraDeBotoes.ativaBotoes();i3GEO.Interface.googleearth.aguarde=$i("i3GEOF.ferramentasGE_imagemCabecalho").style;$i("i3GEOF.ferramentasGE_minimizaCabecalho").style.right="0px";$i("i3GEOF.ferramentasGE").lastChild.style.display="none";i3GEO.ajuda.abreJanela()},balao:function(texto,completo,ddx,ddy){var placemark=i3GeoMap.createPlacemark(''),point=i3GeoMap.createPoint(''),b;point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);b=i3GeoMap.createHtmlStringBalloon('');b.setContentString("<div style=text-align:left >"+texto+"</div>");b.setFeature(placemark);i3GeoMap.setBalloon(b)},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=false}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);linki3geokml=i3GeoMap.createLink('');if(url.split("http").length===1){url=i3GEO.util.protocolo()+"://"+window.location.host+url}linki3geokml.setHref(url);eval(ngeoxml+" = i3GeoMap.createNetworkLink('')");eval(ngeoxml+".setLink(linki3geokml)");if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===false){i3GEO.arvoreDeCamadas.MOSTRALISTAKML=true;i3GEO.Interface.googleearth.criaArvoreKML()}i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googleearth.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}node=i3GEO.Interface.googleearth.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googleearth.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googleearth.ARVORE.draw();i3GEO.Interface.googleearth.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{return}}i3GEO.Interface.googleearth.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googleearth.ARVORE.getRoot();titulo="<table><tr><td><b>Google Earth Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false;if(i3GEO.parametros.editor==="sim"){d=new YAHOO.widget.HTMLNode({html:"<a style='color:red' title='opção visível apenas para editores' href='../admin/html/webservices.html' target=blank >Editar cadastro</a>",idmenu:"",enableHighlight:false,expanded:false},node)}},existeLink:function(url){var existe=false,features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()===url){existe=true}}catch(e){}}return(existe)},ativaDesativaLink:function(url,valor){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()===url){features.getChildNodes().item(i).setVisibility(valor)}}catch(e){}}},ativaDesativaCamadaKml:function(obj){var url=eval(obj.value+".getLink().getHref()"),existe=i3GEO.Interface.googleearth.existeLink(url);if(!obj.checked){i3GEO.Interface.googleearth.ativaDesativaLink(url,false)}else{if(existe===false){eval("i3GeoMap.getFeatures().appendChild("+obj.value+")")}else{i3GEO.Interface.googleearth.ativaDesativaLink(url,true)}}},zoom2extent:function(mapexten){var r=6378700,lng2,lng1,lat1,lat2,ret=mapexten.split(" "),fov=32,camera=i3GeoMap.getView().copyAsCamera(i3GeoMap.ALTITUDE_RELATIVE_TO_GROUND),dy,dx,d,dist,alt;lng2=(ret[0]*1);lng1=(ret[2]*1);lat1=(ret[1]*1);lat2=(ret[3]*1);camera.setLatitude((lat1+lat2)/2.0);camera.setLongitude((lng1+lng2)/2.0);camera.setHeading(0.0);camera.setTilt(0.0);dy=Math.max(lat1,lat2)-Math.min(lat1,lat2);dx=Math.max(lng1,lng2)-Math.min(lng1,lng2);d=Math.max(dy,dx);d=d*Math.PI/180.0;dist=r*Math.tan(d/2);alt=dist/(Math.tan(fov*Math.PI/180.0));if(alt<0){alt=alt*-1}camera.setAltitude(alt);i3GeoMap.getView().setAbstractView(camera)},alteraParametroLayers:function(parametro,valor){parametro=parametro.toUpperCase();var reg=new RegExp(parametro+"([=])+([a-zA-Z0-9_]*)");i3GEO.Interface.googleearth.PARAMETROSLAYER=i3GEO.Interface.googleearth.PARAMETROSLAYER.replace(reg,"");i3GEO.Interface.googleearth.PARAMETROSLAYER+="&"+parametro+"="+valor;i3GEO.Interface.googleearth.redesenha()}}}; |
235 | 235 | // |
236 | 236 | //compactados/classe_mapa_compacto.js |
237 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",AUTORESIZE:false,RESOLUCAOTIP:8,GEOXML:[],insereDobraPagina:function(tipo,imagem){if(i3GEO.parametros.w<700){return}var novoel=$i("i3GEOdobraPagina");if(!novoel){novoel=document.createElement("img")}novoel.src=imagem;novoel.id="i3GEOdobraPagina";if(tipo==="googlemaps"){novoel.onclick=function(evt){i3GEO.Interface.atual2gm.inicia()}}if(tipo==="openlayers"){novoel.onclick=function(evt){if(i3GEO.Interface.ATUAL==="googlemaps"&&i3GeoMap.getStreetView().getVisible()===true){i3GeoMap.getStreetView().setVisible(false)}else{i3GEO.Interface.atual2ol.inicia()}}}novoel.style.cursor="pointer";novoel.style.position="absolute";novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.zIndex="5000000";novoel.style.left=i3GEO.parametros.w-35+"px";$i(i3GEO.Interface.IDMAPA).appendChild(novoel);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.stopPropagation);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.preventDefault)},reposicionaDobraPagina:function(){var novoel=$i("i3GEOdobraPagina");if(!novoel){return}novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.left=i3GEO.parametros.w-35+"px"},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=YAHOO.util.Dom.getViewportWidth();Dh=YAHOO.util.Dom.getViewportHeight();i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.barraDeBotoes.recria("i3geo_barra2");if(i3GEO.Interface.TABLET===true){i3GEO.guias.escondeGuias();return}if(i3GEO.guias.TIPO==="movel"){i3GEO.guias.guiaMovel.reposiciona();i3GEO.guias.guiaMovel.abreFecha("fecha")}else{i3GEO.guias.ajustaAltura()}i3GEO.mapa.reposicionaDobraPagina();ativo=true},2000)}ativo=false}},ajustaPosicao:function(elemento){if(arguments.length===0){return}var imagemxi=0,imagemyi=0,dc=$i(elemento),c;if(!dc){return}try{while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi+=dc.offsetLeft;imagemyi+=dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi)}i3GEO.util.$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){if(codigo){if(codigo===""){return}if(i3GEO.temaAtivo!==""){i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","")}i3GEO.temaAtivo=codigo;i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown")}},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert($trad("x21"));return}i3GEO.php.ativalogo(i3GEO.atualiza);var cr=$i("i3GEOcopyright");if(cr){if(cr.style.display==="block"){cr.style.display="none"}else{cr.style.display="block"}}},verifica:function(retorno){try{if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},compactaLayerGrafico:function(){var geos=false,geometrias=[],n=0,i,g;if(i3GEO.editorOL&&i3GEO.desenho.layergrafico&&i3GEO.desenho.layergrafico.features){geos=i3GEO.desenho.layergrafico.features;n=geos.length;for(i=0;i<n;i++){g={"atributos":geos[i].attributes,"geometria":geos[i].geometry.toString()};geometrias.push(g)}}g=YAHOO.lang.JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=YAHOO.lang.JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.barraDeBotoes.editor[i3GEO.Interface.ATUAL].ativaPainel();var n=geometrias.length,i;for(i=0;i<n;i++){i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos)}i3GEO.editorOL.sobeLayersGraficos()};if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/classesjs/compactados/classe_editorol_compacto.js",inicia,"editorol.js",true)}}},restauraGraficos:function(graficos){if(graficos.length>0){var inicia=function(){i3GEOF.graficointerativo1.restauraGraficos(graficos)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",inicia,"graficointerativo1",true)}},restauraTabelas:function(tabelas){if(tabelas.length>0){var inicia=function(){i3GEOF.tabela.restauraTabelas(tabelas)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/tabela/dependencias.php",inicia,"tabela",true)}},aplicaPreferencias:function(cookies){var props,nprops,i,temp=[],pint;if(!cookies){cookies=i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo")}if(cookies){props=cookies.split("::");nprops=props.length;for(i=0;i<nprops;i++){try{temp=props[i].split("|");pint=parseInt(temp[1],10);if(temp[1]==='true'||temp[1]==='false'){if(temp[1]==='true'){temp[1]=true}if(temp[1]==='false'){temp[1]=false}eval(temp[0]+" = "+temp[1]+";")}else if(pint+"px"==temp[1]){eval(temp[0]+" = '"+temp[1]+"';")}else if(YAHOO.lang.isNumber(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}if(temp[0]=="i3GEO.configura.mapaRefDisplay"){i3GEO.util.insereCookie("i3GEO.configura.mapaRefDisplay",temp[1])}}catch(e){}}}},legendaHTML:{incluiBotaoLibera:false,ID:"",CAMADASSEMLEGENDA:[],cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var idleg=$i("wlegenda_corpo"),temp=function(retorno){var legenda="",ins,re,desativar,tema="",classe="",b;re=new RegExp();if(retorno.data!=="erro"&&retorno.data!==undefined){re=new RegExp("legendack_","g");retorno.data.legenda=retorno.data.legenda.replace(re,"liblegendack_");legenda="<div class='botoesLegendaFlutuante'>"+"<input type='button' value='"+$trad("mostraTodosLegenda")+"' id='legendaMostraTodos' />"+"<input type='button' value='"+$trad("mostraSoLegenda")+"' id='legendaMostraSo' />"+"<input type='button' value='PNG' id='legendaExpImagem' />"+"</div>"+"<div id='i3GEOconteudoLegenda' class='i3GEOconteudoLegendaClass' style='width:100%;height:100%;'><div>"+retorno.data.legenda+"</div>"}if(legenda!=""&&idleg){ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+='<div style="cursor: pointer; text-align: left; font-size: 10px; display: block; height: 35px;" onclick="i3GEO.mapa.legendaHTML.libera()"><img id="soltaLeg" src="../imagens/branco.gif" title="clique para liberar" style="margin: 5px; position: relative;"> <p style="position: relative; left: -35px; top: -22px;">'+$trad("x11")+'</p></div>'}re=new RegExp("<img src='' />","g");legenda=legenda.replace(re,"");ins+="<div id='corpoLegi' >"+legenda+"</div>";idleg.innerHTML="<div style='padding:5px;' >"+ins+"</div>";if($i("legendaMostraTodos")){b=new YAHOO.widget.Button("legendaMostraTodos",{onclick:{fn:function(){i3GEO.mapa.legendaHTML.mostraTodosOsTemas()}}});b.addClass("legendaMostraTodosTemas");b=new YAHOO.widget.Button("legendaMostraSo",{onclick:{fn:function(){var n,i,temp,raiz=$i("corpoLegi").parentNode;temp=raiz.getElementsByClassName("i3GEOLegendaExcluiTema");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}temp=raiz.getElementsByTagName("input");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}}}});b.addClass("legendaMostraSoTemas");b=new YAHOO.widget.Button("legendaExpImagem",{onclick:{fn:function(){var obj=$i("i3GEOconteudoLegenda");obj.style.width=$i("wlegenda").style.width;obj.style.height=$i("wlegenda_corpo").style.height;i3GEO.mapa.dialogo.html2canvas(obj)}}});b.addClass("legendaExpImagemPng")}}i3GEO.mapa.legendaHTML.escondeTemasMarcados();desativar=retorno.data.desativar;for(tema in desativar){for(classe in desativar[tema]){ins=$i("liblegendack_"+tema+"_"+desativar[tema][classe]);if(ins){ins.checked=false}}}};if(idleg&&idleg.style.display==="block"){if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg){idleg.innerHTML=""}}i3GEO.mapa.legendaHTML.obtem(temp)}else{if(idleg){idleg.innerHTML=""}if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg&&idleg.style.display==="block"){i3GEO.mapa.legendaHTML.obtem(temp)}}}},obtem:function(funcao){i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda)},ativaDesativaTema:function(inputbox){var temp=function(){i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem);i3GEO.arvoreDeCamadas.atualiza("");i3GEO.janela.fechaAguarde("redesenha")};if(!inputbox.checked){i3GEO.php.ligatemas(temp,inputbox.value,"")}else{i3GEO.php.ligatemas(temp,"",inputbox.value)}},escondeTema:function(tema){var d=$i("legendaLayer_"+tema);if(d){d.style.display="none";i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA.push(tema)}},escondeTemasMarcados:function(){var temas=i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA,n=temas.length,i,temp;for(i=0;i<n;i++){temp=$i(temas[i]);if(temp){temp.style.display="none"}}},mostraTodosOsTemas:function(){i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA=[];i3GEO.mapa.legendaHTML.atualiza()},libera:function(ck,largura,altura,topo,esquerda){if(!ck){ck="nao"}if(!largura){largura=340}if(!altura){altura=300}var cabecalho,minimiza,janela,titulo;i3GEO.util.removeChild("corpoLegi");i3GEO.util.defineValor(i3GEO.mapa.legendaHTML.ID,"innerHTML","");janela=YAHOO.i3GEO.janela.manager.find("wlegenda");if(janela){i3GEO.janela.destroi("wlegenda")}cabecalho=function(){};minimiza=function(){var t=i3GEO.janela.minimiza("wlegenda","100px");if(t==="min"){$i("legendaTituloI").style.display="none"}else{$i("legendaTituloI").style.display="block"}};titulo="<span class='i3GEOiconeFerramenta i3GEOiconeLegenda' title='"+$trad("P3")+"'></span>"+"<div class='i3GeoTituloJanela' id='legendaTituloI'>"+$trad("p3")+"</div>";janela=i3GEO.janela.cria(largura+"px",altura+"px","","","",titulo,"wlegenda",false,"hd",cabecalho,minimiza,"","","","","nao");$i("wlegenda_corpo").style.backgroundColor="white";i3GEO.mapa.legendaHTML.ID="wlegenda_corpo";i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza();if(topo&&esquerda){janela=YAHOO.i3GEO.janela.manager.find("wlegenda");janela.moveTo(esquerda,topo)}}},dialogo:{listaLayersWms:function(servico){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwms/listalayers.php?servico="+servico,"","","<div class='i3GeoTituloJanela'>"+$trad("a4")+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=28' ><b> </b></a></div>","i3GEO.conectarwms",false,"hd","","","",true)},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.iniciaJanelaFlutuante()")},ferramentas:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.ferramentas()","atalhosmapa","atalhosmapa","dependencias.php","i3GEOF.atalhosmapa.iniciaJanelaFlutuante()")},html2canvas:function(obj){var temp=function(){i3GEOF.html2canvas.iniciaJanelaFlutuante(obj)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.html2canvas()","html2canvas","html2canvas","dependencias.php",temp)},wkt2layer:function(wkt,texto){var temp=function(){i3GEOF.wkt2layer.iniciaJanelaFlutuante(wkt,texto)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wkt2layer()","wkt2layer","wkt2layer","dependencias.php",temp)},atalhosedicao:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.atalhosedicao()","atalhosedicao","atalhosedicao","dependencias.php","i3GEOF.atalhosedicao.iniciaJanelaFlutuante()")},geolocal:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal","dependencias.php","i3GEOF.geolocal.iniciaJanelaFlutuante()")},listaDeMapasBanco:function(idonde){if(idonde){i3GEO.guias.CONFIGURA["mapas"].click.call(this,idonde);return}if(i3GEO.guias.CONFIGURA["mapas"]){var janela,divid;if($i("i3GEOFsalvaMapaLista")){return}janela=i3GEO.janela.cria("600px","350px","","","","","i3GEOFsalvaMapaLista",false,"hd");divid=janela[2].id;i3GEO.guias.CONFIGURA["mapas"].click.call(this,divid)}else{window.open(i3GEO.configura.locaplic+"/admin/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=YAHOO.util.Dom.generateId(),cabecalho=function(){},titulo,minimiza=function(){i3GEO.janela.minimiza(idjanela)};if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){url=i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<div class='i3GeoTituloJanela'><span class='i3GEOiconeFerramenta i3GEOiconeCongela'></span>"+"Mapa"+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=123' ><b> </b></a></div>";i3GEO.janela.cria("500px","350px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza)}},metaestat:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;i3GEOF.metaestat.comum.iniciaDicionario(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js",temp)},metaestatListaMapas:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()")},preferencias:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias")},locregiao:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.locregiao.iniciaDicionario(largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js",temp)},filtraregiao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa")},telaRemota:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.telaremota()","telaremota","telaremota")},t3d:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d")},imprimir:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir","dependencias.php","i3GEOF.imprimir.iniciaJanelaFlutuante()")},mostraExten:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten","dependencias.php","i3GEOF.mostraExten.iniciaJanelaFlutuante()")},outputformat:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat","dependencias.php","i3GEOF.outputformat.iniciaJanelaFlutuante()")},autoredesenha:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo","dependencias.php","i3GEOF.opcoesTempo.iniciaJanelaFlutuante()")},salvaMapa:function(){if(i3GEO.parametros===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa","dependencias.php","i3GEOF.salvaMapa.iniciaJanelaFlutuante()")},carregaMapa:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.carregaMapa()","carregamapa","carregaMapa","dependencias.php","i3GEOF.carregaMapa.iniciaJanelaFlutuante()")},convertews:function(){if(i3GEO.parametros.mapfile===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml","dependencias.php","i3GEOF.converteMapaKml.iniciaJanelaFlutuante()")},queryMap:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery","dependencias.php","i3GEOF.opcoesQuery.iniciaJanelaFlutuante()")},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","<div class='i3GeoTituloJanela'>Template<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' ><b> </b></a></div>")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho","dependencias.php","i3GEOF.opcoesTamanho.iniciaJanelaFlutuante()")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem","dependencias.php","i3GEOF.tipoimagem.iniciaJanelaFlutuante()")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo","dependencias.php","i3GEOF.opcoesFundo.iniciaJanelaFlutuante()")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala","dependencias.php","i3GEOF.opcoesEscala.iniciaJanelaFlutuante()")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda","dependencias.php","i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord","dependencias.php","i3GEOF.gradeCoord.iniciaJanelaFlutuante()")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt","dependencias.php","i3GEOF.inseretxt.iniciaJanelaFlutuante()")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy","dependencias.php","i3GEOF.inserexy.iniciaJanelaFlutuante()")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico","dependencias.php","i3GEOF.insereGrafico.iniciaJanelaFlutuante()")},cliqueIdentificaDefault:function(x,y){if(objposicaocursor.imgx<70){return}if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identifica"&&i3GEO.eventos.cliquePerm.ativo===false){return}i3GEO.eventos.removeEventos("MOUSEPARADO",["verificaTip()"]);if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php",temp=function(){if(x){i3GEOF.identifica.criaJanelaFlutuante(x,y)}else{i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy)}};i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{if(x){i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y)}else{i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy)}return}},verificaTipDefault:function(e){if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identificaBalao"&&i3GEO.eventos.cliquePerm.ativo===false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}var ntemas,etiquetas,j,retorna,x=objposicaocursor.ddx,y=objposicaocursor.ddy;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.aguarde.visibility="visible"}retorna=function(retorno){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",classeCor,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,tipotip=configura.tipotip;i3GEO.eventos.cliquePerm.status=true;mostra=false;retorno=retorno.data;if(retorno!==""){res="";temas=retorno;if(!temas){return}ntemas=temas.length;for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;if(tipotip!="simples"){titulo="<span class='toolTipBalaoTitulo'><b>"+titulo+"</b></span><br>"}else{titulo=""}tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempCompleto="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;classeCor="toolTipBalaoTexto";for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='"+classeCor+"'>";textoTempSimples+="<div class='"+classeCor+"'>";for(r=0;r<ntips;r+=1){try{temp="";var alias=ds[s][tips[r]].alias;var valor=ds[s][tips[r]].valor;var link=ds[s][tips[r]].link;var img=ds[s][tips[r]].img;if(valor!==""&&link===""){temp+="<span>"+alias+" :"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span>"+alias+" : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(tipotip!="completo"&&ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}if(classeCor==="toolTipBalaoTexto"){classeCor="toolTipBalaoTexto1"}else{classeCor="toolTipBalaoTexto"}textoTempCompleto+="</div>";textoTempSimples+="</div>"}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(tipotip!="simples"){res=textoSimples}else{res=textoCompleto}if(tipotip==="balao"){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y)}else{n=$i(tipotip);if(!n){n=i3GEO.janela.tip();n=$i(n);n.style.textAlign="left";n.innerHTML+=res}else{n.innerHTML=textoSimples}}}}if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).title="";temp="identifica";i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic)}};i3GEO.php.identifica3(retorna,x,y,i3GEO.mapa.RESOLUCAOTIP,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten)}}}; | |
237 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",AUTORESIZE:false,RESOLUCAOTIP:8,GEOXML:[],insereDobraPagina:function(tipo,imagem){if(i3GEO.parametros.w<700){return}var novoel=$i("i3GEOdobraPagina");if(!novoel){novoel=document.createElement("img")}novoel.src=imagem;novoel.id="i3GEOdobraPagina";if(tipo==="googlemaps"){novoel.onclick=function(evt){i3GEO.Interface.atual2gm.inicia()}}if(tipo==="openlayers"){novoel.onclick=function(evt){if(i3GEO.Interface.ATUAL==="googlemaps"&&i3GeoMap.getStreetView().getVisible()===true){i3GeoMap.getStreetView().setVisible(false)}else{i3GEO.Interface.atual2ol.inicia()}}}novoel.style.cursor="pointer";novoel.style.position="absolute";novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.zIndex="5000000";novoel.style.left=i3GEO.parametros.w-35+"px";$i(i3GEO.Interface.IDMAPA).appendChild(novoel);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.stopPropagation);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.preventDefault)},reposicionaDobraPagina:function(){var novoel=$i("i3GEOdobraPagina");if(!novoel){return}novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.left=i3GEO.parametros.w-35+"px"},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=YAHOO.util.Dom.getViewportWidth();Dh=YAHOO.util.Dom.getViewportHeight();i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.barraDeBotoes.recria("i3geo_barra2");if(i3GEO.Interface.TABLET===true){i3GEO.guias.escondeGuias();return}if(i3GEO.guias.TIPO==="movel"){i3GEO.guias.guiaMovel.reposiciona();i3GEO.guias.guiaMovel.abreFecha("fecha")}else{i3GEO.guias.ajustaAltura()}i3GEO.mapa.reposicionaDobraPagina();ativo=true},2000)}ativo=false}},ajustaPosicao:function(elemento){if(arguments.length===0){return}var imagemxi=0,imagemyi=0,dc=$i(elemento),c;if(!dc){return}try{while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi+=dc.offsetLeft;imagemyi+=dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi)}i3GEO.util.$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){if(codigo){if(codigo===""){return}if(i3GEO.temaAtivo!==""){i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","")}i3GEO.temaAtivo=codigo;i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown")}},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert($trad("x21"));return}i3GEO.php.ativalogo(i3GEO.atualiza);var cr=$i("i3GEOcopyright");if(cr){if(cr.style.display==="block"){cr.style.display="none"}else{cr.style.display="block"}}},verifica:function(retorno){try{if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},compactaLayerGrafico:function(){var geos=false,geometrias=[],n=0,i,g;if(i3GEO.editorOL&&i3GEO.desenho.layergrafico&&i3GEO.desenho.layergrafico.features){geos=i3GEO.desenho.layergrafico.features;n=geos.length;for(i=0;i<n;i++){g={"atributos":geos[i].attributes,"geometria":geos[i].geometry.toString()};geometrias.push(g)}}g=YAHOO.lang.JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=YAHOO.lang.JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.barraDeBotoes.editor[i3GEO.Interface.ATUAL].ativaPainel();var n=geometrias.length,i;for(i=0;i<n;i++){i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos)}i3GEO.editorOL.sobeLayersGraficos()};if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/classesjs/compactados/classe_editorol_compacto.js",inicia,"editorol.js",true)}}},restauraGraficos:function(graficos){if(graficos.length>0){var inicia=function(){i3GEOF.graficointerativo1.restauraGraficos(graficos)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",inicia,"graficointerativo1",true)}},restauraTabelas:function(tabelas){if(tabelas.length>0){var inicia=function(){i3GEOF.tabela.restauraTabelas(tabelas)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/tabela/dependencias.php",inicia,"tabela",true)}},aplicaPreferencias:function(cookies){var props,nprops,i,temp=[],pint;if(!cookies){cookies=i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo")}if(cookies){props=cookies.split("::");nprops=props.length;for(i=0;i<nprops;i++){try{temp=props[i].split("|");pint=parseInt(temp[1],10);if(temp[1]==='true'||temp[1]==='false'){if(temp[1]==='true'){temp[1]=true}if(temp[1]==='false'){temp[1]=false}eval(temp[0]+" = "+temp[1]+";")}else if(pint+"px"==temp[1]){eval(temp[0]+" = '"+temp[1]+"';")}else if(YAHOO.lang.isNumber(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}if(temp[0]=="i3GEO.configura.mapaRefDisplay"){i3GEO.util.insereCookie("i3GEO.configura.mapaRefDisplay",temp[1])}}catch(e){}}}},legendaHTML:{incluiBotaoLibera:false,ID:"",CAMADASSEMLEGENDA:[],POSICAO:"",cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var idleg=$i("wlegenda_corpo"),temp=function(retorno){var legenda="",ins,re,desativar,tema="",classe="",b;re=new RegExp();if(retorno.data!=="erro"&&retorno.data!==undefined){re=new RegExp("legendack_","g");retorno.data.legenda=retorno.data.legenda.replace(re,"liblegendack_");legenda="<div class='botoesLegendaFlutuante'>"+"<input type='button' value='"+$trad("mostraTodosLegenda")+"' id='legendaMostraTodos' />"+"<input type='button' value='"+$trad("mostraSoLegenda")+"' id='legendaMostraSo' />"+"<input type='button' value='PNG' id='legendaExpImagem' />"+"</div>"+"<div id='i3GEOconteudoLegenda' class='i3GEOconteudoLegendaClass' style='width:100%;height:100%;'><div>"+retorno.data.legenda+"</div>"}if(legenda!=""&&idleg){ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+='<div style="cursor: pointer; text-align: left; font-size: 10px; display: block; height: 35px;" onclick="i3GEO.mapa.legendaHTML.libera()"><img id="soltaLeg" src="../imagens/branco.gif" title="clique para liberar" style="margin: 5px; position: relative;"> <p style="position: relative; left: -35px; top: -22px;">'+$trad("x11")+'</p></div>'}re=new RegExp("<img src='' />","g");legenda=legenda.replace(re,"");ins+="<div id='corpoLegi' >"+legenda+"</div>";idleg.innerHTML="<div style='padding:5px;' >"+ins+"</div>";if($i("legendaMostraTodos")){b=new YAHOO.widget.Button("legendaMostraTodos",{onclick:{fn:function(){i3GEO.mapa.legendaHTML.mostraTodosOsTemas()}}});b.addClass("legendaMostraTodosTemas");b=new YAHOO.widget.Button("legendaMostraSo",{onclick:{fn:function(){var n,i,temp,raiz=$i("corpoLegi").parentNode;temp=raiz.getElementsByClassName("i3GEOLegendaExcluiTema");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}temp=raiz.getElementsByTagName("input");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}}}});b.addClass("legendaMostraSoTemas");b=new YAHOO.widget.Button("legendaExpImagem",{onclick:{fn:function(){var obj=$i("i3GEOconteudoLegenda");obj.style.width=$i("wlegenda").style.width;obj.style.height=$i("wlegenda_corpo").style.height;i3GEO.mapa.dialogo.html2canvas(obj)}}});b.addClass("legendaExpImagemPng")}}i3GEO.mapa.legendaHTML.escondeTemasMarcados();desativar=retorno.data.desativar;for(tema in desativar){for(classe in desativar[tema]){ins=$i("liblegendack_"+tema+"_"+desativar[tema][classe]);if(ins){ins.checked=false}}}};if(idleg&&idleg.style.display==="block"){if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg){idleg.innerHTML=""}}i3GEO.mapa.legendaHTML.obtem(temp)}else{if(idleg){idleg.innerHTML=""}if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg&&idleg.style.display==="block"){i3GEO.mapa.legendaHTML.obtem(temp)}}}},obtem:function(funcao){i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda)},ativaDesativaTema:function(inputbox){var temp=function(){i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem);i3GEO.arvoreDeCamadas.atualiza("");i3GEO.janela.fechaAguarde("redesenha")};if(!inputbox.checked){i3GEO.php.ligatemas(temp,inputbox.value,"")}else{i3GEO.php.ligatemas(temp,"",inputbox.value)}},escondeTema:function(tema){var d=$i("legendaLayer_"+tema);if(d){d.style.display="none";i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA.push(tema)}},escondeTemasMarcados:function(){var temas=i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA,n=temas.length,i,temp;for(i=0;i<n;i++){temp=$i(temas[i]);if(temp){temp.style.display="none"}}},mostraTodosOsTemas:function(){i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA=[];i3GEO.mapa.legendaHTML.atualiza()},libera:function(ck,largura,altura,topo,esquerda){if(!ck){ck="nao"}if(!largura){largura=340}if(!altura){altura=300}var cabecalho,minimiza,janela,titulo;if(i3GEO.mapa.legendaHTML.POSICAO!=""){topo=i3GEO.mapa.legendaHTML.POSICAO[1];esquerda=i3GEO.mapa.legendaHTML.POSICAO[0]}i3GEO.util.removeChild("corpoLegi");i3GEO.util.defineValor(i3GEO.mapa.legendaHTML.ID,"innerHTML","");janela=YAHOO.i3GEO.janela.manager.find("wlegenda");if(janela){i3GEO.janela.destroi("wlegenda")}cabecalho=function(){};minimiza=function(){var t=i3GEO.janela.minimiza("wlegenda","100px");if(t==="min"){$i("legendaTituloI").style.display="none"}else{$i("legendaTituloI").style.display="block"}};titulo="<span class='i3GEOiconeFerramenta i3GEOiconeLegenda' title='"+$trad("P3")+"'></span>"+"<div class='i3GeoTituloJanela' id='legendaTituloI'>"+$trad("p3")+"</div>";janela=i3GEO.janela.cria(largura+"px",altura+"px","","","",titulo,"wlegenda",false,"hd",cabecalho,minimiza,"","","","","nao");$i("wlegenda_corpo").style.backgroundColor="white";i3GEO.mapa.legendaHTML.ID="wlegenda_corpo";i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);janela[0].moveEvent.subscribe(function(o,p){i3GEO.mapa.legendaHTML.POSICAO=p[0]});i3GEO.mapa.legendaHTML.atualiza();if(topo&&esquerda){janela=YAHOO.i3GEO.janela.manager.find("wlegenda");janela.moveTo(esquerda,topo)}}},dialogo:{listaLayersWms:function(servico){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwms/listalayers.php?servico="+servico,"","","<div class='i3GeoTituloJanela'>"+$trad("a4")+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=28' ><b> </b></a></div>","i3GEO.conectarwms",false,"hd","","","",true)},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.iniciaJanelaFlutuante()")},ferramentas:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.ferramentas()","atalhosmapa","atalhosmapa","dependencias.php","i3GEOF.atalhosmapa.iniciaJanelaFlutuante()")},html2canvas:function(obj){var temp=function(){i3GEOF.html2canvas.iniciaJanelaFlutuante(obj)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.html2canvas()","html2canvas","html2canvas","dependencias.php",temp)},wkt2layer:function(wkt,texto){var temp=function(){i3GEOF.wkt2layer.iniciaJanelaFlutuante(wkt,texto)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wkt2layer()","wkt2layer","wkt2layer","dependencias.php",temp)},atalhosedicao:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.atalhosedicao()","atalhosedicao","atalhosedicao","dependencias.php","i3GEOF.atalhosedicao.iniciaJanelaFlutuante()")},geolocal:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal","dependencias.php","i3GEOF.geolocal.iniciaJanelaFlutuante()")},listaDeMapasBanco:function(idonde){if(idonde){i3GEO.guias.CONFIGURA["mapas"].click.call(this,idonde);return}if(i3GEO.guias.CONFIGURA["mapas"]){var janela,divid;if($i("i3GEOFsalvaMapaLista")){return}janela=i3GEO.janela.cria("600px","350px","","","","","i3GEOFsalvaMapaLista",false,"hd");divid=janela[2].id;i3GEO.guias.CONFIGURA["mapas"].click.call(this,divid)}else{window.open(i3GEO.configura.locaplic+"/admin/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=YAHOO.util.Dom.generateId(),cabecalho=function(){},titulo,minimiza=function(){i3GEO.janela.minimiza(idjanela)};if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){url=i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<div class='i3GeoTituloJanela'><span class='i3GEOiconeFerramenta i3GEOiconeCongela'></span>"+"Mapa"+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=123' ><b> </b></a></div>";i3GEO.janela.cria("500px","350px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza)}},metaestat:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;i3GEOF.metaestat.comum.iniciaDicionario(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js",temp)},metaestatListaMapas:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()")},preferencias:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias")},locregiao:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.locregiao.iniciaDicionario(largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js",temp)},filtraregiao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa")},telaRemota:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.telaremota()","telaremota","telaremota")},t3d:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d")},imprimir:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir","dependencias.php","i3GEOF.imprimir.iniciaJanelaFlutuante()")},mostraExten:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten","dependencias.php","i3GEOF.mostraExten.iniciaJanelaFlutuante()")},outputformat:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat","dependencias.php","i3GEOF.outputformat.iniciaJanelaFlutuante()")},autoredesenha:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo","dependencias.php","i3GEOF.opcoesTempo.iniciaJanelaFlutuante()")},salvaMapa:function(){if(i3GEO.parametros===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa","dependencias.php","i3GEOF.salvaMapa.iniciaJanelaFlutuante()")},carregaMapa:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.carregaMapa()","carregamapa","carregaMapa","dependencias.php","i3GEOF.carregaMapa.iniciaJanelaFlutuante()")},convertews:function(){if(i3GEO.parametros.mapfile===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml","dependencias.php","i3GEOF.converteMapaKml.iniciaJanelaFlutuante()")},queryMap:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery","dependencias.php","i3GEOF.opcoesQuery.iniciaJanelaFlutuante()")},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","<div class='i3GeoTituloJanela'>Template<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' ><b> </b></a></div>")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho","dependencias.php","i3GEOF.opcoesTamanho.iniciaJanelaFlutuante()")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem","dependencias.php","i3GEOF.tipoimagem.iniciaJanelaFlutuante()")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo","dependencias.php","i3GEOF.opcoesFundo.iniciaJanelaFlutuante()")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala","dependencias.php","i3GEOF.opcoesEscala.iniciaJanelaFlutuante()")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda","dependencias.php","i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord","dependencias.php","i3GEOF.gradeCoord.iniciaJanelaFlutuante()")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt","dependencias.php","i3GEOF.inseretxt.iniciaJanelaFlutuante()")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy","dependencias.php","i3GEOF.inserexy.iniciaJanelaFlutuante()")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico","dependencias.php","i3GEOF.insereGrafico.iniciaJanelaFlutuante()")},cliqueIdentificaDefault:function(x,y){if(objposicaocursor.imgx<70){return}if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identifica"&&i3GEO.eventos.cliquePerm.ativo===false){return}i3GEO.eventos.removeEventos("MOUSEPARADO",["verificaTip()"]);if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php",temp=function(){if(x){i3GEOF.identifica.criaJanelaFlutuante(x,y)}else{i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy)}};i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{if(x){i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y)}else{i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy)}return}},verificaTipDefault:function(e){if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identificaBalao"&&i3GEO.eventos.cliquePerm.ativo===false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}var ntemas,etiquetas,j,retorna,x=objposicaocursor.ddx,y=objposicaocursor.ddy;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.aguarde.visibility="visible"}retorna=function(retorno){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",classeCor,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,tipotip=configura.tipotip;i3GEO.eventos.cliquePerm.status=true;mostra=false;retorno=retorno.data;if(retorno!==""){res="";temas=retorno;if(!temas){return}ntemas=temas.length;for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;if(tipotip!="simples"){titulo="<span class='toolTipBalaoTitulo'><b>"+titulo+"</b></span><br>"}else{titulo=""}tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempCompleto="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;classeCor="toolTipBalaoTexto";for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='"+classeCor+"'>";textoTempSimples+="<div class='"+classeCor+"'>";for(r=0;r<ntips;r+=1){try{temp="";var alias=ds[s][tips[r]].alias;var valor=ds[s][tips[r]].valor;var link=ds[s][tips[r]].link;var img=ds[s][tips[r]].img;if(valor!==""&&link===""){temp+="<span>"+alias+" :"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span>"+alias+" : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(tipotip!="completo"&&ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}if(classeCor==="toolTipBalaoTexto"){classeCor="toolTipBalaoTexto1"}else{classeCor="toolTipBalaoTexto"}textoTempCompleto+="</div>";textoTempSimples+="</div>"}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(tipotip!="simples"){res=textoSimples}else{res=textoCompleto}if(tipotip==="balao"){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y)}else{n=$i(tipotip);if(!n){n=i3GEO.janela.tip();n=$i(n);n.style.textAlign="left";n.innerHTML+=res}else{n.innerHTML=textoSimples}}}}if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).title="";temp="identifica";i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic)}};i3GEO.php.identifica3(retorna,x,y,i3GEO.mapa.RESOLUCAOTIP,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten)}}}; | |
238 | 238 | // |
239 | 239 | //compactados/classe_tema_compacto.js |
240 | 240 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.tema={TEMPORIZADORESID:{},ativaFerramentas:function(camada){if(camada.ferramentas&&camada.ferramentas!=""){var f=camada.ferramentas;if(f.tme&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.animagif(camada.name)}}},exclui:function(tema,confirma){if(confirma&&confirma===true){i3GEO.janela.confirma($trad("removerDoMapa"),300,$trad("x14"),"",function(){i3GEO.tema.exclui(tema)});return}try{try{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}try{var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p)}catch(rr){}var ck=i3GEO.arvoreDeTemas.buscaCheckbox(tema);if(ck){ck.checked=false}}catch(e){}i3GEO.php.excluitema(i3GEO.atualiza,[tema]);i3GEO.mapa.ativaTema("");i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/admin/abrefontemapfile.php?tema="+tema}if(!popup){window.open(link)}else{i3GEO.janela.cria((i3GEO.parametros.w/2)+25+"px",(i3GEO.parametros.h/2)+18+"px",link,"","","<div class='i3GeoTituloJanela'>Metadata</div>","metadata"+tema)}},sobe:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.descetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},zoom:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.limpasel(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,tema)},tema)},mudatransp:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){if($i("tr"+idtema)){valor=$i("tr"+idtema).value}}if(valor!==""){i3GEO.php.mudatransp(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,idtema)},idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x16"))}},invertestatuslegenda:function(idtema){i3GEO.janela.tempoMsg($trad("x17"));i3GEO.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb){i3GEO.mapa.ativaTema(idtema);i3GEO.php.aplicaCorClasseTema(temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)},idtema,idclasse,rgb)},mudanome:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){return}if(valor!==""){i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x18"))}},copia:function(idtema){i3GEO.php.copiatema(i3GEO.atualiza,idtema)},mostralegendajanela:function(idtema,nome,tipoOperacao){if(tipoOperacao==="ativatimer"){mostralegendajanelaTimer=setTimeout("i3GEO.tema.mostralegendajanela('"+idtema+"','"+nome+"','abrejanela')",4000)}if(tipoOperacao==="abrejanela"){try{clearTimeout(mostralegendajanelaTimer)}catch(e){}if(!$i("janelaLegenda"+idtema)){var janela=i3GEO.janela.cria("250px","","","","",nome,"janelaLegenda"+idtema,false);janela[2].style.textAlign="left";janela[2].style.background="white";janela[2].innerHTML=$trad("o1")}i3GEO.php.criaLegendaHTML(function(retorno){$i("janelaLegenda"+idtema+"_corpo").innerHTML=retorno.data.legenda},idtema,"legenda3.htm")}if(tipoOperacao==="desativatimer"){clearTimeout(mostralegendajanelaTimer)}},temporizador:function(idtema,tempo){var t;if(!tempo){if($i("temporizador"+idtema)){tempo=$i("temporizador"+idtema).value}else{tempo=0}}if(tempo!=""&&parseInt(tempo,10)>0){t=function(){if(!$i("arrastar_"+idtema)){delete(i3GEO.tema.TEMPORIZADORESID[idtema]);return}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.tema.TEMPORIZADORESID[idtema]={tempo:tempo,idtemporizador:setInterval(t,parseInt(tempo,10)*1000)}}else{try{window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador);delete(i3GEO.tema.TEMPORIZADORESID[idtema])}catch(e){}}},dialogo:{animagif:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.animagif.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animagif()","animagif","animagif","dependencias.php",temp)},tme:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.tme.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","dependencias.php",temp)},storymap:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.storymap.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.storymap()","storymap","storymap","dependencias.php",temp)},mostraWms:function(tema){i3GEO.janela.mensagemSimples(i3GEO.configura.locaplic+"/ogc.php?tema="+tema,"WMS url")},comentario:function(tema){i3GEO.janela.cria("530px","330px",i3GEO.configura.locaplic+"/ferramentas/comentarios/index.php?tema="+tema+"&g_sid="+i3GEO.configura.sid+"&locaplic="+i3GEO.configura.locaplic,"","","<img src='"+i3GEO.configura.locaplic+"/imagens/player_volta.png' style=cursor:pointer onclick='javascript:history.go(-1)'><span style=position:relative;top:-2px; > "+$trad("x19")+" "+tema+"</span><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a>","comentario"+Math.random())},cortina:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.cortina()","cortina","cortina","dependencias.php","i3GEOF.cortina.iniciaJanelaFlutuante()")},mmscale:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.mmscale()","mmscale","mmscale","dependencias.php","i3GEOF.mmscale.iniciaJanelaFlutuante()")},atalhoscamada:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.atalhoscamada()","atalhoscamada","atalhoscamada","dependencias.php","i3GEOF.atalhoscamada.iniciaJanelaFlutuante()")},abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js","i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}else{i3GEOF.converteKml.criaJanelaFlutuante(tema,tipo)}},salvaMapfile:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.salvaMapfile()","salvamapfile","salvamapfile")},graficotema:function(idtema,propriedades){i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.graficoTema.iniciaJanelaFlutuante(propriedades)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.graficotema()","graficotema","graficoTema","dependencias.php",temp)},toponimia:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.filtro.iniciaJanelaFlutuante(modoCalculadora,idRetorno)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.filtro()","filtro","filtro","dependencias.php",temp)},procuraratrib:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.procuraratrib()","busca","busca","dependencias.php","i3GEOF.busca.iniciaJanelaFlutuante()")},tabela:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.legenda.aposIniciar=function(){i3GEOF.legenda.classe=0;i3GEOF.legenda.estilo=0;i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_'+idtema+"-"+idclasse);i3GEOF.legenda.aposIniciar=function(){}};i3GEOF.legenda.iniciaJanelaFlutuante(idtema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php",temp)},download:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.download()","download","download")},ogcwindow:function(idtema){i3GEO.mapa.ativaTema(idtema);window.open(i3GEO.configura.locaplic+"/ogc.htm?temaOgc="+idtema)},sld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","<div class='i3GeoTituloJanela'>SLD<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' ><b> </b></a></div>")},aplicarsld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.aplicarsld()","aplicarsld","aplicarsld","dependencias.php","i3GEOF.aplicarsld.iniciaJanelaFlutuante()")},editorsql:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql","dependencias.php","i3GEOF.editorsql.iniciaJanelaFlutuante()")},mudanome:function(idtema){i3GEO.mapa.ativaTema(idtema);var temp=function(){var valor=$i("i3GEOjanelaprompt").value;i3GEO.tema.mudanome(idtema,valor)};i3GEO.janela.prompt($trad("novonome"),temp)}}}; | ... | ... |
classesjs/i3geo_tudo_compacto6.js.php
... | ... | @@ -234,7 +234,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.desenho={layergrafico:null,es |
234 | 234 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.Interface={TABLET:false,ALTTABLET:"",OUTPUTFORMAT:"AGG_Q",BARRABOTOESTOP:12,BARRABOTOESLEFT:3,BARRADEZOOMRIGHT:0,BARRADEZOOMTOP:20,BARRADEZOOMLEFT:10,ATUAL:"openlayers",IDCORPO:"corpoMapa",ATIVAMENUCONTEXTO:false,IDMAPA:"",STATUS:{atualizando:[],trocando:false,pan:false},atual2gm:{insereIcone:true,inicia:function(){i3GEO.Interface.STATUS.trocando=true;i3GEO.janela.ESTILOAGUARDE="normal";try{if(google){i3GEO.Interface.atual2gm.initemp()}}catch(e){i3GEO.util.scriptTag("http://www.google.com/jsapi?callback=i3GEO.Interface.atual2gm.loadMaps","","",false)}},loadMaps:function(){google.load("maps","3",{callback:"i3GEO.Interface.atual2gm.initemp",other_params:"sensor=false"})},initemp:function(){var temp=function(){$i(i3GEO.Interface.IDCORPO).innerHTML="";i3GEO.Interface.ATUAL="googlemaps";i3GEO.Interface.cria(i3GEO.parametros.w,i3GEO.parametros.h);i3GEO.Interface.googlemaps.inicia();i3GEO.janela.fechaAguarde("googleMapsAguarde");i3GEO.arvoreDeCamadas.CAMADAS=[];i3GEO.atualiza();if(i3GEO.Interface.atual2gm.insereIcone===true){i3GEO.mapa.insereDobraPagina("openlayers",i3GEO.configura.locaplic+"/imagens/dobraopenlayers.png")}};i3GEO.php.converte2googlemaps(temp)}},atual2ol:{insereIcone:true,inicia:function(){i3GEO.Interface.STATUS.trocando=true;i3GEO.janela.ESTILOAGUARDE="normal";try{if(OpenLayers){i3GEO.Interface.atual2ol.initemp()}}catch(e){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/openlayers/OpenLayers2131.js.php","i3GEO.Interface.atual2ol.initemp()","",false)}},initemp:function(){i3GEO.Interface.openlayers.fundoDefault();var temp=function(){OpenLayers.ImgPath="../pacotes/openlayers/img/";$i(i3GEO.Interface.IDCORPO).innerHTML="";i3GEO.Interface.ATUAL="openlayers";i3GEO.Interface.cria(i3GEO.parametros.w,i3GEO.parametros.h);i3GEO.Interface.openlayers.inicia();i3GEO.janela.fechaAguarde("OpenLayersAguarde");i3GEO.arvoreDeCamadas.CAMADAS=[];i3GEO.atualiza();if(i3GEO.Interface.atual2ol.insereIcone===true){i3GEO.mapa.insereDobraPagina("googlemaps",i3GEO.configura.locaplic+"/imagens/dobragooglemaps.png")}i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten)};i3GEO.php.converte2openlayers(temp)}},aposAdicNovaCamada:function(camada){i3GEO.tema.ativaFerramentas(camada)},redesenha:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].redesenha()},aplicaOpacidade:function(opacidade,layer){i3GEO.Interface[i3GEO.Interface.ATUAL].aplicaOpacidade(opacidade,layer)},atualizaMapa:function(){switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;default:i3GEO.Interface[i3GEO.Interface.ATUAL].redesenha()}},atualizaTema:function(retorno,tema){i3GEO.Interface[i3GEO.Interface.ATUAL].atualizaTema(retorno,tema)},ligaDesliga:function(obj){i3GEO.Interface[i3GEO.Interface.ATUAL].ligaDesliga(obj);if(obj.value&&obj.value!=""){var ck=i3GEO.arvoreDeTemas.buscaCheckbox(obj.value);if(ck){ck.checked=obj.checked}}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.adicionaKml("foo")}},cria:function(w,h){i3GEO.Interface[i3GEO.Interface.ATUAL].cria(w,h)},inicia:function(w,h){var temp=window.location.href.split("?")[0],gadgets=i3GEO.gadgets;if($i("i3GEOcompartilhar")){i3GEO.social.compartilhar("i3GEOcompartilhar",temp,temp,"semtotal")}gadgets.mostraBuscaRapida();gadgets.mostraVersao();gadgets.mostraEmail();i3GEO.guias.cria();if($i("mst")){$i("mst").style.display="block"}i3GEO.navega.autoRedesenho.ativa();i3GEO.util.defineValor("i3geo_escalanum","value",i3GEO.parametros.mapscale);if((i3GEO.parametros.geoip==="nao")&&($i("ondeestou"))){$i("ondeestou").style.display="none"}i3GEO.Interface[i3GEO.Interface.ATUAL].inicia();if($i(i3GEO.login.divnomelogin)&&i3GEO.util.pegaCookie("i3geousuarionome")){$i(i3GEO.login.divnomelogin).innerHTML=i3GEO.util.pegaCookie("i3geousuarionome")}},alteraParametroLayers:function(parametro,valor){i3GEO.Interface[i3GEO.Interface.ATUAL].alteraParametroLayers(parametro,valor)},ativaBotoes:function(){if(i3GEO.Interface.STATUS.trocando===false){if(i3GEO.barraDeBotoes.TIPO==="olhodepeixe"||i3GEO.barraDeBotoes.TIPO==="olhodepeixe1"){i3GEO.barraDeBotoes.inicializaBarra()}else if(i3GEO.barraDeBotoes.TIPO==="yui"){i3GEO.Interface[i3GEO.Interface.ATUAL].ativaBotoes()}}},openlayers:{parametrosMap:{controls:[],resolutions:[0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.000021457672119140625,0.000010728836059570312,0.000005364418029785156,0.000002682209014892578]},FUNDOTEMA:"yellow",TILES:true,BUFFER:0,GADGETS:{PanZoomBar:true,PanZoom:false,LayerSwitcher:true,ScaleLine:true,OverviewMap:false},MINEXTENT:[-0.0003,-0.0003,0.0003,0.0003],MAXEXTENT:[-180,-90,180,90],LAYERSADICIONAIS:[],LAYERFUNDO:"",googleLike:false,BALAOPROP:{removeAoAdicionar:true,classeCadeado:"i3GEOiconeAberto"},balao:function(texto,completo,x,y){var e,b,c,temp,p=i3GEO.Interface.openlayers.BALAOPROP;c="<div class='i3GEOCabecalhoInfoWindow' ></div>";texto=c+texto;b=new OpenLayers.Popup.FramedCloud(null,i3GEO.util.projGeo2OSM(new OpenLayers.LonLat(x,y)),null,texto,null,true);b.maxsize=new OpenLayers.Size(parseInt(i3GEO.parametros.w/2,10),parseInt(i3GEO.parametros.h/2,10));i3geoOL.addPopup(b,p.removeAoAdicionar);e=document.createElement("div");e.className=p.classeCadeado;e.onclick=function(){if(p.classeCadeado==="i3GEOiconeAberto"){p.classeCadeado="i3GEOiconeFechado"}else{p.classeCadeado="i3GEOiconeAberto"}this.className=p.classeCadeado;p.removeAoAdicionar=!p.removeAoAdicionar};temp=$i(b.id).getElementsByClassName("i3GEOCabecalhoInfoWindow")[0];temp.appendChild(e);e=document.createElement("div");e.className="i3GEOiconeFerramentas";e.style.left="3px";e.onclick=function(){i3GEO.janela.prompt($trad("tolerancia"),function(){i3GEO.mapa.RESOLUCAOTIP=$i("i3GEOjanelaprompt").value},i3GEO.mapa.RESOLUCAOTIP)};temp.appendChild(e);e=document.createElement("div");e.className="i3GEOiconeMais";e.style.left="9px";e.onclick=function(){i3GEO.janela.mensagemSimples("<div style='overflow:auto;height:100%'>"+completo+"</div>","")};temp.appendChild(e)},redesenha:function(){var openlayers=i3GEO.Interface.openlayers;openlayers.criaLayers();openlayers.ordenaLayers();openlayers.recalcPar();i3GEO.janela.fechaAguarde();openlayers.sobeLayersGraficos()},fundoDefault:function(){var eng,oce,ims,wsm,bra,tms;eng=new OpenLayers.Layer.ArcGIS93Rest("ESRI National Geographic","http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:true,attribution:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer">ArcGIS</a>'});oce=new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer">ArcGIS</a>'});ims=new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer">ArcGIS</a>'});wsm=new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer">ArcGIS</a>'});bra=new OpenLayers.Layer.WMS("Base carto MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map",{layers:"baseraster",srs:"EPSG:4618",format:"image/png",isBaseLayer:false},{isBaseLayer:true,visibility:false});tms=new OpenLayers.Layer.TMS("OSGEO","http://tilecache.osgeo.org/wms-c/Basic.py/",{layername:"basic",type:"png",tileOrigin:new OpenLayers.LonLat(-180,-90),isBaseLayer:true,visibility:false,attribution:'© <a href="http://www.tilecache.org/">2006-2010, TileCache Contributors</a>'});i3GEO.Interface.openlayers.LAYERSADICIONAIS=[eng,oce,ims,wsm,tms,bra]},cria:function(w,h){var f,ins,temp,j,r,mi=i3GEO.Interface.openlayers.MINEXTENT,ma=i3GEO.Interface.openlayers.MAXEXTENT,i=$i(i3GEO.Interface.IDCORPO),bb=i3GEO.barraDeBotoes;if(typeof(OpenLayers)=='undefined'){return}OpenLayers.DOTS_PER_INCH=i3GEO.util.calculaDPI();OpenLayers._getScriptLocation=function(){return i3GEO.configura.locaplic+"/pacotes/openlayers/"};if(i){f=$i("openlayers");if(!f){ins='<div id=openlayers style="width:0px;height:0px;text-align:left;"></div>';i.innerHTML=ins}f=$i("openlayers");f.style.width=w+"px";f.style.height=h+"px"}i3GEO.Interface.IDMAPA="openlayers";i3GEO.Interface.openlayers.parametrosMap.fractionalZoom=false;if(!i3GEO.Interface.openlayers.parametrosMap.minResolution){i3GEO.Interface.openlayers.parametrosMap.minResolution="auto"}if(!i3GEO.Interface.openlayers.parametrosMap.minExtent){i3GEO.Interface.openlayers.parametrosMap.minExtent=new OpenLayers.Bounds(mi[0],mi[1],mi[2],mi[3])}if(!i3GEO.Interface.openlayers.parametrosMap.maxResolution){i3GEO.Interface.openlayers.parametrosMap.maxResolution="auto"}if(i3GEO.Interface.openlayers.parametrosMap.numZoomLevels){if(i3GEO.Interface.openlayers.parametrosMap.minResolution=="auto"){temp=0.703125}else{temp=i3GEO.Interface.openlayers.parametrosMap.minResolution}r=[temp];for(j=0;j<(i3GEO.Interface.openlayers.parametrosMap.numZoomLevels-1);j++){temp=temp/2;r.push(temp)}i3GEO.Interface.openlayers.parametrosMap.resolutions=r}if(!i3GEO.Interface.openlayers.parametrosMap.maxExtent){i3GEO.Interface.openlayers.parametrosMap.maxExtent=new OpenLayers.Bounds(ma[0],ma[1],ma[2],ma[3])}if(!i3GEO.Interface.openlayers.parametrosMap.allOverlays){i3GEO.Interface.openlayers.parametrosMap.allOverlays=false}if(i3GEO.Interface.TABLET===true){i3GEO.Interface.openlayers.parametrosMap.theme=null;i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.TouchNavigation({dragPanOptions:{interval:100,enableKinetic:true}}));i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.ZoomPanel())}else if(i3GEO.parametros.w>700){bb.INCLUIBOTAO.zoomli=true;bb.INCLUIBOTAO.pan=true;bb.INCLUIBOTAO.zoomtot=true}if(i3GEO.Interface.openlayers.googleLike===true){i3GEO.Interface.openlayers.parametrosMap={numZoomLevels:18,maxResolution:156543.0339,units:'m',projection:new OpenLayers.Projection("EPSG:3857"),displayProjection:new OpenLayers.Projection("EPSG:4326"),fractionalZoom:false}}i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.Attribution());i3geoOL=new OpenLayers.Map('openlayers',i3GEO.Interface.openlayers.parametrosMap)},inicia:function(){if(typeof(OpenLayers)=='undefined'){return}var montaMapa=function(){var pz,temp,layers,i,texto,estilo,layersn,openlayers=i3GEO.Interface.openlayers;i3GEO.util.multiStep([openlayers.registraEventos,openlayers.zoom2ext],[null,[i3GEO.parametros.mapexten]],function(){});if(openlayers.GADGETS.PanZoom===true){pz=new OpenLayers.Control.PanZoom();i3geoOL.addControl(pz);pz.div.style.zIndex=5000}openlayers.criaLayers();temp=$i("listaLayersBase");if(temp&&i3GEO.arvoreDeCamadas.INCLUILFUNDO===false){i3GEO.arvoreDeCamadas.INCLUILFUNDO=false;estilo="cursor:pointer;vertical-align:top;padding-top:5px;";if(navm){estilo="border:0px solid white;cursor:pointer;vertical-align:middle;padding-top:0px;"}temp={"propriedades":[]};layers=i3geoOL.getLayersBy("isBaseLayer",true);layersn=layers.length;for(i=0;i<layersn;i++){texto="<input type=radio style='"+estilo+"' onclick='i3GEO.Interface.openlayers.ativaFundo(this.value)' name=i3GEObaseLayer value='"+layers[i].name+"' />"+layers[i].name;temp.propriedades.push({text:texto,url:""})}i3GEO.util.arvore("<b>"+$trad("p16")+"</b>","listaLayersBase",temp)}else{if(openlayers.GADGETS.LayerSwitcher===true&&i3GEO.arvoreDeCamadas.INCLUILFUNDO===false){i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher())}}if(i3GEO.parametros.h<550){openlayers.GADGETS.PanZoomBar=false;openlayers.GADGETS.ScaleLine=false}if(openlayers.GADGETS.ScaleLine===true){pz=new OpenLayers.Control.ScaleLine();i3geoOL.addControl(pz);pz.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+5+"px"}if(openlayers.GADGETS.OverviewMap===true){i3geoOL.addControl(new OpenLayers.Control.OverviewMap())}if(i3GEO.Interface.TABLET===false){i3GEO.Interface.openlayers.OLpan=new OpenLayers.Control.Navigation();i3GEO.Interface.openlayers.OLzoom=new OpenLayers.Control.ZoomBox();i3GEO.Interface.openlayers.OLpanel=new OpenLayers.Control.Panel();i3GEO.Interface.openlayers.OLpanel.addControls([i3GEO.Interface.openlayers.OLpan,i3GEO.Interface.openlayers.OLzoom]);i3geoOL.addControl(i3GEO.Interface.openlayers.OLpanel)}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"){i3GEO.maparef.inicia()}}if(i3GEO.Interface.TABLET===false&&i3GEO.Interface.openlayers.OLpanel){i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}if(i3GEO.Interface.openlayers.googleLike===true){i3GEO.barraDeBotoes.INCLUIBOTAO.lentei=false}if(openlayers.GADGETS.PanZoomBar===true){i3GEO.Interface.openlayers.OLpanzoombar=new OpenLayers.Control.PanZoomBar();i3geoOL.addControl(i3GEO.Interface.openlayers.OLpanzoombar);i3GEO.Interface.openlayers.OLpanzoombar.div.style.zIndex=5000;i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px";if(i3GEO.Interface.BARRADEZOOMLEFT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}}};if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this);i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS);"}i3GEO.coordenadas.mostraCoordenadas();montaMapa();i3GEO.gadgets.mostraMenuSuspenso();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.idioma.mostraSeletor();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.util.arvore("<b>"+$trad("p13")+"</b>","listaPropriedades",i3GEO.configura.listaDePropriedadesDoMapa);i3GEO.gadgets.mostraMenuLista();i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic);if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===true){i3GEO.Interface.openlayers.adicionaListaKml()}if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.openlayers.adicionaKml(true,i3GEO.parametros.kmlurl)}if($i("mst")){$i("mst").style.visibility="visible"}i3GEO.Interface.ativaBotoes();if(YAHOO.lang.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}i3GEO.configura.iniciaFerramentas.executa();i3GEO.Interface.openlayers.sobeLayersGraficos()},aplicaOpacidade:function(opacidade,layer){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,l,i,camada;if(!layer){layer=""}for(i=nlayers-1;i>=0;i--){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];l=i3geoOL.getLayersByName(camada.name)[0];if(l&&l.isBaseLayer===false){if(layer==""||layer==camada.name){l.setOpacity(opacidade)}}}},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.openlayers.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i;if(!$i("arvoreCamadasKml")){i3GEO.Interface.openlayers.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=true}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===false){i3GEO.arvoreDeCamadas.MOSTRALISTAKML=true;i3GEO.Interface.openlayers.criaArvoreKML()}i3GEO.Interface.openlayers.adicionaNoArvoreKml(url,titulo,ativo,ngeoxml)},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{return}}i3GEO.Interface.openlayers.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.openlayers.ARVORE.getRoot();titulo="<table><tr><td><b>Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false;if(i3GEO.parametros.editor==="sim"){d=new YAHOO.widget.HTMLNode({html:"<a style='color:red' title='opção visível apenas para editores' href='../admin/html/webservices.html' target=blank >Editar cadastro</a>",idmenu:"",enableHighlight:false,expanded:false},node)}},adicionaNoArvoreKml:function(url,nomeOverlay,ativo,id){var node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.openlayers.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}node=i3GEO.Interface.openlayers.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.openlayers.ativaDesativaCamadaKml(this,\""+url+"\")' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";if(navm){estilo="cursor:default;vertical-align:35%;padding-top:0px;"}else{estilo="cursor:default;vertical-align:top;"}html+=" <span style='"+estilo+"'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.openlayers.ARVORE.draw();i3GEO.Interface.openlayers.ARVORE.collapseAll();node.expand();if(ativo===true){i3GEO.Interface.openlayers.insereLayerKml(id,url)}},insereLayerKml:function(id,url){var l,temp;url=i3GEO.configura.locaplic+"/classesphp/proxy.php?url="+url;l=new OpenLayers.Layer.Vector(id,{displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:url,format:new OpenLayers.Format.KML({extractStyles:true,extractAttributes:true,maxDepth:5})})});i3geoOL.addLayer(l);temp=l.div;temp.onclick=function(e){var targ="",id,temp,features,n,i,j="",html="";if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.id){temp=targ.id.split("_Point");if(temp[0]==="OpenLayers_Geometry"){id=targ.id;temp=i3geoOL.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}}},ativaDesativaCamadaKml:function(obj,url){if(!obj.checked){i3geoOL.getLayersByName(obj.value)[0].setVisibility(false)}else{if(!(i3geoOL.getLayersByName(obj.value)[0])){i3GEO.Interface.openlayers.insereLayerKml(obj.value,url)}else{i3geoOL.getLayersByName(obj.value)[0].setVisibility(true)}}},criaLayers:function(){var configura=i3GEO.configura,url=configura.locaplic+"/classesphp/mapa_openlayers.php?g_sid="+i3GEO.configura.sid+"&TIPOIMAGEM="+configura.tipoimagem,nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,layer,camada,urllayer,opcoes,i,n,temp=$i("i3GEOprogressoDiv"),fundoIsBase=true;if(temp){i3GEO.Interface.STATUS.atualizando=[];temp.style.display="none"}if(i3GEO.Interface.openlayers.googleLike===true){url=configura.locaplic+"/classesphp/mapa_googlemaps.php?g_sid="+i3GEO.configura.sid+"&TIPOIMAGEM="+configura.tipoimagem}try{temp=i3GEO.Interface.openlayers.LAYERSADICIONAIS;n=temp.length;for(i=0;i<n;i++){if(temp[i].isBaseLayer===true&&temp[i].visibility===true){fundoIsBase=false}}}catch(e){}if(i3geoOL.getLayersByName("Nenhum").length===0&&fundoIsBase===true){layer=new OpenLayers.Layer.Vector("Nenhum",{displayInLayerSwitcher:true,visibility:false,isBaseLayer:true,singleTile:true});i3geoOL.addLayer(layer);if($i(i3geoOL.id+"_OpenLayers_ViewPort")){$i(i3geoOL.id+"_OpenLayers_ViewPort").style.backgroundColor="rgb("+i3GEO.parametros.cordefundo+")"}}opcoes={gutter:0,isBaseLayer:false,displayInLayerSwitcher:false,opacity:1,visibility:false,singleTile:!(i3GEO.Interface.openlayers.TILES),ratio:1,buffer:i3GEO.Interface.openlayers.BUFFER,wrapDateLine:true,transitionEffect:"resize",eventListeners:{"loadstart":i3GEO.Interface.openlayers.loadStartLayer,"loadend":i3GEO.Interface.openlayers.loadStopLayer}};for(i=nlayers-1;i>=0;i--){layer="";camada=i3GEO.arvoreDeCamadas.CAMADAS[i];opcoes.singleTile=!(i3GEO.Interface.openlayers.TILES);if(camada.exttema&&camada.exttema!=""){opcoes.maxExtent=camada.exttema.split(" ")}else{opcoes.maxExtent=null}if(i3geoOL.getLayersByName(camada.name).length===0&&camada.name.toLowerCase()!="copyright"){if(camada.plugini3geo&&camada.plugini3geo!=""&&camada.plugini3geo.parametros!=undefined){i3GEO.pluginI3geo.inicia(camada);continue}else{if(camada.cache){urllayer=url+"&cache="+camada.cache+"&layer="+camada.name+"&r="+Math.random()}else{urllayer=url+"&cache=&layer="+camada.name+"&r="+Math.random()}try{temp=camada.transitioneffect==="nao"?opcoes.transitionEffect="null":opcoes.transitionEffect="resize";if(i3GEO.Interface.openlayers.googleLike===false&&camada.connectiontype===7&&camada.wmsurl!==""&&camada.usasld.toLowerCase()!="sim"){urllayer=camada.wmsurl+"&r="+Math.random();if(camada.wmstile==1){layer=new OpenLayers.Layer.TMS(camada.name,camada.wmsurl,{isBaseLayer:false,layername:camada.wmsname,type:'png',maxExtent:opcoes.maxExtent})}else{layer=new OpenLayers.Layer.WMS(camada.name,urllayer,{LAYERS:camada.name,format:camada.wmsformat,transparent:true},opcoes)}if(camada.wmssrs!=""&&layer.url){layer.url=layer.url+"&SRS="+camada.wmssrs+"&CRS="+camada.wmssrs}}else{if(camada.tiles==="nao"||camada.escondido.toLowerCase()==="sim"||camada.connectiontype===10||(camada.type===0&&camada.cache==="nao")||camada.type===8){opcoes.singleTile=true}else{temp=camada.type===3?opcoes.singleTile=false:opcoes.singleTile=!(i3GEO.Interface.openlayers.TILES)}if(camada.tiles==="nao"){opcoes.singleTile=true}if(camada.tiles==="sim"||camada.cache==="sim"||(camada.cortepixels&&camada.cortepixels>0)){opcoes.singleTile=false}if(opcoes.singleTile===true){if(i3GEO.Interface.openlayers.googleLike===true){opcoes.projection=new OpenLayers.Projection("EPSG:3857")}layer=new OpenLayers.Layer.WMS(camada.name,urllayer,{LAYERS:camada.name,format:camada.wmsformat,transparent:true},opcoes)}else{if(i3GEO.Interface.openlayers.googleLike===true){layer=new OpenLayers.Layer.OSM(camada.name,urllayer+"&Z=${z}&X=${x}&Y=${y}",{isBaseLayer:false})}else{layer=new OpenLayers.Layer.TMS(camada.name,urllayer,{isBaseLayer:false,serviceVersion:"&tms=",type:"png",layername:camada.name,map_imagetype:i3GEO.Interface.OUTPUTFORMAT,maxExtent:opcoes.maxExtent},opcoes)}}}}catch(e){}}if(layer&&layer!=""){if(camada.escondido.toLowerCase()==="sim"){layer.transitionEffect="null"}i3geoOL.addLayer(layer);i3GEO.Interface.aposAdicNovaCamada(camada)}}else{layer=i3geoOL.getLayersByName(camada.name)[0]}if(layer&&layer!=""){temp=camada.status==0?layer.setVisibility(false):layer.setVisibility(true)}}try{i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS)}catch(e){}if(i3GEO.parametros.copyright!=""&&!$i("i3GEOcopyright")){temp=document.createElement("div");temp.id="i3GEOcopyright";temp.style.display="block";temp.style.top="0px";temp.style.left="0px";temp.style.zIndex=5000;temp.style.position="absolute";temp.innerHTML="<p class=paragrafo >"+i3GEO.parametros.copyright+"</p>";if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).appendChild(temp)}}if(i3GEO.Interface.openlayers.LAYERFUNDO!=""){i3GEO.Interface.openlayers.ativaFundo(i3GEO.Interface.openlayers.LAYERFUNDO)}i3GEO.Interface.openlayers.sobeLayersGraficos()},sobeLayersGraficos:function(){var nlayers=i3geoOL.getNumLayers(),layers=i3geoOL.layers,i;for(i=0;i<nlayers;i++){if(layers[i].CLASS_NAME=="OpenLayers.Layer.Vector"&&layers[i].name!="Nenhum"){i3geoOL.raiseLayer(i3geoOL.layers[i],nlayers)}}},inverteModoTile:function(){if(i3GEO.Interface.openlayers.TILES===true){i3GEO.Interface.openlayers.TILES=false}else{i3GEO.Interface.openlayers.TILES=true}i3GEO.Interface.openlayers.removeTodosOsLayers();i3GEO.Interface.openlayers.criaLayers()},removeTodosOsLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,layer,i,camada;for(i=nlayers-1;i>=0;i--){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];layer=i3geoOL.getLayersByName(camada.name)[0];if(layer){i3geoOL.removeLayer(layer,false);i3GEO.pluginI3geo.removeCamada(camada.name)}}},alteraParametroLayers:function(parametro,valor){var layers=i3geoOL.layers,nlayers=layers.length,i,url,reg;for(i=0;i<nlayers;i+=1){if(layers[i].url){url=layers[i].url;if(url.search("\\?")>0){reg=new RegExp(parametro+"([=])+([a-zA-Z0-9_]*)");layers[i].url=url.replace(reg,"");layers[i].url=layers[i].url+"&"+parametro+"="+valor;layers[i].redraw()}}}},loadStartLayer:function(event){var p=$i("i3GEOprogressoDiv");if($i("ArvoreTituloTema"+event.object.name)){i3GEO.Interface.STATUS.atualizando.push(event.object.name);YAHOO.util.Dom.setStyle("ArvoreTituloTema"+event.object.name,"background",i3GEO.Interface.openlayers.FUNDOTEMA);if(p){p.style.display="block";i3GEO.arvoreDeCamadas.progressBar.set('maxValue',i3GEO.Interface.STATUS.atualizando.length);i3GEO.arvoreDeCamadas.progressBar.set('value',i3GEO.arvoreDeCamadas.progressBar.get('value')-1)}}},loadStopLayer:function(event){var p=$i("i3GEOprogressoDiv");i3GEO.Interface.STATUS.atualizando.remove(event.object.name);if($i("ArvoreTituloTema"+event.object.name)){YAHOO.util.Dom.setStyle("ArvoreTituloTema"+event.object.name,"background","");if(p){p.style.display="block";if(i3GEO.Interface.STATUS.atualizando.length>0){i3GEO.arvoreDeCamadas.progressBar.set('value',i3GEO.arvoreDeCamadas.progressBar.get('value')+1)}else{i3GEO.arvoreDeCamadas.progressBar.set('value',0);p.style.display="none"}}}},ordenaLayers:function(){var ordem=i3GEO.arvoreDeCamadas.CAMADAS,nordem=ordem.length,layer,layers,i,maiorindice;layers=i3geoOL.layers;maiorindice=i3geoOL.getLayerIndex(layers[(layers.length)-1]);for(i=nordem-1;i>=0;i--){layers=i3geoOL.getLayersByName(ordem[i].name);layer=layers[0];if(layer){i3geoOL.setLayerIndex(layer,maiorindice+i)}}i3GEO.Interface.openlayers.sobeLayersGraficos()},sobeDesceLayer:function(tema,tipo){var layer=i3geoOL.getLayersByName(tema)[0],indice;if(layer){indice=i3geoOL.getLayerIndex(layer);if(tipo==="sobe"){i3geoOL.setLayerIndex(layer,indice+1)}else{i3geoOL.setLayerIndex(layer,indice-1)}}i3GEO.Interface.openlayers.sobeLayersGraficos()},ligaDesliga:function(obj){var layers=i3geoOL.getLayersByName(obj.value),desligar="",ligar="",b;if(layers.length>0){layers[0].setVisibility(obj.checked);if(obj.checked===true){layers[0].div.style.display="block";i3GEO.pluginI3geo.ligaCamada(obj.value)}else{layers[0].div.style.display="none";i3GEO.pluginI3geo.desligaCamada(obj.value)}}if(obj.checked){ligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value)}else{desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value)}b=new Image();b.src=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=ligatemasbeacon&desligar="+desligar+"&ligar="+ligar+"&adicionar=nao&g_sid="+i3GEO.configura.sid;b.onerror=function(){i3GEO.mapa.legendaHTML.atualiza()}},ativaFundo:function(nome){var t,temp=i3geoOL.getLayersBy("name",nome),layers,layersn,i,status;if(temp.length>0){i3geoOL.setBaseLayer(temp[0]);if(i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px"}if(i3GEO.Interface.BARRADEZOOMLEFT===0&&i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0&&i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}i3GEO.Interface.openlayers.LAYERFUNDO=nome}else{i3GEO.Interface.openlayers.LAYERFUNDO=""}t=$i("CK"+temp[0].id);if(t){status=true;if(t.checked===false){status=false}layers=i3GEO.Interface.openlayers.LAYERSADICIONAIS;layersn=layers.length;for(i=0;i<layersn;i++){if(layers[i].name!=nome){layers[i].setVisibility(false);$i("CK"+layers[i].id).checked=false}}temp[0].setVisibility(!status);t.checked=!status}},atualizaMapa:function(){var layers=i3geoOL.layers,nlayers=layers.length,i;for(i=0;i<nlayers;i++){if(layers[i].url){layers[i].mergeNewParams({r:Math.random()});if(layers[i].url.search("\\?")>=0){layers[i].url=layers[i].url.replace("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&","&foo=");layers[i].url=layers[i].url+"&&"}layers[i].url=layers[i].url.replace("&cache=sim","&cache=nao");if(layers[i].visibility===true){layers[i].redraw()}}}i3GEO.Interface.openlayers.sobeLayersGraficos()},atualizaTema:function(retorno,tema){var layer=i3geoOL.getLayersByName(tema)[0],objtemas;if(layer&&layer!=undefined){if(layer.url){layer.mergeNewParams({r:Math.random()});layer.url=layer.url.replace("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&","&foo=");layer.url=layer.url+"&&";layer.url=layer.url.replace("&cache=sim","&cache=nao");layer.redraw()}}if(retorno===""){return}objtemas=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);i3GEO.Interface.openlayers.recalcPar();try{i3GEO.arvoreDeCamadas.atualiza(objtemas)}catch(e){i3GEO.arvoreDeCamadas.atualiza()}i3GEO.janela.fechaAguarde()},registraEventos:function(){i3GEOtouchesPosMapa="";var calcCoord,modoAtual="";calcCoord=function(e){var point,p=false,lonlat=false,d,pos="",projWGS84,proj900913;if(e.xy){p=e.xy}if(e.changedTouches){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO))}pos=i3GEOtouchesPosMapa;p=new OpenLayers.Pixel(e.changedTouches[0].clientX-pos[0],e.changedTouches[0].clientY-pos[1]);e=null}if(p===false){return}lonlat=i3geoOL.getLonLatFromPixel(p);if(i3GEO.Interface.openlayers.googleLike===true){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");if(lonlat){point=new OpenLayers.LonLat(lonlat.lon,lonlat.lat);lonlat=point.transform(proj900913,projWGS84)}}try{d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);objposicaocursor.ddx=lonlat.lon;objposicaocursor.ddy=lonlat.lat;objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];objposicaocursor.imgx=p.x;objposicaocursor.imgy=p.y;if(pos!=""){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO))}objposicaocursor.telax=p.x+pos[0];objposicaocursor.telay=p.y+pos[1]}catch(e){}};i3GEO.eventos.ativa($i(i3geoOL.id+"_OpenLayers_Container"));i3geoOL.events.register("movestart",i3geoOL,function(e){if(e.changedTouches){return}i3GEO.Interface.STATUS.pan=true;modoAtual="move";i3GEO.barraDeBotoes.BOTAOCLICADO="pan";if(i3GEO.configura.mostraCentroDoMapa===true&&$i("localizarxygeoProjxg")){i3GEO.navega.marcaCentroDoMapa(i3GEO.navega.centroDoMapa())}});i3geoOL.events.register("moveend",i3geoOL,function(e){if(e.changedTouches){return}var xy;modoAtual="";i3GEO.Interface.openlayers.recalcPar();i3GEO.Interface.STATUS.pan=false;i3GEO.eventos.navegaMapa();i3GEO.util.escondePin();xy=i3GEO.navega.centroDoMapa();xy=i3GEO.calculo.dd2dms(xy[0],xy[1]);i3GEO.coordenadas.atualizaGeo(xy[0],xy[1],"localizarxygeoProj");i3GEO.eventos.cliquePerm.status=false;i3GEO.navega.registraExt(i3GEO.parametros.mapexten);i3GEO.Interface.STATUS.pan=false});i3geoOL.events.register("mousemove",i3geoOL,function(e){if(e.changedTouches){return}if(modoAtual==="move"){return}calcCoord(e)});i3geoOL.events.register("touchend",i3geoOL,function(e){e.preventDefault();calcCoord(e);if(i3GEO.eventos.cliquePerm.status===true&&i3GEO.eventos.CONTATOUCH<10){i3GEO.eventos.mouseupMapa(e)}i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.CONTATOUCH=0;i3GEO.Interface.STATUS.pan=false})},ativaBotoes:function(){var imagemxy,x2=0,y2=0;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},recalcPar:function(){i3GEOtouchesPosMapa="";var bounds=i3geoOL.getExtent().toBBOX().split(","),escalaAtual=i3geoOL.getScale();if(i3GEO.parametros.mapscale!==escalaAtual){i3GEO.arvoreDeCamadas.atualizaFarol(escalaAtual)}i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];i3GEO.parametros.mapscale=escalaAtual;i3GEO.parametros.pixelsize=i3geoOL.getResolution();i3GEO.gadgets.atualizaEscalaNumerica(parseInt(escalaAtual,10))},zoom2ext:function(ext){var m,b;ext=i3GEO.util.extGeo2OSM(ext);m=ext.split(" ");b=new OpenLayers.Bounds(m[0],m[1],m[2],m[3]);i3geoOL.zoomToExtent(b,true);i3GEO.eventos.cliquePerm.status=true},pan2ponto:function(x,y){if(i3GEO.Interface.openlayers.googleLike===true){var projWGS84,proj900913,point,metrica;if(x<180&&x>-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(x,y);metrica=point.transform(projWGS84,proj900913);x=metrica.lon;y=metrica.lat}}i3geoOL.panTo(new OpenLayers.LonLat(x,y))}},googlemaps:{ESTILOS:{'Red':[{featureType:'all',stylers:[{hue:'#ff0000'}]}],'Countries':[{featureType:'all',stylers:[{visibility:'off'}]},{featureType:'water',stylers:[{visibility:'on'},{lightness:-100}]}],'Night':[{featureType:'all',stylers:[{invert_lightness:'true'}]}],'Blue':[{featureType:'all',elementType:'geometry',stylers:[{hue:'#0000b0'},{invert_lightness:'true'},{saturation:-30}]}],'Greyscale':[{featureType:'all',stylers:[{saturation:-100},{gamma:0.50}]}],'No roads':[{featureType:'road',stylers:[{visibility:'off'}]}],'Mixed':[{featureType:'landscape',stylers:[{hue:'#00dd00'}]},{featureType:'road',stylers:[{hue:'#dd0000'}]},{featureType:'water',stylers:[{hue:'#000040'}]},{featureType:'poi.park',stylers:[{visibility:'off'}]},{featureType:'road.arterial',stylers:[{hue:'#ffff00'}]},{featureType:'road.local',stylers:[{visibility:'off'}]}],'Chilled':[{featureType:'road',elementType:'geometry',stylers:[{'visibility':'simplified'}]},{featureType:'road.arterial',stylers:[{hue:149},{saturation:-78},{lightness:0}]},{featureType:'road.highway',stylers:[{hue:-31},{saturation:-40},{lightness:2.8}]},{featureType:'poi',elementType:'label',stylers:[{'visibility':'off'}]},{featureType:'landscape',stylers:[{hue:163},{saturation:-26},{lightness:-1.1}]},{featureType:'transit',stylers:[{'visibility':'off'}]},{featureType:'water',stylers:[{hue:3},{saturation:-24.24},{lightness:-38.57}]}]},ESTILOPADRAO:"",MAPOPTIONS:{scaleControl:true,mapTypeControlOptions:{position:1}},OPACIDADE:0.8,TIPOMAPA:"terrain",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],PARAMETROSLAYER:"&TIPOIMAGEM="+i3GEO.configura.tipoimagem,posfixo:0,BALAOPROP:{removeAoAdicionar:true,classeCadeado:"i3GEOiconeAberto",baloes:[]},removeBaloes:function(){var p=i3GEO.Interface.googlemaps.BALAOPROP.baloes,n=p.length,i;for(i=0;i<n;i++){p[i].close()}p=[]},balao:function(texto,completo,x,y){var temp,elem,b,c,p;if(x===null||y===null){return}p=i3GEO.Interface.googlemaps.BALAOPROP;if(p.removeAoAdicionar===true){i3GEO.Interface.googlemaps.removeBaloes()}temp=document.createElement("div");temp.className="i3GEOCabecalhoInfoWindow";temp.style.top="0px";elem=document.createElement("img");elem.src=i3GEO.configura.locaplic+"/imagens/branco.gif";elem.className=p.classeCadeado;elem.onclick=function(){if(p.classeCadeado==="i3GEOiconeAberto"){p.classeCadeado="i3GEOiconeFechado"}else{p.classeCadeado="i3GEOiconeAberto"}this.className=p.classeCadeado;p.removeAoAdicionar=!p.removeAoAdicionar};temp.appendChild(elem);elem=document.createElement("img");elem.src=i3GEO.configura.locaplic+"/imagens/branco.gif";elem.className="i3GEOiconeFerramentas";elem.style.marginLeft="5px";elem.onclick=function(){i3GEO.janela.prompt($trad("tolerancia"),function(){i3GEO.mapa.RESOLUCAOTIP=$i("i3GEOjanelaprompt").value},i3GEO.mapa.RESOLUCAOTIP)};temp.appendChild(elem);elem=document.createElement("img");elem.src=i3GEO.configura.locaplic+"/imagens/branco.gif";elem.className="i3GEOiconeMais";elem.style.marginLeft="7px";elem.onclick=function(){i3GEO.janela.mensagemSimples("<div style='overflow:auto;height:100%'>"+completo+"</div>","");return false};temp.appendChild(elem);c=document.createElement("div");c.innerHTML=texto;e=document.createElement("div");e.appendChild(temp);e.appendChild(c);b=new google.maps.InfoWindow({content:e,position:new google.maps.LatLng(y,x),pixelOffset:new google.maps.Size(0,-24)});b.open(i3GeoMap);p.baloes.push(b)},atualizaTema:function(retorno,tema){var indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(tema),objtemas;i3GeoMap.overlayMapTypes.removeAt(indice);i3GEO.Interface.googlemaps.posfixo+=1;i3GEO.Interface.googlemaps.insereLayer(tema,indice);if(retorno===""){return}objtemas=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);i3GEO.Interface.googlemaps.recalcPar();try{i3GEO.arvoreDeCamadas.atualiza(objtemas)}catch(e){i3GEO.arvoreDeCamadas.atualiza()}i3GEO.janela.fechaAguarde()},removeTodosLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,indice;for(i=0;i<nlayers;i++){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(camada.name);if(indice!==false){try{i3GeoMap.overlayMapTypes.removeAt(indice);i3GEO.pluginI3geo.removeCamada(camada.name)}catch(e){}}}},redesenha:function(){i3GEO.Interface.googlemaps.posfixo+=1;i3GEO.Interface.googlemaps.removeTodosLayers();i3GEO.Interface.googlemaps.criaLayers()},cria:function(w,h){var i,f,ins;google.maps.visualRefresh=true;posfixo="&nd=0";i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("googlemapsdiv");if(!f){ins='<div id=googlemapsdiv style="width:0px;height:0px;text-align:left;background-image:url('+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg)"></div>';i.innerHTML=ins}f=$i("googlemapsdiv");if(w){f.style.width=w+"px";f.style.height=h+"px"}}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv";if(i3GEO.Interface.TABLET===false){i3GEO.barraDeBotoes.INCLUIBOTAO.zoomli=true;i3GEO.barraDeBotoes.INCLUIBOTAO.pan=true;i3GEO.barraDeBotoes.INCLUIBOTAO.zoomtot=true}},ativaZoomBox:function(){i3GeoMap.enableKeyDragZoom({key:'ctrl'})},inicia:function(){var pol,ret,montaMapa;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");if($i("i3GEOprogressoDiv")){$i("i3GEOprogressoDiv").style.display="block"}montaMapa=function(retorno){var sw,ne,estilo,dobra=$i("i3GEOdobraPagina");if(i3GEO.Interface.googlemaps.ESTILOS&&i3GEO.Interface.googlemaps.ESTILOPADRAO!=""){i3GEO.Interface.googlemaps.MAPOPTIONS.mapTypeId=i3GEO.Interface.googlemaps.ESTILOPADRAO}if(i3GEO.Interface.BARRADEZOOMRIGHT!=0){i3GEO.Interface.googlemaps.MAPOPTIONS.zoomControlOptions={position:google.maps.ControlPosition.RIGHT_TOP};i3GEO.Interface.googlemaps.MAPOPTIONS.panControlOptions={position:google.maps.ControlPosition.RIGHT_TOP}}try{i3GeoMap=new google.maps.Map($i(i3GEO.Interface.IDMAPA),i3GEO.Interface.googlemaps.MAPOPTIONS)}catch(e){return}if(i3GEO.Interface.googlemaps.ESTILOS&&i3GEO.Interface.googlemaps.ESTILOPADRAO!=""){estilo=i3GEO.Interface.googlemaps.ESTILOS[i3GEO.Interface.googlemaps.ESTILOPADRAO];i3GeoMap.mapTypes.set(i3GEO.Interface.googlemaps.ESTILOPADRAO,new google.maps.StyledMapType(estilo,{name:i3GEO.Interface.googlemaps.ESTILOPADRAO}))}else{i3GeoMap.setMapTypeId(i3GEO.Interface.googlemaps.TIPOMAPA)}if(dobra){$i(i3GEO.Interface.IDMAPA).appendChild(dobra)}if(!i3GEO.Interface.googlemaps.MAPOPTIONS.center&&!i3GEO.Interface.googlemaps.MAPOPTIONS.zoom){sw=new google.maps.LatLng(ret[1],ret[0]);ne=new google.maps.LatLng(ret[3],ret[2]);i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne))}if(!$i("keydragzoom_script")){js=i3GEO.configura.locaplic+"/pacotes/google/keydragzoom.js";i3GEO.util.scriptTag(js,"i3GEO.Interface.googlemaps.ativaZoomBox()","keydragzoom_script")}i3GeoMapOverlay=new google.maps.OverlayView();i3GeoMapOverlay.draw=function(){};i3GEO.Interface.googlemaps.criaLayers();i3GeoMapOverlay.setMap(i3GeoMap);i3GEO.Interface.googlemaps.registraEventos();if(i3GEO.Interface.STATUS.trocando===false){i3GEO.gadgets.mostraInserirKml()}i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));if(i3GEO.Interface.STATUS.trocando===false){i3GEO.coordenadas.mostraCoordenadas();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.gadgets.mostraMenuLista();i3GEO.idioma.mostraSeletor()}i3GEO.gadgets.mostraMenuSuspenso();if(i3GEO.Interface.STATUS.trocando===true&&$i(i3GEO.arvoreDeCamadas.IDHTML)){$i(i3GEO.arvoreDeCamadas.IDHTML).innerHTML=""}if(i3GEO.Interface.STATUS.trocando===false){i3GEO.util.arvore("<b>"+$trad("p13")+"</b>","listaPropriedades",i3GEO.configura.listaDePropriedadesDoMapa)}if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this)"}i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic);if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===true){i3GEO.Interface.googlemaps.adicionaListaKml()}if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.googlemaps.adicionaKml(true,i3GEO.parametros.kmlurl)}if(YAHOO.lang.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}i3GEO.configura.iniciaFerramentas.executa();i3GEO.Interface.ativaBotoes();google.maps.event.addListenerOnce(i3GeoMap,'idle',function(){var z=i3GeoMap.getZoom();if(z!=undefined){i3GeoMap.setZoom(parseInt(z,10)+1)}})};i3GEO.php.googlemaps(montaMapa)},criaLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,indice;for(i=0;i<nlayers;i++){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(camada.name);if(!indice){if(camada.status!=0){if(camada.plugini3geo&&camada.plugini3geo!=""&&camada.plugini3geo.parametros!=undefined){i3GEO.pluginI3geo.inicia(camada);continue}else{i3GEO.Interface.googlemaps.insereLayer(camada.name,0,camada.cache)}}i3GEO.Interface.aposAdicNovaCamada(camada)}}i3GEO.Interface.googlemaps.recalcPar()},criaImageMap:function(nomeLayer,cache){var i3GEOTileO="";if(cache=="undefined"||cache==undefined){cache=""}i3GEOTileO=new google.maps.ImageMapType({getTileUrl:function(coord,zoom){var url=i3GEO.configura.locaplic+"/classesphp/mapa_googlemaps.php?g_sid="+i3GEO.configura.sid+"&cache="+cache+"&Z="+zoom+"&X="+coord.x+"&Y="+coord.y+"&layer="+nomeLayer+i3GEO.Interface.googlemaps.PARAMETROSLAYER+'&r='+Math.random();return url+'&nd='+i3GEO.Interface.googlemaps.posfixo},tileSize:new google.maps.Size(256,256),isPng:true,name:nomeLayer});return i3GEOTileO},bbox2mercator:function(bbox){var c=bbox.split(" "),p1,p2;p1=i3GEO.Interface.googlemaps.geo2mercator(c[0],c[1]);p2=i3GEO.Interface.googlemaps.geo2mercator(c[2],c[3]);return p1.x+" "+p1.y+" "+p2.x+" "+p2.y},geo2mercator:function(x,y){var source="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",dest="+title= Google Mercator EPSG:900913 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",p=new Proj4js.Point(parseInt(x,10),parseInt(y,10));Proj4js.defs["WGS84"]=source;Proj4js.defs["EPSG:900913"]=dest;source=new Proj4js.Proj('WGS84');dest=new Proj4js.Proj('EPSG:900913');Proj4js.transform(source,dest,p);return p},insereLayer:function(nomeLayer,indice,cache){if(i3GEO.pluginI3geo.existeObjeto(nomeLayer)===false){var i=i3GEO.Interface.googlemaps.criaImageMap(nomeLayer,cache);i3GeoMap.overlayMapTypes.insertAt(indice,i)}},registraEventos:function(){i3GEOtouchesPosMapa="";modoAtual="";google.maps.event.addListener(i3GeoMap,"dragstart",function(){modoAtual="move";if(i3GEO.configura.mostraCentroDoMapa===true&&$i("localizarxygeoProjxg")){i3GEO.navega.marcaCentroDoMapa(i3GEO.navega.centroDoMapa())}i3GEO.eventos.cliquePerm.status=false});google.maps.event.addListener(i3GeoMap,"dragend",function(){var xy;i3GEO.Interface.googlemaps.recalcPar();i3GEO.eventos.navegaMapa();i3GEO.util.escondePin();xy=i3GEO.navega.centroDoMapa();xy=i3GEO.calculo.dd2dms(xy[0],xy[1]);i3GEO.coordenadas.atualizaGeo(xy[0],xy[1],"localizarxygeoProj");i3GEO.navega.registraExt(i3GEO.parametros.mapexten)});google.maps.event.addListener(i3GeoMap,"tilesloaded",function(){i3GEO.Interface.googlemaps.recalcPar();i3GEO.navega.registraExt(i3GEO.parametros.mapexten)});google.maps.event.addListener(i3GeoMap,"bounds_changed",function(){i3GEO.Interface.googlemaps.recalcPar();i3GEO.eventos.navegaMapa()});google.maps.event.addListener(i3GeoMap,"mousemove",function(ponto){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}var teladms,tela,pos=i3GEOtouchesPosMapa;if(modoAtual==="move"){return}ponto=ponto.latLng;teladms=i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());tela=i3GeoMapOverlay.getProjection().fromLatLngToContainerPixel(ponto);objposicaocursor={ddx:ponto.lng(),ddy:ponto.lat(),dmsx:teladms[0],dmsy:teladms[1],imgx:tela.x,imgy:tela.y,telax:tela.x+pos[0],telay:tela.y+pos[1]}})},retornaIndiceLayer:function(nomeLayer){var i=false;try{i3GeoMap.overlayMapTypes.forEach(function(elemento,number){if(elemento.name===nomeLayer){i=number}});return i}catch(e){return false}},retornaObjetoLayer:function(nomeLayer){var i=false;try{i3GeoMap.overlayMapTypes.forEach(function(elemento,number){if(elemento.name===nomeLayer){i=elemento}});return i}catch(e){return false}},retornaDivLayer:function(nomeLayer){var i,divmapa=$i("googlemapsdiv"),divimg,n;divimg=divmapa.getElementsByTagName("img");n=divimg.length;if(divimg&&n>0){for(i=0;i<n;i++){if(divimg[i].src.search("&layer="+nomeLayer+"&")>0){return divimg[i].parentNode.parentNode.parentNode}}}return false},ligaDesliga:function(obj){var plugin,indice,temp,desligar="",ligar="",n,i,lista=[],listatemp;indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(obj.value);temp=function(){i3GEO.mapa.legendaHTML.atualiza()};plugin=i3GEO.pluginI3geo.existeObjeto(obj.value);if(obj.checked&&(!indice||plugin===true)){ligar=obj.value;listatemp=i3GEO.arvoreDeCamadas.listaLigadosDesligados()[0];n=i3GEO.arvoreDeCamadas.CAMADAS.length;for(i=0;i<n;i++){if(i3GEO.util.in_array(i3GEO.arvoreDeCamadas.CAMADAS[i].name,listatemp)){lista.push(i3GEO.arvoreDeCamadas.CAMADAS[i].name)}}lista.reverse();if(plugin===false){n=lista.length;indice=0;for(i=0;i<n;i++){if(lista[i]==obj.value){indice=i}}i3GEO.Interface.googlemaps.insereLayer(obj.value,(indice))}else{i3GEO.pluginI3geo.ligaCamada(obj.value)}i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value)}else{if(plugin===true){desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);i3GEO.pluginI3geo.desligaCamada(obj.value)}else if(indice!==false){desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);i3GeoMap.overlayMapTypes.removeAt(indice)}}if(desligar!==""||ligar!==""){i3GEO.php.ligatemas(temp,desligar,ligar)}},bbox:function(){var bd,so,ne,bbox;bd=i3GeoMap.getBounds();so=bd.getSouthWest();ne=bd.getNorthEast();bbox=so.lng()+" "+so.lat()+" "+ne.lng()+" "+ne.lat();return(bbox)},ativaBotoes:function(){var imagemxy,x2=0,y2=0;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},aplicaOpacidade:function(opacidade,layer){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,div;if(!layer){layer=""}for(i=0;i<nlayers;i++){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];if(camada&&camada.name){div=i3GEO.Interface.googlemaps.retornaDivLayer(camada.name);if(div){if(layer==""||layer==camada.name){YAHOO.util.Dom.setStyle(div,"opacity",opacidade)}}}}},mudaOpacidade:function(valor){i3GEO.Interface.googlemaps.OPACIDADE=valor;i3GEO.Interface.googlemaps.redesenha()},recalcPar:function(){i3GEOtouchesPosMapa="";try{var sw,ne,escalaAtual=i3GEO.parametros.mapscale;sw=i3GeoMap.getBounds().getSouthWest();ne=i3GeoMap.getBounds().getNorthEast();i3GEO.parametros.mapexten=sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala();sw=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(0,1));ne=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(1,0));i3GEO.parametros.pixelsize=sw.lng()-ne.lng();if(i3GEO.parametros.pixelsize<0){i3GEO.parametros.pixelsize=i3GEO.parametros.pixelsize*-1}if(i3GEO.parametros.mapscale!==escalaAtual&&escalaAtual!==0){i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale)}}catch(e){i3GEO.parametros.mapexten="0 0 0 0";i3GEO.parametros.mapscale=0}},calcescala:function(){var zoom=i3GeoMap.getZoom();return(i3GEO.Interface.googlemaps.ZOOMSCALE[zoom])},escala2nzoom:function(escala){var n,i;n=i3GEO.Interface.googlemaps.ZOOMSCALE.length;for(i=0;i<n;i++){if(i3GEO.Interface.googlemaps.ZOOMSCALE[i]<escala){return(i)}}},zoom2extent:function(mapexten){var re=new RegExp(",","g"),pol=mapexten.replace(re," "),ret=pol.split(" "),sw=new google.maps.LatLng(ret[1],ret[0]),ne=new google.maps.LatLng(ret[3],ret[2]);i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne))},pan2ponto:function(x,y){i3GeoMap.panTo(new google.maps.LatLng(y,x))},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=true}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===false){i3GEO.arvoreDeCamadas.MOSTRALISTAKML=true;i3GEO.Interface.googlemaps.criaArvoreKML()}i3GEO.Interface.googlemaps.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googlemaps.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}node=i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this,\""+url+"\")' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";if(navm){estilo="cursor:default;vertical-align:35%;padding-top:0px;"}else{estilo="cursor:default;vertical-align:top;"}html+=" <span style='"+estilo+"'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand();if(ativo===true){eval(id+" = new google.maps.KmlLayer('"+url+"',{map:i3GeoMap,preserveViewport:true});")}},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="<table><tr><td><b>Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false;if(i3GEO.parametros.editor==="sim"){d=new YAHOO.widget.HTMLNode({html:"<a style='color:red' title='opção visível apenas para editores' href='../admin/html/webservices.html' target=blank >Editar cadastro</a>",idmenu:"",enableHighlight:false,expanded:false},node)}},ativaDesativaCamadaKml:function(obj,url){if(!obj.checked){eval(obj.value+".setMap(null);")}else{eval(obj.value+" = new google.maps.KmlLayer(url,{map:i3GeoMap,preserveViewport:true});")}},alteraParametroLayers:function(parametro,valor){parametro=parametro.toUpperCase();var reg=new RegExp(parametro+"([=])+([a-zA-Z0-9_]*)");i3GEO.Interface.googlemaps.PARAMETROSLAYER=i3GEO.Interface.googlemaps.PARAMETROSLAYER.replace(reg,"");i3GEO.Interface.googlemaps.PARAMETROSLAYER+="&"+parametro+"="+valor;i3GEO.Interface.googlemaps.redesenha()}},googleearth:{PARAMETROSLAYER:"&TIPOIMAGEM="+i3GEO.configura.tipoimagem,posfixo:"",GADGETS:{setMouseNavigationEnabled:true,setStatusBarVisibility:true,setOverviewMapVisibility:true,setScaleLegendVisibility:true,setAtmosphereVisibility:true,setGridVisibility:false,getSun:false,LAYER_BORDERS:true,LAYER_BUILDINGS:false,LAYER_ROADS:false,LAYER_TERRAIN:true},POSICAOTELA:[0,0],aguarde:"",ligaDesliga:function(obj){var layer=i3GEO.Interface.googleearth.retornaObjetoLayer(obj.value),temp=function(){i3GEO.mapa.legendaHTML.atualiza()},desligar="",ligar="";if(obj.checked){i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value);ligar=obj.value}else{i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);desligar=obj.value}layer.setVisibility(obj.checked);if(desligar!==""||ligar!==""){i3GEO.php.ligatemas(temp,desligar,ligar)}},atualizaTema:function(retorno,tema){var layer=i3GEO.Interface.googleearth.retornaObjetoLayer(tema),hr=layer.getLink().getHref(),objtemas;hr=hr.replace("&&&&&&&&&&&&&&&&&&&","");layer.getLink().setHref(hr+"&");if(retorno===""){return}objtemas=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);i3GEO.Interface.googleearth.recalcPar();try{i3GEO.arvoreDeCamadas.atualiza(objtemas)}catch(e){i3GEO.arvoreDeCamadas.atualiza()}i3GEO.janela.fechaAguarde()},redesenha:function(){i3GEO.Interface.googleearth.posfixo+="&";var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,indice;for(i=0;i<nlayers;i++){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];indice=i3GEO.Interface.googleearth.retornaObjetoLayer(camada.name);if(indice!==false){try{i3GeoMap.getFeatures().removeChild(indice)}catch(e){}}}i3GEO.Interface.googleearth.criaLayers()},cria:function(w,h){var i,i3GeoMap3d,texto;i3GEO.configura.listaDePropriedadesDoMapa={"propriedades":[{text:"p2",url:"javascript:i3GEO.mapa.dialogo.tipoimagem()"},{text:"p3",url:"javascript:i3GEO.mapa.dialogo.opcoesLegenda()"},{text:"p4",url:"javascript:i3GEO.mapa.dialogo.opcoesEscala()"},{text:"p8",url:"javascript:i3GEO.mapa.dialogo.queryMap()"},{text:"p9",url:"javascript:i3GEO.mapa.dialogo.corFundo()"},{text:"p10",url:"javascript:i3GEO.mapa.dialogo.gradeCoord()"}]};texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setMouseNavigationEnabled(this.checked)'";texto+="> "+$trad("ge1");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setStatusBarVisibility(this.checked)'";texto+="> "+$trad("ge2");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setOverviewMapVisibility(this.checked)'";texto+="> "+$trad("ge3");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setScaleLegendVisibility(this.checked)'";texto+="> "+$trad("ge4");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setAtmosphereVisibility(this.checked)'";texto+="> "+$trad("ge5");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setGridVisibility===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setGridVisibility(this.checked)'";texto+="> "+$trad("ge6");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.getSun===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getSun().setVisibility(this.checked)'";texto+="> "+$trad("ge7");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BORDERS, this.checked)'";texto+="> "+$trad("ge8");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BUILDINGS, this.checked)'";texto+="> "+$trad("ge9");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_ROADS, this.checked)'";texto+="> "+$trad("ge10");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN===true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_TERRAIN, this.checked)'";texto+="> "+$trad("ge11");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});i3GEO.util.arvore("<b>"+$trad("p13")+"</b>","listaPropriedades",i3GEO.configura.listaDePropriedadesDoMapa);i3GEO.barraDeBotoes.INCLUIBOTAO.zoomli=false;i3GEO.barraDeBotoes.INCLUIBOTAO.pan=false;i3GEO.barraDeBotoes.INCLUIBOTAO.zoomtot=false;i3GEO.barraDeBotoes.INCLUIBOTAO.zoomproximo=false;i3GEO.barraDeBotoes.INCLUIBOTAO.zoomanterior=false;i3GEO.Interface.IDMAPA="i3GeoMap3d";if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.googleearth.ligaDesliga(this)"}i=$i(i3GEO.Interface.IDCORPO);if(i){i3GeoMap3d=document.createElement("div");i3GeoMap3d.style.width=w+"px";i3GeoMap3d.style.height=h+"px";i.style.height=h;i3GeoMap3d.id="i3GeoMap3d";i3GeoMap3d.style.zIndex=0;i.appendChild(i3GeoMap3d)}google.load("earth","1")},inicia:function(){google.earth.createInstance("i3GeoMap3d",i3GEO.Interface.googleearth.iniciaGE,i3GEO.Interface.googleearth.falha)},iniciaGE:function(object){var montaMapa=function(retorno){i3GeoMap=object;i3GeoMap.getWindow().setVisibility(true);i3GEO.Interface.googleearth.zoom2extent(i3GEO.parametros.mapexten);i3GEO.Interface.googleearth.criaLayers();var options=i3GeoMap.getOptions(),layerRoot=i3GeoMap.getLayerRoot();options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled);options.setStatusBarVisibility(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility);options.setOverviewMapVisibility(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility);options.setScaleLegendVisibility(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility);options.setAtmosphereVisibility(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility);options.setGridVisibility(i3GEO.Interface.googleearth.GADGETS.setGridVisibility);layerRoot.enableLayerById(i3GeoMap.LAYER_BORDERS,i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS);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.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW);i3GEO.Interface.googleearth.POSICAOTELA=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO));i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic);i3GEO.gadgets.mostraMenuSuspenso();i3GEO.gadgets.mostraMenuLista();i3GEO.Interface.googleearth.ativaBotoes();i3GEO.gadgets.mostraInserirKml("inserirKml");if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===true){i3GEO.Interface.googleearth.adicionaListaKml()}i3GEO.Interface.googleearth.registraEventos();if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.googleearth.adicionaKml(true,i3GEO.parametros.kmlurl,i3GEO.parametros.kmlurl,false)}if(YAHOO.lang.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}i3GEO.configura.iniciaFerramentas.executa()};i3GEO.php.googleearth(montaMapa)},criaLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length-1,i,camada,indice,layer;for(i=nlayers;i>=0;i--){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];indice=i3GEO.Interface.googleearth.retornaIndiceLayer(camada.name);layer=i3GEO.Interface.googleearth.retornaObjetoLayer(camada.name);if(indice==false){layer=i3GEO.Interface.googleearth.insereLayer(camada.name)}try{if(camada.status!=0){layer.setVisibility(true)}else{layer.setVisibility(false)}}catch(e){}}},insereLayer:function(nomeLayer){var kmlUrl=i3GEO.configura.locaplic+"/classesphp/mapa_googleearth.php?REQUEST=GetKml&g_sid="+i3GEO.configura.sid+"&layer="+nomeLayer+i3GEO.Interface.googleearth.PARAMETROSLAYER+"&r="+Math.random(),linki3geo=i3GeoMap.createLink(''),nl=i3GeoMap.createNetworkLink('');linki3geo.setHref(kmlUrl+i3GEO.Interface.googleearth.posfixo);nl.setLink(linki3geo);nl.setFlyToView(false);nl.setName(nomeLayer);i3GeoMap.getFeatures().appendChild(nl);return nl},retornaIndiceLayer:function(nomeLayer){var n=i3GeoMap.getFeatures().getChildNodes().getLength(),indice=0,i=0;if(n>0){for(i=0;i<n;i++){if(i3GeoMap.getFeatures().getChildNodes().item(i).getName()===nomeLayer){indice=i}}return indice}else{return false}},aplicaOpacidade:function(opacidade){var n=i3GeoMap.getFeatures().getChildNodes().getLength(),i;for(i=0;i<n;i++){i3GeoMap.getFeatures().getChildNodes().item(i).setOpacity(opacidade)}},retornaObjetoLayer:function(nomeLayer){var n=i3GeoMap.getFeatures().getChildNodes().getLength(),indice=false,i;for(i=0;i<n;i++){if(i3GeoMap.getFeatures().getChildNodes().item(i).getName()===nomeLayer){indice=i3GeoMap.getFeatures().getChildNodes().item(i)}}return indice},registraEventos:function(){google.earth.addEventListener(i3GeoMap.getView(),"viewchangeend",function(e){i3GEO.Interface.googleearth.recalcPar();i3GEO.eventos.cliquePerm.status=false;i3GEO.navega.registraExt(i3GEO.parametros.mapexten)});google.earth.addEventListener(i3GeoMap.getGlobe(),'mousemove',function(event){d=i3GEO.calculo.dd2dms(event.getLongitude(),event.getLatitude());objposicaocursor={ddx:event.getLongitude(),ddy:event.getLatitude(),dmsx:d[0],dmsy:d[1],imgx:event.getClientX(),imgy:event.getClientY(),telax:event.getClientX()+i3GEO.Interface.googleearth.POSICAOTELA[0],telay:event.getClientY()+i3GEO.Interface.googleearth.POSICAOTELA[1]};i3GEO.eventos.mousemoveMapa()});google.earth.addEventListener(i3GeoMap.getGlobe(),'click',function(event){if(i3GEO.Interface.googleearth.aguarde.visibility==="hidden"){i3GEO.eventos.mousecliqueMapa()}else{i3GEO.Interface.googleearth.aguarde.visibility="hidden"}})},recalcPar:function(){var bounds;bounds=i3GeoMap.getView().getViewportGlobeBounds();i3GEO.parametros.mapexten=bounds.getWest()+" "+bounds.getSouth()+" "+bounds.getEast()+" "+bounds.getNorth()},falha:function(){alert("Falhou. Vc precisa do plugin instalado")},ativaBotoes:function(){var cabecalho=function(){i3GEO.barraDeBotoes.ativaIcone("")},minimiza=function(){i3GEO.janela.minimiza("i3GEOF.ferramentasGE")},janela=i3GEO.janela.cria("230px","110px","","","",$trad("u15a"),"i3GEOF.ferramentasGE",false,"hd",cabecalho,minimiza);$i("i3GEOF.ferramentasGE_c").style.zIndex=100;i3GEO.barraDeBotoes.TEMPLATEBOTAO='<div style="display:inline;background-color:rgb(250,250,250);"><img src="'+i3GEO.configura.locaplic+'/imagens/branco.gif" id="$$"/></div> ';i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id);i3GEO.barraDeBotoes.ativaBotoes();i3GEO.Interface.googleearth.aguarde=$i("i3GEOF.ferramentasGE_imagemCabecalho").style;$i("i3GEOF.ferramentasGE_minimizaCabecalho").style.right="0px";$i("i3GEOF.ferramentasGE").lastChild.style.display="none";i3GEO.ajuda.abreJanela()},balao:function(texto,completo,ddx,ddy){var placemark=i3GeoMap.createPlacemark(''),point=i3GeoMap.createPoint(''),b;point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);b=i3GeoMap.createHtmlStringBalloon('');b.setContentString("<div style=text-align:left >"+texto+"</div>");b.setFeature(placemark);i3GeoMap.setBalloon(b)},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=false}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);linki3geokml=i3GeoMap.createLink('');if(url.split("http").length===1){url=i3GEO.util.protocolo()+"://"+window.location.host+url}linki3geokml.setHref(url);eval(ngeoxml+" = i3GeoMap.createNetworkLink('')");eval(ngeoxml+".setLink(linki3geokml)");if(i3GEO.arvoreDeCamadas.MOSTRALISTAKML===false){i3GEO.arvoreDeCamadas.MOSTRALISTAKML=true;i3GEO.Interface.googleearth.criaArvoreKML()}i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googleearth.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}node=i3GEO.Interface.googleearth.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googleearth.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googleearth.ARVORE.draw();i3GEO.Interface.googleearth.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{return}}i3GEO.Interface.googleearth.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googleearth.ARVORE.getRoot();titulo="<table><tr><td><b>Google Earth Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false;if(i3GEO.parametros.editor==="sim"){d=new YAHOO.widget.HTMLNode({html:"<a style='color:red' title='opção visível apenas para editores' href='../admin/html/webservices.html' target=blank >Editar cadastro</a>",idmenu:"",enableHighlight:false,expanded:false},node)}},existeLink:function(url){var existe=false,features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()===url){existe=true}}catch(e){}}return(existe)},ativaDesativaLink:function(url,valor){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()===url){features.getChildNodes().item(i).setVisibility(valor)}}catch(e){}}},ativaDesativaCamadaKml:function(obj){var url=eval(obj.value+".getLink().getHref()"),existe=i3GEO.Interface.googleearth.existeLink(url);if(!obj.checked){i3GEO.Interface.googleearth.ativaDesativaLink(url,false)}else{if(existe===false){eval("i3GeoMap.getFeatures().appendChild("+obj.value+")")}else{i3GEO.Interface.googleearth.ativaDesativaLink(url,true)}}},zoom2extent:function(mapexten){var r=6378700,lng2,lng1,lat1,lat2,ret=mapexten.split(" "),fov=32,camera=i3GeoMap.getView().copyAsCamera(i3GeoMap.ALTITUDE_RELATIVE_TO_GROUND),dy,dx,d,dist,alt;lng2=(ret[0]*1);lng1=(ret[2]*1);lat1=(ret[1]*1);lat2=(ret[3]*1);camera.setLatitude((lat1+lat2)/2.0);camera.setLongitude((lng1+lng2)/2.0);camera.setHeading(0.0);camera.setTilt(0.0);dy=Math.max(lat1,lat2)-Math.min(lat1,lat2);dx=Math.max(lng1,lng2)-Math.min(lng1,lng2);d=Math.max(dy,dx);d=d*Math.PI/180.0;dist=r*Math.tan(d/2);alt=dist/(Math.tan(fov*Math.PI/180.0));if(alt<0){alt=alt*-1}camera.setAltitude(alt);i3GeoMap.getView().setAbstractView(camera)},alteraParametroLayers:function(parametro,valor){parametro=parametro.toUpperCase();var reg=new RegExp(parametro+"([=])+([a-zA-Z0-9_]*)");i3GEO.Interface.googleearth.PARAMETROSLAYER=i3GEO.Interface.googleearth.PARAMETROSLAYER.replace(reg,"");i3GEO.Interface.googleearth.PARAMETROSLAYER+="&"+parametro+"="+valor;i3GEO.Interface.googleearth.redesenha()}}}; |
235 | 235 | // |
236 | 236 | //compactados/classe_mapa_compacto.js |
237 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",AUTORESIZE:false,RESOLUCAOTIP:8,GEOXML:[],insereDobraPagina:function(tipo,imagem){if(i3GEO.parametros.w<700){return}var novoel=$i("i3GEOdobraPagina");if(!novoel){novoel=document.createElement("img")}novoel.src=imagem;novoel.id="i3GEOdobraPagina";if(tipo==="googlemaps"){novoel.onclick=function(evt){i3GEO.Interface.atual2gm.inicia()}}if(tipo==="openlayers"){novoel.onclick=function(evt){if(i3GEO.Interface.ATUAL==="googlemaps"&&i3GeoMap.getStreetView().getVisible()===true){i3GeoMap.getStreetView().setVisible(false)}else{i3GEO.Interface.atual2ol.inicia()}}}novoel.style.cursor="pointer";novoel.style.position="absolute";novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.zIndex="5000000";novoel.style.left=i3GEO.parametros.w-35+"px";$i(i3GEO.Interface.IDMAPA).appendChild(novoel);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.stopPropagation);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.preventDefault)},reposicionaDobraPagina:function(){var novoel=$i("i3GEOdobraPagina");if(!novoel){return}novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.left=i3GEO.parametros.w-35+"px"},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=YAHOO.util.Dom.getViewportWidth();Dh=YAHOO.util.Dom.getViewportHeight();i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.barraDeBotoes.recria("i3geo_barra2");if(i3GEO.Interface.TABLET===true){i3GEO.guias.escondeGuias();return}if(i3GEO.guias.TIPO==="movel"){i3GEO.guias.guiaMovel.reposiciona();i3GEO.guias.guiaMovel.abreFecha("fecha")}else{i3GEO.guias.ajustaAltura()}i3GEO.mapa.reposicionaDobraPagina();ativo=true},2000)}ativo=false}},ajustaPosicao:function(elemento){if(arguments.length===0){return}var imagemxi=0,imagemyi=0,dc=$i(elemento),c;if(!dc){return}try{while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi+=dc.offsetLeft;imagemyi+=dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi)}i3GEO.util.$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){if(codigo){if(codigo===""){return}if(i3GEO.temaAtivo!==""){i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","")}i3GEO.temaAtivo=codigo;i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown")}},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert($trad("x21"));return}i3GEO.php.ativalogo(i3GEO.atualiza);var cr=$i("i3GEOcopyright");if(cr){if(cr.style.display==="block"){cr.style.display="none"}else{cr.style.display="block"}}},verifica:function(retorno){try{if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},compactaLayerGrafico:function(){var geos=false,geometrias=[],n=0,i,g;if(i3GEO.editorOL&&i3GEO.desenho.layergrafico&&i3GEO.desenho.layergrafico.features){geos=i3GEO.desenho.layergrafico.features;n=geos.length;for(i=0;i<n;i++){g={"atributos":geos[i].attributes,"geometria":geos[i].geometry.toString()};geometrias.push(g)}}g=YAHOO.lang.JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=YAHOO.lang.JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.barraDeBotoes.editor[i3GEO.Interface.ATUAL].ativaPainel();var n=geometrias.length,i;for(i=0;i<n;i++){i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos)}i3GEO.editorOL.sobeLayersGraficos()};if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/classesjs/compactados/classe_editorol_compacto.js",inicia,"editorol.js",true)}}},restauraGraficos:function(graficos){if(graficos.length>0){var inicia=function(){i3GEOF.graficointerativo1.restauraGraficos(graficos)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",inicia,"graficointerativo1",true)}},restauraTabelas:function(tabelas){if(tabelas.length>0){var inicia=function(){i3GEOF.tabela.restauraTabelas(tabelas)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/tabela/dependencias.php",inicia,"tabela",true)}},aplicaPreferencias:function(cookies){var props,nprops,i,temp=[],pint;if(!cookies){cookies=i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo")}if(cookies){props=cookies.split("::");nprops=props.length;for(i=0;i<nprops;i++){try{temp=props[i].split("|");pint=parseInt(temp[1],10);if(temp[1]==='true'||temp[1]==='false'){if(temp[1]==='true'){temp[1]=true}if(temp[1]==='false'){temp[1]=false}eval(temp[0]+" = "+temp[1]+";")}else if(pint+"px"==temp[1]){eval(temp[0]+" = '"+temp[1]+"';")}else if(YAHOO.lang.isNumber(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}if(temp[0]=="i3GEO.configura.mapaRefDisplay"){i3GEO.util.insereCookie("i3GEO.configura.mapaRefDisplay",temp[1])}}catch(e){}}}},legendaHTML:{incluiBotaoLibera:false,ID:"",CAMADASSEMLEGENDA:[],cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var idleg=$i("wlegenda_corpo"),temp=function(retorno){var legenda="",ins,re,desativar,tema="",classe="",b;re=new RegExp();if(retorno.data!=="erro"&&retorno.data!==undefined){re=new RegExp("legendack_","g");retorno.data.legenda=retorno.data.legenda.replace(re,"liblegendack_");legenda="<div class='botoesLegendaFlutuante'>"+"<input type='button' value='"+$trad("mostraTodosLegenda")+"' id='legendaMostraTodos' />"+"<input type='button' value='"+$trad("mostraSoLegenda")+"' id='legendaMostraSo' />"+"<input type='button' value='PNG' id='legendaExpImagem' />"+"</div>"+"<div id='i3GEOconteudoLegenda' class='i3GEOconteudoLegendaClass' style='width:100%;height:100%;'><div>"+retorno.data.legenda+"</div>"}if(legenda!=""&&idleg){ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+='<div style="cursor: pointer; text-align: left; font-size: 10px; display: block; height: 35px;" onclick="i3GEO.mapa.legendaHTML.libera()"><img id="soltaLeg" src="../imagens/branco.gif" title="clique para liberar" style="margin: 5px; position: relative;"> <p style="position: relative; left: -35px; top: -22px;">'+$trad("x11")+'</p></div>'}re=new RegExp("<img src='' />","g");legenda=legenda.replace(re,"");ins+="<div id='corpoLegi' >"+legenda+"</div>";idleg.innerHTML="<div style='padding:5px;' >"+ins+"</div>";if($i("legendaMostraTodos")){b=new YAHOO.widget.Button("legendaMostraTodos",{onclick:{fn:function(){i3GEO.mapa.legendaHTML.mostraTodosOsTemas()}}});b.addClass("legendaMostraTodosTemas");b=new YAHOO.widget.Button("legendaMostraSo",{onclick:{fn:function(){var n,i,temp,raiz=$i("corpoLegi").parentNode;temp=raiz.getElementsByClassName("i3GEOLegendaExcluiTema");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}temp=raiz.getElementsByTagName("input");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}}}});b.addClass("legendaMostraSoTemas");b=new YAHOO.widget.Button("legendaExpImagem",{onclick:{fn:function(){var obj=$i("i3GEOconteudoLegenda");obj.style.width=$i("wlegenda").style.width;obj.style.height=$i("wlegenda_corpo").style.height;i3GEO.mapa.dialogo.html2canvas(obj)}}});b.addClass("legendaExpImagemPng")}}i3GEO.mapa.legendaHTML.escondeTemasMarcados();desativar=retorno.data.desativar;for(tema in desativar){for(classe in desativar[tema]){ins=$i("liblegendack_"+tema+"_"+desativar[tema][classe]);if(ins){ins.checked=false}}}};if(idleg&&idleg.style.display==="block"){if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg){idleg.innerHTML=""}}i3GEO.mapa.legendaHTML.obtem(temp)}else{if(idleg){idleg.innerHTML=""}if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg&&idleg.style.display==="block"){i3GEO.mapa.legendaHTML.obtem(temp)}}}},obtem:function(funcao){i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda)},ativaDesativaTema:function(inputbox){var temp=function(){i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem);i3GEO.arvoreDeCamadas.atualiza("");i3GEO.janela.fechaAguarde("redesenha")};if(!inputbox.checked){i3GEO.php.ligatemas(temp,inputbox.value,"")}else{i3GEO.php.ligatemas(temp,"",inputbox.value)}},escondeTema:function(tema){var d=$i("legendaLayer_"+tema);if(d){d.style.display="none";i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA.push(tema)}},escondeTemasMarcados:function(){var temas=i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA,n=temas.length,i,temp;for(i=0;i<n;i++){temp=$i(temas[i]);if(temp){temp.style.display="none"}}},mostraTodosOsTemas:function(){i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA=[];i3GEO.mapa.legendaHTML.atualiza()},libera:function(ck,largura,altura,topo,esquerda){if(!ck){ck="nao"}if(!largura){largura=340}if(!altura){altura=300}var cabecalho,minimiza,janela,titulo;i3GEO.util.removeChild("corpoLegi");i3GEO.util.defineValor(i3GEO.mapa.legendaHTML.ID,"innerHTML","");janela=YAHOO.i3GEO.janela.manager.find("wlegenda");if(janela){i3GEO.janela.destroi("wlegenda")}cabecalho=function(){};minimiza=function(){var t=i3GEO.janela.minimiza("wlegenda","100px");if(t==="min"){$i("legendaTituloI").style.display="none"}else{$i("legendaTituloI").style.display="block"}};titulo="<span class='i3GEOiconeFerramenta i3GEOiconeLegenda' title='"+$trad("P3")+"'></span>"+"<div class='i3GeoTituloJanela' id='legendaTituloI'>"+$trad("p3")+"</div>";janela=i3GEO.janela.cria(largura+"px",altura+"px","","","",titulo,"wlegenda",false,"hd",cabecalho,minimiza,"","","","","nao");$i("wlegenda_corpo").style.backgroundColor="white";i3GEO.mapa.legendaHTML.ID="wlegenda_corpo";i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza();if(topo&&esquerda){janela=YAHOO.i3GEO.janela.manager.find("wlegenda");janela.moveTo(esquerda,topo)}}},dialogo:{listaLayersWms:function(servico){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwms/listalayers.php?servico="+servico,"","","<div class='i3GeoTituloJanela'>"+$trad("a4")+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=28' ><b> </b></a></div>","i3GEO.conectarwms",false,"hd","","","",true)},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.iniciaJanelaFlutuante()")},ferramentas:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.ferramentas()","atalhosmapa","atalhosmapa","dependencias.php","i3GEOF.atalhosmapa.iniciaJanelaFlutuante()")},html2canvas:function(obj){var temp=function(){i3GEOF.html2canvas.iniciaJanelaFlutuante(obj)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.html2canvas()","html2canvas","html2canvas","dependencias.php",temp)},wkt2layer:function(wkt,texto){var temp=function(){i3GEOF.wkt2layer.iniciaJanelaFlutuante(wkt,texto)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wkt2layer()","wkt2layer","wkt2layer","dependencias.php",temp)},atalhosedicao:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.atalhosedicao()","atalhosedicao","atalhosedicao","dependencias.php","i3GEOF.atalhosedicao.iniciaJanelaFlutuante()")},geolocal:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal","dependencias.php","i3GEOF.geolocal.iniciaJanelaFlutuante()")},listaDeMapasBanco:function(idonde){if(idonde){i3GEO.guias.CONFIGURA["mapas"].click.call(this,idonde);return}if(i3GEO.guias.CONFIGURA["mapas"]){var janela,divid;if($i("i3GEOFsalvaMapaLista")){return}janela=i3GEO.janela.cria("600px","350px","","","","","i3GEOFsalvaMapaLista",false,"hd");divid=janela[2].id;i3GEO.guias.CONFIGURA["mapas"].click.call(this,divid)}else{window.open(i3GEO.configura.locaplic+"/admin/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=YAHOO.util.Dom.generateId(),cabecalho=function(){},titulo,minimiza=function(){i3GEO.janela.minimiza(idjanela)};if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){url=i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<div class='i3GeoTituloJanela'><span class='i3GEOiconeFerramenta i3GEOiconeCongela'></span>"+"Mapa"+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=123' ><b> </b></a></div>";i3GEO.janela.cria("500px","350px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza)}},metaestat:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;i3GEOF.metaestat.comum.iniciaDicionario(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js",temp)},metaestatListaMapas:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()")},preferencias:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias")},locregiao:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.locregiao.iniciaDicionario(largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js",temp)},filtraregiao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa")},telaRemota:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.telaremota()","telaremota","telaremota")},t3d:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d")},imprimir:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir","dependencias.php","i3GEOF.imprimir.iniciaJanelaFlutuante()")},mostraExten:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten","dependencias.php","i3GEOF.mostraExten.iniciaJanelaFlutuante()")},outputformat:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat","dependencias.php","i3GEOF.outputformat.iniciaJanelaFlutuante()")},autoredesenha:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo","dependencias.php","i3GEOF.opcoesTempo.iniciaJanelaFlutuante()")},salvaMapa:function(){if(i3GEO.parametros===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa","dependencias.php","i3GEOF.salvaMapa.iniciaJanelaFlutuante()")},carregaMapa:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.carregaMapa()","carregamapa","carregaMapa","dependencias.php","i3GEOF.carregaMapa.iniciaJanelaFlutuante()")},convertews:function(){if(i3GEO.parametros.mapfile===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml","dependencias.php","i3GEOF.converteMapaKml.iniciaJanelaFlutuante()")},queryMap:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery","dependencias.php","i3GEOF.opcoesQuery.iniciaJanelaFlutuante()")},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","<div class='i3GeoTituloJanela'>Template<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' ><b> </b></a></div>")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho","dependencias.php","i3GEOF.opcoesTamanho.iniciaJanelaFlutuante()")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem","dependencias.php","i3GEOF.tipoimagem.iniciaJanelaFlutuante()")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo","dependencias.php","i3GEOF.opcoesFundo.iniciaJanelaFlutuante()")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala","dependencias.php","i3GEOF.opcoesEscala.iniciaJanelaFlutuante()")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda","dependencias.php","i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord","dependencias.php","i3GEOF.gradeCoord.iniciaJanelaFlutuante()")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt","dependencias.php","i3GEOF.inseretxt.iniciaJanelaFlutuante()")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy","dependencias.php","i3GEOF.inserexy.iniciaJanelaFlutuante()")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico","dependencias.php","i3GEOF.insereGrafico.iniciaJanelaFlutuante()")},cliqueIdentificaDefault:function(x,y){if(objposicaocursor.imgx<70){return}if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identifica"&&i3GEO.eventos.cliquePerm.ativo===false){return}i3GEO.eventos.removeEventos("MOUSEPARADO",["verificaTip()"]);if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php",temp=function(){if(x){i3GEOF.identifica.criaJanelaFlutuante(x,y)}else{i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy)}};i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{if(x){i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y)}else{i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy)}return}},verificaTipDefault:function(e){if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identificaBalao"&&i3GEO.eventos.cliquePerm.ativo===false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}var ntemas,etiquetas,j,retorna,x=objposicaocursor.ddx,y=objposicaocursor.ddy;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.aguarde.visibility="visible"}retorna=function(retorno){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",classeCor,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,tipotip=configura.tipotip;i3GEO.eventos.cliquePerm.status=true;mostra=false;retorno=retorno.data;if(retorno!==""){res="";temas=retorno;if(!temas){return}ntemas=temas.length;for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;if(tipotip!="simples"){titulo="<span class='toolTipBalaoTitulo'><b>"+titulo+"</b></span><br>"}else{titulo=""}tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempCompleto="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;classeCor="toolTipBalaoTexto";for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='"+classeCor+"'>";textoTempSimples+="<div class='"+classeCor+"'>";for(r=0;r<ntips;r+=1){try{temp="";var alias=ds[s][tips[r]].alias;var valor=ds[s][tips[r]].valor;var link=ds[s][tips[r]].link;var img=ds[s][tips[r]].img;if(valor!==""&&link===""){temp+="<span>"+alias+" :"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span>"+alias+" : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(tipotip!="completo"&&ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}if(classeCor==="toolTipBalaoTexto"){classeCor="toolTipBalaoTexto1"}else{classeCor="toolTipBalaoTexto"}textoTempCompleto+="</div>";textoTempSimples+="</div>"}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(tipotip!="simples"){res=textoSimples}else{res=textoCompleto}if(tipotip==="balao"){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y)}else{n=$i(tipotip);if(!n){n=i3GEO.janela.tip();n=$i(n);n.style.textAlign="left";n.innerHTML+=res}else{n.innerHTML=textoSimples}}}}if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).title="";temp="identifica";i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic)}};i3GEO.php.identifica3(retorna,x,y,i3GEO.mapa.RESOLUCAOTIP,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten)}}}; | |
237 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",AUTORESIZE:false,RESOLUCAOTIP:8,GEOXML:[],insereDobraPagina:function(tipo,imagem){if(i3GEO.parametros.w<700){return}var novoel=$i("i3GEOdobraPagina");if(!novoel){novoel=document.createElement("img")}novoel.src=imagem;novoel.id="i3GEOdobraPagina";if(tipo==="googlemaps"){novoel.onclick=function(evt){i3GEO.Interface.atual2gm.inicia()}}if(tipo==="openlayers"){novoel.onclick=function(evt){if(i3GEO.Interface.ATUAL==="googlemaps"&&i3GeoMap.getStreetView().getVisible()===true){i3GeoMap.getStreetView().setVisible(false)}else{i3GEO.Interface.atual2ol.inicia()}}}novoel.style.cursor="pointer";novoel.style.position="absolute";novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.zIndex="5000000";novoel.style.left=i3GEO.parametros.w-35+"px";$i(i3GEO.Interface.IDMAPA).appendChild(novoel);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.stopPropagation);YAHOO.util.Event.addListener("i3GEOdobraPagina","click",YAHOO.util.Event.preventDefault)},reposicionaDobraPagina:function(){var novoel=$i("i3GEOdobraPagina");if(!novoel){return}novoel.style.top=i3GEO.parametros.h-35+"px";novoel.style.left=i3GEO.parametros.w-35+"px"},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=YAHOO.util.Dom.getViewportWidth();Dh=YAHOO.util.Dom.getViewportHeight();i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.barraDeBotoes.recria("i3geo_barra2");if(i3GEO.Interface.TABLET===true){i3GEO.guias.escondeGuias();return}if(i3GEO.guias.TIPO==="movel"){i3GEO.guias.guiaMovel.reposiciona();i3GEO.guias.guiaMovel.abreFecha("fecha")}else{i3GEO.guias.ajustaAltura()}i3GEO.mapa.reposicionaDobraPagina();ativo=true},2000)}ativo=false}},ajustaPosicao:function(elemento){if(arguments.length===0){return}var imagemxi=0,imagemyi=0,dc=$i(elemento),c;if(!dc){return}try{while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi+=dc.offsetLeft;imagemyi+=dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{i3GEO.util.$left(i3GEO.Interface.IDCORPO,imagemxi)}i3GEO.util.$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){if(codigo){if(codigo===""){return}if(i3GEO.temaAtivo!==""){i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","")}i3GEO.temaAtivo=codigo;i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown")}},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert($trad("x21"));return}i3GEO.php.ativalogo(i3GEO.atualiza);var cr=$i("i3GEOcopyright");if(cr){if(cr.style.display==="block"){cr.style.display="none"}else{cr.style.display="block"}}},verifica:function(retorno){try{if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},compactaLayerGrafico:function(){var geos=false,geometrias=[],n=0,i,g;if(i3GEO.editorOL&&i3GEO.desenho.layergrafico&&i3GEO.desenho.layergrafico.features){geos=i3GEO.desenho.layergrafico.features;n=geos.length;for(i=0;i<n;i++){g={"atributos":geos[i].attributes,"geometria":geos[i].geometry.toString()};geometrias.push(g)}}g=YAHOO.lang.JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=YAHOO.lang.JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.barraDeBotoes.editor[i3GEO.Interface.ATUAL].ativaPainel();var n=geometrias.length,i;for(i=0;i<n;i++){i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos)}i3GEO.editorOL.sobeLayersGraficos()};if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/classesjs/compactados/classe_editorol_compacto.js",inicia,"editorol.js",true)}}},restauraGraficos:function(graficos){if(graficos.length>0){var inicia=function(){i3GEOF.graficointerativo1.restauraGraficos(graficos)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",inicia,"graficointerativo1",true)}},restauraTabelas:function(tabelas){if(tabelas.length>0){var inicia=function(){i3GEOF.tabela.restauraTabelas(tabelas)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/tabela/dependencias.php",inicia,"tabela",true)}},aplicaPreferencias:function(cookies){var props,nprops,i,temp=[],pint;if(!cookies){cookies=i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo")}if(cookies){props=cookies.split("::");nprops=props.length;for(i=0;i<nprops;i++){try{temp=props[i].split("|");pint=parseInt(temp[1],10);if(temp[1]==='true'||temp[1]==='false'){if(temp[1]==='true'){temp[1]=true}if(temp[1]==='false'){temp[1]=false}eval(temp[0]+" = "+temp[1]+";")}else if(pint+"px"==temp[1]){eval(temp[0]+" = '"+temp[1]+"';")}else if(YAHOO.lang.isNumber(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}if(temp[0]=="i3GEO.configura.mapaRefDisplay"){i3GEO.util.insereCookie("i3GEO.configura.mapaRefDisplay",temp[1])}}catch(e){}}}},legendaHTML:{incluiBotaoLibera:false,ID:"",CAMADASSEMLEGENDA:[],POSICAO:"",cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var idleg=$i("wlegenda_corpo"),temp=function(retorno){var legenda="",ins,re,desativar,tema="",classe="",b;re=new RegExp();if(retorno.data!=="erro"&&retorno.data!==undefined){re=new RegExp("legendack_","g");retorno.data.legenda=retorno.data.legenda.replace(re,"liblegendack_");legenda="<div class='botoesLegendaFlutuante'>"+"<input type='button' value='"+$trad("mostraTodosLegenda")+"' id='legendaMostraTodos' />"+"<input type='button' value='"+$trad("mostraSoLegenda")+"' id='legendaMostraSo' />"+"<input type='button' value='PNG' id='legendaExpImagem' />"+"</div>"+"<div id='i3GEOconteudoLegenda' class='i3GEOconteudoLegendaClass' style='width:100%;height:100%;'><div>"+retorno.data.legenda+"</div>"}if(legenda!=""&&idleg){ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+='<div style="cursor: pointer; text-align: left; font-size: 10px; display: block; height: 35px;" onclick="i3GEO.mapa.legendaHTML.libera()"><img id="soltaLeg" src="../imagens/branco.gif" title="clique para liberar" style="margin: 5px; position: relative;"> <p style="position: relative; left: -35px; top: -22px;">'+$trad("x11")+'</p></div>'}re=new RegExp("<img src='' />","g");legenda=legenda.replace(re,"");ins+="<div id='corpoLegi' >"+legenda+"</div>";idleg.innerHTML="<div style='padding:5px;' >"+ins+"</div>";if($i("legendaMostraTodos")){b=new YAHOO.widget.Button("legendaMostraTodos",{onclick:{fn:function(){i3GEO.mapa.legendaHTML.mostraTodosOsTemas()}}});b.addClass("legendaMostraTodosTemas");b=new YAHOO.widget.Button("legendaMostraSo",{onclick:{fn:function(){var n,i,temp,raiz=$i("corpoLegi").parentNode;temp=raiz.getElementsByClassName("i3GEOLegendaExcluiTema");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}temp=raiz.getElementsByTagName("input");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}}}});b.addClass("legendaMostraSoTemas");b=new YAHOO.widget.Button("legendaExpImagem",{onclick:{fn:function(){var obj=$i("i3GEOconteudoLegenda");obj.style.width=$i("wlegenda").style.width;obj.style.height=$i("wlegenda_corpo").style.height;i3GEO.mapa.dialogo.html2canvas(obj)}}});b.addClass("legendaExpImagemPng")}}i3GEO.mapa.legendaHTML.escondeTemasMarcados();desativar=retorno.data.desativar;for(tema in desativar){for(classe in desativar[tema]){ins=$i("liblegendack_"+tema+"_"+desativar[tema][classe]);if(ins){ins.checked=false}}}};if(idleg&&idleg.style.display==="block"){if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg){idleg.innerHTML=""}}i3GEO.mapa.legendaHTML.obtem(temp)}else{if(idleg){idleg.innerHTML=""}if(i3GEO.mapa.legendaHTML.ID!==""){idleg=$i(i3GEO.mapa.legendaHTML.ID);if(idleg&&idleg.style.display==="block"){i3GEO.mapa.legendaHTML.obtem(temp)}}}},obtem:function(funcao){i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda)},ativaDesativaTema:function(inputbox){var temp=function(){i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem);i3GEO.arvoreDeCamadas.atualiza("");i3GEO.janela.fechaAguarde("redesenha")};if(!inputbox.checked){i3GEO.php.ligatemas(temp,inputbox.value,"")}else{i3GEO.php.ligatemas(temp,"",inputbox.value)}},escondeTema:function(tema){var d=$i("legendaLayer_"+tema);if(d){d.style.display="none";i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA.push(tema)}},escondeTemasMarcados:function(){var temas=i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA,n=temas.length,i,temp;for(i=0;i<n;i++){temp=$i(temas[i]);if(temp){temp.style.display="none"}}},mostraTodosOsTemas:function(){i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA=[];i3GEO.mapa.legendaHTML.atualiza()},libera:function(ck,largura,altura,topo,esquerda){if(!ck){ck="nao"}if(!largura){largura=340}if(!altura){altura=300}var cabecalho,minimiza,janela,titulo;if(i3GEO.mapa.legendaHTML.POSICAO!=""){topo=i3GEO.mapa.legendaHTML.POSICAO[1];esquerda=i3GEO.mapa.legendaHTML.POSICAO[0]}i3GEO.util.removeChild("corpoLegi");i3GEO.util.defineValor(i3GEO.mapa.legendaHTML.ID,"innerHTML","");janela=YAHOO.i3GEO.janela.manager.find("wlegenda");if(janela){i3GEO.janela.destroi("wlegenda")}cabecalho=function(){};minimiza=function(){var t=i3GEO.janela.minimiza("wlegenda","100px");if(t==="min"){$i("legendaTituloI").style.display="none"}else{$i("legendaTituloI").style.display="block"}};titulo="<span class='i3GEOiconeFerramenta i3GEOiconeLegenda' title='"+$trad("P3")+"'></span>"+"<div class='i3GeoTituloJanela' id='legendaTituloI'>"+$trad("p3")+"</div>";janela=i3GEO.janela.cria(largura+"px",altura+"px","","","",titulo,"wlegenda",false,"hd",cabecalho,minimiza,"","","","","nao");$i("wlegenda_corpo").style.backgroundColor="white";i3GEO.mapa.legendaHTML.ID="wlegenda_corpo";i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.mapa.legendaHTML.atualiza()"]);janela[0].moveEvent.subscribe(function(o,p){i3GEO.mapa.legendaHTML.POSICAO=p[0]});i3GEO.mapa.legendaHTML.atualiza();if(topo&&esquerda){janela=YAHOO.i3GEO.janela.manager.find("wlegenda");janela.moveTo(esquerda,topo)}}},dialogo:{listaLayersWms:function(servico){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwms/listalayers.php?servico="+servico,"","","<div class='i3GeoTituloJanela'>"+$trad("a4")+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=28' ><b> </b></a></div>","i3GEO.conectarwms",false,"hd","","","",true)},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.iniciaJanelaFlutuante()")},ferramentas:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.ferramentas()","atalhosmapa","atalhosmapa","dependencias.php","i3GEOF.atalhosmapa.iniciaJanelaFlutuante()")},html2canvas:function(obj){var temp=function(){i3GEOF.html2canvas.iniciaJanelaFlutuante(obj)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.html2canvas()","html2canvas","html2canvas","dependencias.php",temp)},wkt2layer:function(wkt,texto){var temp=function(){i3GEOF.wkt2layer.iniciaJanelaFlutuante(wkt,texto)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wkt2layer()","wkt2layer","wkt2layer","dependencias.php",temp)},atalhosedicao:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.atalhosedicao()","atalhosedicao","atalhosedicao","dependencias.php","i3GEOF.atalhosedicao.iniciaJanelaFlutuante()")},geolocal:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal","dependencias.php","i3GEOF.geolocal.iniciaJanelaFlutuante()")},listaDeMapasBanco:function(idonde){if(idonde){i3GEO.guias.CONFIGURA["mapas"].click.call(this,idonde);return}if(i3GEO.guias.CONFIGURA["mapas"]){var janela,divid;if($i("i3GEOFsalvaMapaLista")){return}janela=i3GEO.janela.cria("600px","350px","","","","","i3GEOFsalvaMapaLista",false,"hd");divid=janela[2].id;i3GEO.guias.CONFIGURA["mapas"].click.call(this,divid)}else{window.open(i3GEO.configura.locaplic+"/admin/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=YAHOO.util.Dom.generateId(),cabecalho=function(){},titulo,minimiza=function(){i3GEO.janela.minimiza(idjanela)};if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){url=i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<div class='i3GeoTituloJanela'><span class='i3GEOiconeFerramenta i3GEOiconeCongela'></span>"+"Mapa"+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=123' ><b> </b></a></div>";i3GEO.janela.cria("500px","350px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza)}},metaestat:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;i3GEOF.metaestat.comum.iniciaDicionario(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js",temp)},metaestatListaMapas:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()")},preferencias:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias")},locregiao:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.locregiao.iniciaDicionario(largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js",temp)},filtraregiao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa")},telaRemota:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.telaremota()","telaremota","telaremota")},t3d:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d")},imprimir:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir","dependencias.php","i3GEOF.imprimir.iniciaJanelaFlutuante()")},mostraExten:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten","dependencias.php","i3GEOF.mostraExten.iniciaJanelaFlutuante()")},outputformat:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat","dependencias.php","i3GEOF.outputformat.iniciaJanelaFlutuante()")},autoredesenha:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo","dependencias.php","i3GEOF.opcoesTempo.iniciaJanelaFlutuante()")},salvaMapa:function(){if(i3GEO.parametros===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa","dependencias.php","i3GEOF.salvaMapa.iniciaJanelaFlutuante()")},carregaMapa:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.carregaMapa()","carregamapa","carregaMapa","dependencias.php","i3GEOF.carregaMapa.iniciaJanelaFlutuante()")},convertews:function(){if(i3GEO.parametros.mapfile===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml","dependencias.php","i3GEOF.converteMapaKml.iniciaJanelaFlutuante()")},queryMap:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery","dependencias.php","i3GEOF.opcoesQuery.iniciaJanelaFlutuante()")},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","<div class='i3GeoTituloJanela'>Template<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' ><b> </b></a></div>")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho","dependencias.php","i3GEOF.opcoesTamanho.iniciaJanelaFlutuante()")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem","dependencias.php","i3GEOF.tipoimagem.iniciaJanelaFlutuante()")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo","dependencias.php","i3GEOF.opcoesFundo.iniciaJanelaFlutuante()")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala","dependencias.php","i3GEOF.opcoesEscala.iniciaJanelaFlutuante()")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda","dependencias.php","i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord","dependencias.php","i3GEOF.gradeCoord.iniciaJanelaFlutuante()")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt","dependencias.php","i3GEOF.inseretxt.iniciaJanelaFlutuante()")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy","dependencias.php","i3GEOF.inserexy.iniciaJanelaFlutuante()")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico","dependencias.php","i3GEOF.insereGrafico.iniciaJanelaFlutuante()")},cliqueIdentificaDefault:function(x,y){if(objposicaocursor.imgx<70){return}if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identifica"&&i3GEO.eventos.cliquePerm.ativo===false){return}i3GEO.eventos.removeEventos("MOUSEPARADO",["verificaTip()"]);if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php",temp=function(){if(x){i3GEOF.identifica.criaJanelaFlutuante(x,y)}else{i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy)}};i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{if(x){i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y)}else{i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy)}return}},verificaTipDefault:function(e){if(i3GEO.barraDeBotoes.BOTAOCLICADO!=="identificaBalao"&&i3GEO.eventos.cliquePerm.ativo===false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(i3GEO.Interface.ATUAL==="googleearth"&&i3GEO.eventos.MOUSECLIQUE.length>1){return}var ntemas,etiquetas,j,retorna,x=objposicaocursor.ddx,y=objposicaocursor.ddy;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.aguarde.visibility="visible"}retorna=function(retorno){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",classeCor,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,tipotip=configura.tipotip;i3GEO.eventos.cliquePerm.status=true;mostra=false;retorno=retorno.data;if(retorno!==""){res="";temas=retorno;if(!temas){return}ntemas=temas.length;for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;if(tipotip!="simples"){titulo="<span class='toolTipBalaoTitulo'><b>"+titulo+"</b></span><br>"}else{titulo=""}tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempCompleto="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;classeCor="toolTipBalaoTexto";for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='"+classeCor+"'>";textoTempSimples+="<div class='"+classeCor+"'>";for(r=0;r<ntips;r+=1){try{temp="";var alias=ds[s][tips[r]].alias;var valor=ds[s][tips[r]].valor;var link=ds[s][tips[r]].link;var img=ds[s][tips[r]].img;if(valor!==""&&link===""){temp+="<span>"+alias+" :"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span>"+alias+" : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(tipotip!="completo"&&ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}if(classeCor==="toolTipBalaoTexto"){classeCor="toolTipBalaoTexto1"}else{classeCor="toolTipBalaoTexto"}textoTempCompleto+="</div>";textoTempSimples+="</div>"}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(tipotip!="simples"){res=textoSimples}else{res=textoCompleto}if(tipotip==="balao"){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y)}else{n=$i(tipotip);if(!n){n=i3GEO.janela.tip();n=$i(n);n.style.textAlign="left";n.innerHTML+=res}else{n.innerHTML=textoSimples}}}}if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).title="";temp="identifica";i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic)}};i3GEO.php.identifica3(retorna,x,y,i3GEO.mapa.RESOLUCAOTIP,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten)}}}; | |
238 | 238 | // |
239 | 239 | //compactados/classe_tema_compacto.js |
240 | 240 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.tema={TEMPORIZADORESID:{},ativaFerramentas:function(camada){if(camada.ferramentas&&camada.ferramentas!=""){var f=camada.ferramentas;if(f.tme&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.animagif(camada.name)}}},exclui:function(tema,confirma){if(confirma&&confirma===true){i3GEO.janela.confirma($trad("removerDoMapa"),300,$trad("x14"),"",function(){i3GEO.tema.exclui(tema)});return}try{try{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}try{var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p)}catch(rr){}var ck=i3GEO.arvoreDeTemas.buscaCheckbox(tema);if(ck){ck.checked=false}}catch(e){}i3GEO.php.excluitema(i3GEO.atualiza,[tema]);i3GEO.mapa.ativaTema("");i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/admin/abrefontemapfile.php?tema="+tema}if(!popup){window.open(link)}else{i3GEO.janela.cria((i3GEO.parametros.w/2)+25+"px",(i3GEO.parametros.h/2)+18+"px",link,"","","<div class='i3GeoTituloJanela'>Metadata</div>","metadata"+tema)}},sobe:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.descetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},zoom:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.limpasel(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,tema)},tema)},mudatransp:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){if($i("tr"+idtema)){valor=$i("tr"+idtema).value}}if(valor!==""){i3GEO.php.mudatransp(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,idtema)},idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x16"))}},invertestatuslegenda:function(idtema){i3GEO.janela.tempoMsg($trad("x17"));i3GEO.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb){i3GEO.mapa.ativaTema(idtema);i3GEO.php.aplicaCorClasseTema(temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)},idtema,idclasse,rgb)},mudanome:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){return}if(valor!==""){i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x18"))}},copia:function(idtema){i3GEO.php.copiatema(i3GEO.atualiza,idtema)},mostralegendajanela:function(idtema,nome,tipoOperacao){if(tipoOperacao==="ativatimer"){mostralegendajanelaTimer=setTimeout("i3GEO.tema.mostralegendajanela('"+idtema+"','"+nome+"','abrejanela')",4000)}if(tipoOperacao==="abrejanela"){try{clearTimeout(mostralegendajanelaTimer)}catch(e){}if(!$i("janelaLegenda"+idtema)){var janela=i3GEO.janela.cria("250px","","","","",nome,"janelaLegenda"+idtema,false);janela[2].style.textAlign="left";janela[2].style.background="white";janela[2].innerHTML=$trad("o1")}i3GEO.php.criaLegendaHTML(function(retorno){$i("janelaLegenda"+idtema+"_corpo").innerHTML=retorno.data.legenda},idtema,"legenda3.htm")}if(tipoOperacao==="desativatimer"){clearTimeout(mostralegendajanelaTimer)}},temporizador:function(idtema,tempo){var t;if(!tempo){if($i("temporizador"+idtema)){tempo=$i("temporizador"+idtema).value}else{tempo=0}}if(tempo!=""&&parseInt(tempo,10)>0){t=function(){if(!$i("arrastar_"+idtema)){delete(i3GEO.tema.TEMPORIZADORESID[idtema]);return}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.tema.TEMPORIZADORESID[idtema]={tempo:tempo,idtemporizador:setInterval(t,parseInt(tempo,10)*1000)}}else{try{window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador);delete(i3GEO.tema.TEMPORIZADORESID[idtema])}catch(e){}}},dialogo:{animagif:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.animagif.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animagif()","animagif","animagif","dependencias.php",temp)},tme:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.tme.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","dependencias.php",temp)},storymap:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.storymap.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.storymap()","storymap","storymap","dependencias.php",temp)},mostraWms:function(tema){i3GEO.janela.mensagemSimples(i3GEO.configura.locaplic+"/ogc.php?tema="+tema,"WMS url")},comentario:function(tema){i3GEO.janela.cria("530px","330px",i3GEO.configura.locaplic+"/ferramentas/comentarios/index.php?tema="+tema+"&g_sid="+i3GEO.configura.sid+"&locaplic="+i3GEO.configura.locaplic,"","","<img src='"+i3GEO.configura.locaplic+"/imagens/player_volta.png' style=cursor:pointer onclick='javascript:history.go(-1)'><span style=position:relative;top:-2px; > "+$trad("x19")+" "+tema+"</span><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a>","comentario"+Math.random())},cortina:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.cortina()","cortina","cortina","dependencias.php","i3GEOF.cortina.iniciaJanelaFlutuante()")},mmscale:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.mmscale()","mmscale","mmscale","dependencias.php","i3GEOF.mmscale.iniciaJanelaFlutuante()")},atalhoscamada:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.atalhoscamada()","atalhoscamada","atalhoscamada","dependencias.php","i3GEOF.atalhoscamada.iniciaJanelaFlutuante()")},abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js","i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}else{i3GEOF.converteKml.criaJanelaFlutuante(tema,tipo)}},salvaMapfile:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.salvaMapfile()","salvamapfile","salvamapfile")},graficotema:function(idtema,propriedades){i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.graficoTema.iniciaJanelaFlutuante(propriedades)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.graficotema()","graficotema","graficoTema","dependencias.php",temp)},toponimia:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.filtro.iniciaJanelaFlutuante(modoCalculadora,idRetorno)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.filtro()","filtro","filtro","dependencias.php",temp)},procuraratrib:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.procuraratrib()","busca","busca","dependencias.php","i3GEOF.busca.iniciaJanelaFlutuante()")},tabela:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.legenda.aposIniciar=function(){i3GEOF.legenda.classe=0;i3GEOF.legenda.estilo=0;i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_'+idtema+"-"+idclasse);i3GEOF.legenda.aposIniciar=function(){}};i3GEOF.legenda.iniciaJanelaFlutuante(idtema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php",temp)},download:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.download()","download","download")},ogcwindow:function(idtema){i3GEO.mapa.ativaTema(idtema);window.open(i3GEO.configura.locaplic+"/ogc.htm?temaOgc="+idtema)},sld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","<div class='i3GeoTituloJanela'>SLD<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' ><b> </b></a></div>")},aplicarsld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.aplicarsld()","aplicarsld","aplicarsld","dependencias.php","i3GEOF.aplicarsld.iniciaJanelaFlutuante()")},editorsql:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql","dependencias.php","i3GEOF.editorsql.iniciaJanelaFlutuante()")},mudanome:function(idtema){i3GEO.mapa.ativaTema(idtema);var temp=function(){var valor=$i("i3GEOjanelaprompt").value;i3GEO.tema.mudanome(idtema,valor)};i3GEO.janela.prompt($trad("novonome"),temp)}}}; | ... | ... |
classesphp/mapa_controle.php
... | ... | @@ -1612,10 +1612,10 @@ switch (strtoupper($funcao)) |
1612 | 1612 | $filtro = $_pg["filtro"]; |
1613 | 1613 | |
1614 | 1614 | $m = new Menutemas($map_file,$perfil,$locaplic,$urli3geo,$editores,$idioma,$filtro); |
1615 | - if(!isset($idmenu)){ | |
1616 | - $idmenu = ""; | |
1615 | + if(!isset($_pg["idmenu"])){ | |
1616 | + $_pg["idmenu"] = ""; | |
1617 | 1617 | } |
1618 | - $retorno = $m->pegaListaDeSubGrupos($grupo,$idmenu); | |
1618 | + $retorno = $m->pegaListaDeSubGrupos($_pg["grupo"],$_pg["idmenu"]); | |
1619 | 1619 | break; |
1620 | 1620 | /* |
1621 | 1621 | Valor: PEGALISTADETEMAS |
... | ... | @@ -1631,10 +1631,10 @@ switch (strtoupper($funcao)) |
1631 | 1631 | $idioma = $_pg["idioma"]; |
1632 | 1632 | |
1633 | 1633 | $m = new Menutemas($map_file,$perfil,$locaplic,$urli3geo,$editores,$idioma); |
1634 | - if(!isset($idmenu)){ | |
1635 | - $idmenu = ""; | |
1634 | + if(!isset($_pg["idmenu"])){ | |
1635 | + $_pg["idmenu"] = ""; | |
1636 | 1636 | } |
1637 | - $retorno = array("temas"=>$m->pegaListaDeTemas($grupo,$subgrupo,$idmenu)); | |
1637 | + $retorno = array("temas"=>$m->pegaListaDeTemas($_pg["grupo"],$_pg["subgrupo"],$_pg["idmenu"])); | |
1638 | 1638 | break; |
1639 | 1639 | /* |
1640 | 1640 | Valor: PEGATODOSTEMAS | ... | ... |
ferramentas/opcoes_escala/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -17,7 +17,7 @@ Aplica novos par&acirc;metros na barra de escala atual. |
17 | 17 | include_once(dirname(__FILE__)."/../../classesphp/classe_escala.php"); |
18 | 18 | copiaSeguranca($map_file); |
19 | 19 | $m = new Escala($map_file); |
20 | - $retorno = $m->mudaEscalaGrafica($w,$h,$estilo,$intervalos,$unidade,$cor,$bcor,$ocor,$status); | |
20 | + $retorno = $m->mudaEscalaGrafica($_GET["w"],$_GET["h"],$_GET["estilo"],$_GET["intervalos"],$_GET["unidade"],$_GET["cor"],$_GET["bcor"],$_GET["ocor"],$_GET["status"]); | |
21 | 21 | $_SESSION["contadorsalva"]++; |
22 | 22 | break; |
23 | 23 | /* |
... | ... | @@ -42,15 +42,12 @@ Testa os novos par&acirc;metros de uma barra de escala. |
42 | 42 | case "TESTAESCALAGRAFICA": |
43 | 43 | include_once(dirname(__FILE__)."/../../classesphp/classe_escala.php"); |
44 | 44 | $m = new Escala($map_file); |
45 | - $retorno = $m->testaescalagrafica($w,$h,$estilo,$intervalos,$unidade,$cor,$bcor,$ocor); | |
45 | + $retorno = $m->testaescalagrafica($_GET["w"],$_GET["h"],$_GET["estilo"],$_GET["intervalos"],$_GET["unidade"],$_GET["cor"],$_GET["bcor"],$_GET["ocor"]); | |
46 | 46 | break; |
47 | 47 | |
48 | 48 | } |
49 | -if (!connection_aborted()){ | |
50 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
49 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
51 | 50 | restauraCon($map_file,$postgis_mapa); |
52 | - cpjson($retorno); | |
53 | 51 | } |
54 | -else | |
55 | -{exit();} | |
52 | +cpjson($retorno); | |
56 | 53 | ?> |
57 | 54 | \ No newline at end of file | ... | ... |
ferramentas/opcoes_fundo/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -37,7 +37,7 @@ Altera a cor do fundo do mapa. |
37 | 37 | include_once(dirname(__FILE__)."/../../classesphp/classe_mapa.php"); |
38 | 38 | copiaSeguranca($map_file); |
39 | 39 | $m = new Mapa($map_file); |
40 | - $m->corfundo($cor); | |
40 | + $m->corfundo($_GET["cor"]); | |
41 | 41 | $m->salva(); |
42 | 42 | //no caso da interface openlayers, o mapfile é outro |
43 | 43 | /* |
... | ... | @@ -53,12 +53,9 @@ Altera a cor do fundo do mapa. |
53 | 53 | break; |
54 | 54 | |
55 | 55 | } |
56 | -if (!connection_aborted()){ | |
57 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
56 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
58 | 57 | restauraCon($map_file,$postgis_mapa); |
59 | - cpjson($retorno); | |
60 | 58 | } |
61 | -else | |
62 | -{exit();} | |
59 | +cpjson($retorno); | |
63 | 60 | |
64 | 61 | ?> |
65 | 62 | \ No newline at end of file | ... | ... |
ferramentas/opcoes_legenda/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -24,7 +24,7 @@ Aplica um par&acirc;metro em um estilo de uma classe. |
24 | 24 | $utilizacgi = "nao"; |
25 | 25 | } |
26 | 26 | $m = new Legenda($map_file); |
27 | - $retorno = $m->aplicaParametrosLegImg($fonte,$imagecolor,$position,$status,$outlinecolor,$keyspacingy,$keyspacingx,$keysizey,$keysizex,$height,$width,$labelsize); | |
27 | + $retorno = $m->aplicaParametrosLegImg($_GET["fonte"],$_GET["imagecolor"],$_GET["position"],$_GET["status"],$_GET["outlinecolor"],$_GET["keyspacingy"],$_GET["keyspacingx"],$_GET["keysizey"],$_GET["keysizex"],$_GET["height"],$_GET["width"],$_GET["labelsize"]); | |
28 | 28 | $m->salva(); |
29 | 29 | $_SESSION["contadorsalva"]++; |
30 | 30 | break; |
... | ... | @@ -52,16 +52,13 @@ Testa os par&acirc;metros de defini&ccedil;&atilde;o da legenda inserida no mapa |
52 | 52 | $map_file = str_replace(".map","",$map_file).".map"; |
53 | 53 | copy($map_file,str_replace(".map","testeleg.map",$map_file)); |
54 | 54 | $m = new Legenda(str_replace(".map","testeleg.map",$map_file)); |
55 | - $m->aplicaParametrosLegImg($fonte,$imagecolor,$position,$status,$outlinecolor,$keyspacingy,$keyspacingx,$keysizey,$keysizex,$height,$width,$labelsize); | |
55 | + $m->aplicaParametrosLegImg($_GET["fonte"],$_GET["imagecolor"],$_GET["position"],$_GET["status"],$_GET["outlinecolor"],$_GET["keyspacingy"],$_GET["keyspacingx"],$_GET["keysizey"],$_GET["keysizex"],$_GET["height"],$_GET["width"],$_GET["labelsize"]); | |
56 | 56 | $retorno = $m->legendaGrafica(); |
57 | 57 | break; |
58 | 58 | |
59 | 59 | } |
60 | -if (!connection_aborted()){ | |
61 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
60 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
62 | 61 | restauraCon($map_file,$postgis_mapa); |
63 | - cpjson($retorno); | |
64 | 62 | } |
65 | -else | |
66 | -{exit();} | |
63 | +cpjson($retorno); | |
67 | 64 | ?> |
68 | 65 | \ No newline at end of file | ... | ... |
ferramentas/opcoes_querymap/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -19,11 +19,8 @@ Pega a cor de sele&ccedil;&atilde;o atual. |
19 | 19 | $retorno = $m->corQM(""); |
20 | 20 | break; |
21 | 21 | } |
22 | -if (!connection_aborted()){ | |
23 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
22 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
24 | 23 | restauraCon($map_file,$postgis_mapa); |
25 | - cpjson($retorno); | |
26 | 24 | } |
27 | -else | |
28 | -{exit();} | |
25 | +cpjson($retorno); | |
29 | 26 | ?> |
30 | 27 | \ No newline at end of file | ... | ... |
ferramentas/opcoes_tamanho/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -16,22 +16,18 @@ Muda o tamanho da imagem do mapa atual. |
16 | 16 | case "MUDATAMANHO": |
17 | 17 | copiaSeguranca($map_file); |
18 | 18 | $map = ms_newMapObj($map_file); |
19 | - $map->setsize($largura,$altura); | |
20 | - if (connection_aborted()){exit();} | |
19 | + $map->setsize($_GET["largura"],$_GET["altura"]); | |
21 | 20 | $salvo = $map->save($map_file); |
22 | 21 | include_once(dirname(__FILE__)."/../../classesphp/classe_mapa.php"); |
23 | 22 | $m = new Mapa($map_file); |
24 | - $m->mudaQS($largura,$altura); | |
23 | + $m->mudaQS($_GET["largura"],$_GET["altura"]); | |
25 | 24 | $retorno = "ok"; |
26 | 25 | $_SESSION["contadorsalva"]++; |
27 | 26 | break; |
28 | 27 | |
29 | 28 | } |
30 | -if (!connection_aborted()){ | |
31 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
29 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
32 | 30 | restauraCon($map_file,$postgis_mapa); |
33 | - cpjson($retorno); | |
34 | 31 | } |
35 | -else | |
36 | -{exit();} | |
32 | +cpjson($retorno); | |
37 | 33 | ?> |
38 | 34 | \ No newline at end of file | ... | ... |
ferramentas/pontoempoligono/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -18,17 +18,14 @@ Salva o mapa acrescentando um novo layer com o resultado. |
18 | 18 | case "PONTOEMPOLIGONO": |
19 | 19 | include_once(dirname(__FILE__)."/../../classesphp/classe_analise.php"); |
20 | 20 | copiaSeguranca($map_file); |
21 | - $m = new Analise($map_file,$temaPt,$locaplic,$ext); | |
22 | - $retorno = $m->pontoEmPoligono($temaPt,$temasPo,$locaplic); | |
21 | + $m = new Analise($map_file,$_GET["temaPt"],$locaplic,$ext); | |
22 | + $retorno = $m->pontoEmPoligono($_GET["temaPt"],$_GET["temasPo"],$locaplic); | |
23 | 23 | $m->salva(); |
24 | 24 | $_SESSION["contadorsalva"]++; |
25 | 25 | break; |
26 | 26 | } |
27 | -if (!connection_aborted()){ | |
28 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
27 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
29 | 28 | restauraCon($map_file,$postgis_mapa); |
30 | - cpjson($retorno); | |
31 | 29 | } |
32 | -else | |
33 | -{exit();} | |
30 | +cpjson($retorno); | |
34 | 31 | ?> |
35 | 32 | \ No newline at end of file | ... | ... |
ferramentas/pontosdistri/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -18,24 +18,21 @@ Executa script R para gerar a imagem. |
18 | 18 | case "ANALISEDISTRIPT": |
19 | 19 | include_once(dirname(__FILE__)."/../../classesphp/classe_analise.php"); |
20 | 20 | copiaSeguranca($map_file); |
21 | - if(!isset($tema2)) | |
22 | - {$tema2 = "";} | |
23 | - if(!isset($limitepontos)) | |
24 | - {$limitepontos = "";} | |
21 | + if(!isset($_GET["tema2"])) | |
22 | + {$_GET["tema2"] = "";} | |
23 | + if(!isset($_GET["limitepontos"])) | |
24 | + {$_GET["limitepontos"] = "";} | |
25 | 25 | $m = new Analise($map_file,$tema,$locaplic,$ext); |
26 | - if(empty($item)){ | |
27 | - $item = ""; | |
26 | + if(empty($_GET["item"])){ | |
27 | + $_GET["item"] = ""; | |
28 | 28 | } |
29 | - $retorno = $m->analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma,$limitepontos,$tema2,$extendelimite); | |
29 | + $retorno = $m->analiseDistriPt($locaplic,$dir_tmp,$R_path,$_GET["numclasses"],$_GET["tipo"],$_GET["cori"],$_GET["corf"],$tmpurl,$_GET["sigma"],$_GET["limitepontos"],$_GET["tema2"],$_GET["extendelimite"]); | |
30 | 30 | $m->salva(); |
31 | 31 | $_SESSION["contadorsalva"]++; |
32 | 32 | break; |
33 | 33 | } |
34 | -if (!connection_aborted()){ | |
35 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
34 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
36 | 35 | restauraCon($map_file,$postgis_mapa); |
37 | - cpjson($retorno); | |
38 | 36 | } |
39 | -else | |
40 | -{exit();} | |
37 | +cpjson($retorno); | |
41 | 38 | ?> |
42 | 39 | \ No newline at end of file | ... | ... |
ferramentas/preferencias/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -8,11 +8,8 @@ switch (strtoupper($funcao)) |
8 | 8 | { |
9 | 9 | |
10 | 10 | } |
11 | -if (!connection_aborted()){ | |
12 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
11 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
13 | 12 | restauraCon($map_file,$postgis_mapa); |
14 | - cpjson($retorno); | |
15 | 13 | } |
16 | -else | |
17 | -{exit();} | |
14 | +cpjson($retorno); | |
18 | 15 | ?> | ... | ... |
ferramentas/salvamapa/geraminiatura.php
... | ... | @@ -9,6 +9,11 @@ |
9 | 9 | */ |
10 | 10 | include_once (dirname(__FILE__)."/../../ms_configura.php"); |
11 | 11 | include_once (dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
12 | + | |
13 | +if (filter_var($_GET["restauramapa"], FILTER_VALIDATE_INT) === false){ | |
14 | + exit; | |
15 | +} | |
16 | + | |
12 | 17 | $base = restauraMapaAdmin($_GET["restauramapa"],$dir_tmp); |
13 | 18 | |
14 | 19 | $nomeImagem = dirname($base)."/".str_replace(".map","","restauramapa".$_GET["restauramapa"])."_miniatura.png"; | ... | ... |
ferramentas/telaremota/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -22,11 +22,8 @@ O ID &eacute; adicionado à string $_SESSION["fingerprint"] separado por ',' |
22 | 22 | break; |
23 | 23 | |
24 | 24 | } |
25 | -if (!connection_aborted()){ | |
26 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
25 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
27 | 26 | restauraCon($map_file,$postgis_mapa); |
28 | - cpjson($retorno); | |
29 | 27 | } |
30 | -else | |
31 | -{exit();} | |
28 | +cpjson($retorno); | |
32 | 29 | ?> |
33 | 30 | \ No newline at end of file | ... | ... |
ferramentas/toponimia/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -23,16 +23,16 @@ Cria um novo tema com a topon&iacute;mia do tema atual. |
23 | 23 | if(!isset($novotema)){ |
24 | 24 | $novotema = "sim"; |
25 | 25 | } |
26 | - $retorno = $m->criaToponimia($item,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$tipo,$wrap,$novotema); | |
27 | - if(empty($maxscale)){ | |
28 | - $maxscale = -1; | |
26 | + $retorno = $m->criaToponimia($_GET["item"],$_GET["position"],$_GET["partials"],$_GET["offsetx"],$_GET["offsety"],$_GET["minfeaturesize"],$_GET["mindistance"],$_GET["force"],$_GET["shadowcolor"],$_GET["shadowsizex"],$_GET["shadowsizey"],$_GET["outlinecolor"],$_GET["cor"],$_GET["sombray"],$_GET["sombrax"],$_GET["sombra"],$_GET["fundo"],$_GET["angulo"],$_GET["tamanho"],$_GET["fonte"],$_GET["tipo"],$_GET["wrap"],$_GET["novotema"]); | |
27 | + if(empty($_GET["maxscale"])){ | |
28 | + $_GET["maxscale"] = -1; | |
29 | 29 | } |
30 | - if(empty($minscale)){ | |
31 | - $minscale = -1; | |
30 | + if(empty($_GET["minscale"])){ | |
31 | + $_GET["minscale"] = -1; | |
32 | 32 | } |
33 | - $m->layer->set("labelmaxscaledenom",$maxscale); | |
34 | - $m->layer->set("labelminscaledenom",$minscale); | |
35 | - if ($tipo != "teste"){ | |
33 | + $m->layer->set("labelmaxscaledenom",$_GET["maxscale"]); | |
34 | + $m->layer->set("labelminscaledenom",$_GET["minscale"]); | |
35 | + if ($_GET["tipo"] != "teste"){ | |
36 | 36 | $m->salva();$_SESSION["contadorsalva"]++; |
37 | 37 | } |
38 | 38 | break; |
... | ... | @@ -46,11 +46,8 @@ Cria um novo tema com a topon&iacute;mia do tema atual. |
46 | 46 | $_SESSION["contadorsalva"]++; |
47 | 47 | break; |
48 | 48 | } |
49 | -if (!connection_aborted()){ | |
50 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
49 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
51 | 50 | restauraCon($map_file,$postgis_mapa); |
52 | - cpjson($retorno); | |
53 | 51 | } |
54 | -else | |
55 | -{exit();} | |
52 | +cpjson($retorno); | |
56 | 53 | ?> | ... | ... |
ferramentas/wkt2layer/exec.php
1 | 1 | <?php |
2 | -include_once(dirname(__FILE__)."/../inicia.php"); | |
2 | +include_once(dirname(__FILE__)."/../safe.php"); | |
3 | 3 | // |
4 | 4 | //faz a busca da função que deve ser executada |
5 | 5 | // |
... | ... | @@ -19,7 +19,7 @@ Insere elementos no mapa como um layer do tipo feature baseado em wkt |
19 | 19 | if(!isset($marca)){ |
20 | 20 | $marca=""; |
21 | 21 | } |
22 | - $shp = ms_shapeObjFromWkt($xy); | |
22 | + $shp = ms_shapeObjFromWkt($_GET["xy"]); | |
23 | 23 | if($shp->type == MS_SHAPE_POINT){ |
24 | 24 | $tipo = "POINT"; |
25 | 25 | } |
... | ... | @@ -29,19 +29,19 @@ Insere elementos no mapa como um layer do tipo feature baseado em wkt |
29 | 29 | if($shp->type == MS_SHAPE_POLYGON){ |
30 | 30 | $tipo = "POLYGON"; |
31 | 31 | } |
32 | - $m->insereFeature($marca,$tipo,$xy,$texto,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$wrap,true,$nometema); | |
32 | + $m->insereFeature($_GET["marca"],$_GET["tipo"],$_GET["xy"],$_GET["texto"],$_GET["position"],$_GET["partials"],$_GET["offsetx"],$_GET["offsety"],$_GET["minfeaturesize"],$_GET["mindistance"],$_GET["force"],$_GET["shadowcolor"],$_GET["shadowsizex"],$_GET["shadowsizey"],$_GET["outlinecolor"],$_GET["cor"],$_GET["sombray"],$_GET["sombrax"],$_GET["sombra"],$_GET["fundo"],$_GET["angulo"],$_GET["tamanho"],$_GET["fonte"],$_GET["wrap"],true,$_GET["nometema"]); | |
33 | 33 | $m->salva(); |
34 | 34 | redesenhaMapa(); |
35 | 35 | break; |
36 | 36 | case "SHAPEFILE": |
37 | 37 | include_once("../../classesphp/classe_analise.php"); |
38 | 38 | $m = new Analise($map_file,""); |
39 | - $nomeLayer = $m->aplicaFuncaoListaWKT(array($xy),"converteSHP",$dir_tmp,$imgdir); | |
39 | + $nomeLayer = $m->aplicaFuncaoListaWKT(array($_GET["xy"]),"converteSHP",$dir_tmp,$imgdir); | |
40 | 40 | $l = $m->mapa->getlayerbyname($nomeLayer); |
41 | - $l->setmetadata("tema",$nometema); | |
41 | + $l->setmetadata("tema",$_GET["nometema"]); | |
42 | 42 | //verifica projecao |
43 | 43 | //verifica a projecao |
44 | - $shp = ms_shapeObjFromWkt($xy); | |
44 | + $shp = ms_shapeObjFromWkt($_GET["xy"]); | |
45 | 45 | $c = $shp->getCentroid(); |
46 | 46 | $c = $c->x; |
47 | 47 | if($c > -181 && $c < 181){ |
... | ... | @@ -55,11 +55,8 @@ Insere elementos no mapa como um layer do tipo feature baseado em wkt |
55 | 55 | break; |
56 | 56 | |
57 | 57 | } |
58 | -if (!connection_aborted()){ | |
59 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
58 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ | |
60 | 59 | restauraCon($map_file,$postgis_mapa); |
61 | - cpjson($retorno); | |
62 | 60 | } |
63 | -else | |
64 | -{exit();} | |
61 | +cpjson($retorno); | |
65 | 62 | ?> |
66 | 63 | \ No newline at end of file | ... | ... |