Commit 434e0a1ffdfbcda9f7cd637ed8b2ed8745c17f49
1 parent
ae2e98f1
Exists in
master
and in
6 other branches
Otimização do código que faz a montagem tos balões de info
Showing
7 changed files
with
25 additions
and
47 deletions
Show diff stats
js/compactados/eventos_compacto.js
1 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}var objposicaocursor={ddx:"",ddy:"",dmsx:"",dmsy:"",telax:"",telay:"",imgx:"",imgy:"",refx:"",refy:""};i3GEO.eventos={CONTATOUCH:0,MOUSEOVERDATA:[],MOUSEOUTDATA:[],RESIZE:[],SELECAO:[],ATUALIZAARVORECAMADAS:[],ATIVATEMA:[],NAVEGAMAPA:[],MOUSEPARADO:[],MOUSEMOVE:[],MOUSEDOWN:[],MOUSEUP:["i3GEO.eventos.cliquePerm.executa()"],MOUSECLIQUE:["i3GEO.eventos.cliqueCapturaPt()"],MOUSECLIQUEPERM:["i3GEO.mapa.dialogo.verificaTipDefault()"],TIMERPARADO:"",mouseOverData:function(){i3GEO.eventos.executaEventos(this.MOUSEOVERDATA)},mouseOutData:function(){i3GEO.eventos.executaEventos(this.MOUSEOUTDATA)},mouseParado:function(){try{clearTimeout(this.TIMERPARADO)}catch(e){this.TIMERPARADO=""}if(objposicaocursor.dentroDomapa===false){return}try{if(objposicaocursor.imgy===""){objposicaocursor.imgy=1;objposicaocursor.imgx=1}if(i3GEO.eventos.MOUSEPARADO.length>0&&objposicaocursor.imgy>0&&objposicaocursor.imgx>0){if(objposicaocursor.imgx>0){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO)}}}catch(e){}},navegaMapa:function(){i3GEO.eventos.executaEventos(this.NAVEGAMAPA)},mousemoveMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEMOVE)},mousedownMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEDOWN)},mouseupMapa:function(exy){if(!exy){i3GEO.eventos.executaEventos(this.MOUSEUP)}else{if(i3GEO.Interface.ATUAL==="googlemaps"&&exy.target&&!exy.target.src){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}pos=i3GEOtouchesPosMapa;p=new google.maps.Point(exy.clientX-pos[0],exy.clientY-pos[1]);e=null;lonlat=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p);if(lonlat){objposicaocursor.ddx=lonlat.lng();objposicaocursor.ddy=lonlat.lat()}i3GEO.eventos.executaEventos(this.MOUSEUP)}else if(i3GEO.Interface.ATUAL==="openlayers"&&exy.target&&exy.target.tagName==="CANVAS"){i3GEO.eventos.executaEventos(this.MOUSEUP)}}},mousecliqueMapa:function(){i3GEO.eventos.executaEventos(this.MOUSECLIQUE)},resizeMapa:function(){i3GEO.eventos.executaEventos(this.RESIZE)},executaEventos:function(eventos){if(i3GEO.Interface.STATUS.pan===true){return}var f=0;try{if(eventos.length>0){f=eventos.length-1;if(f>=0){do{if(eventos[f]!==""){if(typeof(eventos[f])==="function"){eventos[f].call()}else{eval(eventos[f])}}}while(f--)}}}catch(e){eventos[f]=""}},removeEventos:function(tipo,eventos){var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].remove(eventos[i])}i3GEO.eventos[tipo].remove("");i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},adicionaEventos:function(tipo,eventos){if(eventos==""){i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique();return}var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].push(eventos[i])}i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},posicaoMouseMapa:function(e){var teladd,teladms,container="",targ="",pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex;if(!e){e=window.event}try{if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.parentNode){container=targ.parentNode.id}}catch(erro){return}if(container!=="mapaReferencia"){return}pos=i3GEO.util.pegaPosicaoObjeto(targ);mousex=0;mousey=0;if(e.pageX||e.pageY){mousex=e.pageX;mousey=e.pageY}else if(e.clientX||e.clientY){mousex=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mousey=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}xfig=mousex-pos[0];yfig=mousey-pos[1];xreffig=xfig;yreffig=yfig;xtela=mousex;ytela=mousey;c=i3GEO.parametros.celularef;ex=i3GEO.parametros.extentref;teladd=i3GEO.calculo.tela2dd(xfig,yfig,c,ex,targ.id);teladms=i3GEO.calculo.dd2dms(teladd[0],teladd[1]);objposicaocursor={ddx:teladd[0],ddy:teladd[1],dmsx:teladms[0],dmsy:teladms[1],telax:xtela,telay:ytela,imgx:xfig,imgy:yfig,refx:xreffig,refy:yreffig,dentroDomapa:true}},ativa:function(docMapa){if(!docMapa){return}var timer=0;var delay=300;var prevent=false;docMapa.onmouseover=function(){objposicaocursor.dentroDomapa=true;this.onmousemove=function(exy){i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.posicaoMouseMapa(exy);try{i3GEO.eventos.mousemoveMapa()}catch(e){}}};docMapa.onmouseout=function(){objposicaocursor.dentroDomapa=false};docMapa.onmousedown=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousedownMapa()};docMapa.onclick=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousecliqueMapa(exy)};docMapa.ondblclick=function(){if(objposicaocursor.dentroDomapa===false){return}clearTimeout(timer);prevent=true};docMapa.onmouseup=function(exy){if(objposicaocursor.dentroDomapa===false){return}if(i3GEO.Interface.ATUAL==="googlemaps"){if(modoAtual==="move"){modoAtual="";return}}i3GEO.eventos.cliquePerm.status=true;timer=setTimeout(function(){if(!prevent){i3GEO.eventos.mouseupMapa(exy)}prevent=false},delay)};docMapa.ontouchmove=function(exy){i3GEO.eventos.CONTATOUCH++;i3GEO.Interface.STATUS.pan=true;i3GEO.eventos.posicaoMouseMapa(exy)};docMapa.ontouchcancel=function(exy){i3GEO.eventos.CONTATOUCH=0}},botaoDireita:function(exy){try{var k=(navm)?event.button:exy.button;if(k!==2){return false}else{return true}}catch(e){return false}},cliqueCapturaPt:function(ixg,ixm,ixs,iyg,iym,iys){var x,y,doc=document;if(arguments.length===0){ixg="ixg";ixm="ixm";ixs="ixs";iyg="iyg";iym="iym";iys="iys";if($i("wdocai")){doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument}}try{if(doc){x=objposicaocursor.dmsx.split(" ");y=objposicaocursor.dmsy.split(" ");if(doc.getElementById(ixg)){doc.getElementById(ixg).value=x[0]}if(doc.getElementById(ixm)){doc.getElementById(ixm).value=x[1]}if(doc.getElementById(ixs)){doc.getElementById(ixs).value=$.number(x[2],2,$trad("dec"),$trad("mil"))}if(doc.getElementById(iyg)){doc.getElementById(iyg).value=y[0]}if(doc.getElementById(iym)){doc.getElementById(iym).value=y[1]}if(doc.getElementById(iys)){doc.getElementById(iys).value=$.number(y[2],2,$trad("dec"),$trad("mil"))}}}catch(m){}},cliquePerm:{ativo:true,status:true,executa:function(evt){if(i3GEO.eventos.cliquePerm.ativo===true&&i3GEO.eventos.cliquePerm.status===true){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUEPERM)}},ativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=true}},desativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=false}},ativoinicial:true}}; | |
2 | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}var objposicaocursor={ddx:"",ddy:"",dmsx:"",dmsy:"",telax:"",telay:"",imgx:"",imgy:"",refx:"",refy:""};i3GEO.eventos={CONTATOUCH:0,MOUSEOVERDATA:[],MOUSEOUTDATA:[],RESIZE:[],SELECAO:[],ATUALIZAARVORECAMADAS:[],ATIVATEMA:[],NAVEGAMAPA:[],MOUSEPARADO:[],MOUSEMOVE:[],MOUSEDOWN:[],MOUSEUP:["i3GEO.eventos.cliquePerm.executa()"],MOUSECLIQUE:["i3GEO.eventos.cliqueCapturaPt()"],MOUSECLIQUEPERM:["i3GEO.mapa.dialogo.verificaTipDefault(xx,yy)"],TIMERPARADO:"",mouseOverData:function(){i3GEO.eventos.executaEventos(this.MOUSEOVERDATA)},mouseOutData:function(){i3GEO.eventos.executaEventos(this.MOUSEOUTDATA)},mouseParado:function(){try{clearTimeout(this.TIMERPARADO)}catch(e){this.TIMERPARADO=""}if(objposicaocursor.dentroDomapa===false){return}try{if(objposicaocursor.imgy===""){objposicaocursor.imgy=1;objposicaocursor.imgx=1}if(i3GEO.eventos.MOUSEPARADO.length>0&&objposicaocursor.imgy>0&&objposicaocursor.imgx>0){if(objposicaocursor.imgx>0){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO)}}}catch(e){}},navegaMapa:function(){i3GEO.eventos.executaEventos(this.NAVEGAMAPA)},mousemoveMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEMOVE)},mousedownMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEDOWN)},mouseupMapa:function(exy){if(!exy){i3GEO.eventos.executaEventos(this.MOUSEUP)}else{if(i3GEO.Interface.ATUAL==="googlemaps"&&exy.target&&!exy.target.src){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}pos=i3GEOtouchesPosMapa;p=new google.maps.Point(exy.clientX-pos[0],exy.clientY-pos[1]);e=null;lonlat=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p);if(lonlat){objposicaocursor.ddx=lonlat.lng();objposicaocursor.ddy=lonlat.lat()}i3GEO.eventos.executaEventos(this.MOUSEUP)}else if(i3GEO.Interface.ATUAL==="openlayers"&&exy.target&&exy.target.tagName==="CANVAS"){i3GEO.eventos.executaEventos(this.MOUSEUP)}}},mousecliqueMapa:function(){i3GEO.eventos.executaEventos(this.MOUSECLIQUE)},resizeMapa:function(){i3GEO.eventos.executaEventos(this.RESIZE)},executaEventos:function(eventos){if(i3GEO.Interface.STATUS.pan===true){return}var f=0;try{if(eventos.length>0){f=eventos.length-1;if(f>=0){do{if(eventos[f]!==""){if(typeof(eventos[f])==="function"){eventos[f].call()}else{var f=eventos[f];f=f.replace("xx",objposicaocursor.ddx);f=f.replace("yy",objposicaocursor.ddy);eval(f)}}}while(f--)}}}catch(e){eventos[f]=""}},removeEventos:function(tipo,eventos){var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].remove(eventos[i])}i3GEO.eventos[tipo].remove("");i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},adicionaEventos:function(tipo,eventos){if(eventos==""){i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique();return}var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].push(eventos[i])}i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},posicaoMouseMapa:function(e){var teladd,teladms,container="",targ="",pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex;if(!e){e=window.event}try{if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.parentNode){container=targ.parentNode.id}}catch(erro){return}if(container!=="mapaReferencia"){return}pos=i3GEO.util.pegaPosicaoObjeto(targ);mousex=0;mousey=0;if(e.pageX||e.pageY){mousex=e.pageX;mousey=e.pageY}else if(e.clientX||e.clientY){mousex=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mousey=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}xfig=mousex-pos[0];yfig=mousey-pos[1];xreffig=xfig;yreffig=yfig;xtela=mousex;ytela=mousey;c=i3GEO.parametros.celularef;ex=i3GEO.parametros.extentref;teladd=i3GEO.calculo.tela2dd(xfig,yfig,c,ex,targ.id);teladms=i3GEO.calculo.dd2dms(teladd[0],teladd[1]);objposicaocursor={ddx:teladd[0],ddy:teladd[1],dmsx:teladms[0],dmsy:teladms[1],telax:xtela,telay:ytela,imgx:xfig,imgy:yfig,refx:xreffig,refy:yreffig,dentroDomapa:true}},ativa:function(docMapa){if(!docMapa){return}var timer=0;var delay=300;var prevent=false;docMapa.onmouseover=function(){objposicaocursor.dentroDomapa=true;this.onmousemove=function(exy){i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.posicaoMouseMapa(exy);try{i3GEO.eventos.mousemoveMapa()}catch(e){}}};docMapa.onmouseout=function(){objposicaocursor.dentroDomapa=false};docMapa.onmousedown=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousedownMapa()};docMapa.onclick=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousecliqueMapa(exy)};docMapa.ondblclick=function(){if(objposicaocursor.dentroDomapa===false){return}clearTimeout(timer);prevent=true};docMapa.onmouseup=function(exy){if(objposicaocursor.dentroDomapa===false){return}if(i3GEO.Interface.ATUAL==="googlemaps"){if(modoAtual==="move"){modoAtual="";return}}i3GEO.eventos.cliquePerm.status=true;timer=setTimeout(function(){if(!prevent){i3GEO.eventos.mouseupMapa(exy)}prevent=false},delay)};docMapa.ontouchmove=function(exy){i3GEO.eventos.CONTATOUCH++;i3GEO.Interface.STATUS.pan=true;i3GEO.eventos.posicaoMouseMapa(exy)};docMapa.ontouchcancel=function(exy){i3GEO.eventos.CONTATOUCH=0}},botaoDireita:function(exy){try{var k=(navm)?event.button:exy.button;if(k!==2){return false}else{return true}}catch(e){return false}},cliqueCapturaPt:function(ixg,ixm,ixs,iyg,iym,iys){var x,y,doc=document;if(arguments.length===0){ixg="ixg";ixm="ixm";ixs="ixs";iyg="iyg";iym="iym";iys="iys";if($i("wdocai")){doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument}}try{if(doc){x=objposicaocursor.dmsx.split(" ");y=objposicaocursor.dmsy.split(" ");if(doc.getElementById(ixg)){doc.getElementById(ixg).value=x[0]}if(doc.getElementById(ixm)){doc.getElementById(ixm).value=x[1]}if(doc.getElementById(ixs)){doc.getElementById(ixs).value=$.number(x[2],2,$trad("dec"),$trad("mil"))}if(doc.getElementById(iyg)){doc.getElementById(iyg).value=y[0]}if(doc.getElementById(iym)){doc.getElementById(iym).value=y[1]}if(doc.getElementById(iys)){doc.getElementById(iys).value=$.number(y[2],2,$trad("dec"),$trad("mil"))}}}catch(m){}},cliquePerm:{ativo:true,status:true,executa:function(evt){if(i3GEO.eventos.cliquePerm.ativo===true&&i3GEO.eventos.cliquePerm.status===true){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUEPERM)}},ativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=true}},desativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=false}},ativoinicial:true}}; | |
3 | 3 | \ No newline at end of file | ... | ... |
js/compactados/mapa_compacto.js
1 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={BALAOATIVO:true,OPENTIPIFEMPTY:true,TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",GEOXML:[],limpasel:function(){i3GEO.php.limpasel(function(retorno){i3GEO.atualiza();i3GEO.Interface.atualizaMapa()},"")},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=window.innerWidth;Dh=window.innerHeight;i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.guias.abreFecha("fecha");ativo=true},2000)}ativo=false}},ativaIdentifica:function(){i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"];i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.verificaTipDefault()"]);i3GEO.eventos.cliquePerm.ativa()},ativaIdentificaBalao:function(){i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.verificaTipDefault()"];i3GEO.eventos.cliquePerm.ativa()},ativaTema:function(codigo){if(codigo){i3GEO.temaAtivo=codigo}},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.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.janela.fechaAguarde();if(this.recupera&&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=JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.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($.isNumeric(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}}catch(e){}}}},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)},wms:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wms()","conectarwms","conectarwms","dependencias.php","i3GEOF.conectarwms.iniciaJanelaFlutuante()")},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.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 temp,janela,id="listaMapa"+Math.random();janela=i3GEO.janela.cria("800px","500px",i3GEO.configura.locaplic+"/mapas/indexnomenu.php","","","<span class='i3GeoTituloJanelaBsNolink' ></span></div>",id)}else{window.open(i3GEO.configura.locaplic+"/rss/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=i3GEO.util.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/openlayers3.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<span class='i3GeoTituloJanelaBsNolink' ></span></div>";i3GEO.janela.cria("520px","370px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza,"","","","",false,"","123")}},metaestat:function(largura,altura,topo,esquerda,Interface,conexao){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;if(Interface){i3GEOF.metaestat.INTERFACE=Interface}if(conexao){i3GEOF.metaestat.CONEXAODEFAULT=conexao}i3GEOF.metaestat.INTERFACE="flutuante";i3GEOF.metaestat.principal.inicia(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","dependencias.php",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()")},filtraperiodo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraperiodo()","filtraperiodo","filtraperiodo","dependencias.php","i3GEOF.filtraperiodo.iniciaJanelaFlutuante()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidademapa()","opacidademapa","opacidademapa","dependencias.php","i3GEOF.opacidademapa.iniciaJanelaFlutuante()")},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(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){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()")},opcoesMapaRef:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesMapaRef()","opcoes_maparef","opcoesMaparef","dependencias.php","i3GEOF.opcoesMaparef.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","dependencias.php","i3GEOF.selecao.iniciaJanelaFlutuante()")},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,tema){if(!x){x=objposicaocursor.ddx;y=objposicaocursor.ddy}var temp=function(){i3GEOF.identifica.start({"x":x,"y":y,"tema":tema})};if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php";i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{temp()}},verificaTipDefault:function(x,y){if(i3GEO.mapa.BALAOATIVO==false){return}if(i3GEO.eventos.cliquePerm.ativo==false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(!x){x=objposicaocursor.ddx}if(!y){y=objposicaocursor.ddy}var ntemas,etiquetas,j,temp;if(x===-1||y===-1){return}objposicaocursor.ddx=-1;objposicaocursor.ddy=-1;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""||i3GEO.arvoreDeCamadas.CAMADAS[j].identifica=="SIM"){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""&&i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal==""){$.get(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y,function(data){i3GEO.janela.closeMsg(data)});return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal!=""){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""){var temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y;temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal.replace("{{{url}}}",temp);i3GEO.janela.closeMsg(temp)}else{i3GEO.janela.closeMsg(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal)}return}var res=i3GEO.configura.ferramentas.identifica.resolution;var bdiv=document.createElement("div");bdiv.className="waitInfoWindow";bdiv.style.width=res+"px";bdiv.style.height=res+"px";bdiv.style.top=(res/2*-1)+"px";var b=new ol.Overlay({element:bdiv,stopEvent:true,autoPan:false,origem:"balao",autoPanAnimation:false,positioning:"center-center",position:i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates()});i3geoOL.addOverlay(b);temp=function(retorno){i3geoOL.removeOverlay(b);i3GEO.mapa.montaTip(retorno,x,y)};i3GEO.php.identifica3(temp,x,y,res,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten,"","sim")}},montaTip:function(retorno,xx,yy){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",x,y,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,wkts=[];i3GEO.eventos.cliquePerm.status=true;mostra=false;if(retorno.data){retorno=retorno.data;temp=retorno[0].xy.split(",");x=temp[0]*1;y=temp[1]*1}else{x=xx;y=yy;mostra=true;textoSimples=$trad("balaoVazio");textoCompleto="";wkt=[];if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.openTipNoData==false){mostra=false}}if(retorno!==""){res="";ntemas=0;temas=retorno;if(temas){ntemas=temas.length}for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="layer"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");var mais="<button style='margin: 2px;padding: 0px;vertical-align: middle;position: relative;top: -7px;' class='btn btn-default btn-xs' onclick=\"i3GEO.mapa.dialogo.cliqueIdentificaDefault("+x+","+y+",'"+temas[j].tema+"');return false;\" ><span style='opacity:0.5;vertical-align: middle;padding: 0px;' class='material-icons'>info</span></button>";titulo="<div class='toolTipBalaoTitulo'>"+mais+" <b>"+titulo+"</b><br>"+temp1+"</div>";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;for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='toolTipBalaoTexto'>";textoTempSimples+="<div class='toolTipBalaoTexto'>";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;var estilo="tooltip-"+temas[j].tema;if(valor!==""&&link===""){temp+="<span class='"+estilo+"'><label>"+alias+": </label>"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span class='"+estilo+"'><label>"+alias+" : </label><a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}textoTempCompleto+="</div>";var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="registro"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");textoTempSimples+=temp1+"</div>";if(ds[s].wkt&&ds[s].wkt.valor!=""){ds[s].tema=temas[j].tema;ds[s].titulo=titulo;wkts.push(ds[s])}}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){res=textoSimples;if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal==true){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.janela.closeMsg(textoSimples);return}else{i3GEO.janela.closeMsg(textoCompleto);return}}else{if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y,true,wkts.length)}else{i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoCompleto,textoSimples,x,y)}}}}n=wkts.length;if(n>0){if(i3GEO.Interface.ATUAL!="openlayers"){return}i3GEO.desenho.openlayers.criaLayerGrafico();var g,format,f,idunico,c=i3GEO.desenho.layergrafico.getSource();format=new ol.format.WKT();for(r=0;r<n;r+=1){f=format.readFeatures(wkts[r].wkt.valor);f=f[0];f.setProperties({origem:"pin"});g=f.getGeometry();g=i3GEO.util.projGeo2OSM(g);f.setGeometry(g);f.setId(i3GEO.util.uid());i3GEO.editor.setStyleByTypeFeature(f);i3GEO.editor.sel.setPropertiesDefault(f);wkts[r].wkt="",f.setProperties({"fat":wkts[r]});c.addFeature(f)}}}}; | |
2 | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={BALAOATIVO:true,OPENTIPIFEMPTY:true,TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",GEOXML:[],limpasel:function(){i3GEO.php.limpasel(function(retorno){i3GEO.atualiza();i3GEO.Interface.atualizaMapa()},"")},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=window.innerWidth;Dh=window.innerHeight;i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.guias.abreFecha("fecha");ativo=true},2000)}ativo=false}},ativaIdentifica:function(){i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"];i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.verificaTipDefault()"]);i3GEO.eventos.cliquePerm.ativa()},ativaIdentificaBalao:function(){i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.verificaTipDefault()"];i3GEO.eventos.cliquePerm.ativa()},ativaTema:function(codigo){if(codigo){i3GEO.temaAtivo=codigo}},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.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.janela.fechaAguarde();if(this.recupera&&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=JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.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($.isNumeric(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}}catch(e){}}}},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)},wms:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wms()","conectarwms","conectarwms","dependencias.php","i3GEOF.conectarwms.iniciaJanelaFlutuante()")},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.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 temp,janela,id="listaMapa"+Math.random();janela=i3GEO.janela.cria("800px","500px",i3GEO.configura.locaplic+"/mapas/indexnomenu.php","","","<span class='i3GeoTituloJanelaBsNolink' ></span></div>",id)}else{window.open(i3GEO.configura.locaplic+"/rss/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=i3GEO.util.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/openlayers3.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<span class='i3GeoTituloJanelaBsNolink' ></span></div>";i3GEO.janela.cria("520px","370px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza,"","","","",false,"","123")}},metaestat:function(largura,altura,topo,esquerda,Interface,conexao){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;if(Interface){i3GEOF.metaestat.INTERFACE=Interface}if(conexao){i3GEOF.metaestat.CONEXAODEFAULT=conexao}i3GEOF.metaestat.INTERFACE="flutuante";i3GEOF.metaestat.principal.inicia(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","dependencias.php",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()")},filtraperiodo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraperiodo()","filtraperiodo","filtraperiodo","dependencias.php","i3GEOF.filtraperiodo.iniciaJanelaFlutuante()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidademapa()","opacidademapa","opacidademapa","dependencias.php","i3GEOF.opacidademapa.iniciaJanelaFlutuante()")},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(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){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()")},opcoesMapaRef:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesMapaRef()","opcoes_maparef","opcoesMaparef","dependencias.php","i3GEOF.opcoesMaparef.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","dependencias.php","i3GEOF.selecao.iniciaJanelaFlutuante()")},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,tema){if(!x){x=objposicaocursor.ddx;y=objposicaocursor.ddy}var temp=function(){i3GEOF.identifica.start({"x":x,"y":y,"tema":tema})};if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php";i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{temp()}},verificaTipDefault:function(x,y){if(i3GEO.mapa.BALAOATIVO==false){return}if(!x){x=objposicaocursor.ddx}if(!y){y=objposicaocursor.ddy}if(x===-1||y===-1||i3GEO.eventos.cliquePerm.ativo===false||i3GEO.eventos.cliquePerm.status===false){return}i3GEO.eventos.cliquePerm.status=false;var ntemas,etiquetas,j,temp;objposicaocursor.ddx=-1;objposicaocursor.ddy=-1;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""||i3GEO.arvoreDeCamadas.CAMADAS[j].identifica=="SIM"){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""&&i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal==""){$.get(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y,function(data){i3GEO.janela.closeMsg(data)});return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal!=""){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""){var temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y;temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal.replace("{{{url}}}",temp);i3GEO.janela.closeMsg(temp)}else{i3GEO.janela.closeMsg(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal)}return}var res=i3GEO.configura.ferramentas.identifica.resolution;var bdiv=document.createElement("div");bdiv.className="waitInfoWindow";bdiv.style.width=res+"px";bdiv.style.height=res+"px";bdiv.style.top=(res/2*-1)+"px";var b=new ol.Overlay({element:bdiv,stopEvent:true,autoPan:false,origem:"balao",autoPanAnimation:false,positioning:"center-center",position:i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates()});i3geoOL.addOverlay(b);temp=function(retorno){i3geoOL.removeOverlay(b);i3GEO.mapa.montaTip(retorno,x,y)};i3GEO.php.identifica3(temp,x,y,res,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten,"","sim")}},montaTip:function(retorno,xx,yy){var textoSimples="",textoTempSimples="",x,y,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,wkts=[];i3GEO.eventos.cliquePerm.status=true;mostra=false;if(retorno.data){retorno=retorno.data;temp=retorno[0].xy.split(",");x=temp[0]*1;y=temp[1]*1}else{x=xx;y=yy;mostra=true;textoSimples=$trad("balaoVazio");textoCompleto="";wkt=[];if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.openTipNoData==false){mostra=false}}if(retorno!==""){res="";ntemas=0;temas=retorno;if(temas){ntemas=temas.length}for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="layer"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");var mais="<button style='margin: 2px;padding: 0px;vertical-align: middle;position: relative;top: -7px;' class='btn btn-default btn-xs' onclick=\"i3GEO.mapa.dialogo.cliqueIdentificaDefault("+x+","+y+",'"+temas[j].tema+"');return false;\" ><span style='opacity:0.5;vertical-align: middle;padding: 0px;' class='material-icons'>info</span></button>";if(ntemas==1){mais=""}titulo="<div class='toolTipBalaoTitulo'>"+mais+" <b>"+titulo+"</b><br>"+temp1+"</div>";tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;for(s=0;s<nds;s+=1){textoTempSimples+="<div class='toolTipBalaoTexto'>";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;var estilo="tooltip-"+temas[j].tema;if(valor!==""&&link===""){temp+="<span class='"+estilo+"'><label>"+alias+": </label>"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span class='"+estilo+"'><label>"+alias+" : </label><a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}mostra=true}catch(e){}}var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="registro"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");textoTempSimples+=temp1+"</div>";if(ds[s].wkt&&ds[s].wkt.valor!=""){ds[s].tema=temas[j].tema;ds[s].titulo=titulo;wkts.push(ds[s])}}}catch(e){}}if(textoTempSimples!==""){textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal==true){i3GEO.janela.closeMsg(textoSimples);return}else{i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,"",x,y,true,wkts.length)}}}n=wkts.length;if(n>0){if(i3GEO.Interface.ATUAL!="openlayers"){return}i3GEO.desenho.openlayers.criaLayerGrafico();var g,format,f,idunico,c=i3GEO.desenho.layergrafico.getSource();format=new ol.format.WKT();for(r=0;r<n;r+=1){f=format.readFeatures(wkts[r].wkt.valor);f=f[0];f.setProperties({origem:"pin"});g=f.getGeometry();g=i3GEO.util.projGeo2OSM(g);f.setGeometry(g);f.setId(i3GEO.util.uid());i3GEO.editor.setStyleByTypeFeature(f);i3GEO.editor.sel.setPropertiesDefault(f);wkts[r].wkt="",f.setProperties({"fat":wkts[r]});c.addFeature(f)}}}}; | |
3 | 3 | \ No newline at end of file | ... | ... |
js/eventos.js
... | ... | @@ -209,7 +209,7 @@ i3GEO.eventos = |
209 | 209 | * |
210 | 210 | * i3GEO.configura.funcaoTip |
211 | 211 | */ |
212 | - MOUSECLIQUEPERM : ["i3GEO.mapa.dialogo.verificaTipDefault()"], | |
212 | + MOUSECLIQUEPERM : ["i3GEO.mapa.dialogo.verificaTipDefault(xx,yy)"], | |
213 | 213 | /** |
214 | 214 | * Timer utilizado pelo contador do mouse parado |
215 | 215 | * |
... | ... | @@ -365,7 +365,10 @@ i3GEO.eventos = |
365 | 365 | if (typeof (eventos[f]) === "function") { |
366 | 366 | eventos[f].call(); |
367 | 367 | } else { |
368 | - eval(eventos[f]); | |
368 | + var f = eventos[f]; | |
369 | + f = f.replace("xx",objposicaocursor.ddx); | |
370 | + f = f.replace("yy",objposicaocursor.ddy); | |
371 | + eval(f); | |
369 | 372 | } |
370 | 373 | } |
371 | 374 | } while (f--); | ... | ... |
js/i3geo_tudo_compacto8.js
... | ... | @@ -248,7 +248,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.desenho={layergrafico:null,es |
248 | 248 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}var i3GEOtouchesPosMapa="";var i3geoOL;i3GEO.Interface={RESTRICTATT:true,LAYEROPACITY:"",INFOOVERLAY:"",ATUAL:"openlayers",IDCORPO:"openlayers",IDMAPA:"",STATUS:{atualizando:[],trocando:false,pan:false},LAYERSUTFGRID:{},aposAdicNovaCamada:function(camada){i3GEO.tema.ativaFerramentas(camada)},redesenha:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].redesenha()},grade:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].grade()},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.checked&&obj.value!=""){i3GEO.mapa.ativaTema(obj.value)}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.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")}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();i3GEO.desenho.criaLayerGrafico();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(){},zoom2ext:function(mapexten){if(!mapexten){mapexten=i3GEO.parametros.mapexten}i3GEO.Interface[i3GEO.Interface.ATUAL].zoom2ext(mapexten)},zoomli:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].zoomli()},getZoom:function(){return i3GEO.Interface[i3GEO.Interface.ATUAL].getZoom()},openlayers:{parametrosMap:{target:"openlayers",layers:[],controls:[],interactions:[],loadTilesWhileAnimating:true,loadTilesWhileInteracting:true},parametrosView:{},TILES:true,LAYERSADICIONAIS:[],googleLike:false,BALAOPROP:{url:"",templateModal:"",removeAoAdicionar:true,classeCadeado:"i3GEOiconeAberto",autoPan:true,autoPanAnimation:{duration:250},minWidth:'200px',modal:false,simple:true,openTipNoData:true,baloes:[]},GRADE:"",FULLSCREEN:"",fullscreen:function(){if(i3GEO.Interface.openlayers.FULLSCREEN==""){i3GEO.Interface.openlayers.FULLSCREEN=new ol.control.FullScreen();i3GEO.Interface.openlayers.FULLSCREEN.setMap(i3geoOL);return}if(i3GEO.Interface.openlayers.FULLSCREEN.getMap()==null){i3GEO.Interface.openlayers.FULLSCREEN.setMap(i3geoOL)}else{i3GEO.Interface.openlayers.FULLSCREEN.setMap(null)}},grade:function(){if(i3GEO.Interface.openlayers.GRADE==""){i3GEO.Interface.openlayers.GRADE=new ol.Graticule({strokeStyle:new ol.style.Stroke({color:'rgba(105,105,105,0.9)',width:2,lineDash:[0.5,4]}),showLabels:true,targetSize:200});i3GEO.Interface.openlayers.GRADE.setMap(i3geoOL);return}if(i3GEO.Interface.openlayers.GRADE.getMap()==null){i3GEO.Interface.openlayers.GRADE.setMap(i3geoOL)}else{i3GEO.Interface.openlayers.GRADE.setMap(null)}},zoomli:function(){if(DetectaMobile("DetectMobileLong")){i3GEO.janela.tempoMsg($trad("x70"))}else{i3GEO.janela.tempoMsg($trad("zoomliShift"))}},getZoom:function(){return i3geoOL.getZoom()},balao:function(texto,completo,x,y,botaoProp,nwkts){var hash={"x":x,"y":y,"resolution":i3GEO.configura.ferramentas.identifica.resolution,"tolerancia":$trad("tolerancia")};if(botaoProp===undefined){botaoProp=true}hash.texto=texto;var createinfotooltip=function(){var icone,painel,b,cabecalho,conteudo,removeBaloes,html,p=i3GEO.Interface.openlayers.BALAOPROP,removeBaloes=function(removeWkt){var nd,t,n=i3GEO.Interface.openlayers.BALAOPROP.baloes.length,i;for(i=0;i<n;i++){t=i3GEO.Interface.openlayers.BALAOPROP.baloes[i];if(t.get("origem")=="balao"){i3geoOL.removeOverlay(t)}}i3GEO.Interface.openlayers.BALAOPROP.baloes=[];if(removeWkt!==false&&i3GEO.desenho.layergrafico){i3GEO.desenho[i3GEO.Interface.ATUAL].removePins()}else if(i3GEO.desenho.layergrafico){var features,n,f,i;features=i3GEO.desenho.layergrafico.getSource().getFeatures();n=features.length;for(i=0;i<n;i++){if(features[i].get("origem")=="pin"){features[i].set("origem","identifica")}}}return false};if(p.removeAoAdicionar===true){removeBaloes(true)}if(i3GEO.eventos.cliquePerm.ativo===false){return}hash.minWidth=p.minWidth;painel=document.createElement("div");hash.lock_open="hidden";hash.lock="hidden";if(p.removeAoAdicionar===true){hash.lock_open=""}else{hash.lock=""}hash.botaoProp="hidden";if(botaoProp===true){hash.botaoProp=""}hash.wkt="hidden";if(nwkts&&nwkts>0){hash.wkt=""}painel=document.createElement("div");painel.innerHTML=Mustache.render(i3GEO.template.infotooltip,hash);$(painel).find("[data-info='close']").on("click",removeBaloes);$(painel).find("[data-info='wkt']").on("click",function(){removeBaloes(false)});$(painel).find("[data-info='info']").on("click",function(){i3GEO.mapa.dialogo.cliqueIdentificaDefault(x,y,"");return false});$(painel).find("[data-info='settings']").on("click",function(){i3GEO.janela.prompt($trad("tolerancia"),function(){i3GEO.configura.ferramentas.identifica.resolution=$i("i3GEOjanelaprompt").value},i3GEO.configura.ferramentas.identifica.resolution);return false});$(painel).find("[data-info='lockopen']").on("click",function(e){var p=i3GEO.Interface.openlayers.BALAOPROP;$(e.target).addClass("hidden");$(e.target.parentNode).find("[data-info='lock']").removeClass("hidden");p.removeAoAdicionar=false;return false});$(painel).find("[data-info='lock']").on("click",function(e){var p=i3GEO.Interface.openlayers.BALAOPROP;$(e.target).addClass("hidden");$(e.target.parentNode).find("[data-info='lockopen']").removeClass("hidden");p.removeAoAdicionar=true;return false});$(painel).find('.dropdown-toggle').dropdown();b=new ol.Overlay({element:painel,stopEvent:true,autoPan:p.autoPan,autoPanAnimation:p.autoPanAnimation});b.setProperties({origem:"balao"});p.baloes.push(b);i3geoOL.addOverlay(b);b.setPosition(i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates())};if(i3GEO.template.infotooltip==false){$.get(i3GEO.configura.locaplic+"/js/templates/infotooltip.html").done(function(r){i3GEO.template.infotooltip=r;createinfotooltip()})}else{createinfotooltip()}},redesenha:function(){var openlayers=i3GEO.Interface.openlayers;openlayers.criaLayers();openlayers.ordenaLayers();openlayers.recalcPar();i3GEO.janela.fechaAguarde()},fundoDefault:function(){var eng,oce,ims,wsm,tms,bra;eng=new ol.layer.Tile({title:"ESRI National Geographic",visible:true,isBaseLayer:true,name:"eng",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer">ArcGIS</a>'})]})});oce=new ol.layer.Tile({title:"ESRI Ocean Basemap",visible:false,isBaseLayer:true,name:"oce",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer">ArcGIS</a>'})]})});ims=new ol.layer.Tile({title:"ESRI Imagery World 2D",visible:false,isBaseLayer:true,name:"ims",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer">ArcGIS</a>'})]})});wsm=new ol.layer.Tile({title:"ESRI World Street Map",visible:false,isBaseLayer:true,name:"wsm",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer">ArcGIS</a>'})]})});bra=new ol.layer.Tile({title:"Base carto MMA",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",params:{'layers':"baseraster",'srs':"EPSG:4326",'format':"image/png"}})});tms=new ol.layer.Tile({title:"OSGEO",visible:false,isBaseLayer:true,name:"tms",source:new ol.source.TileWMS({url:"http://tilecache.osgeo.org/wms-c/Basic.py/",params:{'layers':"basic",'type':"png",'srs':"EPSG:4326",'format':"image/png",'VERSION':'1.1.1'},attributions:[new ol.Attribution({html:'© <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,i=$i(i3GEO.Interface.IDCORPO);if(i){if(!i.style.height){i.style.width="100vw";i.style.height="100vh"}f=$i("openlayers");if(!f){ins='<div id=openlayers style="display: block;position:relative;top: 0px; left: 0px;width:100%;height:100%;text-align:left;"></div>';i.innerHTML=ins;f=$i("openlayers")}}i3GEO.Interface.IDMAPA="openlayers";i3GEO.Interface.openlayers.parametrosMap.target="openlayers";if(i3GEO.Interface.openlayers.googleLike===false){i3GEO.Interface.openlayers.parametrosView.projection="EPSG:4326"}else{i3GEO.Interface.openlayers.parametrosView.projection="EPSG:3857"}i3GEO.Interface.openlayers.parametrosMap.view=new ol.View(i3GEO.Interface.openlayers.parametrosView);i3geoOL=new ol.Map(i3GEO.Interface.openlayers.parametrosMap);ol.layer.Layer.prototype.setVisibility=function(v){this.setVisible(v)};ol.layer.Layer.prototype.getVisibility=function(v){this.getVisible(v)};i3geoOL.panTo=function(x,y){this.getView().setCenter([x,y])};i3geoOL.getLayersByName=function(nome){var res=[],layers=this.getLayers(),n=layers.getLength(),i;for(i=0;i<n;i++){if(layers.item(i).get("name")&&layers.item(i).get("name")===nome){res.push(layers.item(i))}}return res};i3geoOL.addLayers=function(lista){var n=lista.length,i,lan,l;for(i=0;i<n;i++){if(lista[i].get!=undefined){lan=lista[i].get("name");if(lan){l=this.getLayersByName(lan);if(l.length===0){this.addLayer(lista[i])}}}}};i3geoOL.getLayersBase=function(){return i3geoOL.getLayersBy("isBaseLayer",true)};i3geoOL.getLayerBase=function(){var baseLayers,n,i;baseLayers=i3geoOL.getLayersBase();n=baseLayers.length;for(i=0;i<n;i++){if(baseLayers[i].getVisible()==true){return baseLayers[i]}}return false};i3geoOL.getLayersBy=function(chave,valor){var res=[],layers=this.getLayers(),n=layers.getLength(),i;for(i=0;i<n;i++){if(layers.item(i).get(chave)&&layers.item(i).get(chave)===valor){res.push(layers.item(i))}}return res};i3geoOL.getAllLayers=function(){var res=[],layers=this.getLayers(),n=layers.getLength(),i;for(i=0;i<n;i++){res.push(layers.item(i))}return res};i3geoOL.getLayersGr=function(){var layers=i3geoOL.getLayersBy("layerGr",true);if(i3GEO.desenho.layergrafico){layers.unshift(i3GEO.desenho.layergrafico)}return layers};i3geoOL.getLayersGrBy=function(chave,valor){var res=[],layers=this.getLayersGr(),n=layers.length,i;for(i=0;i<n;i++){if(layers[i].get(chave)&&layers[i].get(chave)===valor){res.push(layers[i])}}return res};i3geoOL.getControlsBy=function(chave,valor){var res=[],controles=this.getControls(),n=controles.getLength(),i;for(i=0;i<n;i++){if(controles.item(i).get(chave)&&controles.item(i).get(chave)===valor){res.push(controles.item(i))}}return res};i3geoOL.getControlByType=function(type){var a=false;i3geoOL.getControls().forEach(function(c){if(c instanceof ol.control[type]==true){a=c}});return a},i3geoOL.getCenter=function(){var c=this.getView().getCenter();return{"lon":c[0],"lat":c[1]}};i3geoOL.getZoom=function(){var c=this.getView().getZoom();return c};i3geoOL.getExtent=function(){var e=this.getView().calculateExtent(this.getSize());return{toBBOX:function(){return e.join(",")}}};i3geoOL.getScale=function(){var resolution,units,dpi,mpu,scale;resolution=this.getView().getResolution();units=this.getView().getProjection().getUnits();dpi=25.4/0.28;mpu=ol.proj.METERS_PER_UNIT[units];scale=resolution*mpu*39.37*dpi;return scale};i3geoOL.zoomToScale=function(escala){var resolution,units,dpi,mpu;units=this.getView().getProjection().getUnits();dpi=25.4/0.28;mpu=ol.proj.METERS_PER_UNIT[units];resolution=escala/(mpu*39.37*dpi);this.getView().setResolution(resolution)};i3geoOL.zoomToExtent=function(mapext){this.getView().fit(mapext,this.getSize())}},inicia:function(){if(i3GEO.Interface.openlayers.googleLike===true&&i3geoOL.getView().getProjection().getCode()!="EPSG:3857"){alert("Alerta! Projecao diferente da esperada. Veja i3geo/guia_de_migracao.txt")}var montaMapa=function(){var openlayers=i3GEO.Interface.openlayers;i3geoOL.updateSize();var temp=i3geoOL.getControlByType("ScaleLine");if(temp&&temp.element){temp.element.onclick=function(e){if(temp.getUnits()=="metric"){temp.setUnits("nautical")}else{temp.setUnits("metric")}temp.changed()}}openlayers.registraEventos();openlayers.zoom2ext(i3GEO.parametros.mapexten);$i("openlayers").getElementsByClassName("ol-overlaycontainer-stopevent")[0].style.position="unset";openlayers.criaLayers()};if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this);i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS);"}montaMapa();i3GEO.coordenadas.ativaEventos();i3GEO.idioma.mostraSeletor();if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.openlayers.adicionaKml(true,i3GEO.parametros.kmlurl)}if(jQuery.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}},aplicaOpacidade:function(opacidade,layer){if(opacidade>1){opacidade=opacidade/100}if(layer){i3geoOL.getLayersByName(layer)[0].setOpacity(opacidade*1);return}else{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.get("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);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},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 ol.layer.Vector({title:url,name:id,isBaseLayer:false,source:new ol.source.Vector({url:url,format:new ol.format.KML({extractStyles:true}),tipoServico:"kml"})});i3geoOL.addLayer(l);temp=function(pixel){var feature,chaves,c,i=0,html="",prop,g;feature=i3geoOL.forEachFeatureAtPixel(pixel,function(feature,layer){return feature});if(feature){i3GEO.Interface.openlayers.BALAOPROP.removeAoAdicionar=false;i3GEO.Interface.openlayers.BALAOPROP.classeCadeado="i3GEOiconeFechado";chaves=feature.getKeys();prop=feature.getProperties();c=chaves.length;for(i=0;i<c;i++){if(chaves[i]!="geometry"&&chaves[i]!="styleUrl"){html+=chaves[i]+": "+prop[chaves[i]]}}g=feature.getGeometry().getCoordinates();i3GEO.Interface.openlayers.balao(html,"",g[0],g[1],"kml")}};i3geoOL.on('click',function(evt){evt.stopPropagation();evt.preventDefault();if(evt.dragging){return}temp(i3geoOL.getEventPixel(evt.originalEvent))})},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 matrixIds,resolutions,size,z,projectionExtent,source,configura=i3GEO.configura,url,nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,layer,camada,urllayer,opcoes,i,temp;temp=$i("i3GEOprogressoDiv");if(temp){i3GEO.Interface.STATUS.atualizando=[];temp.style.display="none"}if(i3GEO.Interface.openlayers.googleLike===true){url=configura.locaplic+"/classesphp/mapa_googlemaps.php?";projectionExtent=ol.proj.get('EPSG:3857').getExtent()}else{url=configura.locaplic+"/classesphp/mapa_openlayers.php?";projectionExtent=ol.proj.get('EPSG:4326').getExtent()}url+="TIPOIMAGEM="+configura.tipoimagem;size=ol.extent.getWidth(projectionExtent)/256;resolutions=new Array(40);matrixIds=new Array(40);for(z=0;z<40;++z){resolutions[z]=size/Math.pow(2,z);matrixIds[z]=z}$i("openlayers").style.backgroundColor="rgb("+i3GEO.parametros.cordefundo+")";i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS);opcoes={gutter:0,isBaseLayer:false,opacity:1,visible:false,singleTile:!(i3GEO.Interface.openlayers.TILES),tilePixelRatio:1,preload:0,projection:'EPSG:4326'};if(i3GEO.Interface.openlayers.googleLike===true){opcoes.projection='EPSG:3857'}for(i=nlayers-1;i>=0;i--){layer="";camada=i3GEO.arvoreDeCamadas.CAMADAS[i];opcoes.singleTile=!(i3GEO.Interface.openlayers.TILES);if(camada.transparency!=""){opcoes.opacity=camada.transparency/100}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{try{temp=camada.transitioneffect==="nao"?opcoes.preload=0:opcoes.preload=Infinity;if(i3GEO.Interface.openlayers.googleLike===false&&camada.connectiontype===7&&camada.wmsurl!==""&&camada.usasld.toLowerCase()!="sim"){urllayer=camada.wmsurl;if(camada.wmstile==10){source=new ol.source.WMTS({url:urllayer,matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,tileGrid:new ol.tilegrid.WMTS({origin:ol.extent.getTopLeft(projectionExtent),resolutions:resolutions,matrixIds:matrixIds}),wrapX:true});source.set("tipoServico","WMTS");opcoes.singleTile=false}else{source=new ol.source.TileWMS({url:urllayer,params:{'VERSION':'1.1.0'},projection:camada.wmssrs});source.set("tipoServico","ImageWMS");opcoes.singleTile=false}opcoes.title=camada.tema;opcoes.name=camada.name;opcoes.isBaseLayer=false;opcoes.visible=true}else{if(i3GEO.Interface.openlayers.TILES==false){opcoes.singleTile=true}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(camada.cache){urllayer=url+"&cache="+camada.cache}else{urllayer=url+"&cache=nao"}urllayer+="&layer="+camada.name;if(camada.utfgrid=="sim"&&i3GEO.parametros.w>500){if(i3GEO.Interface.openlayers.googleLike===false){source=new ol.source.TileUTFGrid({projection:opcoes.projection,wrapX:true,tileJSON:{"tilejson":"2.1.0","scheme":"xyz","grids":[urllayer+"&FORMAT=utfgrid&tms=&TileCol={x}&TileRow={y}&TileMatrix={z}"]}})}else{source=new ol.source.TileUTFGrid({projection:opcoes.projection,wrapX:true,tileJSON:{"tilejson":"2.1.0","scheme":"xyz","grids":[urllayer+"&FORMAT=utfgrid&tms=&X={x}&Y={y}&Z={z}"]}})}source.set("tipoServico","WMTS");opcoes.singleTile=false;opcoes.title="";opcoes.name=camada.name+"_utfgrid";opcoes.source=source;opcoes.isBaseLayer=false;opcoes.visible=true;source.set("name",camada.name+"_utfgrid");var layerutfgrid=new ol.layer.Tile(opcoes);camada.status==0?layerutfgrid.setVisible(false):layerutfgrid.setVisible(true);i3GEO.Interface.LAYERSUTFGRID[camada.name+"_utfgrid"]=layerutfgrid;if(i3GEO.Interface.INFOOVERLAY==""){$("#"+i3GEO.Interface.IDMAPA).after(i3GEO.template.utfGridInfo);i3GEO.Interface.INFOOVERLAY=new ol.Overlay({element:$i("i3GEOoverlayInfo"),offset:[3,-3],stopEvent:true,positioning:'bottom-left'});i3GEO.Interface.INFOOVERLAY.setProperties({origem:"infoOverlay"});i3geoOL.addOverlay(i3GEO.Interface.INFOOVERLAY)}i3geoOL.addLayer(layerutfgrid)}if(opcoes.singleTile===true){source=new ol.source.ImageWMS({url:urllayer,params:{'LAYERS':camada.name,'VERSION':'1.1.0'},projection:opcoes.projection,ratio:1});source.set("tipoServico","ImageWMS")}else{if(i3GEO.Interface.openlayers.googleLike===false){source=new ol.source.WMTS({url:urllayer+"&WIDTH=256&HEIGHT=256",matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,tileGrid:new ol.tilegrid.WMTS({origin:ol.extent.getTopLeft(projectionExtent),resolutions:resolutions,matrixIds:matrixIds,tileSize:[256,256]}),wrapX:true});source.set("tipoServico","WMTS")}else{source=new ol.source.XYZ({url:urllayer+"&X={x}&Y={y}&Z={z}",matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,wrapX:true});source.set("tipoServico","WMTS")}}opcoes.title=camada.tema;opcoes.name=camada.name}if(camada.link_tema!=""&&i3GEO.Interface.RESTRICTATT==false){source.setAttributions([new ol.Attribution({html:'<li><a href="'+camada.link_tema+'">'+camada.tema+'</a></li>'})])}source.set("name",camada.name);source.set("parametrosUrl",{par:""});opcoes.source=source;opcoes.isBaseLayer=false;opcoes.visible=true;if($i("i3GEOprogressoCamadas")){source.on('tileloadstart',function(event){i3GEO.Interface.openlayers.loadStartLayer(source.get("name"))});source.on('tileloadend',function(event){i3GEO.Interface.openlayers.loadStopLayer(source.get("name"))});source.on('tileloaderror',function(event){i3GEO.Interface.openlayers.loadStopLayer(source.get("name"))})}if(opcoes.singleTile===true){layer=new ol.layer.Image(opcoes)}else{layer=new ol.layer.Tile(opcoes)}}catch(e){}}if(layer&&layer!=""){if(camada.escondido.toLowerCase()==="sim"){layer.preload=0}if(camada.type>1&&i3GEO.Interface.LAYEROPACITY!=""){layer.setOpacity(i3GEO.Interface.LAYEROPACITY)}i3geoOL.addLayer(layer);i3GEO.Interface.aposAdicNovaCamada(camada)}}else{layer=i3geoOL.getLayersByName(camada.name)[0]}if(layer&&layer!=""){temp=camada.status==0?layer.setVisible(false):layer.setVisible(true)}}if(i3GEO.parametros.copyright!=""&&!$i("i3GEOcopyright")){temp=document.createElement("div");temp.id="i3GEOcopyright";temp.innerHTML="<p class=paragrafo >"+i3GEO.parametros.copyright+"</p>";if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).appendChild(temp)}}else if(i3GEO.parametros.copyright!=""&&$i("i3GEOcopyright")){$i("i3GEOcopyright").innerHTML=i3GEO.parametros.copyright}},sobeLayersGraficos:function(){},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 layer,layers=i3GEO.arvoreDeCamadas.CAMADAS,nlayers=layers.length,i,param,source,k,url="",n,j;for(i=0;i<nlayers;i+=1){layer=i3geoOL.getLayersByName(layers[i].name)[0];if(layer&&layer!=undefined&&layer.get("isBaseLayer")===false){url="";source=layer.getSource();param=source.getProperties().parametrosUrl;param[parametro]=valor;chaves=i3GEO.util.listaTodasChaves(param);n=chaves.length;for(j=0;j<n;j++){k=chaves[j];if(param[k]!=""&&k!="par"){url+="&"+k+"="+param[k]}}param.par=url;source.set("parametrosUrl",param)}}},loadStartLayer:function(name){var p=$i("i3GEOprogressoCamadas");var n100=i3geoOL.getLayers().getLength()-i3GEO.Interface.openlayers.LAYERSADICIONAIS.length;if(p){i3GEO.Interface.STATUS.atualizando.push(" ");var x=i3GEO.Interface.STATUS.atualizando.length;p.style.width=((x*100)/n100)+"%"}},loadStopLayer:function(name){var p=$i("i3GEOprogressoCamadas");if(p){i3GEO.Interface.STATUS.atualizando.pop();if(i3GEO.Interface.STATUS.atualizando.length==0){p.style.width="0%"}}},ordenaLayers:function(){var ordem=i3GEO.arvoreDeCamadas.CAMADAS,nordem=ordem.length,layer,layers,i;layers=i3geoOL.getLayers();for(i=nordem-1;i>=0;i--){layer=i3geoOL.getLayersByName(ordem[i].name);layer=layer[0];if(layer){layers.remove(layer);layers.push(layer)}}},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){i3GEO.pluginI3geo.ligaCamada(obj.value)}else{i3GEO.pluginI3geo.desligaCamada(obj.value)}}if(obj.checked){ligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value);if(i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"]){i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value+"_utfgrid");i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"].setVisibility(true)}}else{desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);if(i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"]){i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value+"_utfgrid");i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"].setVisibility(false)}}i3GEO.php.ligatemas(i3GEO.legenda.atualiza,desligar,ligar)},ativaFundo:function(nome){var baseLayers,n,i,t,ck=true;baseLayers=i3geoOL.getLayersBase();n=baseLayers.length;for(i=0;i<n;i++){baseLayers[i].setVisible(false)}for(i=0;i<n;i++){if(baseLayers[i].get("name")===nome){baseLayers[i].setVisible(true)}}if(i3GEO.maparef.APIOBJ!=""){i3GEO.maparef.inicia()}},atualizaMapa:function(){var camadas=i3GEO.arvoreDeCamadas.CAMADAS,n=camadas.length,i;for(i=0;i<n;i++){i3GEO.Interface.openlayers.atualizaTema("",camadas[i].name)}},atualizaTema:function(retorno,tema){var layer=i3geoOL.getLayersByName(tema),objtemas,funcaoLoad,servico,source;if(layer.length==0){return""}else{layer=layer[0]}if(layer&&layer!=undefined){source=layer.getSource();servico=source.getProperties().tipoServico;if(servico==="WMTS"){funcaoLoad=source.getTileUrlFunction();if(funcaoLoad){layer.getSource().setTileUrlFunction(function(){var url=funcaoLoad.apply(this,arguments);url=url.replace("&cache=sim","&cache=nao");return url.split('&r=')[0]+'&r='+Math.random()+source.getProperties().parametrosUrl.par})}}if(servico==="ImageWMS"){funcaoLoad=source.getImageLoadFunction();if(funcaoLoad){layer.getSource().setImageLoadFunction(function(image,src){src=src.replace("&cache=sim","&cache=nao");src=src.split('&r=')[0]+'&r='+Math.random();image.getImage().src=src+source.getProperties().parametrosUrl.par})}}source.refresh()}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 modoAtual="";var contadorPan=0;i3GEO.eventos.ativa(i3geoOL.getTargetElement());i3geoOL.on("pointerdrag",function(e){i3GEO.Interface.STATUS.pan=true;modoAtual="move"});i3geoOL.on("click",function(e){e.stopPropagation();e.preventDefault();var lonlat=false,d,pos="";lonlat=e.coordinate;if(i3GEO.Interface.openlayers.googleLike===true){lonlat=ol.proj.transform(lonlat,'EPSG:3857','EPSG:4326')}d=i3GEO.calculo.dd2dms(lonlat[0],lonlat[1]);objposicaocursor.ddx=lonlat[0];objposicaocursor.ddy=lonlat[1];objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];objposicaocursor.imgx=e.pixel[0];objposicaocursor.imgy=e.pixel[1];objposicaocursor.telax=objposicaocursor.imgx+pos[0];objposicaocursor.telay=objposicaocursor.imgy+pos[1]});i3geoOL.on("dbclick",function(e){e.stopPropagation();e.preventDefault()});i3geoOL.on("moveend",function(e){if(e.changedTouches){return}var xy;contadorPan++;var timer=setTimeout(function(){contadorPan--;if(contadorPan==0){modoAtual="";i3GEO.navega.registraExt(i3GEO.parametros.mapexten);i3GEO.Interface.openlayers.recalcPar();i3GEO.Interface.STATUS.pan=false;i3GEO.eventos.navegaMapa();i3GEO.util.escondePin();i3GEO.eventos.cliquePerm.status=false;i3GEO.Interface.STATUS.pan=false}},350)});i3geoOL.on("pointermove",function(e){if(modoAtual==="move"||e.dragging){return}var lonlat=false,d,pos="";lonlat=e.coordinate;if(i3GEO.Interface.openlayers.googleLike===true){lonlat=ol.proj.transform(lonlat,'EPSG:3857','EPSG:4326')}d=i3GEO.calculo.dd2dms(lonlat[0],lonlat[1]);objposicaocursor.ddx=lonlat[0];objposicaocursor.ddy=lonlat[1];objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];objposicaocursor.imgx=e.pixel[0];objposicaocursor.imgy=e.pixel[1];objposicaocursor.telax=objposicaocursor.imgx+pos[0];objposicaocursor.telay=objposicaocursor.imgy+pos[1];var viewResolution=(i3geoOL.getView().getResolution());if(i3GEO.Interface.INFOOVERLAY!=""){i3GEO.Interface.INFOOVERLAY.getElement().innerHTML="";i3GEO.Interface.INFOOVERLAY.getElement().style.visibility="hidden"}for(var k in i3GEO.Interface.LAYERSUTFGRID){if(!i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[k.replace("_utfgrid","")]){i3GEO.Interface.LAYERSUTFGRID[k]=null}else{if(i3GEO.Interface.LAYERSUTFGRID[k]&&i3GEO.Interface.LAYERSUTFGRID[k].getVisible()){i3GEO.Interface.LAYERSUTFGRID[k].getSource().forDataAtCoordinateAndResolution(e.coordinate,viewResolution,function(data){var ei=i3GEO.Interface.INFOOVERLAY.getElement();if(data){ei.style.visibility="visible";ei.innerHTML+="<span style='display:block;'>"+data.text+"<span>";i3GEO.Interface.INFOOVERLAY.setPosition(e.coordinate);i3GEO.eventos.mouseOverData()}else if(ei.innerHTML==""){ei.style.visibility="hidden";i3GEO.Interface.INFOOVERLAY.setPosition(undefined);i3GEO.eventos.mouseOutData()}})}}}});i3geoOL.on("touchend",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(){},recalcPar:function(){i3GEOtouchesPosMapa="";var bounds=i3geoOL.getExtent().toBBOX().split(","),escalaAtual=i3geoOL.getScale();i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];if(i3GEO.parametros.mapscale!==escalaAtual){i3GEO.arvoreDeCamadas.atualizaFarol(escalaAtual)}i3GEO.parametros.pixelsize=i3geoOL.getView().getResolution();i3GEO.navega.atualizaEscalaNumerica(parseInt(escalaAtual,10));i3GEO.parametros.mapscale=escalaAtual},zoom2ext:function(ext){var m,v;if(!ext){ext=i3GEO.parametros.extentTotal}ext=i3GEO.util.extGeo2OSM(ext);m=ext.split(" ");m=[m[0]*1,m[1]*1,m[2]*1,m[3]*1];v=i3geoOL.getView();v.fit(m,i3geoOL.getSize());i3GEO.eventos.cliquePerm.status=true},pan2ponto:function(x,y){if(i3GEO.Interface.openlayers.googleLike===true){var metrica;if(x<180&&x>-180){metrica=ol.proj.transform([x,y],'EPSG:4326','EPSG:3857');x=metrica[0];y=metrica[1]}}i3geoOL.panTo(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:{url:"",templateModal:"",removeAoAdicionar:true,modal:false,simple:true,classeCadeado:"i3GEOiconeAberto",baloes:[]},grade:function(){return false},barraProgressoStart:function(){var p=$i("i3GEOprogressoCamadas");if(p){p.style.width="100%"}},barraProgressoStop:function(){var p=$i("i3GEOprogressoCamadas"),n=0,d=0;if(p){n=i3GeoMap.overlayMapTypes.length;d=parseInt(p.style.width,10);if(d<10||n==0){p.style.width="0%"}else{p.style.width=d-(100/n)+"%";if(d-(100/n)<0){p.style.width="0%"}}}},zoomli:function(){if(DetectaMobile("DetectMobileLong")){i3GEO.janela.tempoMsg($trad("x70"))}else{i3GEO.janela.tempoMsg($trad("zoomliCtrl"))}},getZoom:function(){return i3GeoMap.getZoom()},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.configura.ferramentas.identifica.resolution=$i("i3GEOjanelaprompt").value},i3GEO.configura.ferramentas.identifica.resolution)};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"},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");try{i3GeoMap=new google.maps.Map($i(i3GEO.Interface.IDMAPA),i3GEO.Interface.googlemaps.MAPOPTIONS)}catch(e){alert(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();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));if(i3GEO.Interface.STATUS.trocando===false){i3GEO.idioma.mostraSeletor()}if(i3GEO.Interface.STATUS.trocando===true&&$i(i3GEO.arvoreDeCamadas.IDHTML)){$i(i3GEO.arvoreDeCamadas.IDHTML).innerHTML=""}if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this)"}if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.googlemaps.adicionaKml(true,i3GEO.parametros.kmlurl)}if(jQuery.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}google.maps.event.addListenerOnce(i3GeoMap,'idle',function(){var z=i3GeoMap.getZoom();if(z!=undefined){i3GeoMap.setZoom(parseInt(z,10)+1)}});i3GEO.coordenadas.ativaEventos()};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?"+"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});if($i("i3GEOprogressoCamadas")){google.maps.event.addListener(i3GEOTileO,'tilesloaded',function(){i3GEO.Interface.googlemaps.barraProgressoStop()})}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){if($i("i3GEOprogressoCamadas")){i3GEO.Interface.googlemaps.barraProgressoStart()}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";i3GEO.eventos.cliquePerm.status=false});google.maps.event.addListener(i3GeoMap,"dragend",function(){var xy;i3GEO.Interface.googlemaps.recalcPar();i3GEO.eventos.navegaMapa();i3GEO.util.escondePin();i3GEO.navega.registraExt(i3GEO.parametros.mapexten);i3GEO.Interface.googlemaps.barraProgressoStop()});google.maps.event.addListener(i3GeoMap,"tilesloaded",function(){i3GEO.Interface.googlemaps.recalcPar();i3GEO.navega.registraExt(i3GEO.parametros.mapexten);i3GEO.Interface.googlemaps.barraProgressoStop()});google.maps.event.addListener(i3GeoMap,'idle',function(){i3GEO.Interface.googlemaps.barraProgressoStop()});google.maps.event.addListener(i3GeoMap,"bounds_changed",function(){i3GEO.Interface.googlemaps.barraProgressoStart();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.legenda.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(){},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){$(div).css("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))},zoom2ext:function(mapexten){i3GEO.Interface.googlemaps.zoom2extent(mapexten)},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);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},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()}}}; |
249 | 249 | // |
250 | 250 | //compactados/mapa_compacto.js |
251 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={BALAOATIVO:true,OPENTIPIFEMPTY:true,TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",GEOXML:[],limpasel:function(){i3GEO.php.limpasel(function(retorno){i3GEO.atualiza();i3GEO.Interface.atualizaMapa()},"")},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=window.innerWidth;Dh=window.innerHeight;i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.guias.abreFecha("fecha");ativo=true},2000)}ativo=false}},ativaIdentifica:function(){i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"];i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.verificaTipDefault()"]);i3GEO.eventos.cliquePerm.ativa()},ativaIdentificaBalao:function(){i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.verificaTipDefault()"];i3GEO.eventos.cliquePerm.ativa()},ativaTema:function(codigo){if(codigo){i3GEO.temaAtivo=codigo}},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.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.janela.fechaAguarde();if(this.recupera&&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=JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.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($.isNumeric(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}}catch(e){}}}},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)},wms:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wms()","conectarwms","conectarwms","dependencias.php","i3GEOF.conectarwms.iniciaJanelaFlutuante()")},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.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 temp,janela,id="listaMapa"+Math.random();janela=i3GEO.janela.cria("800px","500px",i3GEO.configura.locaplic+"/mapas/indexnomenu.php","","","<span class='i3GeoTituloJanelaBsNolink' ></span></div>",id)}else{window.open(i3GEO.configura.locaplic+"/rss/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=i3GEO.util.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/openlayers3.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<span class='i3GeoTituloJanelaBsNolink' ></span></div>";i3GEO.janela.cria("520px","370px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza,"","","","",false,"","123")}},metaestat:function(largura,altura,topo,esquerda,Interface,conexao){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;if(Interface){i3GEOF.metaestat.INTERFACE=Interface}if(conexao){i3GEOF.metaestat.CONEXAODEFAULT=conexao}i3GEOF.metaestat.INTERFACE="flutuante";i3GEOF.metaestat.principal.inicia(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","dependencias.php",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()")},filtraperiodo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraperiodo()","filtraperiodo","filtraperiodo","dependencias.php","i3GEOF.filtraperiodo.iniciaJanelaFlutuante()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidademapa()","opacidademapa","opacidademapa","dependencias.php","i3GEOF.opacidademapa.iniciaJanelaFlutuante()")},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(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){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()")},opcoesMapaRef:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesMapaRef()","opcoes_maparef","opcoesMaparef","dependencias.php","i3GEOF.opcoesMaparef.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","dependencias.php","i3GEOF.selecao.iniciaJanelaFlutuante()")},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,tema){if(!x){x=objposicaocursor.ddx;y=objposicaocursor.ddy}var temp=function(){i3GEOF.identifica.start({"x":x,"y":y,"tema":tema})};if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php";i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{temp()}},verificaTipDefault:function(x,y){if(i3GEO.mapa.BALAOATIVO==false){return}if(i3GEO.eventos.cliquePerm.ativo==false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(!x){x=objposicaocursor.ddx}if(!y){y=objposicaocursor.ddy}var ntemas,etiquetas,j,temp;if(x===-1||y===-1){return}objposicaocursor.ddx=-1;objposicaocursor.ddy=-1;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""||i3GEO.arvoreDeCamadas.CAMADAS[j].identifica=="SIM"){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""&&i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal==""){$.get(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y,function(data){i3GEO.janela.closeMsg(data)});return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal!=""){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""){var temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y;temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal.replace("{{{url}}}",temp);i3GEO.janela.closeMsg(temp)}else{i3GEO.janela.closeMsg(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal)}return}var res=i3GEO.configura.ferramentas.identifica.resolution;var bdiv=document.createElement("div");bdiv.className="waitInfoWindow";bdiv.style.width=res+"px";bdiv.style.height=res+"px";bdiv.style.top=(res/2*-1)+"px";var b=new ol.Overlay({element:bdiv,stopEvent:true,autoPan:false,origem:"balao",autoPanAnimation:false,positioning:"center-center",position:i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates()});i3geoOL.addOverlay(b);temp=function(retorno){i3geoOL.removeOverlay(b);i3GEO.mapa.montaTip(retorno,x,y)};i3GEO.php.identifica3(temp,x,y,res,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten,"","sim")}},montaTip:function(retorno,xx,yy){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",x,y,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,wkts=[];i3GEO.eventos.cliquePerm.status=true;mostra=false;if(retorno.data){retorno=retorno.data;temp=retorno[0].xy.split(",");x=temp[0]*1;y=temp[1]*1}else{x=xx;y=yy;mostra=true;textoSimples=$trad("balaoVazio");textoCompleto="";wkt=[];if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.openTipNoData==false){mostra=false}}if(retorno!==""){res="";ntemas=0;temas=retorno;if(temas){ntemas=temas.length}for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="layer"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");var mais="<button style='margin: 2px;padding: 0px;vertical-align: middle;position: relative;top: -7px;' class='btn btn-default btn-xs' onclick=\"i3GEO.mapa.dialogo.cliqueIdentificaDefault("+x+","+y+",'"+temas[j].tema+"');return false;\" ><span style='opacity:0.5;vertical-align: middle;padding: 0px;' class='material-icons'>info</span></button>";titulo="<div class='toolTipBalaoTitulo'>"+mais+" <b>"+titulo+"</b><br>"+temp1+"</div>";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;for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='toolTipBalaoTexto'>";textoTempSimples+="<div class='toolTipBalaoTexto'>";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;var estilo="tooltip-"+temas[j].tema;if(valor!==""&&link===""){temp+="<span class='"+estilo+"'><label>"+alias+": </label>"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span class='"+estilo+"'><label>"+alias+" : </label><a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}textoTempCompleto+="</div>";var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="registro"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");textoTempSimples+=temp1+"</div>";if(ds[s].wkt&&ds[s].wkt.valor!=""){ds[s].tema=temas[j].tema;ds[s].titulo=titulo;wkts.push(ds[s])}}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){res=textoSimples;if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal==true){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.janela.closeMsg(textoSimples);return}else{i3GEO.janela.closeMsg(textoCompleto);return}}else{if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y,true,wkts.length)}else{i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoCompleto,textoSimples,x,y)}}}}n=wkts.length;if(n>0){if(i3GEO.Interface.ATUAL!="openlayers"){return}i3GEO.desenho.openlayers.criaLayerGrafico();var g,format,f,idunico,c=i3GEO.desenho.layergrafico.getSource();format=new ol.format.WKT();for(r=0;r<n;r+=1){f=format.readFeatures(wkts[r].wkt.valor);f=f[0];f.setProperties({origem:"pin"});g=f.getGeometry();g=i3GEO.util.projGeo2OSM(g);f.setGeometry(g);f.setId(i3GEO.util.uid());i3GEO.editor.setStyleByTypeFeature(f);i3GEO.editor.sel.setPropertiesDefault(f);wkts[r].wkt="",f.setProperties({"fat":wkts[r]});c.addFeature(f)}}}}; | |
251 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={BALAOATIVO:true,OPENTIPIFEMPTY:true,TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",GEOXML:[],limpasel:function(){i3GEO.php.limpasel(function(retorno){i3GEO.atualiza();i3GEO.Interface.atualizaMapa()},"")},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=window.innerWidth;Dh=window.innerHeight;i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.guias.abreFecha("fecha");ativo=true},2000)}ativo=false}},ativaIdentifica:function(){i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"];i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.verificaTipDefault()"]);i3GEO.eventos.cliquePerm.ativa()},ativaIdentificaBalao:function(){i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.verificaTipDefault()"];i3GEO.eventos.cliquePerm.ativa()},ativaTema:function(codigo){if(codigo){i3GEO.temaAtivo=codigo}},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.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.janela.fechaAguarde();if(this.recupera&&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=JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.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($.isNumeric(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}}catch(e){}}}},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)},wms:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wms()","conectarwms","conectarwms","dependencias.php","i3GEOF.conectarwms.iniciaJanelaFlutuante()")},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.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 temp,janela,id="listaMapa"+Math.random();janela=i3GEO.janela.cria("800px","500px",i3GEO.configura.locaplic+"/mapas/indexnomenu.php","","","<span class='i3GeoTituloJanelaBsNolink' ></span></div>",id)}else{window.open(i3GEO.configura.locaplic+"/rss/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=i3GEO.util.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/openlayers3.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<span class='i3GeoTituloJanelaBsNolink' ></span></div>";i3GEO.janela.cria("520px","370px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza,"","","","",false,"","123")}},metaestat:function(largura,altura,topo,esquerda,Interface,conexao){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;if(Interface){i3GEOF.metaestat.INTERFACE=Interface}if(conexao){i3GEOF.metaestat.CONEXAODEFAULT=conexao}i3GEOF.metaestat.INTERFACE="flutuante";i3GEOF.metaestat.principal.inicia(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","dependencias.php",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()")},filtraperiodo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraperiodo()","filtraperiodo","filtraperiodo","dependencias.php","i3GEOF.filtraperiodo.iniciaJanelaFlutuante()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidademapa()","opacidademapa","opacidademapa","dependencias.php","i3GEOF.opacidademapa.iniciaJanelaFlutuante()")},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(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){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()")},opcoesMapaRef:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesMapaRef()","opcoes_maparef","opcoesMaparef","dependencias.php","i3GEOF.opcoesMaparef.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","dependencias.php","i3GEOF.selecao.iniciaJanelaFlutuante()")},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,tema){if(!x){x=objposicaocursor.ddx;y=objposicaocursor.ddy}var temp=function(){i3GEOF.identifica.start({"x":x,"y":y,"tema":tema})};if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php";i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{temp()}},verificaTipDefault:function(x,y){if(i3GEO.mapa.BALAOATIVO==false){return}if(!x){x=objposicaocursor.ddx}if(!y){y=objposicaocursor.ddy}if(x===-1||y===-1||i3GEO.eventos.cliquePerm.ativo===false||i3GEO.eventos.cliquePerm.status===false){return}i3GEO.eventos.cliquePerm.status=false;var ntemas,etiquetas,j,temp;objposicaocursor.ddx=-1;objposicaocursor.ddy=-1;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""||i3GEO.arvoreDeCamadas.CAMADAS[j].identifica=="SIM"){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""&&i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal==""){$.get(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y,function(data){i3GEO.janela.closeMsg(data)});return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal!=""){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""){var temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y;temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal.replace("{{{url}}}",temp);i3GEO.janela.closeMsg(temp)}else{i3GEO.janela.closeMsg(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal)}return}var res=i3GEO.configura.ferramentas.identifica.resolution;var bdiv=document.createElement("div");bdiv.className="waitInfoWindow";bdiv.style.width=res+"px";bdiv.style.height=res+"px";bdiv.style.top=(res/2*-1)+"px";var b=new ol.Overlay({element:bdiv,stopEvent:true,autoPan:false,origem:"balao",autoPanAnimation:false,positioning:"center-center",position:i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates()});i3geoOL.addOverlay(b);temp=function(retorno){i3geoOL.removeOverlay(b);i3GEO.mapa.montaTip(retorno,x,y)};i3GEO.php.identifica3(temp,x,y,res,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten,"","sim")}},montaTip:function(retorno,xx,yy){var textoSimples="",textoTempSimples="",x,y,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,wkts=[];i3GEO.eventos.cliquePerm.status=true;mostra=false;if(retorno.data){retorno=retorno.data;temp=retorno[0].xy.split(",");x=temp[0]*1;y=temp[1]*1}else{x=xx;y=yy;mostra=true;textoSimples=$trad("balaoVazio");textoCompleto="";wkt=[];if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.openTipNoData==false){mostra=false}}if(retorno!==""){res="";ntemas=0;temas=retorno;if(temas){ntemas=temas.length}for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="layer"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");var mais="<button style='margin: 2px;padding: 0px;vertical-align: middle;position: relative;top: -7px;' class='btn btn-default btn-xs' onclick=\"i3GEO.mapa.dialogo.cliqueIdentificaDefault("+x+","+y+",'"+temas[j].tema+"');return false;\" ><span style='opacity:0.5;vertical-align: middle;padding: 0px;' class='material-icons'>info</span></button>";if(ntemas==1){mais=""}titulo="<div class='toolTipBalaoTitulo'>"+mais+" <b>"+titulo+"</b><br>"+temp1+"</div>";tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;for(s=0;s<nds;s+=1){textoTempSimples+="<div class='toolTipBalaoTexto'>";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;var estilo="tooltip-"+temas[j].tema;if(valor!==""&&link===""){temp+="<span class='"+estilo+"'><label>"+alias+": </label>"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span class='"+estilo+"'><label>"+alias+" : </label><a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}mostra=true}catch(e){}}var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="registro"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");textoTempSimples+=temp1+"</div>";if(ds[s].wkt&&ds[s].wkt.valor!=""){ds[s].tema=temas[j].tema;ds[s].titulo=titulo;wkts.push(ds[s])}}}catch(e){}}if(textoTempSimples!==""){textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal==true){i3GEO.janela.closeMsg(textoSimples);return}else{i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,"",x,y,true,wkts.length)}}}n=wkts.length;if(n>0){if(i3GEO.Interface.ATUAL!="openlayers"){return}i3GEO.desenho.openlayers.criaLayerGrafico();var g,format,f,idunico,c=i3GEO.desenho.layergrafico.getSource();format=new ol.format.WKT();for(r=0;r<n;r+=1){f=format.readFeatures(wkts[r].wkt.valor);f=f[0];f.setProperties({origem:"pin"});g=f.getGeometry();g=i3GEO.util.projGeo2OSM(g);f.setGeometry(g);f.setId(i3GEO.util.uid());i3GEO.editor.setStyleByTypeFeature(f);i3GEO.editor.sel.setPropertiesDefault(f);wkts[r].wkt="",f.setProperties({"fat":wkts[r]});c.addFeature(f)}}}}; | |
252 | 252 | // |
253 | 253 | //compactados/tema_compacto.js |
254 | 254 | 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&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto&&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{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}var excluir=[tema];var camada=i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[tema];$.each(i3GEO.arvoreDeCamadas.CAMADAS,function(index,v){if((camada.group!=""&&camada.group==v.group)||camada.name==v.group){excluir.push(v.name)}});i3GEO.php.excluitema(function(){i3GEO.atualiza()},excluir);i3GEO.mapa.ativaTema();i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/ferramentas/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.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(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.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb,objImg){var w=25,h=25,temp;if(objImg&&objImg.style&&objImg.style.width){w=parseInt(objImg.style.width,10);h=parseInt(objImg.style.height,10)}i3GEO.mapa.ativaTema(idtema);temp=function(retorno){if(objImg){objImg.src=retorno.data}else{i3GEO.legenda.CAMADAS="";i3GEO.atualiza()}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.php.aplicaCorClasseTema(temp,idtema,idclasse,rgb,w,h)},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)},contorno:function(idtema){var temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)};i3GEO.php.contorno(temp,idtema)},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){}}},cortina:{_cortinaCompose:"",_slide:"",start:function(obj,tema){var layer=i3geoOL.getLayersByName(tema)[0];if(i3GEO.tema.cortina._cortinaCompose==""){var a=layer.on('precompose',function(event){var ctx=event.context;var width=ctx.canvas.width*(obj.value/100);ctx.save();ctx.beginPath();ctx.rect(width,0,ctx.canvas.width-width,ctx.canvas.height);ctx.clip()});var b=layer.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.tema.cortina._cortinaCompose=[a,b];obj.addEventListener('input',function(){i3geoOL.render()},false)}},stop:function(){ol.Observable.unByKey(i3GEO.tema.cortina._cortinaCompose);i3GEO.tema.cortina._cortinaCompose="";i3geoOL.renderSync()}},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)},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)},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)},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())},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){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}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){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}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){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},funcaojstip:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.funcaojstip()","funcaojstip","funcaojstip","dependencias.php","i3GEOF.funcaojstip.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}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)}}}; |
... | ... | @@ -275,7 +275,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.arvoreDeCamadas={FUNCOES:{far |
275 | 275 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.navega={EXTENSOES:{lista:[],redo:[],posicao:0,emAcao:false},offset:function(pixelx,pixely){if(i3GEO.Interface.ATUAL=="openlayers"){var view=i3geoOL.getView(),mover=[pixelx,pixely],s=i3geoOL.getSize(),dx=s[0]/2+mover[0],dy=s[1]/2+mover[1];view.centerOn(view.getCenter(),s,[dx,dy])}},ativaPan:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setOptions({draggable:true})}if(i3GEO.Interface.ATUAL==="openlayers"){marcadorZoom="";i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}},registraExt:function(ext){if(i3GEO.navega.EXTENSOES.emAcao==false){var l=i3GEO.navega.EXTENSOES.lista,n=l.length;if(n>10){l.shift()}n=l.length;if(n>0&&l[n-1]===ext){return}l.push(ext)}else{i3GEO.navega.EXTENSOES.emAcao=false}},extensaoAnterior:function(){i3GEO.navega.EXTENSOES.emAcao=true;var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;if(l.length>0){if(l.length>1){e=l.pop();i3GEO.navega.zoomExt("","","",e);if(r.length>10){r.shift()}if(r.length>0&&r[r.length-1]===e){return}else{r.push(a)}}}else{l.push(i3GEO.parametros.mapexten)}},extensaoProximo:function(){var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;i3GEO.navega.EXTENSOES.emAcao=true;if(r.length>0){i3GEO.navega.zoomExt("","","",r[r.length-1]);e=r.pop();if(l.length>10){l.pop()}if(l.length>0&&l[l.length-1]===e){return}l.push(a)}},pan2ponto:function(x,y){i3GEO.Interface[i3GEO.Interface.ATUAL].pan2ponto(x,y);i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar()},centroDoMapa:function(){var xy;switch(i3GEO.Interface.ATUAL){case"openlayers":xy=i3geoOL.getCenter();if(xy){return[xy.lon,xy.lat]}else{return false}break;case"googlemaps":xy=i3GeoMap.getCenter();if(xy){return[xy.lng(),xy.lat()]}else{return false}break;default:return false}},marcaCentroDoMapa:function(xy){var t=$i("i3GeoCentroDoMapa");if(t&&t.style.display==="block"){return}if(xy!=false){xy=i3GEO.calculo.dd2tela(xy[0]*1,xy[1]*1,$i(i3GEO.Interface.IDMAPA),i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize);i3GEO.util.criaPin("i3GeoCentroDoMapa",i3GEO.configura.locaplic+'/imagens/alvo.png','30px','30px');i3GEO.util.posicionaImagemNoMapa("i3GeoCentroDoMapa",xy[0],xy[1])}},removeCookieExtensao:function(){var nomecookie="i3geoOLUltimaExtensao";if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}i3GEO.util.insereCookie(nomecookie,"")},zoomin:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomIn();return}},zoomout:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomOut();return}},zoomponto:function(locaplic,sid,x,y,tamanho,simbolo,cor){if(!simbolo){simbolo="ponto"}if(!tamanho){tamanho=15}if(!cor){cor="255 0 0"}if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.zoomponto(i3GEO.atualiza,x,y,tamanho,simbolo,cor)},zoompontoIMG:function(locaplic,sid,x,y){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.pan(i3GEO.atualiza,'','',x,y)},xy2xy:function(locaplic,sid,xi,yi,xf,yf,ext,tipoimagem){var disty,distx,ex,novoxi,novoxf,novoyf,nex;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}disty=(yi*-1)+yf;distx=(xi*-1)+xf;ex=ext.split(" ");novoxi=(ex[0]*1)-distx;novoxf=(ex[2]*1)-distx;novoyi=(ex[1]*1)-disty;novoyf=(ex[3]*1)-disty;if((distx===0)&&(disty===0)){return false}else{nex=novoxi+" "+novoyi+" "+novoxf+" "+novoyf;i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,tipoimagem,nex);return true}},localizaIP:function(locaplic,sid,funcao){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.localizaIP(funcao)},zoomIP:function(locaplic,sid){try{if(arguments.length>0){i3GEO.configura.locaplic=locaplic;i3GEO.configura.sid=sid}var mostraIP=function(retorno){if(retorno.data.latitude!==null){i3GEO.navega.zoomponto(locaplic,sid,retorno.data.longitude,retorno.data.latitude)}else{i3GEO.janela.tempoMsg("Nao foi possivel identificar a localizacao.")}};i3GEO.navega.localizaIP(locaplic,sid,mostraIP)}catch(e){}},zoomExt:function(locaplic,sid,tipoimagem,ext){var f;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}if(tipoimagem===""){tipoimagem="nenhum"}ext=i3GEO.util.extGeo2OSM(ext);i3GEO.php.mudaext(function(retorno){i3GEO.atualiza(retorno)},tipoimagem,ext)},aplicaEscala:function(escala){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setZoom(i3GEO.Interface.googlemaps.escala2nzoom(escala))}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomToScale(escala,true);i3GEO.parametros.mapscale=parseInt(i3geoOL.getScale(),10)}},atualizaEscalaNumerica:function(escala){var e=$i("i3GEOescalanum");if(!e){return}if(arguments.length===1){e.value=$.number(escala,0,$trad("dec"),$trad("mil"))}else{if(i3GEO.Interface.ATUAL==="googlemaps"){e.value=parseInt(i3GEO.parametros.mapscale,10)}if(i3GEO.Interface.ATUAL==="openlayers"){e.value=$.number(i3geoOL.getScale(),0,$trad("dec"),$trad("mil"))}}},panFixo:function(){alert("panFixo foi depreciado na versao 6.0")},mostraRosaDosVentos:function(){alert("mostraRosaDosVentos foi depreciado na versao 6.0")},autoRedesenho:{INTERVALO:0,ID:"tempoRedesenho",ativa:function(id){if(arguments.length===0){id="tempoRedesenho"}i3GEO.navega.autoRedesenho.ID=id;if(($i(id))&&i3GEO.navega.autoRedesenho.INTERVALO>0){$i(id).style.display="block"}if(i3GEO.navega.autoRedesenho.INTERVALO>0){i3GEO.navega.tempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.redesenha()',i3GEO.navega.autoRedesenho.INTERVALO)}if(($i(id))&&(i3GEO.navega.autoRedesenho.INTERVALO>0)){$i(id).innerHTML=i3GEO.navega.autoRedesenho.INTERVALO/1000;i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},desativa:function(){i3GEO.navega.autoRedesenho.INTERVALO=0;clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);i3GEO.navega.tempoRedesenho="";i3GEO.navega.contaTempoRedesenho="";if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).style.display="none"}},redesenha:function(){clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;case"googlemaps":i3GEO.Interface.googlemaps.redesenha();break;default:i3GEO.atualiza("")}i3GEO.navega.autoRedesenho.ativa(i3GEO.navega.autoRedesenho.ID)},contagem:function(){if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).innerHTML=parseInt($i(i3GEO.navega.autoRedesenho.ID).innerHTML,10)-1}i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},zoomBox:{inicia:function(){alert("zoomBox depreciado na versao 6.0")}},lente:{_lenteCompose:"",eventMouseout:function(){if(i3GEO.navega.lente._lenteCompose!=""){i3GEO.navega.lente.stop(i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.lente._lenteCompose!=""){i3geoOL.renderSync()}},stop:function(container){ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose);i3GEO.navega.lente._lenteCompose="";container.removeEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.lente.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var container=i3geoOL.getTargetElement();var radius=75;container.addEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.lente.eventMouseout);var a=i3geoOL.on('postcompose',function(event){var context=event.context;var pixelRatio=event.frameState.pixelRatio;var half=radius*pixelRatio;var centerX=objposicaocursor.imgx*pixelRatio;var centerY=objposicaocursor.imgy*pixelRatio;var originX=centerX-half;var originY=centerY-half;var size=2*half+1;var sourceData=context.getImageData(originX,originY,size,size).data;var dest=context.createImageData(size,size);var destData=dest.data;for(var j=0;j<size;++j){for(var i=0;i<size;++i){var dI=i-half;var dJ=j-half;var dist=Math.sqrt(dI*dI+dJ*dJ);var sourceI=i;var sourceJ=j;if(dist<half){sourceI=Math.round(half+dI/2);sourceJ=Math.round(half+dJ/2)}var destOffset=(j*size+i)*4;var sourceOffset=(sourceJ*size+sourceI)*4;destData[destOffset]=sourceData[sourceOffset];destData[destOffset+1]=sourceData[sourceOffset+1];destData[destOffset+2]=sourceData[sourceOffset+2];destData[destOffset+3]=sourceData[sourceOffset+3]}}context.beginPath();context.arc(centerX,centerY,half,0,2*Math.PI);context.lineWidth=3*pixelRatio;context.strokeStyle='rgba(255,255,255,0.5)';context.putImageData(dest,originX,originY);context.stroke();context.restore()});i3GEO.navega.lente._lenteCompose=[a]}},destacaTema:{inicia:function(){i3GEO.janela.tempoMsg("removido na versao 8")}},basemapSpy:{_spyCompose:"",eventMouseout:function(){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(i3geoOL.getLayerBase(),i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.basemapSpy._spyCompose);i3GEO.navega.basemapSpy._spyCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getAllLayers()[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);var a=imagery.on('precompose',function(event){var ctx=event.context;var pixelRatio=event.frameState.pixelRatio;ctx.save();ctx.beginPath();ctx.arc(objposicaocursor.imgx*pixelRatio,objposicaocursor.imgy*pixelRatio,radius*pixelRatio,0,2*Math.PI);ctx.lineWidth=5*pixelRatio;ctx.strokeStyle='rgba(0,0,0,0.5)';ctx.stroke();ctx.clip()});var b=imagery.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.navega.basemapSpy._spyCompose=[a,b]}},dialogo:{wiki:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.wiki()","wiki","wiki","dependencias.php","i3GEOF.wiki.iniciaJanelaFlutuante()")},metar:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.metar()","metar","metar","dependencias.php","i3GEOF.metar.iniciaJanelaFlutuante()")},buscaFotos:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.buscaFotos()","buscafotos","buscaFotos","dependencias.php","i3GEOF.buscaFotos.iniciaJanelaFlutuante()")},google:function(coordenadas){i3GEO.navega.dialogo.google.coordenadas=coordenadas;var temp,janela,idgoogle="googlemaps"+Math.random();janela=i3GEO.janela.cria((i3GEO.parametros.w/2.5)+25+"px",(i3GEO.parametros.h/2.5)+18+"px",i3GEO.configura.locaplic+"/ferramentas/googlemaps1/index.php","","","<span class='i3GeoTituloJanelaBsNolink' >Google maps</span></div>",idgoogle,false,"hd","","","",false,"","","","","68");temp=function(){i3GEO.desenho.removePins("boxOndeGoogle");i3GEO.desenho.removePins("googlemaps")};$(janela[0].close).click(temp)},confluence:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.confluence()","confluence","confluence","dependencias.php","i3GEOF.confluence.iniciaJanelaFlutuante()")}},atualizaGoogle:function(idgoogle){try{parent.frames[idgoogle+"i"].panTogoogle()}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);i3GEO.desenho.removePins("googlemaps");i3GEO.desenho.removePins("boxOndeGoogle")}},dragZoom:function(){i3GEO.navega.dragZoom.draw=new ol.interaction.Draw({type:"Circle",freehand:false,geometryFunction:ol.interaction.Draw.createRegularPolygon(4)});i3GEO.navega.dragZoom.draw.setActive(false);i3GEO.navega.dragZoom.draw.on("drawend",function(evt){var pol=evt.feature.getGeometry();i3geoOL.getView().fit(pol);i3GEO.navega.dragZoom.draw.setActive(false)});document.body.addEventListener('keydown',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(true)}});document.body.addEventListener('keyup',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(false)}});return i3GEO.navega.dragZoom.draw},geolocal:{_timer:"",_delay:500,_pin:"",start:function(){if(i3GEO.navega.geolocal._timer!=""){i3GEO.navega.geolocal.stop()}else{i3GEO.navega.geolocal.firstPoint()}},firstPoint:function(){var retorno=function(position){console.log(position);i3GEO.navega.geolocal.showPoint(position);i3GEO.navega.geolocal.createTimer()};navigator.geolocation.getCurrentPosition(retorno,i3GEO.navega.geolocal.erro)},createTimer:function(){i3GEO.navega.geolocal._timer=setInterval(function(){i3GEO.navega.geolocal.movePoint()},i3GEO.navega.geolocal._delay)},stop:function(){clearInterval(i3GEO.navega.geolocal._timer);i3GEO.navega.geolocal._timer="";i3GEO.navega.geolocal.removePoint()},showPoint:function(position){var y=position.coords.latitude;var x=position.coords.longitude;i3GEO.navega.pan2ponto(x,y);i3GEO.navega.geolocal._pin=i3GEO.desenho.addPin(x,y,"","",i3GEO.configura.locaplic+'/imagens/google/confluence.png',"pingeolocal")},movePoint:function(position){var retorno=function(position){var y=position.coords.latitude;var x=position.coords.longitude;i3GEO.desenho.movePin(i3GEO.navega.geolocal._pin,x,y)};navigator.geolocation.getCurrentPosition(retorno,i3GEO.navega.geolocal.erro)},removePoint:function(){i3GEO.desenho.removePins("pingeolocal")},erro:function(error){i3GEO.navega.geolocal.stop();var erro="";switch(error.code){case error.PERMISSION_DENIED:erro="User denied the request for Geolocation.";break;case error.POSITION_UNAVAILABLE:erro="Location information is unavailable.";break;case error.TIMEOUT:erro="The request to get user location timed out.";break;case error.UNKNOWN_ERROR:erro="An unknown error occurred.";break}i3GEO.janela.tempoMsg(erro)}}}; |
276 | 276 | // |
277 | 277 | //compactados/eventos_compacto.js |
278 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}var objposicaocursor={ddx:"",ddy:"",dmsx:"",dmsy:"",telax:"",telay:"",imgx:"",imgy:"",refx:"",refy:""};i3GEO.eventos={CONTATOUCH:0,MOUSEOVERDATA:[],MOUSEOUTDATA:[],RESIZE:[],SELECAO:[],ATUALIZAARVORECAMADAS:[],ATIVATEMA:[],NAVEGAMAPA:[],MOUSEPARADO:[],MOUSEMOVE:[],MOUSEDOWN:[],MOUSEUP:["i3GEO.eventos.cliquePerm.executa()"],MOUSECLIQUE:["i3GEO.eventos.cliqueCapturaPt()"],MOUSECLIQUEPERM:["i3GEO.mapa.dialogo.verificaTipDefault()"],TIMERPARADO:"",mouseOverData:function(){i3GEO.eventos.executaEventos(this.MOUSEOVERDATA)},mouseOutData:function(){i3GEO.eventos.executaEventos(this.MOUSEOUTDATA)},mouseParado:function(){try{clearTimeout(this.TIMERPARADO)}catch(e){this.TIMERPARADO=""}if(objposicaocursor.dentroDomapa===false){return}try{if(objposicaocursor.imgy===""){objposicaocursor.imgy=1;objposicaocursor.imgx=1}if(i3GEO.eventos.MOUSEPARADO.length>0&&objposicaocursor.imgy>0&&objposicaocursor.imgx>0){if(objposicaocursor.imgx>0){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO)}}}catch(e){}},navegaMapa:function(){i3GEO.eventos.executaEventos(this.NAVEGAMAPA)},mousemoveMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEMOVE)},mousedownMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEDOWN)},mouseupMapa:function(exy){if(!exy){i3GEO.eventos.executaEventos(this.MOUSEUP)}else{if(i3GEO.Interface.ATUAL==="googlemaps"&&exy.target&&!exy.target.src){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}pos=i3GEOtouchesPosMapa;p=new google.maps.Point(exy.clientX-pos[0],exy.clientY-pos[1]);e=null;lonlat=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p);if(lonlat){objposicaocursor.ddx=lonlat.lng();objposicaocursor.ddy=lonlat.lat()}i3GEO.eventos.executaEventos(this.MOUSEUP)}else if(i3GEO.Interface.ATUAL==="openlayers"&&exy.target&&exy.target.tagName==="CANVAS"){i3GEO.eventos.executaEventos(this.MOUSEUP)}}},mousecliqueMapa:function(){i3GEO.eventos.executaEventos(this.MOUSECLIQUE)},resizeMapa:function(){i3GEO.eventos.executaEventos(this.RESIZE)},executaEventos:function(eventos){if(i3GEO.Interface.STATUS.pan===true){return}var f=0;try{if(eventos.length>0){f=eventos.length-1;if(f>=0){do{if(eventos[f]!==""){if(typeof(eventos[f])==="function"){eventos[f].call()}else{eval(eventos[f])}}}while(f--)}}}catch(e){eventos[f]=""}},removeEventos:function(tipo,eventos){var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].remove(eventos[i])}i3GEO.eventos[tipo].remove("");i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},adicionaEventos:function(tipo,eventos){if(eventos==""){i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique();return}var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].push(eventos[i])}i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},posicaoMouseMapa:function(e){var teladd,teladms,container="",targ="",pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex;if(!e){e=window.event}try{if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.parentNode){container=targ.parentNode.id}}catch(erro){return}if(container!=="mapaReferencia"){return}pos=i3GEO.util.pegaPosicaoObjeto(targ);mousex=0;mousey=0;if(e.pageX||e.pageY){mousex=e.pageX;mousey=e.pageY}else if(e.clientX||e.clientY){mousex=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mousey=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}xfig=mousex-pos[0];yfig=mousey-pos[1];xreffig=xfig;yreffig=yfig;xtela=mousex;ytela=mousey;c=i3GEO.parametros.celularef;ex=i3GEO.parametros.extentref;teladd=i3GEO.calculo.tela2dd(xfig,yfig,c,ex,targ.id);teladms=i3GEO.calculo.dd2dms(teladd[0],teladd[1]);objposicaocursor={ddx:teladd[0],ddy:teladd[1],dmsx:teladms[0],dmsy:teladms[1],telax:xtela,telay:ytela,imgx:xfig,imgy:yfig,refx:xreffig,refy:yreffig,dentroDomapa:true}},ativa:function(docMapa){if(!docMapa){return}var timer=0;var delay=300;var prevent=false;docMapa.onmouseover=function(){objposicaocursor.dentroDomapa=true;this.onmousemove=function(exy){i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.posicaoMouseMapa(exy);try{i3GEO.eventos.mousemoveMapa()}catch(e){}}};docMapa.onmouseout=function(){objposicaocursor.dentroDomapa=false};docMapa.onmousedown=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousedownMapa()};docMapa.onclick=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousecliqueMapa(exy)};docMapa.ondblclick=function(){if(objposicaocursor.dentroDomapa===false){return}clearTimeout(timer);prevent=true};docMapa.onmouseup=function(exy){if(objposicaocursor.dentroDomapa===false){return}if(i3GEO.Interface.ATUAL==="googlemaps"){if(modoAtual==="move"){modoAtual="";return}}i3GEO.eventos.cliquePerm.status=true;timer=setTimeout(function(){if(!prevent){i3GEO.eventos.mouseupMapa(exy)}prevent=false},delay)};docMapa.ontouchmove=function(exy){i3GEO.eventos.CONTATOUCH++;i3GEO.Interface.STATUS.pan=true;i3GEO.eventos.posicaoMouseMapa(exy)};docMapa.ontouchcancel=function(exy){i3GEO.eventos.CONTATOUCH=0}},botaoDireita:function(exy){try{var k=(navm)?event.button:exy.button;if(k!==2){return false}else{return true}}catch(e){return false}},cliqueCapturaPt:function(ixg,ixm,ixs,iyg,iym,iys){var x,y,doc=document;if(arguments.length===0){ixg="ixg";ixm="ixm";ixs="ixs";iyg="iyg";iym="iym";iys="iys";if($i("wdocai")){doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument}}try{if(doc){x=objposicaocursor.dmsx.split(" ");y=objposicaocursor.dmsy.split(" ");if(doc.getElementById(ixg)){doc.getElementById(ixg).value=x[0]}if(doc.getElementById(ixm)){doc.getElementById(ixm).value=x[1]}if(doc.getElementById(ixs)){doc.getElementById(ixs).value=$.number(x[2],2,$trad("dec"),$trad("mil"))}if(doc.getElementById(iyg)){doc.getElementById(iyg).value=y[0]}if(doc.getElementById(iym)){doc.getElementById(iym).value=y[1]}if(doc.getElementById(iys)){doc.getElementById(iys).value=$.number(y[2],2,$trad("dec"),$trad("mil"))}}}catch(m){}},cliquePerm:{ativo:true,status:true,executa:function(evt){if(i3GEO.eventos.cliquePerm.ativo===true&&i3GEO.eventos.cliquePerm.status===true){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUEPERM)}},ativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=true}},desativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=false}},ativoinicial:true}}; | |
278 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}var objposicaocursor={ddx:"",ddy:"",dmsx:"",dmsy:"",telax:"",telay:"",imgx:"",imgy:"",refx:"",refy:""};i3GEO.eventos={CONTATOUCH:0,MOUSEOVERDATA:[],MOUSEOUTDATA:[],RESIZE:[],SELECAO:[],ATUALIZAARVORECAMADAS:[],ATIVATEMA:[],NAVEGAMAPA:[],MOUSEPARADO:[],MOUSEMOVE:[],MOUSEDOWN:[],MOUSEUP:["i3GEO.eventos.cliquePerm.executa()"],MOUSECLIQUE:["i3GEO.eventos.cliqueCapturaPt()"],MOUSECLIQUEPERM:["i3GEO.mapa.dialogo.verificaTipDefault(xx,yy)"],TIMERPARADO:"",mouseOverData:function(){i3GEO.eventos.executaEventos(this.MOUSEOVERDATA)},mouseOutData:function(){i3GEO.eventos.executaEventos(this.MOUSEOUTDATA)},mouseParado:function(){try{clearTimeout(this.TIMERPARADO)}catch(e){this.TIMERPARADO=""}if(objposicaocursor.dentroDomapa===false){return}try{if(objposicaocursor.imgy===""){objposicaocursor.imgy=1;objposicaocursor.imgx=1}if(i3GEO.eventos.MOUSEPARADO.length>0&&objposicaocursor.imgy>0&&objposicaocursor.imgx>0){if(objposicaocursor.imgx>0){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO)}}}catch(e){}},navegaMapa:function(){i3GEO.eventos.executaEventos(this.NAVEGAMAPA)},mousemoveMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEMOVE)},mousedownMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEDOWN)},mouseupMapa:function(exy){if(!exy){i3GEO.eventos.executaEventos(this.MOUSEUP)}else{if(i3GEO.Interface.ATUAL==="googlemaps"&&exy.target&&!exy.target.src){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}pos=i3GEOtouchesPosMapa;p=new google.maps.Point(exy.clientX-pos[0],exy.clientY-pos[1]);e=null;lonlat=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p);if(lonlat){objposicaocursor.ddx=lonlat.lng();objposicaocursor.ddy=lonlat.lat()}i3GEO.eventos.executaEventos(this.MOUSEUP)}else if(i3GEO.Interface.ATUAL==="openlayers"&&exy.target&&exy.target.tagName==="CANVAS"){i3GEO.eventos.executaEventos(this.MOUSEUP)}}},mousecliqueMapa:function(){i3GEO.eventos.executaEventos(this.MOUSECLIQUE)},resizeMapa:function(){i3GEO.eventos.executaEventos(this.RESIZE)},executaEventos:function(eventos){if(i3GEO.Interface.STATUS.pan===true){return}var f=0;try{if(eventos.length>0){f=eventos.length-1;if(f>=0){do{if(eventos[f]!==""){if(typeof(eventos[f])==="function"){eventos[f].call()}else{var f=eventos[f];f=f.replace("xx",objposicaocursor.ddx);f=f.replace("yy",objposicaocursor.ddy);eval(f)}}}while(f--)}}}catch(e){eventos[f]=""}},removeEventos:function(tipo,eventos){var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].remove(eventos[i])}i3GEO.eventos[tipo].remove("");i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},adicionaEventos:function(tipo,eventos){if(eventos==""){i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique();return}var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].push(eventos[i])}i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},posicaoMouseMapa:function(e){var teladd,teladms,container="",targ="",pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex;if(!e){e=window.event}try{if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.parentNode){container=targ.parentNode.id}}catch(erro){return}if(container!=="mapaReferencia"){return}pos=i3GEO.util.pegaPosicaoObjeto(targ);mousex=0;mousey=0;if(e.pageX||e.pageY){mousex=e.pageX;mousey=e.pageY}else if(e.clientX||e.clientY){mousex=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mousey=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}xfig=mousex-pos[0];yfig=mousey-pos[1];xreffig=xfig;yreffig=yfig;xtela=mousex;ytela=mousey;c=i3GEO.parametros.celularef;ex=i3GEO.parametros.extentref;teladd=i3GEO.calculo.tela2dd(xfig,yfig,c,ex,targ.id);teladms=i3GEO.calculo.dd2dms(teladd[0],teladd[1]);objposicaocursor={ddx:teladd[0],ddy:teladd[1],dmsx:teladms[0],dmsy:teladms[1],telax:xtela,telay:ytela,imgx:xfig,imgy:yfig,refx:xreffig,refy:yreffig,dentroDomapa:true}},ativa:function(docMapa){if(!docMapa){return}var timer=0;var delay=300;var prevent=false;docMapa.onmouseover=function(){objposicaocursor.dentroDomapa=true;this.onmousemove=function(exy){i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.posicaoMouseMapa(exy);try{i3GEO.eventos.mousemoveMapa()}catch(e){}}};docMapa.onmouseout=function(){objposicaocursor.dentroDomapa=false};docMapa.onmousedown=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousedownMapa()};docMapa.onclick=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousecliqueMapa(exy)};docMapa.ondblclick=function(){if(objposicaocursor.dentroDomapa===false){return}clearTimeout(timer);prevent=true};docMapa.onmouseup=function(exy){if(objposicaocursor.dentroDomapa===false){return}if(i3GEO.Interface.ATUAL==="googlemaps"){if(modoAtual==="move"){modoAtual="";return}}i3GEO.eventos.cliquePerm.status=true;timer=setTimeout(function(){if(!prevent){i3GEO.eventos.mouseupMapa(exy)}prevent=false},delay)};docMapa.ontouchmove=function(exy){i3GEO.eventos.CONTATOUCH++;i3GEO.Interface.STATUS.pan=true;i3GEO.eventos.posicaoMouseMapa(exy)};docMapa.ontouchcancel=function(exy){i3GEO.eventos.CONTATOUCH=0}},botaoDireita:function(exy){try{var k=(navm)?event.button:exy.button;if(k!==2){return false}else{return true}}catch(e){return false}},cliqueCapturaPt:function(ixg,ixm,ixs,iyg,iym,iys){var x,y,doc=document;if(arguments.length===0){ixg="ixg";ixm="ixm";ixs="ixs";iyg="iyg";iym="iym";iys="iys";if($i("wdocai")){doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument}}try{if(doc){x=objposicaocursor.dmsx.split(" ");y=objposicaocursor.dmsy.split(" ");if(doc.getElementById(ixg)){doc.getElementById(ixg).value=x[0]}if(doc.getElementById(ixm)){doc.getElementById(ixm).value=x[1]}if(doc.getElementById(ixs)){doc.getElementById(ixs).value=$.number(x[2],2,$trad("dec"),$trad("mil"))}if(doc.getElementById(iyg)){doc.getElementById(iyg).value=y[0]}if(doc.getElementById(iym)){doc.getElementById(iym).value=y[1]}if(doc.getElementById(iys)){doc.getElementById(iys).value=$.number(y[2],2,$trad("dec"),$trad("mil"))}}}catch(m){}},cliquePerm:{ativo:true,status:true,executa:function(evt){if(i3GEO.eventos.cliquePerm.ativo===true&&i3GEO.eventos.cliquePerm.status===true){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUEPERM)}},ativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=true}},desativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=false}},ativoinicial:true}}; | |
279 | 279 | // |
280 | 280 | //compactados/arvoredetemas_compacto.js |
281 | 281 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.arvoreDeTemas={IDSMENUS:[],buscaTema2:function(palavra){if(palavra===""){return}var busca,root,nodePalavra="";resultadoProcurar=function(retorno){var ig,montaTexto=function(ngSgrupo){var tempn,ngTema,tempng,mostra,d,lk="",st,sg;tempn=ngSgrupo.length;for(sg=0;sg<tempn;sg+=1){ngTema=ngSgrupo[sg].temas;tempng=ngTema.length;for(st=0;st<tempng;st+=1){mostra=true;try{if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD&&ngTema[st].download==="nao"){mostra=false}if(i3GEO.arvoreDeTemas.FILTRAOGC&&ngTema[st].ogc==="nao"){mostra=false}}catch(e){}if(mostra){d=i3GEO.arvoreDeTemas.montaTextoTema("gray",ngTema[st]);if(ngTema[st].link!==" "){lk="<a href='"+ngTema[st].link+"' target='blank'> fonte</a>"}if(ngSgrupo[sg].subgrupo){d+="<td style='text-allign:left'> ("+(ngSgrupo[sg].subgrupo)+") "+lk+"</td>"}else{d+="<td style='text-allign:left'> ("+(ngSgrupo[sg].grupo)+")"+lk+"</td>"}}conta+=1}}}};busca=function(){i3GEO.php.procurartemas2(resultadoProcurar,i3GEO.util.removeAcentos(palavra))}},comboMenus:function(locaplic,funcaoOnchange,idDestino,idCombo,largura,altura){i3GEO.configura.locaplic=locaplic;var combo=function(retorno){var ob,ins,ig;ob=retorno.data;ins="<select id='"+idCombo+"' SIZE="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(this.value)' ><option value='' >Escolha um menu:</option>";for(ig=0;ig<ob.length;ig+=1){if(ob[ig].publicado!=="nao"&&ob[ig].publicado!=="NAO"){if(ob[ig].nomemenu){ins+="<option value="+ob[ig].idmenu+" >"+ob[ig].nomemenu+"</option>"}}}$i(idDestino).innerHTML=ins+"</select>";return retorno.data};i3GEO.php.pegalistademenus(combo)},comboGruposMenu:function(locaplic,funcaoOnchange,idDestino,idCombo,largura,altura,id_menu){i3GEO.configura.locaplic=locaplic;i3GEO.arvoreDeTemas.temasRaizGrupos=[];var combo=function(retorno){var ins,ig,obGrupos=retorno.data;ins="<select id='"+idCombo+"' SIZE="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(this.value)' ><option value='' >Escolha um grupo:</option>";for(ig=0;ig<obGrupos.grupos.length;ig+=1){if(obGrupos.grupos[ig].nome){ins+="<option value="+obGrupos.grupos[ig].id_n1+" >"+obGrupos.grupos[ig].nome+"</option>"}i3GEO.arvoreDeTemas.temasRaizGrupos[obGrupos.grupos[ig].id_n1]=obGrupos.grupos[ig].temasgrupo}$i(idDestino).innerHTML=ins+"</select>"};i3GEO.php.pegalistadegrupos(combo,id_menu,"nao")},comboSubGruposMenu:function(locaplic,funcaoOnchange,idDestino,idCombo,idGrupo,largura,altura){if(idGrupo!==""){var combo=function(retorno){var ins,sg,ig;ins="<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(\""+idGrupo+"\",this.value)' ><option value='' >Escolha um sub-grupo:</option>";if(retorno.data.subgrupo){sg=retorno.data.subgrupo;for(ig=0;ig<sg.length;ig+=1){ins+="<option value="+sg[ig].id_n2+" >"+sg[ig].nome+"</option>"}}$i(idDestino).innerHTML=ins+"</select>"};i3GEO.php.pegalistadeSubgrupos(combo,"",idGrupo)}},comboTemasMenu:function(locaplic,funcaoOnchange,idDestino,idCombo,idGrupo,idSubGrupo,largura,altura,id_menu,temas){var combo=function(retorno){var ins,sg,ig;if(idSubGrupo!=""){ins="<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"("+idGrupo+","+idSubGrupo+",this.value)' ><option value='' >Escolha um tema:</option>"}else{ins="<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"("+idGrupo+",\"\",this.value)' ><option value='' >Escolha um tema:</option>"}if(typeof(retorno.data)!=='undefined'){retorno=retorno.data.temas}sg=retorno.length;for(ig=0;ig<sg;ig++){ins+="<option value="+retorno[ig].tid+" >"+retorno[ig].nome+"</option>"}$i(idDestino).innerHTML=ins+"</select>"};if(typeof(temas)==='undefined'||temas===""){i3GEO.php.pegalistadetemas(combo,id_menu,idGrupo,idSubGrupo)}else{combo(temas)}},dialogo:{uploadarquivo:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/uploadarquivos/dependencias.php","i3GEOF.uploadarquivos.iniciaJanelaFlutuante()","i3GEOF.uploadarquivos_script")},conectaservico:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/conectarservicos/dependencias.php","i3GEOF.conectarservicos.iniciaJanelaFlutuante()","i3GEOF.conectarservicos_script")},carouselTemas:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/carouseltemas/index.js","i3GEOF.carouseltemas.criaJanelaFlutuante()","i3GEOF.carouseltemas_script")},buscaInde:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/buscainde/dependencias.php","i3GEOF.buscainde.iniciaJanelaFlutuante()","i3GEOF.buscainde_script")},nuvemTags:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/nuvemtags/dependencias.php","i3GEOF.nuvemtags.iniciaJanelaFlutuante()","i3GEOF.nuvemtags_script")},nuvemTagsFlash:function(){i3GEO.janela.cria("550px","350px",i3GEO.configura.locaplic+"/ferramentas/nuvemtagsflash/index.htm","","",$trad("x44"))},navegacaoDir:function(){i3GEO.janela.cria("550px","350px",i3GEO.configura.locaplic+"/ferramentas/navegacaodir/index.htm","","","<div class='i3GeoTituloJanela'>"+$trad("x45")+"</div>")},importarwmc:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/importarwmc/dependencias.php","i3GEOF.importarwmc.iniciaJanelaFlutuante()","i3GEOF.importarwmc_script")},conectarwfs:function(){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwfs/index.htm","","","<div class='i3GeoTituloJanela'>WFS</div>")},downloadbase:function(){window.open(i3GEO.configura.locaplic+"/datadownload.htm")}}}; | ... | ... |
js/i3geo_tudo_compacto8.js.php
... | ... | @@ -248,7 +248,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.desenho={layergrafico:null,es |
248 | 248 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}var i3GEOtouchesPosMapa="";var i3geoOL;i3GEO.Interface={RESTRICTATT:true,LAYEROPACITY:"",INFOOVERLAY:"",ATUAL:"openlayers",IDCORPO:"openlayers",IDMAPA:"",STATUS:{atualizando:[],trocando:false,pan:false},LAYERSUTFGRID:{},aposAdicNovaCamada:function(camada){i3GEO.tema.ativaFerramentas(camada)},redesenha:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].redesenha()},grade:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].grade()},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.checked&&obj.value!=""){i3GEO.mapa.ativaTema(obj.value)}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.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")}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();i3GEO.desenho.criaLayerGrafico();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(){},zoom2ext:function(mapexten){if(!mapexten){mapexten=i3GEO.parametros.mapexten}i3GEO.Interface[i3GEO.Interface.ATUAL].zoom2ext(mapexten)},zoomli:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].zoomli()},getZoom:function(){return i3GEO.Interface[i3GEO.Interface.ATUAL].getZoom()},openlayers:{parametrosMap:{target:"openlayers",layers:[],controls:[],interactions:[],loadTilesWhileAnimating:true,loadTilesWhileInteracting:true},parametrosView:{},TILES:true,LAYERSADICIONAIS:[],googleLike:false,BALAOPROP:{url:"",templateModal:"",removeAoAdicionar:true,classeCadeado:"i3GEOiconeAberto",autoPan:true,autoPanAnimation:{duration:250},minWidth:'200px',modal:false,simple:true,openTipNoData:true,baloes:[]},GRADE:"",FULLSCREEN:"",fullscreen:function(){if(i3GEO.Interface.openlayers.FULLSCREEN==""){i3GEO.Interface.openlayers.FULLSCREEN=new ol.control.FullScreen();i3GEO.Interface.openlayers.FULLSCREEN.setMap(i3geoOL);return}if(i3GEO.Interface.openlayers.FULLSCREEN.getMap()==null){i3GEO.Interface.openlayers.FULLSCREEN.setMap(i3geoOL)}else{i3GEO.Interface.openlayers.FULLSCREEN.setMap(null)}},grade:function(){if(i3GEO.Interface.openlayers.GRADE==""){i3GEO.Interface.openlayers.GRADE=new ol.Graticule({strokeStyle:new ol.style.Stroke({color:'rgba(105,105,105,0.9)',width:2,lineDash:[0.5,4]}),showLabels:true,targetSize:200});i3GEO.Interface.openlayers.GRADE.setMap(i3geoOL);return}if(i3GEO.Interface.openlayers.GRADE.getMap()==null){i3GEO.Interface.openlayers.GRADE.setMap(i3geoOL)}else{i3GEO.Interface.openlayers.GRADE.setMap(null)}},zoomli:function(){if(DetectaMobile("DetectMobileLong")){i3GEO.janela.tempoMsg($trad("x70"))}else{i3GEO.janela.tempoMsg($trad("zoomliShift"))}},getZoom:function(){return i3geoOL.getZoom()},balao:function(texto,completo,x,y,botaoProp,nwkts){var hash={"x":x,"y":y,"resolution":i3GEO.configura.ferramentas.identifica.resolution,"tolerancia":$trad("tolerancia")};if(botaoProp===undefined){botaoProp=true}hash.texto=texto;var createinfotooltip=function(){var icone,painel,b,cabecalho,conteudo,removeBaloes,html,p=i3GEO.Interface.openlayers.BALAOPROP,removeBaloes=function(removeWkt){var nd,t,n=i3GEO.Interface.openlayers.BALAOPROP.baloes.length,i;for(i=0;i<n;i++){t=i3GEO.Interface.openlayers.BALAOPROP.baloes[i];if(t.get("origem")=="balao"){i3geoOL.removeOverlay(t)}}i3GEO.Interface.openlayers.BALAOPROP.baloes=[];if(removeWkt!==false&&i3GEO.desenho.layergrafico){i3GEO.desenho[i3GEO.Interface.ATUAL].removePins()}else if(i3GEO.desenho.layergrafico){var features,n,f,i;features=i3GEO.desenho.layergrafico.getSource().getFeatures();n=features.length;for(i=0;i<n;i++){if(features[i].get("origem")=="pin"){features[i].set("origem","identifica")}}}return false};if(p.removeAoAdicionar===true){removeBaloes(true)}if(i3GEO.eventos.cliquePerm.ativo===false){return}hash.minWidth=p.minWidth;painel=document.createElement("div");hash.lock_open="hidden";hash.lock="hidden";if(p.removeAoAdicionar===true){hash.lock_open=""}else{hash.lock=""}hash.botaoProp="hidden";if(botaoProp===true){hash.botaoProp=""}hash.wkt="hidden";if(nwkts&&nwkts>0){hash.wkt=""}painel=document.createElement("div");painel.innerHTML=Mustache.render(i3GEO.template.infotooltip,hash);$(painel).find("[data-info='close']").on("click",removeBaloes);$(painel).find("[data-info='wkt']").on("click",function(){removeBaloes(false)});$(painel).find("[data-info='info']").on("click",function(){i3GEO.mapa.dialogo.cliqueIdentificaDefault(x,y,"");return false});$(painel).find("[data-info='settings']").on("click",function(){i3GEO.janela.prompt($trad("tolerancia"),function(){i3GEO.configura.ferramentas.identifica.resolution=$i("i3GEOjanelaprompt").value},i3GEO.configura.ferramentas.identifica.resolution);return false});$(painel).find("[data-info='lockopen']").on("click",function(e){var p=i3GEO.Interface.openlayers.BALAOPROP;$(e.target).addClass("hidden");$(e.target.parentNode).find("[data-info='lock']").removeClass("hidden");p.removeAoAdicionar=false;return false});$(painel).find("[data-info='lock']").on("click",function(e){var p=i3GEO.Interface.openlayers.BALAOPROP;$(e.target).addClass("hidden");$(e.target.parentNode).find("[data-info='lockopen']").removeClass("hidden");p.removeAoAdicionar=true;return false});$(painel).find('.dropdown-toggle').dropdown();b=new ol.Overlay({element:painel,stopEvent:true,autoPan:p.autoPan,autoPanAnimation:p.autoPanAnimation});b.setProperties({origem:"balao"});p.baloes.push(b);i3geoOL.addOverlay(b);b.setPosition(i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates())};if(i3GEO.template.infotooltip==false){$.get(i3GEO.configura.locaplic+"/js/templates/infotooltip.html").done(function(r){i3GEO.template.infotooltip=r;createinfotooltip()})}else{createinfotooltip()}},redesenha:function(){var openlayers=i3GEO.Interface.openlayers;openlayers.criaLayers();openlayers.ordenaLayers();openlayers.recalcPar();i3GEO.janela.fechaAguarde()},fundoDefault:function(){var eng,oce,ims,wsm,tms,bra;eng=new ol.layer.Tile({title:"ESRI National Geographic",visible:true,isBaseLayer:true,name:"eng",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer">ArcGIS</a>'})]})});oce=new ol.layer.Tile({title:"ESRI Ocean Basemap",visible:false,isBaseLayer:true,name:"oce",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer">ArcGIS</a>'})]})});ims=new ol.layer.Tile({title:"ESRI Imagery World 2D",visible:false,isBaseLayer:true,name:"ims",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer">ArcGIS</a>'})]})});wsm=new ol.layer.Tile({title:"ESRI World Street Map",visible:false,isBaseLayer:true,name:"wsm",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer">ArcGIS</a>'})]})});bra=new ol.layer.Tile({title:"Base carto MMA",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",params:{'layers':"baseraster",'srs':"EPSG:4326",'format':"image/png"}})});tms=new ol.layer.Tile({title:"OSGEO",visible:false,isBaseLayer:true,name:"tms",source:new ol.source.TileWMS({url:"http://tilecache.osgeo.org/wms-c/Basic.py/",params:{'layers':"basic",'type':"png",'srs':"EPSG:4326",'format':"image/png",'VERSION':'1.1.1'},attributions:[new ol.Attribution({html:'© <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,i=$i(i3GEO.Interface.IDCORPO);if(i){if(!i.style.height){i.style.width="100vw";i.style.height="100vh"}f=$i("openlayers");if(!f){ins='<div id=openlayers style="display: block;position:relative;top: 0px; left: 0px;width:100%;height:100%;text-align:left;"></div>';i.innerHTML=ins;f=$i("openlayers")}}i3GEO.Interface.IDMAPA="openlayers";i3GEO.Interface.openlayers.parametrosMap.target="openlayers";if(i3GEO.Interface.openlayers.googleLike===false){i3GEO.Interface.openlayers.parametrosView.projection="EPSG:4326"}else{i3GEO.Interface.openlayers.parametrosView.projection="EPSG:3857"}i3GEO.Interface.openlayers.parametrosMap.view=new ol.View(i3GEO.Interface.openlayers.parametrosView);i3geoOL=new ol.Map(i3GEO.Interface.openlayers.parametrosMap);ol.layer.Layer.prototype.setVisibility=function(v){this.setVisible(v)};ol.layer.Layer.prototype.getVisibility=function(v){this.getVisible(v)};i3geoOL.panTo=function(x,y){this.getView().setCenter([x,y])};i3geoOL.getLayersByName=function(nome){var res=[],layers=this.getLayers(),n=layers.getLength(),i;for(i=0;i<n;i++){if(layers.item(i).get("name")&&layers.item(i).get("name")===nome){res.push(layers.item(i))}}return res};i3geoOL.addLayers=function(lista){var n=lista.length,i,lan,l;for(i=0;i<n;i++){if(lista[i].get!=undefined){lan=lista[i].get("name");if(lan){l=this.getLayersByName(lan);if(l.length===0){this.addLayer(lista[i])}}}}};i3geoOL.getLayersBase=function(){return i3geoOL.getLayersBy("isBaseLayer",true)};i3geoOL.getLayerBase=function(){var baseLayers,n,i;baseLayers=i3geoOL.getLayersBase();n=baseLayers.length;for(i=0;i<n;i++){if(baseLayers[i].getVisible()==true){return baseLayers[i]}}return false};i3geoOL.getLayersBy=function(chave,valor){var res=[],layers=this.getLayers(),n=layers.getLength(),i;for(i=0;i<n;i++){if(layers.item(i).get(chave)&&layers.item(i).get(chave)===valor){res.push(layers.item(i))}}return res};i3geoOL.getAllLayers=function(){var res=[],layers=this.getLayers(),n=layers.getLength(),i;for(i=0;i<n;i++){res.push(layers.item(i))}return res};i3geoOL.getLayersGr=function(){var layers=i3geoOL.getLayersBy("layerGr",true);if(i3GEO.desenho.layergrafico){layers.unshift(i3GEO.desenho.layergrafico)}return layers};i3geoOL.getLayersGrBy=function(chave,valor){var res=[],layers=this.getLayersGr(),n=layers.length,i;for(i=0;i<n;i++){if(layers[i].get(chave)&&layers[i].get(chave)===valor){res.push(layers[i])}}return res};i3geoOL.getControlsBy=function(chave,valor){var res=[],controles=this.getControls(),n=controles.getLength(),i;for(i=0;i<n;i++){if(controles.item(i).get(chave)&&controles.item(i).get(chave)===valor){res.push(controles.item(i))}}return res};i3geoOL.getControlByType=function(type){var a=false;i3geoOL.getControls().forEach(function(c){if(c instanceof ol.control[type]==true){a=c}});return a},i3geoOL.getCenter=function(){var c=this.getView().getCenter();return{"lon":c[0],"lat":c[1]}};i3geoOL.getZoom=function(){var c=this.getView().getZoom();return c};i3geoOL.getExtent=function(){var e=this.getView().calculateExtent(this.getSize());return{toBBOX:function(){return e.join(",")}}};i3geoOL.getScale=function(){var resolution,units,dpi,mpu,scale;resolution=this.getView().getResolution();units=this.getView().getProjection().getUnits();dpi=25.4/0.28;mpu=ol.proj.METERS_PER_UNIT[units];scale=resolution*mpu*39.37*dpi;return scale};i3geoOL.zoomToScale=function(escala){var resolution,units,dpi,mpu;units=this.getView().getProjection().getUnits();dpi=25.4/0.28;mpu=ol.proj.METERS_PER_UNIT[units];resolution=escala/(mpu*39.37*dpi);this.getView().setResolution(resolution)};i3geoOL.zoomToExtent=function(mapext){this.getView().fit(mapext,this.getSize())}},inicia:function(){if(i3GEO.Interface.openlayers.googleLike===true&&i3geoOL.getView().getProjection().getCode()!="EPSG:3857"){alert("Alerta! Projecao diferente da esperada. Veja i3geo/guia_de_migracao.txt")}var montaMapa=function(){var openlayers=i3GEO.Interface.openlayers;i3geoOL.updateSize();var temp=i3geoOL.getControlByType("ScaleLine");if(temp&&temp.element){temp.element.onclick=function(e){if(temp.getUnits()=="metric"){temp.setUnits("nautical")}else{temp.setUnits("metric")}temp.changed()}}openlayers.registraEventos();openlayers.zoom2ext(i3GEO.parametros.mapexten);$i("openlayers").getElementsByClassName("ol-overlaycontainer-stopevent")[0].style.position="unset";openlayers.criaLayers()};if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this);i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS);"}montaMapa();i3GEO.coordenadas.ativaEventos();i3GEO.idioma.mostraSeletor();if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.openlayers.adicionaKml(true,i3GEO.parametros.kmlurl)}if(jQuery.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}},aplicaOpacidade:function(opacidade,layer){if(opacidade>1){opacidade=opacidade/100}if(layer){i3geoOL.getLayersByName(layer)[0].setOpacity(opacidade*1);return}else{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.get("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);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},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 ol.layer.Vector({title:url,name:id,isBaseLayer:false,source:new ol.source.Vector({url:url,format:new ol.format.KML({extractStyles:true}),tipoServico:"kml"})});i3geoOL.addLayer(l);temp=function(pixel){var feature,chaves,c,i=0,html="",prop,g;feature=i3geoOL.forEachFeatureAtPixel(pixel,function(feature,layer){return feature});if(feature){i3GEO.Interface.openlayers.BALAOPROP.removeAoAdicionar=false;i3GEO.Interface.openlayers.BALAOPROP.classeCadeado="i3GEOiconeFechado";chaves=feature.getKeys();prop=feature.getProperties();c=chaves.length;for(i=0;i<c;i++){if(chaves[i]!="geometry"&&chaves[i]!="styleUrl"){html+=chaves[i]+": "+prop[chaves[i]]}}g=feature.getGeometry().getCoordinates();i3GEO.Interface.openlayers.balao(html,"",g[0],g[1],"kml")}};i3geoOL.on('click',function(evt){evt.stopPropagation();evt.preventDefault();if(evt.dragging){return}temp(i3geoOL.getEventPixel(evt.originalEvent))})},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 matrixIds,resolutions,size,z,projectionExtent,source,configura=i3GEO.configura,url,nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,layer,camada,urllayer,opcoes,i,temp;temp=$i("i3GEOprogressoDiv");if(temp){i3GEO.Interface.STATUS.atualizando=[];temp.style.display="none"}if(i3GEO.Interface.openlayers.googleLike===true){url=configura.locaplic+"/classesphp/mapa_googlemaps.php?";projectionExtent=ol.proj.get('EPSG:3857').getExtent()}else{url=configura.locaplic+"/classesphp/mapa_openlayers.php?";projectionExtent=ol.proj.get('EPSG:4326').getExtent()}url+="TIPOIMAGEM="+configura.tipoimagem;size=ol.extent.getWidth(projectionExtent)/256;resolutions=new Array(40);matrixIds=new Array(40);for(z=0;z<40;++z){resolutions[z]=size/Math.pow(2,z);matrixIds[z]=z}$i("openlayers").style.backgroundColor="rgb("+i3GEO.parametros.cordefundo+")";i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS);opcoes={gutter:0,isBaseLayer:false,opacity:1,visible:false,singleTile:!(i3GEO.Interface.openlayers.TILES),tilePixelRatio:1,preload:0,projection:'EPSG:4326'};if(i3GEO.Interface.openlayers.googleLike===true){opcoes.projection='EPSG:3857'}for(i=nlayers-1;i>=0;i--){layer="";camada=i3GEO.arvoreDeCamadas.CAMADAS[i];opcoes.singleTile=!(i3GEO.Interface.openlayers.TILES);if(camada.transparency!=""){opcoes.opacity=camada.transparency/100}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{try{temp=camada.transitioneffect==="nao"?opcoes.preload=0:opcoes.preload=Infinity;if(i3GEO.Interface.openlayers.googleLike===false&&camada.connectiontype===7&&camada.wmsurl!==""&&camada.usasld.toLowerCase()!="sim"){urllayer=camada.wmsurl;if(camada.wmstile==10){source=new ol.source.WMTS({url:urllayer,matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,tileGrid:new ol.tilegrid.WMTS({origin:ol.extent.getTopLeft(projectionExtent),resolutions:resolutions,matrixIds:matrixIds}),wrapX:true});source.set("tipoServico","WMTS");opcoes.singleTile=false}else{source=new ol.source.TileWMS({url:urllayer,params:{'VERSION':'1.1.0'},projection:camada.wmssrs});source.set("tipoServico","ImageWMS");opcoes.singleTile=false}opcoes.title=camada.tema;opcoes.name=camada.name;opcoes.isBaseLayer=false;opcoes.visible=true}else{if(i3GEO.Interface.openlayers.TILES==false){opcoes.singleTile=true}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(camada.cache){urllayer=url+"&cache="+camada.cache}else{urllayer=url+"&cache=nao"}urllayer+="&layer="+camada.name;if(camada.utfgrid=="sim"&&i3GEO.parametros.w>500){if(i3GEO.Interface.openlayers.googleLike===false){source=new ol.source.TileUTFGrid({projection:opcoes.projection,wrapX:true,tileJSON:{"tilejson":"2.1.0","scheme":"xyz","grids":[urllayer+"&FORMAT=utfgrid&tms=&TileCol={x}&TileRow={y}&TileMatrix={z}"]}})}else{source=new ol.source.TileUTFGrid({projection:opcoes.projection,wrapX:true,tileJSON:{"tilejson":"2.1.0","scheme":"xyz","grids":[urllayer+"&FORMAT=utfgrid&tms=&X={x}&Y={y}&Z={z}"]}})}source.set("tipoServico","WMTS");opcoes.singleTile=false;opcoes.title="";opcoes.name=camada.name+"_utfgrid";opcoes.source=source;opcoes.isBaseLayer=false;opcoes.visible=true;source.set("name",camada.name+"_utfgrid");var layerutfgrid=new ol.layer.Tile(opcoes);camada.status==0?layerutfgrid.setVisible(false):layerutfgrid.setVisible(true);i3GEO.Interface.LAYERSUTFGRID[camada.name+"_utfgrid"]=layerutfgrid;if(i3GEO.Interface.INFOOVERLAY==""){$("#"+i3GEO.Interface.IDMAPA).after(i3GEO.template.utfGridInfo);i3GEO.Interface.INFOOVERLAY=new ol.Overlay({element:$i("i3GEOoverlayInfo"),offset:[3,-3],stopEvent:true,positioning:'bottom-left'});i3GEO.Interface.INFOOVERLAY.setProperties({origem:"infoOverlay"});i3geoOL.addOverlay(i3GEO.Interface.INFOOVERLAY)}i3geoOL.addLayer(layerutfgrid)}if(opcoes.singleTile===true){source=new ol.source.ImageWMS({url:urllayer,params:{'LAYERS':camada.name,'VERSION':'1.1.0'},projection:opcoes.projection,ratio:1});source.set("tipoServico","ImageWMS")}else{if(i3GEO.Interface.openlayers.googleLike===false){source=new ol.source.WMTS({url:urllayer+"&WIDTH=256&HEIGHT=256",matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,tileGrid:new ol.tilegrid.WMTS({origin:ol.extent.getTopLeft(projectionExtent),resolutions:resolutions,matrixIds:matrixIds,tileSize:[256,256]}),wrapX:true});source.set("tipoServico","WMTS")}else{source=new ol.source.XYZ({url:urllayer+"&X={x}&Y={y}&Z={z}",matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,wrapX:true});source.set("tipoServico","WMTS")}}opcoes.title=camada.tema;opcoes.name=camada.name}if(camada.link_tema!=""&&i3GEO.Interface.RESTRICTATT==false){source.setAttributions([new ol.Attribution({html:'<li><a href="'+camada.link_tema+'">'+camada.tema+'</a></li>'})])}source.set("name",camada.name);source.set("parametrosUrl",{par:""});opcoes.source=source;opcoes.isBaseLayer=false;opcoes.visible=true;if($i("i3GEOprogressoCamadas")){source.on('tileloadstart',function(event){i3GEO.Interface.openlayers.loadStartLayer(source.get("name"))});source.on('tileloadend',function(event){i3GEO.Interface.openlayers.loadStopLayer(source.get("name"))});source.on('tileloaderror',function(event){i3GEO.Interface.openlayers.loadStopLayer(source.get("name"))})}if(opcoes.singleTile===true){layer=new ol.layer.Image(opcoes)}else{layer=new ol.layer.Tile(opcoes)}}catch(e){}}if(layer&&layer!=""){if(camada.escondido.toLowerCase()==="sim"){layer.preload=0}if(camada.type>1&&i3GEO.Interface.LAYEROPACITY!=""){layer.setOpacity(i3GEO.Interface.LAYEROPACITY)}i3geoOL.addLayer(layer);i3GEO.Interface.aposAdicNovaCamada(camada)}}else{layer=i3geoOL.getLayersByName(camada.name)[0]}if(layer&&layer!=""){temp=camada.status==0?layer.setVisible(false):layer.setVisible(true)}}if(i3GEO.parametros.copyright!=""&&!$i("i3GEOcopyright")){temp=document.createElement("div");temp.id="i3GEOcopyright";temp.innerHTML="<p class=paragrafo >"+i3GEO.parametros.copyright+"</p>";if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).appendChild(temp)}}else if(i3GEO.parametros.copyright!=""&&$i("i3GEOcopyright")){$i("i3GEOcopyright").innerHTML=i3GEO.parametros.copyright}},sobeLayersGraficos:function(){},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 layer,layers=i3GEO.arvoreDeCamadas.CAMADAS,nlayers=layers.length,i,param,source,k,url="",n,j;for(i=0;i<nlayers;i+=1){layer=i3geoOL.getLayersByName(layers[i].name)[0];if(layer&&layer!=undefined&&layer.get("isBaseLayer")===false){url="";source=layer.getSource();param=source.getProperties().parametrosUrl;param[parametro]=valor;chaves=i3GEO.util.listaTodasChaves(param);n=chaves.length;for(j=0;j<n;j++){k=chaves[j];if(param[k]!=""&&k!="par"){url+="&"+k+"="+param[k]}}param.par=url;source.set("parametrosUrl",param)}}},loadStartLayer:function(name){var p=$i("i3GEOprogressoCamadas");var n100=i3geoOL.getLayers().getLength()-i3GEO.Interface.openlayers.LAYERSADICIONAIS.length;if(p){i3GEO.Interface.STATUS.atualizando.push(" ");var x=i3GEO.Interface.STATUS.atualizando.length;p.style.width=((x*100)/n100)+"%"}},loadStopLayer:function(name){var p=$i("i3GEOprogressoCamadas");if(p){i3GEO.Interface.STATUS.atualizando.pop();if(i3GEO.Interface.STATUS.atualizando.length==0){p.style.width="0%"}}},ordenaLayers:function(){var ordem=i3GEO.arvoreDeCamadas.CAMADAS,nordem=ordem.length,layer,layers,i;layers=i3geoOL.getLayers();for(i=nordem-1;i>=0;i--){layer=i3geoOL.getLayersByName(ordem[i].name);layer=layer[0];if(layer){layers.remove(layer);layers.push(layer)}}},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){i3GEO.pluginI3geo.ligaCamada(obj.value)}else{i3GEO.pluginI3geo.desligaCamada(obj.value)}}if(obj.checked){ligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value);if(i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"]){i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value+"_utfgrid");i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"].setVisibility(true)}}else{desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);if(i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"]){i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value+"_utfgrid");i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"].setVisibility(false)}}i3GEO.php.ligatemas(i3GEO.legenda.atualiza,desligar,ligar)},ativaFundo:function(nome){var baseLayers,n,i,t,ck=true;baseLayers=i3geoOL.getLayersBase();n=baseLayers.length;for(i=0;i<n;i++){baseLayers[i].setVisible(false)}for(i=0;i<n;i++){if(baseLayers[i].get("name")===nome){baseLayers[i].setVisible(true)}}if(i3GEO.maparef.APIOBJ!=""){i3GEO.maparef.inicia()}},atualizaMapa:function(){var camadas=i3GEO.arvoreDeCamadas.CAMADAS,n=camadas.length,i;for(i=0;i<n;i++){i3GEO.Interface.openlayers.atualizaTema("",camadas[i].name)}},atualizaTema:function(retorno,tema){var layer=i3geoOL.getLayersByName(tema),objtemas,funcaoLoad,servico,source;if(layer.length==0){return""}else{layer=layer[0]}if(layer&&layer!=undefined){source=layer.getSource();servico=source.getProperties().tipoServico;if(servico==="WMTS"){funcaoLoad=source.getTileUrlFunction();if(funcaoLoad){layer.getSource().setTileUrlFunction(function(){var url=funcaoLoad.apply(this,arguments);url=url.replace("&cache=sim","&cache=nao");return url.split('&r=')[0]+'&r='+Math.random()+source.getProperties().parametrosUrl.par})}}if(servico==="ImageWMS"){funcaoLoad=source.getImageLoadFunction();if(funcaoLoad){layer.getSource().setImageLoadFunction(function(image,src){src=src.replace("&cache=sim","&cache=nao");src=src.split('&r=')[0]+'&r='+Math.random();image.getImage().src=src+source.getProperties().parametrosUrl.par})}}source.refresh()}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 modoAtual="";var contadorPan=0;i3GEO.eventos.ativa(i3geoOL.getTargetElement());i3geoOL.on("pointerdrag",function(e){i3GEO.Interface.STATUS.pan=true;modoAtual="move"});i3geoOL.on("click",function(e){e.stopPropagation();e.preventDefault();var lonlat=false,d,pos="";lonlat=e.coordinate;if(i3GEO.Interface.openlayers.googleLike===true){lonlat=ol.proj.transform(lonlat,'EPSG:3857','EPSG:4326')}d=i3GEO.calculo.dd2dms(lonlat[0],lonlat[1]);objposicaocursor.ddx=lonlat[0];objposicaocursor.ddy=lonlat[1];objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];objposicaocursor.imgx=e.pixel[0];objposicaocursor.imgy=e.pixel[1];objposicaocursor.telax=objposicaocursor.imgx+pos[0];objposicaocursor.telay=objposicaocursor.imgy+pos[1]});i3geoOL.on("dbclick",function(e){e.stopPropagation();e.preventDefault()});i3geoOL.on("moveend",function(e){if(e.changedTouches){return}var xy;contadorPan++;var timer=setTimeout(function(){contadorPan--;if(contadorPan==0){modoAtual="";i3GEO.navega.registraExt(i3GEO.parametros.mapexten);i3GEO.Interface.openlayers.recalcPar();i3GEO.Interface.STATUS.pan=false;i3GEO.eventos.navegaMapa();i3GEO.util.escondePin();i3GEO.eventos.cliquePerm.status=false;i3GEO.Interface.STATUS.pan=false}},350)});i3geoOL.on("pointermove",function(e){if(modoAtual==="move"||e.dragging){return}var lonlat=false,d,pos="";lonlat=e.coordinate;if(i3GEO.Interface.openlayers.googleLike===true){lonlat=ol.proj.transform(lonlat,'EPSG:3857','EPSG:4326')}d=i3GEO.calculo.dd2dms(lonlat[0],lonlat[1]);objposicaocursor.ddx=lonlat[0];objposicaocursor.ddy=lonlat[1];objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];objposicaocursor.imgx=e.pixel[0];objposicaocursor.imgy=e.pixel[1];objposicaocursor.telax=objposicaocursor.imgx+pos[0];objposicaocursor.telay=objposicaocursor.imgy+pos[1];var viewResolution=(i3geoOL.getView().getResolution());if(i3GEO.Interface.INFOOVERLAY!=""){i3GEO.Interface.INFOOVERLAY.getElement().innerHTML="";i3GEO.Interface.INFOOVERLAY.getElement().style.visibility="hidden"}for(var k in i3GEO.Interface.LAYERSUTFGRID){if(!i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[k.replace("_utfgrid","")]){i3GEO.Interface.LAYERSUTFGRID[k]=null}else{if(i3GEO.Interface.LAYERSUTFGRID[k]&&i3GEO.Interface.LAYERSUTFGRID[k].getVisible()){i3GEO.Interface.LAYERSUTFGRID[k].getSource().forDataAtCoordinateAndResolution(e.coordinate,viewResolution,function(data){var ei=i3GEO.Interface.INFOOVERLAY.getElement();if(data){ei.style.visibility="visible";ei.innerHTML+="<span style='display:block;'>"+data.text+"<span>";i3GEO.Interface.INFOOVERLAY.setPosition(e.coordinate);i3GEO.eventos.mouseOverData()}else if(ei.innerHTML==""){ei.style.visibility="hidden";i3GEO.Interface.INFOOVERLAY.setPosition(undefined);i3GEO.eventos.mouseOutData()}})}}}});i3geoOL.on("touchend",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(){},recalcPar:function(){i3GEOtouchesPosMapa="";var bounds=i3geoOL.getExtent().toBBOX().split(","),escalaAtual=i3geoOL.getScale();i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];if(i3GEO.parametros.mapscale!==escalaAtual){i3GEO.arvoreDeCamadas.atualizaFarol(escalaAtual)}i3GEO.parametros.pixelsize=i3geoOL.getView().getResolution();i3GEO.navega.atualizaEscalaNumerica(parseInt(escalaAtual,10));i3GEO.parametros.mapscale=escalaAtual},zoom2ext:function(ext){var m,v;if(!ext){ext=i3GEO.parametros.extentTotal}ext=i3GEO.util.extGeo2OSM(ext);m=ext.split(" ");m=[m[0]*1,m[1]*1,m[2]*1,m[3]*1];v=i3geoOL.getView();v.fit(m,i3geoOL.getSize());i3GEO.eventos.cliquePerm.status=true},pan2ponto:function(x,y){if(i3GEO.Interface.openlayers.googleLike===true){var metrica;if(x<180&&x>-180){metrica=ol.proj.transform([x,y],'EPSG:4326','EPSG:3857');x=metrica[0];y=metrica[1]}}i3geoOL.panTo(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:{url:"",templateModal:"",removeAoAdicionar:true,modal:false,simple:true,classeCadeado:"i3GEOiconeAberto",baloes:[]},grade:function(){return false},barraProgressoStart:function(){var p=$i("i3GEOprogressoCamadas");if(p){p.style.width="100%"}},barraProgressoStop:function(){var p=$i("i3GEOprogressoCamadas"),n=0,d=0;if(p){n=i3GeoMap.overlayMapTypes.length;d=parseInt(p.style.width,10);if(d<10||n==0){p.style.width="0%"}else{p.style.width=d-(100/n)+"%";if(d-(100/n)<0){p.style.width="0%"}}}},zoomli:function(){if(DetectaMobile("DetectMobileLong")){i3GEO.janela.tempoMsg($trad("x70"))}else{i3GEO.janela.tempoMsg($trad("zoomliCtrl"))}},getZoom:function(){return i3GeoMap.getZoom()},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.configura.ferramentas.identifica.resolution=$i("i3GEOjanelaprompt").value},i3GEO.configura.ferramentas.identifica.resolution)};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"},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");try{i3GeoMap=new google.maps.Map($i(i3GEO.Interface.IDMAPA),i3GEO.Interface.googlemaps.MAPOPTIONS)}catch(e){alert(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();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));if(i3GEO.Interface.STATUS.trocando===false){i3GEO.idioma.mostraSeletor()}if(i3GEO.Interface.STATUS.trocando===true&&$i(i3GEO.arvoreDeCamadas.IDHTML)){$i(i3GEO.arvoreDeCamadas.IDHTML).innerHTML=""}if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this)"}if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.googlemaps.adicionaKml(true,i3GEO.parametros.kmlurl)}if(jQuery.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}google.maps.event.addListenerOnce(i3GeoMap,'idle',function(){var z=i3GeoMap.getZoom();if(z!=undefined){i3GeoMap.setZoom(parseInt(z,10)+1)}});i3GEO.coordenadas.ativaEventos()};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?"+"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});if($i("i3GEOprogressoCamadas")){google.maps.event.addListener(i3GEOTileO,'tilesloaded',function(){i3GEO.Interface.googlemaps.barraProgressoStop()})}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){if($i("i3GEOprogressoCamadas")){i3GEO.Interface.googlemaps.barraProgressoStart()}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";i3GEO.eventos.cliquePerm.status=false});google.maps.event.addListener(i3GeoMap,"dragend",function(){var xy;i3GEO.Interface.googlemaps.recalcPar();i3GEO.eventos.navegaMapa();i3GEO.util.escondePin();i3GEO.navega.registraExt(i3GEO.parametros.mapexten);i3GEO.Interface.googlemaps.barraProgressoStop()});google.maps.event.addListener(i3GeoMap,"tilesloaded",function(){i3GEO.Interface.googlemaps.recalcPar();i3GEO.navega.registraExt(i3GEO.parametros.mapexten);i3GEO.Interface.googlemaps.barraProgressoStop()});google.maps.event.addListener(i3GeoMap,'idle',function(){i3GEO.Interface.googlemaps.barraProgressoStop()});google.maps.event.addListener(i3GeoMap,"bounds_changed",function(){i3GEO.Interface.googlemaps.barraProgressoStart();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.legenda.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(){},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){$(div).css("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))},zoom2ext:function(mapexten){i3GEO.Interface.googlemaps.zoom2extent(mapexten)},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);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},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()}}}; |
249 | 249 | // |
250 | 250 | //compactados/mapa_compacto.js |
251 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={BALAOATIVO:true,OPENTIPIFEMPTY:true,TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",GEOXML:[],limpasel:function(){i3GEO.php.limpasel(function(retorno){i3GEO.atualiza();i3GEO.Interface.atualizaMapa()},"")},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=window.innerWidth;Dh=window.innerHeight;i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.guias.abreFecha("fecha");ativo=true},2000)}ativo=false}},ativaIdentifica:function(){i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"];i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.verificaTipDefault()"]);i3GEO.eventos.cliquePerm.ativa()},ativaIdentificaBalao:function(){i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.verificaTipDefault()"];i3GEO.eventos.cliquePerm.ativa()},ativaTema:function(codigo){if(codigo){i3GEO.temaAtivo=codigo}},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.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.janela.fechaAguarde();if(this.recupera&&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=JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.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($.isNumeric(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}}catch(e){}}}},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)},wms:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wms()","conectarwms","conectarwms","dependencias.php","i3GEOF.conectarwms.iniciaJanelaFlutuante()")},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.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 temp,janela,id="listaMapa"+Math.random();janela=i3GEO.janela.cria("800px","500px",i3GEO.configura.locaplic+"/mapas/indexnomenu.php","","","<span class='i3GeoTituloJanelaBsNolink' ></span></div>",id)}else{window.open(i3GEO.configura.locaplic+"/rss/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=i3GEO.util.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/openlayers3.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<span class='i3GeoTituloJanelaBsNolink' ></span></div>";i3GEO.janela.cria("520px","370px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza,"","","","",false,"","123")}},metaestat:function(largura,altura,topo,esquerda,Interface,conexao){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;if(Interface){i3GEOF.metaestat.INTERFACE=Interface}if(conexao){i3GEOF.metaestat.CONEXAODEFAULT=conexao}i3GEOF.metaestat.INTERFACE="flutuante";i3GEOF.metaestat.principal.inicia(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","dependencias.php",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()")},filtraperiodo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraperiodo()","filtraperiodo","filtraperiodo","dependencias.php","i3GEOF.filtraperiodo.iniciaJanelaFlutuante()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidademapa()","opacidademapa","opacidademapa","dependencias.php","i3GEOF.opacidademapa.iniciaJanelaFlutuante()")},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(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){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()")},opcoesMapaRef:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesMapaRef()","opcoes_maparef","opcoesMaparef","dependencias.php","i3GEOF.opcoesMaparef.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","dependencias.php","i3GEOF.selecao.iniciaJanelaFlutuante()")},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,tema){if(!x){x=objposicaocursor.ddx;y=objposicaocursor.ddy}var temp=function(){i3GEOF.identifica.start({"x":x,"y":y,"tema":tema})};if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php";i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{temp()}},verificaTipDefault:function(x,y){if(i3GEO.mapa.BALAOATIVO==false){return}if(i3GEO.eventos.cliquePerm.ativo==false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}if(!x){x=objposicaocursor.ddx}if(!y){y=objposicaocursor.ddy}var ntemas,etiquetas,j,temp;if(x===-1||y===-1){return}objposicaocursor.ddx=-1;objposicaocursor.ddy=-1;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""||i3GEO.arvoreDeCamadas.CAMADAS[j].identifica=="SIM"){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""&&i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal==""){$.get(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y,function(data){i3GEO.janela.closeMsg(data)});return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal!=""){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""){var temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y;temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal.replace("{{{url}}}",temp);i3GEO.janela.closeMsg(temp)}else{i3GEO.janela.closeMsg(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal)}return}var res=i3GEO.configura.ferramentas.identifica.resolution;var bdiv=document.createElement("div");bdiv.className="waitInfoWindow";bdiv.style.width=res+"px";bdiv.style.height=res+"px";bdiv.style.top=(res/2*-1)+"px";var b=new ol.Overlay({element:bdiv,stopEvent:true,autoPan:false,origem:"balao",autoPanAnimation:false,positioning:"center-center",position:i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates()});i3geoOL.addOverlay(b);temp=function(retorno){i3geoOL.removeOverlay(b);i3GEO.mapa.montaTip(retorno,x,y)};i3GEO.php.identifica3(temp,x,y,res,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten,"","sim")}},montaTip:function(retorno,xx,yy){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",x,y,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,wkts=[];i3GEO.eventos.cliquePerm.status=true;mostra=false;if(retorno.data){retorno=retorno.data;temp=retorno[0].xy.split(",");x=temp[0]*1;y=temp[1]*1}else{x=xx;y=yy;mostra=true;textoSimples=$trad("balaoVazio");textoCompleto="";wkt=[];if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.openTipNoData==false){mostra=false}}if(retorno!==""){res="";ntemas=0;temas=retorno;if(temas){ntemas=temas.length}for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="layer"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");var mais="<button style='margin: 2px;padding: 0px;vertical-align: middle;position: relative;top: -7px;' class='btn btn-default btn-xs' onclick=\"i3GEO.mapa.dialogo.cliqueIdentificaDefault("+x+","+y+",'"+temas[j].tema+"');return false;\" ><span style='opacity:0.5;vertical-align: middle;padding: 0px;' class='material-icons'>info</span></button>";titulo="<div class='toolTipBalaoTitulo'>"+mais+" <b>"+titulo+"</b><br>"+temp1+"</div>";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;for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='toolTipBalaoTexto'>";textoTempSimples+="<div class='toolTipBalaoTexto'>";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;var estilo="tooltip-"+temas[j].tema;if(valor!==""&&link===""){temp+="<span class='"+estilo+"'><label>"+alias+": </label>"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span class='"+estilo+"'><label>"+alias+" : </label><a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}textoTempCompleto+="</div>";var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="registro"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");textoTempSimples+=temp1+"</div>";if(ds[s].wkt&&ds[s].wkt.valor!=""){ds[s].tema=temas[j].tema;ds[s].titulo=titulo;wkts.push(ds[s])}}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){res=textoSimples;if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal==true){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.janela.closeMsg(textoSimples);return}else{i3GEO.janela.closeMsg(textoCompleto);return}}else{if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y,true,wkts.length)}else{i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoCompleto,textoSimples,x,y)}}}}n=wkts.length;if(n>0){if(i3GEO.Interface.ATUAL!="openlayers"){return}i3GEO.desenho.openlayers.criaLayerGrafico();var g,format,f,idunico,c=i3GEO.desenho.layergrafico.getSource();format=new ol.format.WKT();for(r=0;r<n;r+=1){f=format.readFeatures(wkts[r].wkt.valor);f=f[0];f.setProperties({origem:"pin"});g=f.getGeometry();g=i3GEO.util.projGeo2OSM(g);f.setGeometry(g);f.setId(i3GEO.util.uid());i3GEO.editor.setStyleByTypeFeature(f);i3GEO.editor.sel.setPropertiesDefault(f);wkts[r].wkt="",f.setProperties({"fat":wkts[r]});c.addFeature(f)}}}}; | |
251 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={BALAOATIVO:true,OPENTIPIFEMPTY:true,TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",GEOXML:[],limpasel:function(){i3GEO.php.limpasel(function(retorno){i3GEO.atualiza();i3GEO.Interface.atualizaMapa()},"")},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=window.innerWidth;Dh=window.innerHeight;i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.guias.abreFecha("fecha");ativo=true},2000)}ativo=false}},ativaIdentifica:function(){i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"];i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.verificaTipDefault()"]);i3GEO.eventos.cliquePerm.ativa()},ativaIdentificaBalao:function(){i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.verificaTipDefault()"];i3GEO.eventos.cliquePerm.ativa()},ativaTema:function(codigo){if(codigo){i3GEO.temaAtivo=codigo}},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.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.janela.fechaAguarde();if(this.recupera&&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=JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.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($.isNumeric(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}}catch(e){}}}},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)},wms:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wms()","conectarwms","conectarwms","dependencias.php","i3GEOF.conectarwms.iniciaJanelaFlutuante()")},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.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 temp,janela,id="listaMapa"+Math.random();janela=i3GEO.janela.cria("800px","500px",i3GEO.configura.locaplic+"/mapas/indexnomenu.php","","","<span class='i3GeoTituloJanelaBsNolink' ></span></div>",id)}else{window.open(i3GEO.configura.locaplic+"/rss/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=i3GEO.util.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/openlayers3.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<span class='i3GeoTituloJanelaBsNolink' ></span></div>";i3GEO.janela.cria("520px","370px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza,"","","","",false,"","123")}},metaestat:function(largura,altura,topo,esquerda,Interface,conexao){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;if(Interface){i3GEOF.metaestat.INTERFACE=Interface}if(conexao){i3GEOF.metaestat.CONEXAODEFAULT=conexao}i3GEOF.metaestat.INTERFACE="flutuante";i3GEOF.metaestat.principal.inicia(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","dependencias.php",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()")},filtraperiodo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraperiodo()","filtraperiodo","filtraperiodo","dependencias.php","i3GEOF.filtraperiodo.iniciaJanelaFlutuante()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidademapa()","opacidademapa","opacidademapa","dependencias.php","i3GEOF.opacidademapa.iniciaJanelaFlutuante()")},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(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){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()")},opcoesMapaRef:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesMapaRef()","opcoes_maparef","opcoesMaparef","dependencias.php","i3GEOF.opcoesMaparef.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","dependencias.php","i3GEOF.selecao.iniciaJanelaFlutuante()")},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,tema){if(!x){x=objposicaocursor.ddx;y=objposicaocursor.ddy}var temp=function(){i3GEOF.identifica.start({"x":x,"y":y,"tema":tema})};if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php";i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{temp()}},verificaTipDefault:function(x,y){if(i3GEO.mapa.BALAOATIVO==false){return}if(!x){x=objposicaocursor.ddx}if(!y){y=objposicaocursor.ddy}if(x===-1||y===-1||i3GEO.eventos.cliquePerm.ativo===false||i3GEO.eventos.cliquePerm.status===false){return}i3GEO.eventos.cliquePerm.status=false;var ntemas,etiquetas,j,temp;objposicaocursor.ddx=-1;objposicaocursor.ddy=-1;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""||i3GEO.arvoreDeCamadas.CAMADAS[j].identifica=="SIM"){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""&&i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal==""){$.get(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y,function(data){i3GEO.janela.closeMsg(data)});return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal!=""){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""){var temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y;temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal.replace("{{{url}}}",temp);i3GEO.janela.closeMsg(temp)}else{i3GEO.janela.closeMsg(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal)}return}var res=i3GEO.configura.ferramentas.identifica.resolution;var bdiv=document.createElement("div");bdiv.className="waitInfoWindow";bdiv.style.width=res+"px";bdiv.style.height=res+"px";bdiv.style.top=(res/2*-1)+"px";var b=new ol.Overlay({element:bdiv,stopEvent:true,autoPan:false,origem:"balao",autoPanAnimation:false,positioning:"center-center",position:i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates()});i3geoOL.addOverlay(b);temp=function(retorno){i3geoOL.removeOverlay(b);i3GEO.mapa.montaTip(retorno,x,y)};i3GEO.php.identifica3(temp,x,y,res,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten,"","sim")}},montaTip:function(retorno,xx,yy){var textoSimples="",textoTempSimples="",x,y,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,wkts=[];i3GEO.eventos.cliquePerm.status=true;mostra=false;if(retorno.data){retorno=retorno.data;temp=retorno[0].xy.split(",");x=temp[0]*1;y=temp[1]*1}else{x=xx;y=yy;mostra=true;textoSimples=$trad("balaoVazio");textoCompleto="";wkt=[];if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.openTipNoData==false){mostra=false}}if(retorno!==""){res="";ntemas=0;temas=retorno;if(temas){ntemas=temas.length}for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="layer"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");var mais="<button style='margin: 2px;padding: 0px;vertical-align: middle;position: relative;top: -7px;' class='btn btn-default btn-xs' onclick=\"i3GEO.mapa.dialogo.cliqueIdentificaDefault("+x+","+y+",'"+temas[j].tema+"');return false;\" ><span style='opacity:0.5;vertical-align: middle;padding: 0px;' class='material-icons'>info</span></button>";if(ntemas==1){mais=""}titulo="<div class='toolTipBalaoTitulo'>"+mais+" <b>"+titulo+"</b><br>"+temp1+"</div>";tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;for(s=0;s<nds;s+=1){textoTempSimples+="<div class='toolTipBalaoTexto'>";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;var estilo="tooltip-"+temas[j].tema;if(valor!==""&&link===""){temp+="<span class='"+estilo+"'><label>"+alias+": </label>"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span class='"+estilo+"'><label>"+alias+" : </label><a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}mostra=true}catch(e){}}var temp1=[];$.each(temas[j].funcoesjs,function(key,value){if(value.tipo=="registro"){var parametros=[x,y,temas[j].tema];$.each(value.parametros,function(key1,value1){parametros.push(ds[s][value1].valor)});parametros="\""+parametros.join("\",\"")+"\"";temp1.push("<a class='toolTipBalaoFuncoes' href='javascript:void(0);' onclick='"+value.funcao+"("+parametros+")' >"+value.titulo+"</a><br>");if(value.script&&value.script!=""){i3GEO.util.scriptTag(value.script,"","funcaolayer"+value.funcao,false)}}});temp1=temp1.join(" ");textoTempSimples+=temp1+"</div>";if(ds[s].wkt&&ds[s].wkt.valor!=""){ds[s].tema=temas[j].tema;ds[s].titulo=titulo;wkts.push(ds[s])}}}catch(e){}}if(textoTempSimples!==""){textoSimples+=titulo+textoTempSimples}}if(mostra===true){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal==true){i3GEO.janela.closeMsg(textoSimples);return}else{i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,"",x,y,true,wkts.length)}}}n=wkts.length;if(n>0){if(i3GEO.Interface.ATUAL!="openlayers"){return}i3GEO.desenho.openlayers.criaLayerGrafico();var g,format,f,idunico,c=i3GEO.desenho.layergrafico.getSource();format=new ol.format.WKT();for(r=0;r<n;r+=1){f=format.readFeatures(wkts[r].wkt.valor);f=f[0];f.setProperties({origem:"pin"});g=f.getGeometry();g=i3GEO.util.projGeo2OSM(g);f.setGeometry(g);f.setId(i3GEO.util.uid());i3GEO.editor.setStyleByTypeFeature(f);i3GEO.editor.sel.setPropertiesDefault(f);wkts[r].wkt="",f.setProperties({"fat":wkts[r]});c.addFeature(f)}}}}; | |
252 | 252 | // |
253 | 253 | //compactados/tema_compacto.js |
254 | 254 | 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&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto&&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{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}var excluir=[tema];var camada=i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[tema];$.each(i3GEO.arvoreDeCamadas.CAMADAS,function(index,v){if((camada.group!=""&&camada.group==v.group)||camada.name==v.group){excluir.push(v.name)}});i3GEO.php.excluitema(function(){i3GEO.atualiza()},excluir);i3GEO.mapa.ativaTema();i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/ferramentas/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.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(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.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb,objImg){var w=25,h=25,temp;if(objImg&&objImg.style&&objImg.style.width){w=parseInt(objImg.style.width,10);h=parseInt(objImg.style.height,10)}i3GEO.mapa.ativaTema(idtema);temp=function(retorno){if(objImg){objImg.src=retorno.data}else{i3GEO.legenda.CAMADAS="";i3GEO.atualiza()}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.php.aplicaCorClasseTema(temp,idtema,idclasse,rgb,w,h)},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)},contorno:function(idtema){var temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)};i3GEO.php.contorno(temp,idtema)},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){}}},cortina:{_cortinaCompose:"",_slide:"",start:function(obj,tema){var layer=i3geoOL.getLayersByName(tema)[0];if(i3GEO.tema.cortina._cortinaCompose==""){var a=layer.on('precompose',function(event){var ctx=event.context;var width=ctx.canvas.width*(obj.value/100);ctx.save();ctx.beginPath();ctx.rect(width,0,ctx.canvas.width-width,ctx.canvas.height);ctx.clip()});var b=layer.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.tema.cortina._cortinaCompose=[a,b];obj.addEventListener('input',function(){i3geoOL.render()},false)}},stop:function(){ol.Observable.unByKey(i3GEO.tema.cortina._cortinaCompose);i3GEO.tema.cortina._cortinaCompose="";i3geoOL.renderSync()}},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)},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)},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)},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())},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){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}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){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}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){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},funcaojstip:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.funcaojstip()","funcaojstip","funcaojstip","dependencias.php","i3GEOF.funcaojstip.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}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)}}}; |
... | ... | @@ -275,7 +275,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.arvoreDeCamadas={FUNCOES:{far |
275 | 275 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.navega={EXTENSOES:{lista:[],redo:[],posicao:0,emAcao:false},offset:function(pixelx,pixely){if(i3GEO.Interface.ATUAL=="openlayers"){var view=i3geoOL.getView(),mover=[pixelx,pixely],s=i3geoOL.getSize(),dx=s[0]/2+mover[0],dy=s[1]/2+mover[1];view.centerOn(view.getCenter(),s,[dx,dy])}},ativaPan:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setOptions({draggable:true})}if(i3GEO.Interface.ATUAL==="openlayers"){marcadorZoom="";i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}},registraExt:function(ext){if(i3GEO.navega.EXTENSOES.emAcao==false){var l=i3GEO.navega.EXTENSOES.lista,n=l.length;if(n>10){l.shift()}n=l.length;if(n>0&&l[n-1]===ext){return}l.push(ext)}else{i3GEO.navega.EXTENSOES.emAcao=false}},extensaoAnterior:function(){i3GEO.navega.EXTENSOES.emAcao=true;var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;if(l.length>0){if(l.length>1){e=l.pop();i3GEO.navega.zoomExt("","","",e);if(r.length>10){r.shift()}if(r.length>0&&r[r.length-1]===e){return}else{r.push(a)}}}else{l.push(i3GEO.parametros.mapexten)}},extensaoProximo:function(){var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;i3GEO.navega.EXTENSOES.emAcao=true;if(r.length>0){i3GEO.navega.zoomExt("","","",r[r.length-1]);e=r.pop();if(l.length>10){l.pop()}if(l.length>0&&l[l.length-1]===e){return}l.push(a)}},pan2ponto:function(x,y){i3GEO.Interface[i3GEO.Interface.ATUAL].pan2ponto(x,y);i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar()},centroDoMapa:function(){var xy;switch(i3GEO.Interface.ATUAL){case"openlayers":xy=i3geoOL.getCenter();if(xy){return[xy.lon,xy.lat]}else{return false}break;case"googlemaps":xy=i3GeoMap.getCenter();if(xy){return[xy.lng(),xy.lat()]}else{return false}break;default:return false}},marcaCentroDoMapa:function(xy){var t=$i("i3GeoCentroDoMapa");if(t&&t.style.display==="block"){return}if(xy!=false){xy=i3GEO.calculo.dd2tela(xy[0]*1,xy[1]*1,$i(i3GEO.Interface.IDMAPA),i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize);i3GEO.util.criaPin("i3GeoCentroDoMapa",i3GEO.configura.locaplic+'/imagens/alvo.png','30px','30px');i3GEO.util.posicionaImagemNoMapa("i3GeoCentroDoMapa",xy[0],xy[1])}},removeCookieExtensao:function(){var nomecookie="i3geoOLUltimaExtensao";if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}i3GEO.util.insereCookie(nomecookie,"")},zoomin:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomIn();return}},zoomout:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomOut();return}},zoomponto:function(locaplic,sid,x,y,tamanho,simbolo,cor){if(!simbolo){simbolo="ponto"}if(!tamanho){tamanho=15}if(!cor){cor="255 0 0"}if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.zoomponto(i3GEO.atualiza,x,y,tamanho,simbolo,cor)},zoompontoIMG:function(locaplic,sid,x,y){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.pan(i3GEO.atualiza,'','',x,y)},xy2xy:function(locaplic,sid,xi,yi,xf,yf,ext,tipoimagem){var disty,distx,ex,novoxi,novoxf,novoyf,nex;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}disty=(yi*-1)+yf;distx=(xi*-1)+xf;ex=ext.split(" ");novoxi=(ex[0]*1)-distx;novoxf=(ex[2]*1)-distx;novoyi=(ex[1]*1)-disty;novoyf=(ex[3]*1)-disty;if((distx===0)&&(disty===0)){return false}else{nex=novoxi+" "+novoyi+" "+novoxf+" "+novoyf;i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,tipoimagem,nex);return true}},localizaIP:function(locaplic,sid,funcao){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.localizaIP(funcao)},zoomIP:function(locaplic,sid){try{if(arguments.length>0){i3GEO.configura.locaplic=locaplic;i3GEO.configura.sid=sid}var mostraIP=function(retorno){if(retorno.data.latitude!==null){i3GEO.navega.zoomponto(locaplic,sid,retorno.data.longitude,retorno.data.latitude)}else{i3GEO.janela.tempoMsg("Nao foi possivel identificar a localizacao.")}};i3GEO.navega.localizaIP(locaplic,sid,mostraIP)}catch(e){}},zoomExt:function(locaplic,sid,tipoimagem,ext){var f;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}if(tipoimagem===""){tipoimagem="nenhum"}ext=i3GEO.util.extGeo2OSM(ext);i3GEO.php.mudaext(function(retorno){i3GEO.atualiza(retorno)},tipoimagem,ext)},aplicaEscala:function(escala){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setZoom(i3GEO.Interface.googlemaps.escala2nzoom(escala))}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomToScale(escala,true);i3GEO.parametros.mapscale=parseInt(i3geoOL.getScale(),10)}},atualizaEscalaNumerica:function(escala){var e=$i("i3GEOescalanum");if(!e){return}if(arguments.length===1){e.value=$.number(escala,0,$trad("dec"),$trad("mil"))}else{if(i3GEO.Interface.ATUAL==="googlemaps"){e.value=parseInt(i3GEO.parametros.mapscale,10)}if(i3GEO.Interface.ATUAL==="openlayers"){e.value=$.number(i3geoOL.getScale(),0,$trad("dec"),$trad("mil"))}}},panFixo:function(){alert("panFixo foi depreciado na versao 6.0")},mostraRosaDosVentos:function(){alert("mostraRosaDosVentos foi depreciado na versao 6.0")},autoRedesenho:{INTERVALO:0,ID:"tempoRedesenho",ativa:function(id){if(arguments.length===0){id="tempoRedesenho"}i3GEO.navega.autoRedesenho.ID=id;if(($i(id))&&i3GEO.navega.autoRedesenho.INTERVALO>0){$i(id).style.display="block"}if(i3GEO.navega.autoRedesenho.INTERVALO>0){i3GEO.navega.tempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.redesenha()',i3GEO.navega.autoRedesenho.INTERVALO)}if(($i(id))&&(i3GEO.navega.autoRedesenho.INTERVALO>0)){$i(id).innerHTML=i3GEO.navega.autoRedesenho.INTERVALO/1000;i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},desativa:function(){i3GEO.navega.autoRedesenho.INTERVALO=0;clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);i3GEO.navega.tempoRedesenho="";i3GEO.navega.contaTempoRedesenho="";if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).style.display="none"}},redesenha:function(){clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;case"googlemaps":i3GEO.Interface.googlemaps.redesenha();break;default:i3GEO.atualiza("")}i3GEO.navega.autoRedesenho.ativa(i3GEO.navega.autoRedesenho.ID)},contagem:function(){if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).innerHTML=parseInt($i(i3GEO.navega.autoRedesenho.ID).innerHTML,10)-1}i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},zoomBox:{inicia:function(){alert("zoomBox depreciado na versao 6.0")}},lente:{_lenteCompose:"",eventMouseout:function(){if(i3GEO.navega.lente._lenteCompose!=""){i3GEO.navega.lente.stop(i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.lente._lenteCompose!=""){i3geoOL.renderSync()}},stop:function(container){ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose);i3GEO.navega.lente._lenteCompose="";container.removeEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.lente.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var container=i3geoOL.getTargetElement();var radius=75;container.addEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.lente.eventMouseout);var a=i3geoOL.on('postcompose',function(event){var context=event.context;var pixelRatio=event.frameState.pixelRatio;var half=radius*pixelRatio;var centerX=objposicaocursor.imgx*pixelRatio;var centerY=objposicaocursor.imgy*pixelRatio;var originX=centerX-half;var originY=centerY-half;var size=2*half+1;var sourceData=context.getImageData(originX,originY,size,size).data;var dest=context.createImageData(size,size);var destData=dest.data;for(var j=0;j<size;++j){for(var i=0;i<size;++i){var dI=i-half;var dJ=j-half;var dist=Math.sqrt(dI*dI+dJ*dJ);var sourceI=i;var sourceJ=j;if(dist<half){sourceI=Math.round(half+dI/2);sourceJ=Math.round(half+dJ/2)}var destOffset=(j*size+i)*4;var sourceOffset=(sourceJ*size+sourceI)*4;destData[destOffset]=sourceData[sourceOffset];destData[destOffset+1]=sourceData[sourceOffset+1];destData[destOffset+2]=sourceData[sourceOffset+2];destData[destOffset+3]=sourceData[sourceOffset+3]}}context.beginPath();context.arc(centerX,centerY,half,0,2*Math.PI);context.lineWidth=3*pixelRatio;context.strokeStyle='rgba(255,255,255,0.5)';context.putImageData(dest,originX,originY);context.stroke();context.restore()});i3GEO.navega.lente._lenteCompose=[a]}},destacaTema:{inicia:function(){i3GEO.janela.tempoMsg("removido na versao 8")}},basemapSpy:{_spyCompose:"",eventMouseout:function(){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(i3geoOL.getLayerBase(),i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.basemapSpy._spyCompose);i3GEO.navega.basemapSpy._spyCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getAllLayers()[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);var a=imagery.on('precompose',function(event){var ctx=event.context;var pixelRatio=event.frameState.pixelRatio;ctx.save();ctx.beginPath();ctx.arc(objposicaocursor.imgx*pixelRatio,objposicaocursor.imgy*pixelRatio,radius*pixelRatio,0,2*Math.PI);ctx.lineWidth=5*pixelRatio;ctx.strokeStyle='rgba(0,0,0,0.5)';ctx.stroke();ctx.clip()});var b=imagery.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.navega.basemapSpy._spyCompose=[a,b]}},dialogo:{wiki:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.wiki()","wiki","wiki","dependencias.php","i3GEOF.wiki.iniciaJanelaFlutuante()")},metar:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.metar()","metar","metar","dependencias.php","i3GEOF.metar.iniciaJanelaFlutuante()")},buscaFotos:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.buscaFotos()","buscafotos","buscaFotos","dependencias.php","i3GEOF.buscaFotos.iniciaJanelaFlutuante()")},google:function(coordenadas){i3GEO.navega.dialogo.google.coordenadas=coordenadas;var temp,janela,idgoogle="googlemaps"+Math.random();janela=i3GEO.janela.cria((i3GEO.parametros.w/2.5)+25+"px",(i3GEO.parametros.h/2.5)+18+"px",i3GEO.configura.locaplic+"/ferramentas/googlemaps1/index.php","","","<span class='i3GeoTituloJanelaBsNolink' >Google maps</span></div>",idgoogle,false,"hd","","","",false,"","","","","68");temp=function(){i3GEO.desenho.removePins("boxOndeGoogle");i3GEO.desenho.removePins("googlemaps")};$(janela[0].close).click(temp)},confluence:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.confluence()","confluence","confluence","dependencias.php","i3GEOF.confluence.iniciaJanelaFlutuante()")}},atualizaGoogle:function(idgoogle){try{parent.frames[idgoogle+"i"].panTogoogle()}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);i3GEO.desenho.removePins("googlemaps");i3GEO.desenho.removePins("boxOndeGoogle")}},dragZoom:function(){i3GEO.navega.dragZoom.draw=new ol.interaction.Draw({type:"Circle",freehand:false,geometryFunction:ol.interaction.Draw.createRegularPolygon(4)});i3GEO.navega.dragZoom.draw.setActive(false);i3GEO.navega.dragZoom.draw.on("drawend",function(evt){var pol=evt.feature.getGeometry();i3geoOL.getView().fit(pol);i3GEO.navega.dragZoom.draw.setActive(false)});document.body.addEventListener('keydown',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(true)}});document.body.addEventListener('keyup',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(false)}});return i3GEO.navega.dragZoom.draw},geolocal:{_timer:"",_delay:500,_pin:"",start:function(){if(i3GEO.navega.geolocal._timer!=""){i3GEO.navega.geolocal.stop()}else{i3GEO.navega.geolocal.firstPoint()}},firstPoint:function(){var retorno=function(position){console.log(position);i3GEO.navega.geolocal.showPoint(position);i3GEO.navega.geolocal.createTimer()};navigator.geolocation.getCurrentPosition(retorno,i3GEO.navega.geolocal.erro)},createTimer:function(){i3GEO.navega.geolocal._timer=setInterval(function(){i3GEO.navega.geolocal.movePoint()},i3GEO.navega.geolocal._delay)},stop:function(){clearInterval(i3GEO.navega.geolocal._timer);i3GEO.navega.geolocal._timer="";i3GEO.navega.geolocal.removePoint()},showPoint:function(position){var y=position.coords.latitude;var x=position.coords.longitude;i3GEO.navega.pan2ponto(x,y);i3GEO.navega.geolocal._pin=i3GEO.desenho.addPin(x,y,"","",i3GEO.configura.locaplic+'/imagens/google/confluence.png',"pingeolocal")},movePoint:function(position){var retorno=function(position){var y=position.coords.latitude;var x=position.coords.longitude;i3GEO.desenho.movePin(i3GEO.navega.geolocal._pin,x,y)};navigator.geolocation.getCurrentPosition(retorno,i3GEO.navega.geolocal.erro)},removePoint:function(){i3GEO.desenho.removePins("pingeolocal")},erro:function(error){i3GEO.navega.geolocal.stop();var erro="";switch(error.code){case error.PERMISSION_DENIED:erro="User denied the request for Geolocation.";break;case error.POSITION_UNAVAILABLE:erro="Location information is unavailable.";break;case error.TIMEOUT:erro="The request to get user location timed out.";break;case error.UNKNOWN_ERROR:erro="An unknown error occurred.";break}i3GEO.janela.tempoMsg(erro)}}}; |
276 | 276 | // |
277 | 277 | //compactados/eventos_compacto.js |
278 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}var objposicaocursor={ddx:"",ddy:"",dmsx:"",dmsy:"",telax:"",telay:"",imgx:"",imgy:"",refx:"",refy:""};i3GEO.eventos={CONTATOUCH:0,MOUSEOVERDATA:[],MOUSEOUTDATA:[],RESIZE:[],SELECAO:[],ATUALIZAARVORECAMADAS:[],ATIVATEMA:[],NAVEGAMAPA:[],MOUSEPARADO:[],MOUSEMOVE:[],MOUSEDOWN:[],MOUSEUP:["i3GEO.eventos.cliquePerm.executa()"],MOUSECLIQUE:["i3GEO.eventos.cliqueCapturaPt()"],MOUSECLIQUEPERM:["i3GEO.mapa.dialogo.verificaTipDefault()"],TIMERPARADO:"",mouseOverData:function(){i3GEO.eventos.executaEventos(this.MOUSEOVERDATA)},mouseOutData:function(){i3GEO.eventos.executaEventos(this.MOUSEOUTDATA)},mouseParado:function(){try{clearTimeout(this.TIMERPARADO)}catch(e){this.TIMERPARADO=""}if(objposicaocursor.dentroDomapa===false){return}try{if(objposicaocursor.imgy===""){objposicaocursor.imgy=1;objposicaocursor.imgx=1}if(i3GEO.eventos.MOUSEPARADO.length>0&&objposicaocursor.imgy>0&&objposicaocursor.imgx>0){if(objposicaocursor.imgx>0){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO)}}}catch(e){}},navegaMapa:function(){i3GEO.eventos.executaEventos(this.NAVEGAMAPA)},mousemoveMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEMOVE)},mousedownMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEDOWN)},mouseupMapa:function(exy){if(!exy){i3GEO.eventos.executaEventos(this.MOUSEUP)}else{if(i3GEO.Interface.ATUAL==="googlemaps"&&exy.target&&!exy.target.src){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}pos=i3GEOtouchesPosMapa;p=new google.maps.Point(exy.clientX-pos[0],exy.clientY-pos[1]);e=null;lonlat=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p);if(lonlat){objposicaocursor.ddx=lonlat.lng();objposicaocursor.ddy=lonlat.lat()}i3GEO.eventos.executaEventos(this.MOUSEUP)}else if(i3GEO.Interface.ATUAL==="openlayers"&&exy.target&&exy.target.tagName==="CANVAS"){i3GEO.eventos.executaEventos(this.MOUSEUP)}}},mousecliqueMapa:function(){i3GEO.eventos.executaEventos(this.MOUSECLIQUE)},resizeMapa:function(){i3GEO.eventos.executaEventos(this.RESIZE)},executaEventos:function(eventos){if(i3GEO.Interface.STATUS.pan===true){return}var f=0;try{if(eventos.length>0){f=eventos.length-1;if(f>=0){do{if(eventos[f]!==""){if(typeof(eventos[f])==="function"){eventos[f].call()}else{eval(eventos[f])}}}while(f--)}}}catch(e){eventos[f]=""}},removeEventos:function(tipo,eventos){var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].remove(eventos[i])}i3GEO.eventos[tipo].remove("");i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},adicionaEventos:function(tipo,eventos){if(eventos==""){i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique();return}var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].push(eventos[i])}i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},posicaoMouseMapa:function(e){var teladd,teladms,container="",targ="",pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex;if(!e){e=window.event}try{if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.parentNode){container=targ.parentNode.id}}catch(erro){return}if(container!=="mapaReferencia"){return}pos=i3GEO.util.pegaPosicaoObjeto(targ);mousex=0;mousey=0;if(e.pageX||e.pageY){mousex=e.pageX;mousey=e.pageY}else if(e.clientX||e.clientY){mousex=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mousey=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}xfig=mousex-pos[0];yfig=mousey-pos[1];xreffig=xfig;yreffig=yfig;xtela=mousex;ytela=mousey;c=i3GEO.parametros.celularef;ex=i3GEO.parametros.extentref;teladd=i3GEO.calculo.tela2dd(xfig,yfig,c,ex,targ.id);teladms=i3GEO.calculo.dd2dms(teladd[0],teladd[1]);objposicaocursor={ddx:teladd[0],ddy:teladd[1],dmsx:teladms[0],dmsy:teladms[1],telax:xtela,telay:ytela,imgx:xfig,imgy:yfig,refx:xreffig,refy:yreffig,dentroDomapa:true}},ativa:function(docMapa){if(!docMapa){return}var timer=0;var delay=300;var prevent=false;docMapa.onmouseover=function(){objposicaocursor.dentroDomapa=true;this.onmousemove=function(exy){i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.posicaoMouseMapa(exy);try{i3GEO.eventos.mousemoveMapa()}catch(e){}}};docMapa.onmouseout=function(){objposicaocursor.dentroDomapa=false};docMapa.onmousedown=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousedownMapa()};docMapa.onclick=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousecliqueMapa(exy)};docMapa.ondblclick=function(){if(objposicaocursor.dentroDomapa===false){return}clearTimeout(timer);prevent=true};docMapa.onmouseup=function(exy){if(objposicaocursor.dentroDomapa===false){return}if(i3GEO.Interface.ATUAL==="googlemaps"){if(modoAtual==="move"){modoAtual="";return}}i3GEO.eventos.cliquePerm.status=true;timer=setTimeout(function(){if(!prevent){i3GEO.eventos.mouseupMapa(exy)}prevent=false},delay)};docMapa.ontouchmove=function(exy){i3GEO.eventos.CONTATOUCH++;i3GEO.Interface.STATUS.pan=true;i3GEO.eventos.posicaoMouseMapa(exy)};docMapa.ontouchcancel=function(exy){i3GEO.eventos.CONTATOUCH=0}},botaoDireita:function(exy){try{var k=(navm)?event.button:exy.button;if(k!==2){return false}else{return true}}catch(e){return false}},cliqueCapturaPt:function(ixg,ixm,ixs,iyg,iym,iys){var x,y,doc=document;if(arguments.length===0){ixg="ixg";ixm="ixm";ixs="ixs";iyg="iyg";iym="iym";iys="iys";if($i("wdocai")){doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument}}try{if(doc){x=objposicaocursor.dmsx.split(" ");y=objposicaocursor.dmsy.split(" ");if(doc.getElementById(ixg)){doc.getElementById(ixg).value=x[0]}if(doc.getElementById(ixm)){doc.getElementById(ixm).value=x[1]}if(doc.getElementById(ixs)){doc.getElementById(ixs).value=$.number(x[2],2,$trad("dec"),$trad("mil"))}if(doc.getElementById(iyg)){doc.getElementById(iyg).value=y[0]}if(doc.getElementById(iym)){doc.getElementById(iym).value=y[1]}if(doc.getElementById(iys)){doc.getElementById(iys).value=$.number(y[2],2,$trad("dec"),$trad("mil"))}}}catch(m){}},cliquePerm:{ativo:true,status:true,executa:function(evt){if(i3GEO.eventos.cliquePerm.ativo===true&&i3GEO.eventos.cliquePerm.status===true){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUEPERM)}},ativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=true}},desativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=false}},ativoinicial:true}}; | |
278 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}var objposicaocursor={ddx:"",ddy:"",dmsx:"",dmsy:"",telax:"",telay:"",imgx:"",imgy:"",refx:"",refy:""};i3GEO.eventos={CONTATOUCH:0,MOUSEOVERDATA:[],MOUSEOUTDATA:[],RESIZE:[],SELECAO:[],ATUALIZAARVORECAMADAS:[],ATIVATEMA:[],NAVEGAMAPA:[],MOUSEPARADO:[],MOUSEMOVE:[],MOUSEDOWN:[],MOUSEUP:["i3GEO.eventos.cliquePerm.executa()"],MOUSECLIQUE:["i3GEO.eventos.cliqueCapturaPt()"],MOUSECLIQUEPERM:["i3GEO.mapa.dialogo.verificaTipDefault(xx,yy)"],TIMERPARADO:"",mouseOverData:function(){i3GEO.eventos.executaEventos(this.MOUSEOVERDATA)},mouseOutData:function(){i3GEO.eventos.executaEventos(this.MOUSEOUTDATA)},mouseParado:function(){try{clearTimeout(this.TIMERPARADO)}catch(e){this.TIMERPARADO=""}if(objposicaocursor.dentroDomapa===false){return}try{if(objposicaocursor.imgy===""){objposicaocursor.imgy=1;objposicaocursor.imgx=1}if(i3GEO.eventos.MOUSEPARADO.length>0&&objposicaocursor.imgy>0&&objposicaocursor.imgx>0){if(objposicaocursor.imgx>0){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO)}}}catch(e){}},navegaMapa:function(){i3GEO.eventos.executaEventos(this.NAVEGAMAPA)},mousemoveMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEMOVE)},mousedownMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEDOWN)},mouseupMapa:function(exy){if(!exy){i3GEO.eventos.executaEventos(this.MOUSEUP)}else{if(i3GEO.Interface.ATUAL==="googlemaps"&&exy.target&&!exy.target.src){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}pos=i3GEOtouchesPosMapa;p=new google.maps.Point(exy.clientX-pos[0],exy.clientY-pos[1]);e=null;lonlat=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p);if(lonlat){objposicaocursor.ddx=lonlat.lng();objposicaocursor.ddy=lonlat.lat()}i3GEO.eventos.executaEventos(this.MOUSEUP)}else if(i3GEO.Interface.ATUAL==="openlayers"&&exy.target&&exy.target.tagName==="CANVAS"){i3GEO.eventos.executaEventos(this.MOUSEUP)}}},mousecliqueMapa:function(){i3GEO.eventos.executaEventos(this.MOUSECLIQUE)},resizeMapa:function(){i3GEO.eventos.executaEventos(this.RESIZE)},executaEventos:function(eventos){if(i3GEO.Interface.STATUS.pan===true){return}var f=0;try{if(eventos.length>0){f=eventos.length-1;if(f>=0){do{if(eventos[f]!==""){if(typeof(eventos[f])==="function"){eventos[f].call()}else{var f=eventos[f];f=f.replace("xx",objposicaocursor.ddx);f=f.replace("yy",objposicaocursor.ddy);eval(f)}}}while(f--)}}}catch(e){eventos[f]=""}},removeEventos:function(tipo,eventos){var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].remove(eventos[i])}i3GEO.eventos[tipo].remove("");i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},adicionaEventos:function(tipo,eventos){if(eventos==""){i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique();return}var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].push(eventos[i])}i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},posicaoMouseMapa:function(e){var teladd,teladms,container="",targ="",pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex;if(!e){e=window.event}try{if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.parentNode){container=targ.parentNode.id}}catch(erro){return}if(container!=="mapaReferencia"){return}pos=i3GEO.util.pegaPosicaoObjeto(targ);mousex=0;mousey=0;if(e.pageX||e.pageY){mousex=e.pageX;mousey=e.pageY}else if(e.clientX||e.clientY){mousex=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mousey=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}xfig=mousex-pos[0];yfig=mousey-pos[1];xreffig=xfig;yreffig=yfig;xtela=mousex;ytela=mousey;c=i3GEO.parametros.celularef;ex=i3GEO.parametros.extentref;teladd=i3GEO.calculo.tela2dd(xfig,yfig,c,ex,targ.id);teladms=i3GEO.calculo.dd2dms(teladd[0],teladd[1]);objposicaocursor={ddx:teladd[0],ddy:teladd[1],dmsx:teladms[0],dmsy:teladms[1],telax:xtela,telay:ytela,imgx:xfig,imgy:yfig,refx:xreffig,refy:yreffig,dentroDomapa:true}},ativa:function(docMapa){if(!docMapa){return}var timer=0;var delay=300;var prevent=false;docMapa.onmouseover=function(){objposicaocursor.dentroDomapa=true;this.onmousemove=function(exy){i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.posicaoMouseMapa(exy);try{i3GEO.eventos.mousemoveMapa()}catch(e){}}};docMapa.onmouseout=function(){objposicaocursor.dentroDomapa=false};docMapa.onmousedown=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousedownMapa()};docMapa.onclick=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousecliqueMapa(exy)};docMapa.ondblclick=function(){if(objposicaocursor.dentroDomapa===false){return}clearTimeout(timer);prevent=true};docMapa.onmouseup=function(exy){if(objposicaocursor.dentroDomapa===false){return}if(i3GEO.Interface.ATUAL==="googlemaps"){if(modoAtual==="move"){modoAtual="";return}}i3GEO.eventos.cliquePerm.status=true;timer=setTimeout(function(){if(!prevent){i3GEO.eventos.mouseupMapa(exy)}prevent=false},delay)};docMapa.ontouchmove=function(exy){i3GEO.eventos.CONTATOUCH++;i3GEO.Interface.STATUS.pan=true;i3GEO.eventos.posicaoMouseMapa(exy)};docMapa.ontouchcancel=function(exy){i3GEO.eventos.CONTATOUCH=0}},botaoDireita:function(exy){try{var k=(navm)?event.button:exy.button;if(k!==2){return false}else{return true}}catch(e){return false}},cliqueCapturaPt:function(ixg,ixm,ixs,iyg,iym,iys){var x,y,doc=document;if(arguments.length===0){ixg="ixg";ixm="ixm";ixs="ixs";iyg="iyg";iym="iym";iys="iys";if($i("wdocai")){doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument}}try{if(doc){x=objposicaocursor.dmsx.split(" ");y=objposicaocursor.dmsy.split(" ");if(doc.getElementById(ixg)){doc.getElementById(ixg).value=x[0]}if(doc.getElementById(ixm)){doc.getElementById(ixm).value=x[1]}if(doc.getElementById(ixs)){doc.getElementById(ixs).value=$.number(x[2],2,$trad("dec"),$trad("mil"))}if(doc.getElementById(iyg)){doc.getElementById(iyg).value=y[0]}if(doc.getElementById(iym)){doc.getElementById(iym).value=y[1]}if(doc.getElementById(iys)){doc.getElementById(iys).value=$.number(y[2],2,$trad("dec"),$trad("mil"))}}}catch(m){}},cliquePerm:{ativo:true,status:true,executa:function(evt){if(i3GEO.eventos.cliquePerm.ativo===true&&i3GEO.eventos.cliquePerm.status===true){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUEPERM)}},ativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=true}},desativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=false}},ativoinicial:true}}; | |
279 | 279 | // |
280 | 280 | //compactados/arvoredetemas_compacto.js |
281 | 281 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.arvoreDeTemas={IDSMENUS:[],buscaTema2:function(palavra){if(palavra===""){return}var busca,root,nodePalavra="";resultadoProcurar=function(retorno){var ig,montaTexto=function(ngSgrupo){var tempn,ngTema,tempng,mostra,d,lk="",st,sg;tempn=ngSgrupo.length;for(sg=0;sg<tempn;sg+=1){ngTema=ngSgrupo[sg].temas;tempng=ngTema.length;for(st=0;st<tempng;st+=1){mostra=true;try{if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD&&ngTema[st].download==="nao"){mostra=false}if(i3GEO.arvoreDeTemas.FILTRAOGC&&ngTema[st].ogc==="nao"){mostra=false}}catch(e){}if(mostra){d=i3GEO.arvoreDeTemas.montaTextoTema("gray",ngTema[st]);if(ngTema[st].link!==" "){lk="<a href='"+ngTema[st].link+"' target='blank'> fonte</a>"}if(ngSgrupo[sg].subgrupo){d+="<td style='text-allign:left'> ("+(ngSgrupo[sg].subgrupo)+") "+lk+"</td>"}else{d+="<td style='text-allign:left'> ("+(ngSgrupo[sg].grupo)+")"+lk+"</td>"}}conta+=1}}}};busca=function(){i3GEO.php.procurartemas2(resultadoProcurar,i3GEO.util.removeAcentos(palavra))}},comboMenus:function(locaplic,funcaoOnchange,idDestino,idCombo,largura,altura){i3GEO.configura.locaplic=locaplic;var combo=function(retorno){var ob,ins,ig;ob=retorno.data;ins="<select id='"+idCombo+"' SIZE="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(this.value)' ><option value='' >Escolha um menu:</option>";for(ig=0;ig<ob.length;ig+=1){if(ob[ig].publicado!=="nao"&&ob[ig].publicado!=="NAO"){if(ob[ig].nomemenu){ins+="<option value="+ob[ig].idmenu+" >"+ob[ig].nomemenu+"</option>"}}}$i(idDestino).innerHTML=ins+"</select>";return retorno.data};i3GEO.php.pegalistademenus(combo)},comboGruposMenu:function(locaplic,funcaoOnchange,idDestino,idCombo,largura,altura,id_menu){i3GEO.configura.locaplic=locaplic;i3GEO.arvoreDeTemas.temasRaizGrupos=[];var combo=function(retorno){var ins,ig,obGrupos=retorno.data;ins="<select id='"+idCombo+"' SIZE="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(this.value)' ><option value='' >Escolha um grupo:</option>";for(ig=0;ig<obGrupos.grupos.length;ig+=1){if(obGrupos.grupos[ig].nome){ins+="<option value="+obGrupos.grupos[ig].id_n1+" >"+obGrupos.grupos[ig].nome+"</option>"}i3GEO.arvoreDeTemas.temasRaizGrupos[obGrupos.grupos[ig].id_n1]=obGrupos.grupos[ig].temasgrupo}$i(idDestino).innerHTML=ins+"</select>"};i3GEO.php.pegalistadegrupos(combo,id_menu,"nao")},comboSubGruposMenu:function(locaplic,funcaoOnchange,idDestino,idCombo,idGrupo,largura,altura){if(idGrupo!==""){var combo=function(retorno){var ins,sg,ig;ins="<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(\""+idGrupo+"\",this.value)' ><option value='' >Escolha um sub-grupo:</option>";if(retorno.data.subgrupo){sg=retorno.data.subgrupo;for(ig=0;ig<sg.length;ig+=1){ins+="<option value="+sg[ig].id_n2+" >"+sg[ig].nome+"</option>"}}$i(idDestino).innerHTML=ins+"</select>"};i3GEO.php.pegalistadeSubgrupos(combo,"",idGrupo)}},comboTemasMenu:function(locaplic,funcaoOnchange,idDestino,idCombo,idGrupo,idSubGrupo,largura,altura,id_menu,temas){var combo=function(retorno){var ins,sg,ig;if(idSubGrupo!=""){ins="<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"("+idGrupo+","+idSubGrupo+",this.value)' ><option value='' >Escolha um tema:</option>"}else{ins="<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"("+idGrupo+",\"\",this.value)' ><option value='' >Escolha um tema:</option>"}if(typeof(retorno.data)!=='undefined'){retorno=retorno.data.temas}sg=retorno.length;for(ig=0;ig<sg;ig++){ins+="<option value="+retorno[ig].tid+" >"+retorno[ig].nome+"</option>"}$i(idDestino).innerHTML=ins+"</select>"};if(typeof(temas)==='undefined'||temas===""){i3GEO.php.pegalistadetemas(combo,id_menu,idGrupo,idSubGrupo)}else{combo(temas)}},dialogo:{uploadarquivo:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/uploadarquivos/dependencias.php","i3GEOF.uploadarquivos.iniciaJanelaFlutuante()","i3GEOF.uploadarquivos_script")},conectaservico:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/conectarservicos/dependencias.php","i3GEOF.conectarservicos.iniciaJanelaFlutuante()","i3GEOF.conectarservicos_script")},carouselTemas:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/carouseltemas/index.js","i3GEOF.carouseltemas.criaJanelaFlutuante()","i3GEOF.carouseltemas_script")},buscaInde:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/buscainde/dependencias.php","i3GEOF.buscainde.iniciaJanelaFlutuante()","i3GEOF.buscainde_script")},nuvemTags:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/nuvemtags/dependencias.php","i3GEOF.nuvemtags.iniciaJanelaFlutuante()","i3GEOF.nuvemtags_script")},nuvemTagsFlash:function(){i3GEO.janela.cria("550px","350px",i3GEO.configura.locaplic+"/ferramentas/nuvemtagsflash/index.htm","","",$trad("x44"))},navegacaoDir:function(){i3GEO.janela.cria("550px","350px",i3GEO.configura.locaplic+"/ferramentas/navegacaodir/index.htm","","","<div class='i3GeoTituloJanela'>"+$trad("x45")+"</div>")},importarwmc:function(){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/importarwmc/dependencias.php","i3GEOF.importarwmc.iniciaJanelaFlutuante()","i3GEOF.importarwmc_script")},conectarwfs:function(){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwfs/index.htm","","","<div class='i3GeoTituloJanela'>WFS</div>")},downloadbase:function(){window.open(i3GEO.configura.locaplic+"/datadownload.htm")}}}; | ... | ... |
js/interface.js
... | ... | @@ -472,6 +472,7 @@ i3GEO.Interface = |
472 | 472 | return i3geoOL.getZoom(); |
473 | 473 | }, |
474 | 474 | //ver i3GEO.mapa |
475 | + //completo depreciado | |
475 | 476 | balao : function(texto, completo, x, y, botaoProp, nwkts) { |
476 | 477 | if (typeof (console) !== 'undefined') |
477 | 478 | console.info("monta o balao de identificacao e mostra na tela"); |
... | ... | @@ -501,11 +502,6 @@ i3GEO.Interface = |
501 | 502 | for (i = 0; i < n; i++) { |
502 | 503 | t = i3GEO.Interface.openlayers.BALAOPROP.baloes[i]; |
503 | 504 | if(t.get("origem") == "balao"){ |
504 | - /* | |
505 | - t.setPosition(undefined); | |
506 | - nd = t.getElement().parentNode; | |
507 | - nd.parentNode.removeChild(nd); | |
508 | - */ | |
509 | 505 | i3geoOL.removeOverlay(t); |
510 | 506 | } |
511 | 507 | } | ... | ... |
js/mapa.js
... | ... | @@ -1008,7 +1008,7 @@ i3GEO.mapa = |
1008 | 1008 | */ |
1009 | 1009 | verificaTipDefault : function(x,y) { |
1010 | 1010 | if (typeof (console) !== 'undefined') |
1011 | - console.info("i3GEO.mapa.dialogo.verificaTipDefault()"); | |
1011 | + console.info("i3GEO.mapa.dialogo.verificaTipDefault()" + x + " " + y ); | |
1012 | 1012 | |
1013 | 1013 | if(i3GEO.mapa.BALAOATIVO == false){ |
1014 | 1014 | if (typeof (console) !== 'undefined') |
... | ... | @@ -1016,26 +1016,19 @@ i3GEO.mapa = |
1016 | 1016 | |
1017 | 1017 | return; |
1018 | 1018 | } |
1019 | - if(i3GEO.eventos.cliquePerm.ativo == false){ | |
1020 | - return; | |
1021 | - } | |
1022 | - | |
1023 | - if (i3GEO.eventos.cliquePerm.status === false) { | |
1024 | - return; | |
1025 | - } else { | |
1026 | - i3GEO.eventos.cliquePerm.status = false; | |
1027 | - } | |
1028 | 1019 | if(!x){ |
1029 | 1020 | x = objposicaocursor.ddx; |
1030 | 1021 | } |
1031 | 1022 | if(!y){ |
1032 | 1023 | y = objposicaocursor.ddy; |
1033 | 1024 | } |
1034 | - | |
1035 | - var ntemas, etiquetas, j, temp; | |
1036 | - if(x === -1 || y === -1){ | |
1025 | + if(x === -1 || y === -1 || i3GEO.eventos.cliquePerm.ativo === false || i3GEO.eventos.cliquePerm.status === false){ | |
1037 | 1026 | return; |
1038 | 1027 | } |
1028 | + i3GEO.eventos.cliquePerm.status = false; | |
1029 | + | |
1030 | + var ntemas, etiquetas, j, temp; | |
1031 | + | |
1039 | 1032 | //para evitar duplo clique |
1040 | 1033 | objposicaocursor.ddx = -1; |
1041 | 1034 | objposicaocursor.ddy = -1; |
... | ... | @@ -1105,7 +1098,7 @@ i3GEO.mapa = |
1105 | 1098 | if (typeof (console) !== 'undefined') |
1106 | 1099 | console.info("i3GEO.mapa.montaTip()"); |
1107 | 1100 | |
1108 | - var textoCompleto = "", textoSimples = "", textoTempCompleto = "", textoTempSimples = "", x, y, temp, n, mostra, res, temas, ntemas, titulo, tips, j, ntips, r, ds, nds, s, configura = | |
1101 | + var textoSimples = "", textoTempSimples = "", x, y, temp, n, mostra, res, temas, ntemas, titulo, tips, j, ntips, r, ds, nds, s, configura = | |
1109 | 1102 | i3GEO.configura, wkts = []; |
1110 | 1103 | |
1111 | 1104 | i3GEO.eventos.cliquePerm.status = true; |
... | ... | @@ -1135,7 +1128,6 @@ i3GEO.mapa = |
1135 | 1128 | } |
1136 | 1129 | for (j = 0; j < ntemas; j += 1) { |
1137 | 1130 | titulo = temas[j].nome; |
1138 | - | |
1139 | 1131 | //para os nomes de funcoes embutidas |
1140 | 1132 | //funcoes sao configuradas no mapfile |
1141 | 1133 | //exemplo do METADATA |
... | ... | @@ -1158,18 +1150,19 @@ i3GEO.mapa = |
1158 | 1150 | temp1 = temp1.join(" "); |
1159 | 1151 | |
1160 | 1152 | var mais = "<button style='margin: 2px;padding: 0px;vertical-align: middle;position: relative;top: -7px;' class='btn btn-default btn-xs' onclick=\"i3GEO.mapa.dialogo.cliqueIdentificaDefault(" + x + "," + y + ",'" + temas[j].tema + "');return false;\" ><span style='opacity:0.5;vertical-align: middle;padding: 0px;' class='material-icons'>info</span></button>"; |
1153 | + if(ntemas == 1){ | |
1154 | + mais = ""; | |
1155 | + } | |
1161 | 1156 | titulo = "<div class='toolTipBalaoTitulo'>" + mais + " <b>" + titulo + "</b><br>" + temp1 + "</div>"; |
1162 | 1157 | tips = temas[j].resultado.todosItens; |
1163 | 1158 | ntips = tips.length; |
1164 | 1159 | ins = ""; |
1165 | - textoTempCompleto = ""; | |
1166 | 1160 | textoTempSimples = ""; |
1167 | 1161 | ds = temas[j].resultado.dados; |
1168 | 1162 | if (ds !== " " && ds[0] && ds[0] != " ") { |
1169 | 1163 | try { |
1170 | 1164 | nds = ds.length; |
1171 | 1165 | for (s = 0; s < nds; s += 1) { |
1172 | - textoTempCompleto += "<div class='toolTipBalaoTexto'>"; | |
1173 | 1166 | textoTempSimples += "<div class='toolTipBalaoTexto'>"; |
1174 | 1167 | for (r = 0; r < ntips; r += 1) { |
1175 | 1168 | try { |
... | ... | @@ -1197,12 +1190,9 @@ i3GEO.mapa = |
1197 | 1190 | if (ds[s][tips[r]].tip.toLowerCase() === "sim") { |
1198 | 1191 | textoTempSimples += temp; |
1199 | 1192 | } |
1200 | - textoTempCompleto += temp; | |
1201 | 1193 | mostra = true; |
1202 | 1194 | } catch (e) {} |
1203 | 1195 | } |
1204 | - | |
1205 | - textoTempCompleto += "</div>"; | |
1206 | 1196 | //para os nomes de funcoes embutidas |
1207 | 1197 | //funcoes sao configuradas no mapfile |
1208 | 1198 | //exemplo do METADATA |
... | ... | @@ -1235,26 +1225,15 @@ i3GEO.mapa = |
1235 | 1225 | } |
1236 | 1226 | } |
1237 | 1227 | if (textoTempSimples !== "") { |
1238 | - textoCompleto += titulo + textoTempCompleto; | |
1239 | 1228 | textoSimples += titulo + textoTempSimples; |
1240 | 1229 | } |
1241 | 1230 | } |
1242 | 1231 | if (mostra === true) { |
1243 | - res = textoSimples; | |
1244 | 1232 | if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal == true){ |
1245 | - if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple == true){ | |
1246 | - i3GEO.janela.closeMsg(textoSimples); | |
1247 | - return; | |
1248 | - } else { | |
1249 | - i3GEO.janela.closeMsg(textoCompleto); | |
1250 | - return; | |
1251 | - } | |
1233 | + i3GEO.janela.closeMsg(textoSimples); | |
1234 | + return; | |
1252 | 1235 | } else { |
1253 | - if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple == true){ | |
1254 | - i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples, textoCompleto, x, y, true, wkts.length); | |
1255 | - } else { | |
1256 | - i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoCompleto, textoSimples, x, y); | |
1257 | - } | |
1236 | + i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples, "", x, y, true, wkts.length); | |
1258 | 1237 | } |
1259 | 1238 | } |
1260 | 1239 | } | ... | ... |