Commit 2596a22c5ed6a52bbc5f7156e995dfdf74849f3a
1 parent
1cf47ba7
Exists in
master
and in
7 other branches
--no commit message
Showing
5 changed files
with
8 additions
and
8 deletions
Show diff stats
aplicmap/googleearth.phtml
classesjs/classe_interface.js
... | ... | @@ -1081,7 +1081,7 @@ i3GEO.Interface = { |
1081 | 1081 | aguarde: "", |
1082 | 1082 | redesenha: function(){ |
1083 | 1083 | try{ |
1084 | - if(typeof(linki3geo) !== 'undefined') | |
1084 | + if(linki3geo !== undefined) | |
1085 | 1085 | {linki3geo.setHref(linki3geo.getHref()+"&");} |
1086 | 1086 | } |
1087 | 1087 | catch(e){ |
... | ... | @@ -1374,10 +1374,10 @@ i3GEO.Interface = { |
1374 | 1374 | if(url === "") |
1375 | 1375 | {return;} |
1376 | 1376 | i3GEO.mapa.GEOXML.push(ngeoxml); |
1377 | - linki3geo = i3GeoMap.createLink(''); | |
1378 | - linki3geo.setHref(url); | |
1377 | + linki3geokml = i3GeoMap.createLink(''); | |
1378 | + linki3geokml.setHref(url); | |
1379 | 1379 | eval(ngeoxml+" = i3GeoMap.createNetworkLink('')"); |
1380 | - eval(ngeoxml+".setLink(linki3geo)"); | |
1380 | + eval(ngeoxml+".setLink(linki3geokml)"); | |
1381 | 1381 | i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml); |
1382 | 1382 | }, |
1383 | 1383 | adicionaListaKml: function(){ | ... | ... |
classesjs/compactados/classe_interface_compacto.js
1 | -if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.Interface={OUTPUTFORMAT:"AGG_Q",BARRABOTOESTOP:12,BARRABOTOESLEFT:3,ATUAL:"padrao",IDCORPO:"corpoMapa",ATIVAMENUCONTEXTO:false,IDMAPA:"",redesenha:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.redesenha()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.redesenha()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.redesenha()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.redesenha()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.redesenha()}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.adicionaKml("foo")}},cria:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.cria(w,h)}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.cria(w,h)}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.cria(w,h)}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.cria(w,h)}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.cria(w,h)}},inicia:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.inicia()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.inicia()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.inicia()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.inicia()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.inicia()}},ativaBotoes:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.ativaBotoes()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.ativaBotoes()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.ativaBotoes()}},padrao:{TRANSICAO:false,redesenha:function(){var ndiv,i;if(!$i("img")){i3GEO.janela.fechaAguarde();return}$i("img").onload=function(){var imagem,temp;imagem=$i("img");imagem.onload="";i3GEO.gadgets.quadros.grava("imagem",i3GEO.parametros.mapimagem);i3GEO.gadgets.quadros.grava("extensao",i3GEO.parametros.mapexten);temp=function(retorno){eval(retorno.data);i3GEO.gadgets.quadros.grava("legenda",legimagem)};if(i3GEO.gadgets.quadros.geraLegenda===true){i3GEO.mapa.legendaIMAGEM.obtem(temp)}if(i3GEO.Interface.padrao.TRANSICAO===true){if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",50,5,true)}i3GEO.util.aparece("img",50,5)}else{if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",15,5,true)}i3GEO.util.aparece("img",5,5)}i3GEO.janela.fechaAguarde("ajaxCorpoMapa")};if(!$i("imgtemp")){ndiv=document.createElement("div");ndiv.id="imgtemp";ndiv.style.position="absolute";ndiv.style.border="1px solid blue";document.getElementById("corpoMapa").appendChild(ndiv)}if(g_tipoacao==="pan"&&i3GEO.barraDeBotoes.BOTAOCLICADO==="pan"){$i("imgtemp").style.left=parseInt($i("img").style.left,10);$i("imgtemp").style.top=parseInt($i("img").style.top,10);$i("imgtemp").style.width=i3GEO.parametros.w;$i("imgtemp").style.height=i3GEO.parametros.h}$i("imgtemp").style.backgroundImage='url("'+$i("img").src+'")';$i("imgtemp").style.display="block";i=$i("img");i.style.display="none";i.style.left=0;i.style.top=0;i.src=i3GEO.parametros.mapimagem},cria:function(){var ins="<input style='position:relative;top:0px;left:0px'' type=image src='' id='img' />",temp=$i(i3GEO.Interface.IDCORPO);if(temp){temp.innerHTML=ins}i3GEO.Interface.IDMAPA="img"},ativaMenuContexto:function(){var temp,oFieldContextMenuItemData,oFieldContextMenu,onFieldMenuRender;temp=$i("contexto_"+i3GEO.Interface.IDMAPA);if(temp){temp.parentNode.removeChild(temp)}oFieldContextMenuItemData=[{text:" <span class='container-close'></span>"},{text:"<img class='rosamais' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Aproxima</span>",onclick:{fn:i3GEO.navega.zoomin}},{text:"<img class='rosamenos' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Afasta</span>",onclick:{fn:i3GEO.navega.zoomout}},{text:"<img class='rosanorte' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Norte</span>",onclick:{fn:i3GEO.navega.panFixoNorte}},{text:"<img class='rosasul' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Sul</span>",onclick:{fn:i3GEO.navega.panFixoSul}},{text:"<img class='rosaleste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Leste</span>",onclick:{fn:i3GEO.navega.panFixoLeste}},{text:"<img class='rosaoeste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Oeste</span>",onclick:{fn:i3GEO.navega.panFixoOeste}},{text:"Captura",onclick:{fn:i3GEO.gadgets.quadros.listaImagens}}];oFieldContextMenu=new YAHOO.widget.ContextMenu("contexto_"+i3GEO.Interface.IDMAPA,{trigger:i3GEO.Interface.IDMAPA,itemdata:oFieldContextMenuItemData,lazyload:true});onFieldMenuRender=function(){var id="contexto_"+i3GEO.Interface.IDMAPA;if(id){$i(id).style.zIndex=50000}};oFieldContextMenu.subscribe("render",onFieldMenuRender)},inicia:function(){var elemento,i,estilo;if($i("contemImg")){elemento="contemImg"}else{elemento="img"}i3GEO.mapa.ajustaPosicao(elemento);i=$i("img");if(!i){return}i.style.width=i3GEO.parametros.w+"px";i.style.height=i3GEO.parametros.h+"px";estilo=$i(i3GEO.Interface.IDCORPO).style;estilo.width=i3GEO.parametros.w+"px";estilo.height=i3GEO.parametros.h+"px";estilo.clip='rect('+0+" "+(i3GEO.parametros.w)+" "+(i3GEO.parametros.h)+" "+0+')';objmapaparado="nao";i3GEO.gadgets.mostraMenuSuspenso();i3GEO.eventos.ativa(i);i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.gadgets.mostraEscalaGrafica();i3GEO.gadgets.visual.inicia();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.Interface.padrao.ativaBotoes();i3GEO.idioma.mostraSeletor();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){var imagemxy,x1,y1,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y1=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if(($i("barraDeBotoes1")&&$i("barraDeBotoes2"))||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+40}if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes1","i3geo_barra1",true,x1,y1)}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes();if(document.getElementById("botao3d")){if(i3GEO.configura.map3d===""){document.getElementById("botao3d").style.display="none"}}if(i3GEO.Interface.ATIVAMENUCONTEXTO){i3GEO.Interface.padrao.ativaMenuContexto()}if(i3GEO.configura.visual!=="default"){i3GEO.gadgets.visual.troca(i3GEO.configura.visual)}}},flamingo:{redesenha:function(){var w=parseInt($i("flamingo").style.width,10);if(w===i3GEO.parametros.w){$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)+1}else{$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)-1}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("flamingo");if(!f){ins='<div id=flamingo style="width:0px;height:0px;text-align:left;background-image:url(/"'+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg/")"></div>';i.innerHTML=ins}f=$i("flamingo");f.style.width=w;f.style.height=h;i3GEO.Interface.IDMAPA="flamingo"}},inicia:function(){var monta=function(retorno){$i("flamingo").style.height=i3GEO.parametros.h+45;childPopups=[];childPopupNr=0;var so=new SWFObject(i3GEO.configura.locaplic+"/pacotes/flamingo/flamingo/flamingo.swf?config="+retorno.data,"flamingoi","100%","100%","8","#eaeaea");so.addParam("wmode","transparent");so.write("flamingo")};i3GEO.php.flamingo(monta);i3GEO.eventos.ativa($i("flamingo"));i3GEO.maparef.atualiza();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){}},openlayers:{TILES:false,GADGETS:{PanZoomBar:true,LayerSwitcher:true,ScaleLine:true,OverviewMap:true},redesenha:function(){if($i("openlayers_OpenLayers_Container")){var a,b,c,no,divs1,n1,divs2,n2,imgs,nimg;no=$i("openlayers_OpenLayers_Container");divs1=no.getElementsByTagName("div");n1=divs1.length;for(a=0;a<n1;a++){divs2=divs1[a].getElementsByTagName("div");n2=divs2.length;for(b=0;b<n2;b++){imgs=divs2[b].getElementsByTagName("img");nimg=imgs.length;for(c=0;c<nimg;c++){imgs[c].src+="&x"}}}i3GEO.Interface.openlayers.recalcPar()}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("openlayers");if(!f){ins='<div id=openlayers style="width:0px;height:0px;text-align:left;background-image:url('+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg)"></div>';i.innerHTML=ins}f=$i("openlayers");f.style.width=w;f.style.height=h}i3GEO.Interface.IDMAPA="openlayers"},inicia:function(){var montaMapa=function(){var url,pz,pos;url=window.location.protocol+"//"+window.location.host+i3GEO.parametros.cgi+"?";url+="map="+i3GEO.parametros.mapfile+"&mode=map&SRS=epsg:4326&";i3geoOL=new OpenLayers.Map('openlayers',{controls:[]});if(i3GEO.Interface.openlayers.TILES===true){i3geoOLlayer=new OpenLayers.Layer.MapServer("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}else{i3geoOLlayer=new OpenLayers.Layer.MapServer.Untiled("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}i3geoOLlayer.setVisibility(true);i3geoOLlayer.transitionEffect="resize";i3geoOL.addLayer(i3geoOLlayer);i3geoOL.events.register("moveend",i3geoOL,function(e){i3GEO.Interface.openlayers.recalcPar();g_operacao="";g_tipoacao=""});i3geoOL.events.register("mousemove",i3geoOL,function(e){var p,lonlat,d,dc;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3geoOL.getLonLatFromPixel(p);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{objposicaocursor.ddx=lonlat.lon;objposicaocursor.ddy=lonlat.lat;objposicaocursor.telax=p.x;objposicaocursor.telay=p.y;objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];dc=$i("i3geo");if($i("openlayers_OpenLayers_Container")){dc=$i("openlayers_OpenLayers_Container")}while(dc.offsetParent){dc=dc.offsetParent;objposicaocursor.telax=objposicaocursor.telax+dc.offsetLeft;objposicaocursor.telay=objposicaocursor.telay+dc.offsetTop}}catch(e){}});i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);if(i3GEO.Interface.openlayers.GADGETS.PanZoomBar==true){pz=new OpenLayers.Control.PanZoomBar({numZoomLevels:5});i3geoOL.addControl(pz);pz.div.style.zIndex=5000}if(i3GEO.Interface.openlayers.GADGETS.LayerSwitcher==true){i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher())}if(i3GEO.Interface.openlayers.GADGETS.ScaleLine==true){i3geoOL.addControl(new OpenLayers.Control.ScaleLine())}if(i3GEO.Interface.openlayers.GADGETS.OverviewMap==true){i3geoOL.addControl(new OpenLayers.Control.OverviewMap())}i3geoOL.addControl(new OpenLayers.Control.KeyboardDefaults());i3GEO.eventos.ativa($i("openlayers"));pos=i3GEO.util.pegaPosicaoObjeto($i("openlayers"));if($i("aguarde")){$top("aguarde",pos[1]);$left("aguarde",pos[0])}OLpan=new OpenLayers.Control.Navigation();OLzoom=new OpenLayers.Control.ZoomBox();OLpanel=new OpenLayers.Control.Panel();OLpanel.addControls([OLpan,OLzoom]);i3geoOL.addControl(OLpanel);i3GEO.Interface.openlayers.ativaBotoes()};i3GEO.php.openlayers(montaMapa);i3GEO.gadgets.mostraMenuSuspenso();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.idioma.mostraSeletor();i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica()},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},recalcPar:function(){g_operacao="";g_tipoacao="";var bounds=i3geoOL.getExtent().toBBOX().split(",");i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];i3GEO.parametros.mapscale=i3geoOL.getScale();atualizaEscalaNumerica(parseInt(i3GEO.parametros.mapscale,10))},zoom2ext:function(ext){var m,b;m=ext.split(" ");b=new OpenLayers.Bounds(m[0],m[1],m[2],m[3]);i3geoOL.zoomToExtent(b)}},googlemaps:{OPACIDADE:0.8,TIPOMAPA:"G_PHYSICAL_MAP",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],redesenha:function(){try{if(i3GeoMap!==""){posfixo=posfixo+"&";i3GeoMap.removeOverlay(i3GEOTileO);var i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile()+posfixo,isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO)}}catch(e){}},cria:function(w,h){var i,f,ins;posfixo="&";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");f.style.width=w;f.style.height=h}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv"},inicia:function(){var pos,myMapType,pol,ret,pt1,pt2,bottomLeft,bottomRight,sw,ne,z,i3GEOTile;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;i3GeoMap=new GMap2($i(i3GEO.Interface.IDMAPA));i3GeoMap.addMapType(G_PHYSICAL_MAP);if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_SATELLITE_MAP"){i3GeoMap.setMapType(G_SATELLITE_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_PHYSICAL_MAP"){i3GeoMap.setMapType(G_PHYSICAL_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_HYBRID_MAP"){i3GeoMap.setMapType(G_HYBRID_MAP)}i3GeoMap.addControl(new GLargeMapControl());i3GeoMap.addControl(new GMapTypeControl());bottomLeft=new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0,40));i3GeoMap.addControl(new GScaleControl(),bottomLeft);bottomRight=new GControlPosition(G_ANCHOR_BOTTOM_RIGHT);i3GeoMap.addControl(new GOverviewMapControl(),bottomRight);sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z);i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile(),isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO);myMapType=new GMapType([i3GEOTile],new GMercatorProjection(18),'i3Geo');i3GeoMap.addMapType(myMapType);GEvent.addListener(i3GeoMap,"dragstart",function(){g_operacao="";g_tipoacao=""});GEvent.addListener(i3GeoMap,"dragend",function(){i3GEO.Interface.googlemaps.recalcPar()});GEvent.addListener(i3GeoMap,"zoomend",function(){i3GEO.Interface.googlemaps.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googlemaps.ativaBotoes();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraMenuSuspenso();i3GEO.gadgets.mostraInserirKml();pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA));GEvent.addListener(i3GeoMap,"mousemove",function(ponto){var teladms,tela;teladms=i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());tela=i3GeoMap.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]}});g_operacao="";g_tipoacao="";if(i3GEO.parametros.kmlurl!==""){i3GEO.mapa.insereKml(true,i3GEO.parametros.kmlurl)}i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala();i3GEO.Interface.googlemaps.adicionaListaKml()},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)},criaWMS:function(){var cgi,parametros;cgi=i3GEO.configura.locaplic+"/classesphp/parse_cgi.php?g_sid="+i3GEO.configura.sid;parametros="&map_size="+parseInt($i(i3GEO.Interface.IDMAPA).style.width,10);parametros+=","+parseInt($i(i3GEO.Interface.IDMAPA).style.height,10);parametros+="&mapext="+i3GEO.Interface.googlemaps.bbox();parametros+="&map_imagecolor=-1 -1 -1&map_transparent=on";return(cgi+parametros)},criaTile:function(){var cgi,parametros;cgi=i3GEO.util.protocolo()+"://"+window.location.host+i3GEO.parametros.cgi+"?";parametros="map="+i3GEO.parametros.mapfile;parametros+='&mode=tile';parametros+='&tilemode=gmap';parametros+='&tile={X}+{Y}+{Z}';parametros+='&map_imagetype='+i3GEO.Interface.OUTPUTFORMAT;return(cgi+parametros)},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+70;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},mudaOpacidade:function(valor){i3GEO.Interface.googlemaps.OPACIDADE=valor/200;i3GEO.Interface.googlemaps.redesenha()},recalcPar:function(){var bounds,sw,ne;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getBounds();sw=bounds.getSouthWest();ne=bounds.getNorthEast();i3GEO.parametros.mapexten=sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala()},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 pol,ret,pt1,pt2,sw,ne,z;pol=mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z)},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;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(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);zoom=function(){if(pan){eval("var ll = "+ngeoxml+".getDefaultCenter()");eval(ngeoxml+".gotoDefaultViewport(i3GeoMap)")}};eval(ngeoxml+" = new GGeoXml(url,zoom)");if(ativo===true){eval("i3GeoMap.addOverlay("+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 root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googlemaps.ARVORE.getRoot();node=i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="<table><tr><td><b>Google Maps</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},ativaDesativaCamadaKml:function(obj){if(!obj.checked){eval("i3GeoMap.removeOverlay("+obj.value+")")}else{eval("i3GeoMap.addOverlay("+obj.value+")")}}},googleearth:{GADGETS:{setMouseNavigationEnabled:true,setStatusBarVisibility:true,setOverviewMapVisibility:true,setScaleLegendVisibility:true,setAtmosphereVisibility:true,setGridVisibility:false,getSun:false,LAYER_BORDERS:true,LAYER_BUILDINGS:false,LAYER_ROADS:false,LAYER_TERRAIN:true},POSICAOTELA:[0,0],aguarde:"",redesenha:function(){try{if(typeof(linki3geo)!=='undefined'){linki3geo.setHref(linki3geo.getHref()+"&")}}catch(e){}},cria:function(w,h){var i,i3GeoMap3d,i3GeoMap,texto;i3GEO.configura.listaDePropriedadesDoMapa={"propriedades":[]};texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setMouseNavigationEnabled(this.checked)'";texto+="> "+$trad("ge1");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setStatusBarVisibility(this.checked)'";texto+="> "+$trad("ge2");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setOverviewMapVisibility(this.checked)'";texto+="> "+$trad("ge3");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setScaleLegendVisibility(this.checked)'";texto+="> "+$trad("ge4");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setAtmosphereVisibility(this.checked)'";texto+="> "+$trad("ge5");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setGridVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setGridVisibility(this.checked)'";texto+="> "+$trad("ge6");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.getSun==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getSun().setVisibility(this.checked)'";texto+="> "+$trad("ge7");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BORDERS, this.checked)'";texto+="> "+$trad("ge8");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BUILDINGS, this.checked)'";texto+="> "+$trad("ge9");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_ROADS, this.checked)'";texto+="> "+$trad("ge10");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_TERRAIN, this.checked)'";texto+="> "+$trad("ge11");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});i=$i(i3GEO.Interface.IDCORPO);if(i){i3GeoMap3d=document.createElement("div");i3GeoMap3d.style.width=w;i3GeoMap3d.style.height=h+45;i.style.height=h+45;i3GeoMap3d.id="i3GeoMap3d";i.appendChild(i3GeoMap3d)}i3GEO.Interface.IDMAPA="i3GeoMap3d";google.load("earth","1");i3GeoMap=null},inicia:function(){google.earth.createInstance("i3GeoMap3d",i3GEO.Interface.googleearth.iniciaGE,i3GEO.Interface.googleearth.falha)},iniciaGE:function(object){i3GeoMap=object;i3GeoMap.getWindow().setVisibility(true);kmlUrl=i3GEO.configura.locaplic+"/pacotes/kmlmapserver/kmlservice.php?map="+i3GEO.parametros.mapfile+"&typename=estadosl&request=kml&mode=map&";linki3geo=i3GeoMap.createLink('');linki3geo.setHref(kmlUrl);nl=i3GeoMap.createNetworkLink('');nl.setLink(linki3geo);nl.setFlyToView(true);i3GeoMap.getFeatures().appendChild(nl);var options=i3GeoMap.getOptions(),layerRoot=i3GeoMap.getLayerRoot(),evento=function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""};options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled);options.setStatusBarVisibility(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility);options.setOverviewMapVisibility(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility);options.setScaleLegendVisibility(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility);options.setAtmosphereVisibility(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility);options.setGridVisibility(i3GEO.Interface.googleearth.GADGETS.setGridVisibility);layerRoot.enableLayerById(i3GeoMap.LAYER_BORDERS,i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS);layerRoot.enableLayerById(i3GeoMap.LAYER_BUILDINGS,i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS);layerRoot.enableLayerById(i3GeoMap.LAYER_ROADS,i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS);layerRoot.enableLayerById(i3GeoMap.LAYER_TERRAIN,i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN);i3GeoMap.getSun().setVisibility(i3GEO.Interface.googleearth.GADGETS.getSun);i3GeoMap.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW);google.earth.addEventListener(i3GeoMap.getView(),"viewchangeend",function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googleearth.POSICAOTELA=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO));google.earth.addEventListener(i3GeoMap.getGlobe(),'mousemove',function(event){objposicaocursor={ddx:event.getLongitude(),ddy:event.getLatitude(),dmsx:0,dmsy:0,imgx:event.getClientX(),imgy:event.getClientY(),telax:event.getClientX()+i3GEO.Interface.googleearth.POSICAOTELA[0],telay:event.getClientY()+i3GEO.Interface.googleearth.POSICAOTELA[1]};i3GEO.eventos.mousemoveMapa()});google.earth.addEventListener(i3GeoMap.getGlobe(),'click',function(event){if(i3GEO.Interface.googleearth.aguarde.visibility==="hidden"){i3GEO.eventos.mousecliqueMapa()}else{i3GEO.Interface.googleearth.aguarde.visibility="hidden"}});i3GEO.Interface.googleearth.ativaBotoes();i3GEO.gadgets.mostraInserirKml("inserirKml");i3GEO.Interface.googleearth.adicionaListaKml()},recalcPar:function(){var bounds;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getView().getViewportGlobeBounds();i3GEO.parametros.mapexten=bounds.getWest()+" "+bounds.getSouth()+" "+bounds.getEast()+" "+bounds.getNorth()},falha:function(){alert("Falhou. Vc precisa do plugin instalado")},ativaBotoes:function(){var cabecalho=function(){};var minimiza=function(){i3GEO.janela.minimiza("i3GEOF.ferramentasGE")};var janela=i3GEO.janela.cria("200px","70px","","","","Ferramentas","i3GEOF.ferramentasGE",false,"hd",cabecalho,minimiza);i3GEO.barraDeBotoes.TEMPLATEBOTAO='<div style="display:inline;background-color:rgb(250,250,250);"><img src="'+i3GEO.configura.locaplic+'/imagens/branco.gif" id="$$"/></div> ';i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id);i3GEO.barraDeBotoes.ativaBotoes();i3GEO.Interface.googleearth.aguarde=$i("i3GEOF.ferramentasGE_imagemCabecalho").style},balao:function(texto,ddx,ddy){var placemark=i3GeoMap.createPlacemark('');var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);var b=i3GeoMap.createHtmlStringBalloon('');b.setContentString("<div style=text-align:left >"+texto+"</div>");b.setFeature(placemark);i3GeoMap.setBalloon(b);i3GEO.Interface.googleearth.aguarde.visibility="hidden"},insereMarca:function(texto,ddx,ddy,name){var placemark=i3GeoMap.createPlacemark('');placemark.setName(name);var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);if(texto!=""){placemark.setDescription(texto)}i3GeoMap.getFeatures().appendChild(placemark)},removePlacemark:function(nome){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getName()==nome){features.getChildNodes().item(i).setVisibility(false)}}catch(e){}}},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=false}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);linki3geo=i3GeoMap.createLink('');linki3geo.setHref(url);eval(ngeoxml+" = i3GeoMap.createNetworkLink('')");eval(ngeoxml+".setLink(linki3geo)");i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googleearth.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googleearth.ARVORE.getRoot();node=i3GEO.Interface.googleearth.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googleearth.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googleearth.ARVORE.draw();i3GEO.Interface.googleearth.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googleearth.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googleearth.ARVORE.getRoot();titulo="<table><tr><td><b>Google Earth Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},existeLink:function(url){var existe=false,features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){existe=true}}catch(e){}}return(existe)},ativaDesativaLink:function(url,valor){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){features.getChildNodes().item(i).setVisibility(valor)}}catch(e){}}},ativaDesativaCamadaKml:function(obj){var url=eval(obj.value+".getLink().getHref()");var existe=i3GEO.Interface.googleearth.existeLink(url);if(!obj.checked){{i3GEO.Interface.googleearth.ativaDesativaLink(url,false)}}else{if(existe==false){eval("i3GeoMap.getFeatures().appendChild("+obj.value+")")}else{i3GEO.Interface.googleearth.ativaDesativaLink(url,true)}}}}};i3GEO.interface=i3GEO.Interface; | |
2 | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.Interface={OUTPUTFORMAT:"AGG_Q",BARRABOTOESTOP:12,BARRABOTOESLEFT:3,ATUAL:"padrao",IDCORPO:"corpoMapa",ATIVAMENUCONTEXTO:false,IDMAPA:"",redesenha:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.redesenha()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.redesenha()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.redesenha()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.redesenha()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.redesenha()}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.adicionaKml("foo")}},cria:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.cria(w,h)}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.cria(w,h)}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.cria(w,h)}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.cria(w,h)}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.cria(w,h)}},inicia:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.inicia()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.inicia()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.inicia()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.inicia()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.inicia()}},ativaBotoes:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.ativaBotoes()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.ativaBotoes()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.ativaBotoes()}},padrao:{TRANSICAO:false,redesenha:function(){var ndiv,i;if(!$i("img")){i3GEO.janela.fechaAguarde();return}$i("img").onload=function(){var imagem,temp;imagem=$i("img");imagem.onload="";i3GEO.gadgets.quadros.grava("imagem",i3GEO.parametros.mapimagem);i3GEO.gadgets.quadros.grava("extensao",i3GEO.parametros.mapexten);temp=function(retorno){eval(retorno.data);i3GEO.gadgets.quadros.grava("legenda",legimagem)};if(i3GEO.gadgets.quadros.geraLegenda===true){i3GEO.mapa.legendaIMAGEM.obtem(temp)}if(i3GEO.Interface.padrao.TRANSICAO===true){if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",50,5,true)}i3GEO.util.aparece("img",50,5)}else{if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",15,5,true)}i3GEO.util.aparece("img",5,5)}i3GEO.janela.fechaAguarde("ajaxCorpoMapa")};if(!$i("imgtemp")){ndiv=document.createElement("div");ndiv.id="imgtemp";ndiv.style.position="absolute";ndiv.style.border="1px solid blue";document.getElementById("corpoMapa").appendChild(ndiv)}if(g_tipoacao==="pan"&&i3GEO.barraDeBotoes.BOTAOCLICADO==="pan"){$i("imgtemp").style.left=parseInt($i("img").style.left,10);$i("imgtemp").style.top=parseInt($i("img").style.top,10);$i("imgtemp").style.width=i3GEO.parametros.w;$i("imgtemp").style.height=i3GEO.parametros.h}$i("imgtemp").style.backgroundImage='url("'+$i("img").src+'")';$i("imgtemp").style.display="block";i=$i("img");i.style.display="none";i.style.left=0;i.style.top=0;i.src=i3GEO.parametros.mapimagem},cria:function(){var ins="<input style='position:relative;top:0px;left:0px'' type=image src='' id='img' />",temp=$i(i3GEO.Interface.IDCORPO);if(temp){temp.innerHTML=ins}i3GEO.Interface.IDMAPA="img"},ativaMenuContexto:function(){var temp,oFieldContextMenuItemData,oFieldContextMenu,onFieldMenuRender;temp=$i("contexto_"+i3GEO.Interface.IDMAPA);if(temp){temp.parentNode.removeChild(temp)}oFieldContextMenuItemData=[{text:" <span class='container-close'></span>"},{text:"<img class='rosamais' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Aproxima</span>",onclick:{fn:i3GEO.navega.zoomin}},{text:"<img class='rosamenos' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Afasta</span>",onclick:{fn:i3GEO.navega.zoomout}},{text:"<img class='rosanorte' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Norte</span>",onclick:{fn:i3GEO.navega.panFixoNorte}},{text:"<img class='rosasul' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Sul</span>",onclick:{fn:i3GEO.navega.panFixoSul}},{text:"<img class='rosaleste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Leste</span>",onclick:{fn:i3GEO.navega.panFixoLeste}},{text:"<img class='rosaoeste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Oeste</span>",onclick:{fn:i3GEO.navega.panFixoOeste}},{text:"Captura",onclick:{fn:i3GEO.gadgets.quadros.listaImagens}}];oFieldContextMenu=new YAHOO.widget.ContextMenu("contexto_"+i3GEO.Interface.IDMAPA,{trigger:i3GEO.Interface.IDMAPA,itemdata:oFieldContextMenuItemData,lazyload:true});onFieldMenuRender=function(){var id="contexto_"+i3GEO.Interface.IDMAPA;if(id){$i(id).style.zIndex=50000}};oFieldContextMenu.subscribe("render",onFieldMenuRender)},inicia:function(){var elemento,i,estilo;if($i("contemImg")){elemento="contemImg"}else{elemento="img"}i3GEO.mapa.ajustaPosicao(elemento);i=$i("img");if(!i){return}i.style.width=i3GEO.parametros.w+"px";i.style.height=i3GEO.parametros.h+"px";estilo=$i(i3GEO.Interface.IDCORPO).style;estilo.width=i3GEO.parametros.w+"px";estilo.height=i3GEO.parametros.h+"px";estilo.clip='rect('+0+" "+(i3GEO.parametros.w)+" "+(i3GEO.parametros.h)+" "+0+')';objmapaparado="nao";i3GEO.gadgets.mostraMenuSuspenso();i3GEO.eventos.ativa(i);i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.gadgets.mostraEscalaGrafica();i3GEO.gadgets.visual.inicia();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.Interface.padrao.ativaBotoes();i3GEO.idioma.mostraSeletor();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){var imagemxy,x1,y1,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y1=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if(($i("barraDeBotoes1")&&$i("barraDeBotoes2"))||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+40}if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes1","i3geo_barra1",true,x1,y1)}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes();if(document.getElementById("botao3d")){if(i3GEO.configura.map3d===""){document.getElementById("botao3d").style.display="none"}}if(i3GEO.Interface.ATIVAMENUCONTEXTO){i3GEO.Interface.padrao.ativaMenuContexto()}if(i3GEO.configura.visual!=="default"){i3GEO.gadgets.visual.troca(i3GEO.configura.visual)}}},flamingo:{redesenha:function(){var w=parseInt($i("flamingo").style.width,10);if(w===i3GEO.parametros.w){$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)+1}else{$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)-1}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("flamingo");if(!f){ins='<div id=flamingo style="width:0px;height:0px;text-align:left;background-image:url(/"'+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg/")"></div>';i.innerHTML=ins}f=$i("flamingo");f.style.width=w;f.style.height=h;i3GEO.Interface.IDMAPA="flamingo"}},inicia:function(){var monta=function(retorno){$i("flamingo").style.height=i3GEO.parametros.h+45;childPopups=[];childPopupNr=0;var so=new SWFObject(i3GEO.configura.locaplic+"/pacotes/flamingo/flamingo/flamingo.swf?config="+retorno.data,"flamingoi","100%","100%","8","#eaeaea");so.addParam("wmode","transparent");so.write("flamingo")};i3GEO.php.flamingo(monta);i3GEO.eventos.ativa($i("flamingo"));i3GEO.maparef.atualiza();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){}},openlayers:{TILES:false,GADGETS:{PanZoomBar:true,LayerSwitcher:true,ScaleLine:true,OverviewMap:true},redesenha:function(){if($i("openlayers_OpenLayers_Container")){var a,b,c,no,divs1,n1,divs2,n2,imgs,nimg;no=$i("openlayers_OpenLayers_Container");divs1=no.getElementsByTagName("div");n1=divs1.length;for(a=0;a<n1;a++){divs2=divs1[a].getElementsByTagName("div");n2=divs2.length;for(b=0;b<n2;b++){imgs=divs2[b].getElementsByTagName("img");nimg=imgs.length;for(c=0;c<nimg;c++){imgs[c].src+="&x"}}}i3GEO.Interface.openlayers.recalcPar()}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("openlayers");if(!f){ins='<div id=openlayers style="width:0px;height:0px;text-align:left;background-image:url('+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg)"></div>';i.innerHTML=ins}f=$i("openlayers");f.style.width=w;f.style.height=h}i3GEO.Interface.IDMAPA="openlayers"},inicia:function(){var montaMapa=function(){var url,pz,pos;url=window.location.protocol+"//"+window.location.host+i3GEO.parametros.cgi+"?";url+="map="+i3GEO.parametros.mapfile+"&mode=map&SRS=epsg:4326&";i3geoOL=new OpenLayers.Map('openlayers',{controls:[]});if(i3GEO.Interface.openlayers.TILES===true){i3geoOLlayer=new OpenLayers.Layer.MapServer("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}else{i3geoOLlayer=new OpenLayers.Layer.MapServer.Untiled("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}i3geoOLlayer.setVisibility(true);i3geoOLlayer.transitionEffect="resize";i3geoOL.addLayer(i3geoOLlayer);i3geoOL.events.register("moveend",i3geoOL,function(e){i3GEO.Interface.openlayers.recalcPar();g_operacao="";g_tipoacao=""});i3geoOL.events.register("mousemove",i3geoOL,function(e){var p,lonlat,d,dc;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3geoOL.getLonLatFromPixel(p);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{objposicaocursor.ddx=lonlat.lon;objposicaocursor.ddy=lonlat.lat;objposicaocursor.telax=p.x;objposicaocursor.telay=p.y;objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];dc=$i("i3geo");if($i("openlayers_OpenLayers_Container")){dc=$i("openlayers_OpenLayers_Container")}while(dc.offsetParent){dc=dc.offsetParent;objposicaocursor.telax=objposicaocursor.telax+dc.offsetLeft;objposicaocursor.telay=objposicaocursor.telay+dc.offsetTop}}catch(e){}});i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);if(i3GEO.Interface.openlayers.GADGETS.PanZoomBar==true){pz=new OpenLayers.Control.PanZoomBar({numZoomLevels:5});i3geoOL.addControl(pz);pz.div.style.zIndex=5000}if(i3GEO.Interface.openlayers.GADGETS.LayerSwitcher==true){i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher())}if(i3GEO.Interface.openlayers.GADGETS.ScaleLine==true){i3geoOL.addControl(new OpenLayers.Control.ScaleLine())}if(i3GEO.Interface.openlayers.GADGETS.OverviewMap==true){i3geoOL.addControl(new OpenLayers.Control.OverviewMap())}i3geoOL.addControl(new OpenLayers.Control.KeyboardDefaults());i3GEO.eventos.ativa($i("openlayers"));pos=i3GEO.util.pegaPosicaoObjeto($i("openlayers"));if($i("aguarde")){$top("aguarde",pos[1]);$left("aguarde",pos[0])}OLpan=new OpenLayers.Control.Navigation();OLzoom=new OpenLayers.Control.ZoomBox();OLpanel=new OpenLayers.Control.Panel();OLpanel.addControls([OLpan,OLzoom]);i3geoOL.addControl(OLpanel);i3GEO.Interface.openlayers.ativaBotoes()};i3GEO.php.openlayers(montaMapa);i3GEO.gadgets.mostraMenuSuspenso();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.idioma.mostraSeletor();i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica()},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},recalcPar:function(){g_operacao="";g_tipoacao="";var bounds=i3geoOL.getExtent().toBBOX().split(",");i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];i3GEO.parametros.mapscale=i3geoOL.getScale();atualizaEscalaNumerica(parseInt(i3GEO.parametros.mapscale,10))},zoom2ext:function(ext){var m,b;m=ext.split(" ");b=new OpenLayers.Bounds(m[0],m[1],m[2],m[3]);i3geoOL.zoomToExtent(b)}},googlemaps:{OPACIDADE:0.8,TIPOMAPA:"G_PHYSICAL_MAP",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],redesenha:function(){try{if(i3GeoMap!==""){posfixo=posfixo+"&";i3GeoMap.removeOverlay(i3GEOTileO);var i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile()+posfixo,isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO)}}catch(e){}},cria:function(w,h){var i,f,ins;posfixo="&";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");f.style.width=w;f.style.height=h}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv"},inicia:function(){var pos,myMapType,pol,ret,pt1,pt2,bottomLeft,bottomRight,sw,ne,z,i3GEOTile;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;i3GeoMap=new GMap2($i(i3GEO.Interface.IDMAPA));i3GeoMap.addMapType(G_PHYSICAL_MAP);if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_SATELLITE_MAP"){i3GeoMap.setMapType(G_SATELLITE_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_PHYSICAL_MAP"){i3GeoMap.setMapType(G_PHYSICAL_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_HYBRID_MAP"){i3GeoMap.setMapType(G_HYBRID_MAP)}i3GeoMap.addControl(new GLargeMapControl());i3GeoMap.addControl(new GMapTypeControl());bottomLeft=new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0,40));i3GeoMap.addControl(new GScaleControl(),bottomLeft);bottomRight=new GControlPosition(G_ANCHOR_BOTTOM_RIGHT);i3GeoMap.addControl(new GOverviewMapControl(),bottomRight);sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z);i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile(),isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO);myMapType=new GMapType([i3GEOTile],new GMercatorProjection(18),'i3Geo');i3GeoMap.addMapType(myMapType);GEvent.addListener(i3GeoMap,"dragstart",function(){g_operacao="";g_tipoacao=""});GEvent.addListener(i3GeoMap,"dragend",function(){i3GEO.Interface.googlemaps.recalcPar()});GEvent.addListener(i3GeoMap,"zoomend",function(){i3GEO.Interface.googlemaps.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googlemaps.ativaBotoes();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraMenuSuspenso();i3GEO.gadgets.mostraInserirKml();pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA));GEvent.addListener(i3GeoMap,"mousemove",function(ponto){var teladms,tela;teladms=i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());tela=i3GeoMap.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]}});g_operacao="";g_tipoacao="";if(i3GEO.parametros.kmlurl!==""){i3GEO.mapa.insereKml(true,i3GEO.parametros.kmlurl)}i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala();i3GEO.Interface.googlemaps.adicionaListaKml()},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)},criaWMS:function(){var cgi,parametros;cgi=i3GEO.configura.locaplic+"/classesphp/parse_cgi.php?g_sid="+i3GEO.configura.sid;parametros="&map_size="+parseInt($i(i3GEO.Interface.IDMAPA).style.width,10);parametros+=","+parseInt($i(i3GEO.Interface.IDMAPA).style.height,10);parametros+="&mapext="+i3GEO.Interface.googlemaps.bbox();parametros+="&map_imagecolor=-1 -1 -1&map_transparent=on";return(cgi+parametros)},criaTile:function(){var cgi,parametros;cgi=i3GEO.util.protocolo()+"://"+window.location.host+i3GEO.parametros.cgi+"?";parametros="map="+i3GEO.parametros.mapfile;parametros+='&mode=tile';parametros+='&tilemode=gmap';parametros+='&tile={X}+{Y}+{Z}';parametros+='&map_imagetype='+i3GEO.Interface.OUTPUTFORMAT;return(cgi+parametros)},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+70;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},mudaOpacidade:function(valor){i3GEO.Interface.googlemaps.OPACIDADE=valor/200;i3GEO.Interface.googlemaps.redesenha()},recalcPar:function(){var bounds,sw,ne;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getBounds();sw=bounds.getSouthWest();ne=bounds.getNorthEast();i3GEO.parametros.mapexten=sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala()},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 pol,ret,pt1,pt2,sw,ne,z;pol=mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z)},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;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(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);zoom=function(){if(pan){eval("var ll = "+ngeoxml+".getDefaultCenter()");eval(ngeoxml+".gotoDefaultViewport(i3GeoMap)")}};eval(ngeoxml+" = new GGeoXml(url,zoom)");if(ativo===true){eval("i3GeoMap.addOverlay("+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 root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googlemaps.ARVORE.getRoot();node=i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="<table><tr><td><b>Google Maps</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},ativaDesativaCamadaKml:function(obj){if(!obj.checked){eval("i3GeoMap.removeOverlay("+obj.value+")")}else{eval("i3GeoMap.addOverlay("+obj.value+")")}}},googleearth:{GADGETS:{setMouseNavigationEnabled:true,setStatusBarVisibility:true,setOverviewMapVisibility:true,setScaleLegendVisibility:true,setAtmosphereVisibility:true,setGridVisibility:false,getSun:false,LAYER_BORDERS:true,LAYER_BUILDINGS:false,LAYER_ROADS:false,LAYER_TERRAIN:true},POSICAOTELA:[0,0],aguarde:"",redesenha:function(){try{if(linki3geo!==undefined){linki3geo.setHref(linki3geo.getHref()+"&")}}catch(e){}},cria:function(w,h){var i,i3GeoMap3d,i3GeoMap,texto;i3GEO.configura.listaDePropriedadesDoMapa={"propriedades":[]};texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setMouseNavigationEnabled(this.checked)'";texto+="> "+$trad("ge1");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setStatusBarVisibility(this.checked)'";texto+="> "+$trad("ge2");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setOverviewMapVisibility(this.checked)'";texto+="> "+$trad("ge3");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setScaleLegendVisibility(this.checked)'";texto+="> "+$trad("ge4");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setAtmosphereVisibility(this.checked)'";texto+="> "+$trad("ge5");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setGridVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setGridVisibility(this.checked)'";texto+="> "+$trad("ge6");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.getSun==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getSun().setVisibility(this.checked)'";texto+="> "+$trad("ge7");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BORDERS, this.checked)'";texto+="> "+$trad("ge8");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BUILDINGS, this.checked)'";texto+="> "+$trad("ge9");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_ROADS, this.checked)'";texto+="> "+$trad("ge10");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_TERRAIN, this.checked)'";texto+="> "+$trad("ge11");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});i=$i(i3GEO.Interface.IDCORPO);if(i){i3GeoMap3d=document.createElement("div");i3GeoMap3d.style.width=w;i3GeoMap3d.style.height=h+45;i.style.height=h+45;i3GeoMap3d.id="i3GeoMap3d";i.appendChild(i3GeoMap3d)}i3GEO.Interface.IDMAPA="i3GeoMap3d";google.load("earth","1");i3GeoMap=null},inicia:function(){google.earth.createInstance("i3GeoMap3d",i3GEO.Interface.googleearth.iniciaGE,i3GEO.Interface.googleearth.falha)},iniciaGE:function(object){i3GeoMap=object;i3GeoMap.getWindow().setVisibility(true);kmlUrl=i3GEO.configura.locaplic+"/pacotes/kmlmapserver/kmlservice.php?map="+i3GEO.parametros.mapfile+"&typename=estadosl&request=kml&mode=map&";linki3geo=i3GeoMap.createLink('');linki3geo.setHref(kmlUrl);nl=i3GeoMap.createNetworkLink('');nl.setLink(linki3geo);nl.setFlyToView(true);i3GeoMap.getFeatures().appendChild(nl);var options=i3GeoMap.getOptions(),layerRoot=i3GeoMap.getLayerRoot(),evento=function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""};options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled);options.setStatusBarVisibility(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility);options.setOverviewMapVisibility(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility);options.setScaleLegendVisibility(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility);options.setAtmosphereVisibility(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility);options.setGridVisibility(i3GEO.Interface.googleearth.GADGETS.setGridVisibility);layerRoot.enableLayerById(i3GeoMap.LAYER_BORDERS,i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS);layerRoot.enableLayerById(i3GeoMap.LAYER_BUILDINGS,i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS);layerRoot.enableLayerById(i3GeoMap.LAYER_ROADS,i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS);layerRoot.enableLayerById(i3GeoMap.LAYER_TERRAIN,i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN);i3GeoMap.getSun().setVisibility(i3GEO.Interface.googleearth.GADGETS.getSun);i3GeoMap.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW);google.earth.addEventListener(i3GeoMap.getView(),"viewchangeend",function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googleearth.POSICAOTELA=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO));google.earth.addEventListener(i3GeoMap.getGlobe(),'mousemove',function(event){objposicaocursor={ddx:event.getLongitude(),ddy:event.getLatitude(),dmsx:0,dmsy:0,imgx:event.getClientX(),imgy:event.getClientY(),telax:event.getClientX()+i3GEO.Interface.googleearth.POSICAOTELA[0],telay:event.getClientY()+i3GEO.Interface.googleearth.POSICAOTELA[1]};i3GEO.eventos.mousemoveMapa()});google.earth.addEventListener(i3GeoMap.getGlobe(),'click',function(event){if(i3GEO.Interface.googleearth.aguarde.visibility==="hidden"){i3GEO.eventos.mousecliqueMapa()}else{i3GEO.Interface.googleearth.aguarde.visibility="hidden"}});i3GEO.Interface.googleearth.ativaBotoes();i3GEO.gadgets.mostraInserirKml("inserirKml");i3GEO.Interface.googleearth.adicionaListaKml()},recalcPar:function(){var bounds;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getView().getViewportGlobeBounds();i3GEO.parametros.mapexten=bounds.getWest()+" "+bounds.getSouth()+" "+bounds.getEast()+" "+bounds.getNorth()},falha:function(){alert("Falhou. Vc precisa do plugin instalado")},ativaBotoes:function(){var cabecalho=function(){};var minimiza=function(){i3GEO.janela.minimiza("i3GEOF.ferramentasGE")};var janela=i3GEO.janela.cria("200px","70px","","","","Ferramentas","i3GEOF.ferramentasGE",false,"hd",cabecalho,minimiza);i3GEO.barraDeBotoes.TEMPLATEBOTAO='<div style="display:inline;background-color:rgb(250,250,250);"><img src="'+i3GEO.configura.locaplic+'/imagens/branco.gif" id="$$"/></div> ';i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id);i3GEO.barraDeBotoes.ativaBotoes();i3GEO.Interface.googleearth.aguarde=$i("i3GEOF.ferramentasGE_imagemCabecalho").style},balao:function(texto,ddx,ddy){var placemark=i3GeoMap.createPlacemark('');var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);var b=i3GeoMap.createHtmlStringBalloon('');b.setContentString("<div style=text-align:left >"+texto+"</div>");b.setFeature(placemark);i3GeoMap.setBalloon(b);i3GEO.Interface.googleearth.aguarde.visibility="hidden"},insereMarca:function(texto,ddx,ddy,name){var placemark=i3GeoMap.createPlacemark('');placemark.setName(name);var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);if(texto!=""){placemark.setDescription(texto)}i3GeoMap.getFeatures().appendChild(placemark)},removePlacemark:function(nome){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getName()==nome){features.getChildNodes().item(i).setVisibility(false)}}catch(e){}}},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=false}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);linki3geokml=i3GeoMap.createLink('');linki3geokml.setHref(url);eval(ngeoxml+" = i3GeoMap.createNetworkLink('')");eval(ngeoxml+".setLink(linki3geokml)");i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googleearth.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googleearth.ARVORE.getRoot();node=i3GEO.Interface.googleearth.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googleearth.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googleearth.ARVORE.draw();i3GEO.Interface.googleearth.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googleearth.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googleearth.ARVORE.getRoot();titulo="<table><tr><td><b>Google Earth Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},existeLink:function(url){var existe=false,features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){existe=true}}catch(e){}}return(existe)},ativaDesativaLink:function(url,valor){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){features.getChildNodes().item(i).setVisibility(valor)}}catch(e){}}},ativaDesativaCamadaKml:function(obj){var url=eval(obj.value+".getLink().getHref()");var existe=i3GEO.Interface.googleearth.existeLink(url);if(!obj.checked){{i3GEO.Interface.googleearth.ativaDesativaLink(url,false)}}else{if(existe==false){eval("i3GeoMap.getFeatures().appendChild("+obj.value+")")}else{i3GEO.Interface.googleearth.ativaDesativaLink(url,true)}}}}};i3GEO.interface=i3GEO.Interface; | |
3 | 3 | \ No newline at end of file | ... | ... |
classesjs/i3geo_tudo_compacto.js
... | ... | @@ -147,7 +147,7 @@ if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.configura={grupoLayers:"",oMenuDa |
147 | 147 | function i3GEOmantemCompatibilidade(){try{i3GEO.configura.oMenuData=oMenuData}catch(e){}try{i3GEO.configura.tipoimagem=g_tipoimagem}catch(e){}try{i3GEO.configura.tipotip=g_tipotip}catch(e){}try{i3GEO.configura.funcaoTip=g_funcaoTip}catch(e){}try{i3GEO.configura.map3d=g_3dmap}catch(e){}try{i3GEO.configura.embedLegenda=g_embedLegenda}catch(e){}try{i3GEO.configura.templateLegenda=g_templateLegenda}catch(e){}try{if(objmapa.finaliza!="")i3GEO.finaliza=objmapa.finaliza}catch(e){};g_arvoreClick="";g_arvoreClicks="";if($i("longlat")){atualizalonglat=function(){$i("longlat").innerHTML=objposicaocursor.dmsx+" "+objposicaocursor.dmsy};YAHOO.util.Event.addListener($i("img"),"mousemove",atualizalonglat)}try{if(g_opcoesTemas=="nao"){i3GEO.arvoreDeCamadas.OPCOESTEMAS=false}}catch(e){};try{i3GEO.maparef.fatorZoomDinamico=g_zoomRefDinamico}catch(e){};try{i3GEO.configura.mashuppar=g_mashuppar}catch(e){};try{if(!$i("arvoreAdicionaTema")){i3GEO.arvoreDeTemas.IDHTML=objmapa.guiaMenu+"obj"}else{i3GEO.arvoreDeTemas.IDHTML="arvoreAdicionaTema"}}catch(e){};try{if(g_uploaddbf=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.uploaddbf=false}}catch(e){};try{if(g_uploadlocal=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.uploadlocal=false}}catch(e){};try{if(g_downloadbase=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.downloadbase=false}}catch(e){};try{if(g_conectarwms=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.conectarwms=false}}catch(e){};try{if(g_conectargeorss=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.conectargeorss=false}}catch(e){};try{if(g_nuvemTags=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.nuvemTags=false}}catch(e){};try{if(g_kml=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.kml=false}}catch(e){};try{if(g_qrcode=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.qrcode=false}}catch(e){};try{if(g_tipoacao!=""){i3GEO.barraDeBotoes.BOTAOPADRAO=g_tipoacao}}catch(e){}try{if(g_listaPropriedades){i3GEO.configura.listaDePropriedadesDoMapa=g_listaPropriedades}}catch(e){};try{if(g_tempo_aplicar){i3GEO.configura.tempoAplicar=g_tempo_aplicar}}catch(e){};try{if(g_janelaMen=="nao"){i3GEO.configura.iniciaJanelaMensagens=false}}catch(e){};try{if(g_locaplic){i3GEO.configura.locaplic=g_locaplic}}catch(e){};try{if(g_tempotip){i3GEO.configura.tempoMouseParado=g_tempotip}}catch(e){};try{if(g_mostraRosa){i3GEO.configura.mostraRosaDosVentos=g_mostraRosa}}catch(e){};try{if(g_visual){i3GEO.configura.visual=g_visual}}catch(e){};try{if(g_mapaRefDisplay){i3GEO.configura.mapaRefDisplay=g_mapaRefDisplay}}catch(e){};try{if(g_docaguias){i3GEO.configura.liberaGuias=g_docaguias}}catch(e){};if(window.location.href.split("?")[1]){g_sid=window.location.href.split("?")[1];if(g_sid.split("#")[0]){g_sid=g_sid.split("#")[0]}}else{g_sid=""}i3GEO.configura.sid=g_sid;try{i3GEO.guias.ATUAL=g_guiaativa}catch(e){}try{i3GEO.navega.autoRedesenho.INTERVALO=g_autoRedesenho}catch(e){}try{i3GEO.eventos.NAVEGAMAPA=g_funcoesNavegaMapaDefault}catch(e){}try{i3GEO.eventos.MOUSEMOVE=g_funcoesMousemoveMapaDefault}catch(e){}try{i3GEO.eventos.MOUSECLIQUE=g_funcoesClickMapaDefault}catch(e){}try{i3GEO.configura.entorno=g_entorno}catch(e){}try{i3GEO.navega.lente.POSICAOX=g_posicaoLenteX=0}catch(e){}try{i3GEO.navega.lente.POSICAOY=g_posicaoLenteY}catch(e){}try{i3GEO.navega.destacaTema.TAMANHO=destacaTamanho}catch(e){}if(!$i("tip")){var novoel=document.createElement("div");novoel.id="tip";novoel.style.position="absolute";novoel.style.zIndex=5000;if(navm){novoel.style.filter="alpha(opacity=90)"}document.body.appendChild(novoel)}try{objmapa.atualizaListaTemas=function(temas){alert("atualizaListaTemas foi depreciado. Utilize i3GEO.arvoreDeCamadas")}}catch(e){}}if(typeof(i3GEO)=='undefined'){i3GEO=[]}cpObj=new cpaint();cpObj.set_async("true");cpObj.set_response_type("JSON");function Mapa(e,m){i3GEO.cria();this.inicializa=function(){i3GEO.finaliza=this.finaliza;i3GEO.inicia()}}objaguarde={abre:function(){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"))},fecha:function(){i3GEO.janela.fechaAguarde("i3GEO.atualiza")}};function iCookie(nome,valor){i3GEO.util.insereCookie(nome,valor)}function pCookie(nome){i3GEO.util.pegaCookie(nome)}function trocalingua(l){i3GEO.idioma.trocaIdioma(l);alert("trocalingua foi depreciado utilize i3GEO.idioma")}function initJanelaMen(){i3GEO.ajuda.abreJanela();alert("initJanelaMen foi depreciado utilize i3GEO.ajuda")}function pegalistademenus(retorno){alert("Funcao pegalistademenus foi depreciado. Utilize i3GEO.arvoreDeTemas")}function wdocaf(wlargura,waltura,wsrc,nx,ny,texto){var janela=i3GEO.janela.cria(wlargura,waltura,wsrc,nx,ny,texto)}function redimwdocaf(w,h){i3GEO.janela.alteraTamanho(w,h);alert("redimwdocaf foi depreciado utilize i3GEO.janela")}function wdocaf2(wlargura,waltura,wsrc,nx,ny,texto){var id=YAHOO.util.Dom.generateId();i3GEO.janela.cria(wlargura,waltura,wsrc,nx,ny,texto,id,true)}function wdocafechaf(odoca){alert("wdocafechaf foi depreciado")}function mostradicasf(objeto,dica,hlpt){i3GEO.ajuda.mostraJanela(dica);alert("mostradicasf foi depreciado utilize i3GEO.ajuda")}function mudaboxnf(tipo,obj,nomeFuncao){alert("mudaboxnf foi depreciado")}function procurartemas(texto){alert("procurartemas foi depreciado")}function expandeTema(itemID){var tema=itemID.split("legenda");if(tema.length==2){g_arvoreClick=itemID;tema=tema[1];var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=criaLegendaHTML&template=legenda2.htm&tema="+tema+"&g_sid="+g_sid;cpObj.call(p,"criaLegenda",expandeLegendaVer)}alert("expandeTema foi depreciado")}function pegavalSistemas(sis){alert("Funcao pegavalSistemas foi depreciada - veja i3GEO.arvoreDeTemas")}function processevent1(exy1){}function removeAcentos(palavra){return(i3GEO.util.removeAcentos(palavra));alert("removeAcentos foi depreciado utilize i3GEO.util")}function ativaMensagemBanner(){alert("ativaMensagemBanner fooi depreciado utilize i3GEO.ajuda")}function mensagemBanner(){}function mensagemf(m){alert("mensagemf foi depreciado");try{if(!$i("mensagem")){var novoel=document.createElement("div");novoel.id='mensagem';novoel.innerHTML='<table width="50" style="border: 1px solid #000000;"> <tr> <td onclick="mensagemf()" style="text-align:left;cursor:pointer" class="tdclara"> <img src="'+g_locaplic+'/imagens/excluir.png" /> </td> <td style="text-align:left" class="tdclara"> <input style="text-align:left" class="textocb" type="text" id="mensagemt" size="70" value="" /> </td></tr> </table>';if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}}if(m==null){$i("mensagem").style.visibility="hidden"}else{$i("mensagemt").value=m;$i("mensagem").style.visibility="visible"}var pos=pegaPosicaoObjeto($i("img"));pos[1]=pos[1]+parseInt($i("img").style.height)-22;eval('document.getElementById("mensagem").style.'+g_tipoleft+' = pos[0] + g_postpx');eval('document.getElementById("mensagem").style.'+g_tipotop+' = pos[1] + g_postpx')}catch(e){alert("Impossivel criar mensagem."+e)}}function aguarde(){alert("aguarde foi depreciado utilize i3GEO.janela");this.abre=function(aguardeId,texto){i3GEO.janela.abreAguarde(aguardeId,texto)};this.fecha=function(aguardeId){i3GEO.janela.fechaAguarde(aguardeId)}}function zoomiauto(){alert("zoomiauto foi depreciado utilize i3GEO.navega");i3GEO.navega.zoomin(g_locaplic,g_sid)}function zoomoauto(){alert("zoomoauto foi depreciado utilize i3GEO.navega");i3GEO.navega.zoomout(g_locaplic,g_sid)}function convdmsddf(cd,cm,cs){alert("convdmsddf foi depreciado utilize i3GEO.calculo");return(i3GEO.calculo.dsm2dd(cd,cm,cs))}function zoomPonto(){alert("utilize i3GEO.navega.zoomponto")}function zoomIP(){alert("zoomIP foi depreciado. Utilize i3GEO.navega.zoomIP")}function zoomtot(){alert("zoomtot foi depreciado. Utilize i3GEO.navega.zoomExt")}function panFixo(direcao,w,h,escala){alert("panFixo foi depreciado. Utilize i3GEO.navega.panFixo")}function protocolo(){alert("protocolo foi depreciado utilize i3GEO.util");return(i3GEO.util.protocolo())}function borra(){}function pegaPosicaoObjeto(obj){alert("pegaPosicaoObjeto foi depreciado utilize i3GEO.util");return(i3GEO.util.pegaPosicaoObjeto(obj))}function i3geo_pegaElementoPai(e){alert("i3geo_pegaElementoPai foi depreciado utilize i3GEO.util");return(i3GEO.util.pegaElementoPai(e))}function convddtela(vx,vy,docmapa){alert("convddtela foi depreciado utilize i3GEO.calculo");return(i3GEO.calculo.dd2tela(vx,vy,docmapa,i3GEO.parametros.extent,i3GEO.parametros.pixelsize))}function convdmsf(x,y){alert("convdmsf foi depreciado utilize i3GEO.calculo");return(i3GEO.calculo.dd2dms(x,y))}function calcddf(xfign,yfign,g_celula,imgext){alert("calcddf foi depreciado utilize i3GEO.calculo");return(i3GEO.calculo.tela2dd(xfign,yfign,g_celula,imgext))}function movecursor(){if($i("obj")){if($i("openlayers")||$i("flamingo")){$i("obj").style.display="none"}else{var obje=$i("obj").style;if($i("img")){eval("obje."+g_tipotop+"= objposicaocursor.telay + 9 + g_postpx");eval("obje."+g_tipoleft+"= objposicaocursor.telax + 9 + g_postpx")}else{eval("obje."+g_tipotop+"= objposicaocursor.telay - 15 + g_postpx");eval("obje."+g_tipoleft+"= objposicaocursor.telax + 15 + g_postpx")}}}if($i("box1")){var bx=$i("box1");if(bx.style.visibility!="visible"){bx.style.left=objposicaocursor.telax+g_postpx;bx.style.top=objposicaocursor.telay+g_postpx}}}function pegaCoordenadaUTM(){alert("pegaCoordenadaUTM foi depreciado utilize i3GEO.gadgets");i3GEO.gadgets.mostraCoordenadasUTM(g_locaplic,"mostraUTM")}function ativaLocalizarxy(iddiv){alert("ativaLocalizarxy foi depreciado utilize i3GEO.gadgets");i3GEO.gadgets.mostraCoordenadasGEO(iddiv)}function ativaEscalaNumerica(iddiv){alert("ativaEscalaNumerica foi depreciado utilize i3GEO.gadgets");i3GEO.gadgets.mostraEscalaNumerica(iddiv)}function ativaBuscaRapida(iddiv){alert("ativaBuscaRapida foi depreciado utilize i3GEO.gadgets");i3GEO.gadgets.mostraBuscaRapida(iddiv)}function buscaRapida(){i3geo_buscarapida()}function criaboxg(){i3GEO.util.criaBox();i3GEO.util.criaPin();alert("criaboxg foi depreciado utilize i3GEO.util")}function initJanelaZoom(qual){i3GEO.barraDeBotoes.reativa(qual-1)}function sobeferramentas(){}function desceferramentas(){}function mostraRosaDosVentos(){alert("mostraRosaDosVentos foi depreciado utilize i3GEO.navega");i3GEO.navega.mostraRosaDosVentos()}function mudaVisual(visual){alert("visual foi depreciado utilize i3GEO.visual");i3GEO.gadgets.visual.troca(visual)}function visual(iddiv){alert("visual foi depreciado utilize i3GEO.visual");i3GEO.gadgets.visual.inicia(iddiv)}function arvoreclick(itemID){if(itemID.search("tema")==0){if($i(itemID).checked==true){$i(itemID).checked=false}else{$i(itemID).checked=true}}}function pegaTema(celula){var nos=celula.parentNode.childNodes;var tempi=nos.length;for(var no=0;no<tempi;no++){if(nos[no].type=="checkbox"){return nos[no].value}}}function gerafilmef(qs){}function gravaQuadro(variavel,valor){i3GEO.gadgets.quadros.grava(variavel,valor)}function avancaQuadro(){i3GEO.gadgets.quadros.avanca()}function zoomAnterior(){}function zoomProximo(){}function opcoesQuadros(){}function filmef(o){}function rebobinaf(){}function filmezf(o){}function quadrofilme(){}function filmeanimaf(){}function filmeanimarodaf(janima){}function pegaimagens(){}function calculaArea(pontos,pixel){return(i3GEO.calculo.area(pontos,pixel))}function calculadistancia(lga,lta,lgb,ltb){return(i3GEO.calculo.distancia(lga,lta,lgb,ltb))}function initJanelaRef(){i3GEO.maparef.inicia()}function ajaxReferencia(retorno){i3GEO.maparef.processaImagem(retorno)}function clicouRef(){}function movimentoRef(obj){}function mostraTip(retorno){if(!$i("tip")){var novoel=document.createElement("div");novoel.id="tip";novoel.style.position="absolute";novoel.style.zIndex=5000;if(navm){novoel.style.filter="alpha(opacity=90)"}document.body.appendChild(novoel)}var i=$i("i3geo_rosa");if(i)i.style.display="none";var mostra=false;var retorno=retorno.data;if((retorno!="erro")&&(retorno!=undefined)){if($i("img")){$i("img").title=""}if(retorno!=""){var res="<div id='cabecatip' style='text-align:left;background-color:rgb(240,240,240)'><span style='color:navy;cursor:pointer;text-align:left' onclick='javascript:objmapaparado=\"cancela\"'>parar </span>";res+="<span style='color:navy;cursor:pointer;text-align:left' onclick='javascript:i3GEO.janela.TIPS.push($i(\"tip\"));$i(\"tip\").id=\"\";$i(\"cabecatip\").innerHTML =\"\";$i(\"cabecatip\").id =\"\"' >fixar</span></div>";var temas=retorno.split("!");var tema=temas.length-1;if(tema>=0){do{var titulo=temas[tema].split("@");if(g_tipotip=="completo"){res+="<span style='text-align:left;font-size:9pt'><b>"+titulo[0]+"</b></span><br>"}var ocorrencias=titulo[1].split("*");var ocorrencia=ocorrencias.length-1;if(ocorrencia>=0){do{if(ocorrencias[ocorrencia]!=""){var pares=ocorrencias[ocorrencia].split("##");var paresi=pares.length;for(var par=0;par<paresi;par++){var valores=pares[par].split("#");if(g_tipotip=="completo"){res=res+"<span class='tiptexto' style='text-align:left;font-size:9pt'>"+valores[0]+" <i>"+valores[1]+"</i></span><br>";var mostra=true}else{res=res+"<span class='tiptexto' style='text-align:left;font-size:9pt'><i>"+valores[1]+"</i></span><br>";var mostra=true}}}}while(ocorrencia--)}}while(tema--)}if(!mostra){$i("tip").style.display="none";return}if($i("janelaMen")){$i("janelaMenTexto").innerHTML=res}else{var i=$i("tip");i.innerHTML="<table style='text-align:left'><tr><td style='text-align:left'>"+res+"</td></tr></table>";ist=i.style;ist.top=objposicaocursor.telay-10;ist.left=objposicaocursor.telax-20;ist.display="block"}}}}function trataErro(){i3GEO.janela.fechaAguarde()}function mostraguiaf(guia){i3GEO.guias.mostra(guia)}function ativaGuias(){for(var g=0;g<12;g++){if($i("guia"+g))var gpai=$i("guia"+g).parentNode}if(gpai){gpai.id="guiasYUI";gpai.className="yui-navset";var ins='<ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">';try{if($i(objmapa.guiaTemas)){$i(objmapa.guiaTemas).innerHTML=$trad("g1")}if($i(objmapa.guiaMenu)){$i(objmapa.guiaMenu).innerHTML=$trad("g2")}if($i(objmapa.guiaLegenda)){$i(objmapa.guiaLegenda).innerHTML=$trad("g3")}if($i(objmapa.guiaListaMapas)){$i(objmapa.guiaListaMapas).innerHTML=$trad("g4")}}catch(e){};for(var g=0;g<12;g++){if($i("guia"+g)){var tituloguia=$i("guia"+g).innerHTML;var re=new RegExp(" ","g");var tituloguia=tituloguia.replace(re,'');ins+='<li><a href="#"><em><div id="guia'+g+'" >'+tituloguia+'</div></em></a></li>'}}ins+="</ul>";gpai.innerHTML=ins;for(var g=0;g<12;g++){if($i("guia"+g)){eval('$i("guia'+g+'").onclick = function(){g_guiaativa = "guia'+g+'";mostraguiaf('+g+');}');$i("guia"+g).onmouseover=function(){var bcg=this.parentNode.parentNode.style;var cor=bcg.background.split(" ")[0];if(cor!="white")bcg.background="#bfdaff"};$i("guia"+g).onmouseout=function(){var bcg=this.parentNode.parentNode.style;var cor=bcg.background.split(" ")[0];if(cor!="white")bcg.background="transparent"};if($i("guia"+g+"obj")){$i("guia"+g+"obj").style.overflow="auto";$i("guia"+g+"obj").style.height=i3GEO.parametros.h}}}}if($i(objmapa.guiaTemas)){$i(objmapa.guiaTemas).onclick=function(){g_guiaativa=objmapa.guiaTemas;mostraguiaf(1)}}if($i(objmapa.guiaMenu)){$i(objmapa.guiaMenu).onclick=function(){g_guiaativa=objmapa.guiaMenu;mostraguiaf(2);if(!$i("arvoreAdicionaTema")){var ondeArvore=objmapa.guiaMenu+"obj"}else{var ondeArvore="arvoreAdicionaTema"}if(document.getElementById("outrasOpcoesAdiciona")){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.idonde="outrasOpcoesAdiciona";i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluiArvore=false}i3GEO.arvoreDeTemas.cria(i3GEO.configura.sid,i3GEO.configura.locaplic,ondeArvore)}}if($i(objmapa.guiaLegenda)){$i(objmapa.guiaLegenda).onclick=function(){g_guiaativa=objmapa.guiaLegenda;mostraguiaf(4);objmapa.atualizaLegendaHTML()}}if($i(objmapa.guiaListaMapas)){$i(objmapa.guiaListaMapas).onclick=function(){g_guiaativa=objmapa.guiaListaMapas;mostraguiaf(5);if($i("banners")){$i("banners").innerHTML==$trad("o1");var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaMapas&g_sid="+i3GEO.configura.sid;cpObj.call(p,"pegaMapas",pegaMapas)}else{alert("id banners nao encontrado")}}}}function docaguias(){i3GEO.guias.libera()}function autoRedesenho(opcao){}function movePan(){alert("movePan foi depreciado")}function selecao(){}function cliqueSelecao(){}function zoomboxf(tipo){}function i3geo_comboGruposMenu(funcaoOnchange,idDestino,idCombo,largura,altura){}function i3geo_comboSubGruposMenu(funcaoOnchange,idDestino,idCombo,idGrupo,largura,altura){}function i3geo_comboTemasMenu(funcaoOnchange,idDestino,idCombo,idGrupo,idSubGrupo,largura,altura){}function remapaf(){i3GEO.atualiza("")}function limpacontainerf(){}function inseremarcaf(xi,yi,funcaoOnclick,container){i3GEO.utl.insereMarca.cria(xi,yi,funcaoOnclick,container)}function moveSelecaoPoli(){}function cliqueSelecaoPoli(){}function capturaposicao(e){alert("capturaposicao foi depreciado utilize i3GEO.eventos")}function ativaEntorno(){}function geraURLentorno(){}function ajustaEntorno(){}function lenteDeAumento(){alert("lenteDeAumento foi depreciado utilize i3GEO.navega.lente.ativaDesativa()")}function ajaxabrelente(retorno){}function movelentef(){}function destacaTema(tema){alert("destacaTema foi depreciado utilize i3GEO.navega")}function ajaxdestaca(){alert("ajaxdestaca foi depreciado, utilize i3GEO.navega")}function ativaClicks(docMapa){}function incluir(path){i3GEO.util.adicionaSHP(path)}function pontosdist(){this.xpt=[];this.ypt=[];this.dist=[];this.xtela=[];this.ytela=[];this.ximg=[];this.yimg=[];this.linhas=[]}function mudaiconf(i){i3GEO.barraDeBotoes.ativaIcone(i)}function calcposf(){i3GEO.mapa.ajustaPosicao()}function recuperamapa(){}function criaContainerRichdraw(){alert("criaContainerRichdraw foi depreciado utilize i3GEO.desenho")}function desenhoRichdraw(tipo,objeto,n){}function ajaxhttp(){try{var objhttp1=new XMLHttpRequest()}catch(ee){try{var objhttp1=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{var objhttp1=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){var objhttp1=false}}}return(objhttp1)}function ajaxexecAS(programa,funcao){var ohttp=ajaxhttp();ohttp.open("POST",programa,true);var retorno="";ohttp.onreadystatechange=function(){if(ohttp.readyState==4){retorno=ohttp.responseText;var reg=/Warning/gi;if(retorno.search(reg)!=-1){alert("OOps! Ocorreu um erro\n"+retorno);return}var reg=/erro/gi;if(retorno.search(reg)!=-1){alert("OOps! Ocorreu um erro\n"+retorno);return}if(funcao!="volta"){eval(funcao+'("'+retorno+'")')}}};ohttp.send(null)}function ajaxexec(programa,funcao){var objhttp=ajaxhttp();objhttp.open('GET',programa,false);objhttp.send(null);if(objhttp.status==200){if(funcao!="volta"){eval(funcao+'("'+objhttp.responseText+'")')}else{return objhttp.responseText}}}function ajaxLegendaHTML(retorno){}function ajaxLegendaImagem(retorno){}function mede(){}function cliqueMede(){}function moveMede(){}function area(){}function cliqueArea(){}function moveArea(){}function textofid(){}function inserexy(){}function cliqueInseretoponimo(){}function cliqueInserexy(){}function inseregrafico(){}function cliqueInseregrafico(){}function ativaHistoricoZoom(iddiv){}function ajaxhttp(){return i3GEO.util.ajaxhttp()}function ajaxCorpoMapa(retorno){i3GEO.mapa.corpo.veirifca(retorno)}function ajaxredesenha(retorno){i3GEO.atualiza(retorno)}function ajaxIniciaParametros(retorno){i3GEO.atualiza(retorno)}function montaMenuSuspenso(iddiv){i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.idhtml=iddiv;i3GEO.gadgets.mostraMenuSuspenso()} |
148 | 148 | if(typeof(i3GEO)=='undefined'){i3GEO=[]}i3GEO.calculo={dms2dd:function(cd,cm,cs){try{var sinal,spm,mpg,dd;sinal='positivo';if(cd<0){cd=cd*-1;sinal='negativo'}spm=cs/3600;mpg=cm/60;dd=(cd*1)+(mpg*1)+(spm*1);if(sinal=='negativo'){dd=dd*-1}return(dd)}catch(e){return(0)}},dd2tela:function(vx,vy,docmapa,ext,cellsize){try{var pos,latlng,xyn,dc,imgext,c,xy;if(i3GEO.Interface.ATUAL=="googlemaps"){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));latlng=new GLatLng(vy,vx);xyn=i3GeoMap.fromLatLngToContainerPixel(latlng);xy=[];return[(xyn.x)+pos[0],(xyn.y)+pos[1]]}if(i3GEO.Interface.ATUAL=="openlayers"){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xy=i3geoOL.getViewPortPxFromLonLat(new OpenLayers.LonLat(vx,vy));return[(xy.x)+pos[0],(xy.y)+pos[1]]}if(arguments.length==3){ext=i3GEO.parametros.mapexten;cellsize=i3GEO.parametros.pixelsize}if(arguments.length==4){cellsize=i3GEO.parametros.pixelsize}if(!docmapa){docmapa=window.document}dc=docmapa;pos=i3GEO.util.pegaPosicaoObjeto(dc);imgext=ext.split(" ");vx=(vx*1)-(imgext[0]*1);vy=(vy*-1)+(imgext[3]*1);c=cellsize*1;return[(vx/c)+pos[0],(vy/c)+pos[1]]}catch(e){return([])}},dd2dms:function(x,y){var restod,mx,sx,mm,restos,my,sy,s,dx,dy;dx=parseInt(x,10);if(dx>0){restod=x-dx}if(dx<0){restod=(x*-1)-(dx*-1)}if(restod!==0){mm=restod*60;mx=parseInt(restod*60,10);restos=mm-mx;if(restos!==0){s=restos*60;s=(s+"_").substring(0,5);sx=s}}else{mx="00";sx="00.00"}dy=parseInt(y,10);if(dy>0){restod=y-dy}if(dy<0){restod=(y*-1)-(dy*-1)}if(restod!==0){mm=restod*60;my=parseInt(restod*60,10);restos=mm-my;if(restos!==0){s=restos*60;s=(s+"_").substring(0,5);sy=s}}else{my="00";sy="00.00"}return[dx+" "+mx+" "+sx,dy+" "+my+" "+sy]},tela2dd:function(xfign,yfign,g_celula,imgext){try{var amext,longdd,latdd;if(navm){xfign=xfign-2.2;yfign=yfign-2.7}else{xfign=xfign-0.12;yfign=yfign-1.05}amext=imgext.split(" ");longdd=(amext[0]*1)+(g_celula*xfign);latdd=(amext[3]*1)-(g_celula*yfign);return[longdd,latdd]}catch(e){return(0)}},area:function(pontos,pixel){var $polygon_area,$i,$array_length;try{if(pontos.xpt.length>2){$array_length=pontos.xpt.length;pontos.xtela.push(pontos.xtela[0]);pontos.ytela.push(pontos.ytela[0]);pontos.xtela.push(pontos.xtela[0]);pontos.ytela.push(pontos.ytela[1]);$polygon_area=0;for($i=0;$i<=$array_length;$i++){$polygon_area+=((pontos.xtela[$i]*pontos.ytela[$i+1])-(pontos.ytela[$i]*pontos.xtela[$i+1]))}$polygon_area=Math.abs($polygon_area)/2}else{$polygon_area="Sao necessarios pelo menos tres pontos para o calculo"}return $polygon_area*pixel}catch(e){return(0)}},distancia:function(lon1,lat1,lon2,lat2){var dLat,dLon,a,c,d;dLat=((lat2-lat1))*Math.PI/180;dLon=((lon2-lon1))*Math.PI/180;a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(lat1*Math.PI/180)*Math.cos(lat2*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2);c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));d=6371*c;return d},direcao:function(lon1,lat1,lon2,lat2){var dLon,y,x,r;lat1=lat1*(Math.PI/180);lat2=lat2*(Math.PI/180);dLon=(lon2-lon1)*(Math.PI/180);y=Math.sin(dLon)*Math.cos(lat2);x=Math.cos(lat1)*Math.sin(lat2)-Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);r=Math.atan2(y,x);r=r*180/Math.PI;r=r+360;return r%360},destinoDD:function(lon,lat,d,direcao){var R,lat1,lon1,brng,lat2,lon2;R=6371;lat1=lat*(Math.PI/180);lon1=lon*(Math.PI/180);brng=direcao*(Math.PI/180);lat2=Math.asin(Math.sin(lat1)*Math.cos(d/R)+Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng));lon2=lon1+Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));lon2=(lon2+Math.PI)%(2*Math.PI)-Math.PI;if(isNaN(lat2)||isNaN(lon2)){return null}return[(lon2*180/Math.PI),(lat2*180/Math.PI)]},rect2ext:function(idrect,mapext,pixel){var bx,bxs,xfig,yfig,nx,ny,pix,piy,pos,amext,dx,dy,x1,y1,x2,y2;eval('pix = parseInt(document.getElementById("'+idrect+'").style.'+g_tipoleft+")");eval('piy = parseInt(document.getElementById("'+idrect+'").style.'+g_tipotop+")");if($i(idrect)){bx=$i(idrect);bxs=bx.style}else{alert("Box nao encontrado");return}pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xfig=pix+(parseInt(bxs.width,10))-pos[0];yfig=piy+(parseInt(bxs.height,10))-pos[1];amext=mapext.split(" ");dx=((amext[0]*-1)-(amext[2]*-1))/-1;dy=((amext[1]*1)-(amext[3]*1))/-1;if(dy<0){dy=dy*-1}nx=pixel*xfig;ny=pixel*yfig;x1=(amext[0]*1)+nx;y1=(amext[3]*1)-ny;xfig=pix-pos[0];yfig=piy-pos[1];if(dy<0){dy=dy*-1}nx=pixel*xfig;ny=pixel*yfig;x2=(amext[0]*1)+nx;y2=(amext[3]*1)-ny;return[x2+" "+y2+" "+x1+" "+y1,x1,y1,x2,y2]},ext2rect:function(idrect,mapext,boxext,pixel,documento){var rectbox,rectmap,xyMin,xyMax,w,h,tl,pos,t,l,d,box;rectbox=boxext.split(" ");rectmap=mapext.split(" ");xyMin=i3GEO.calculo.dd2tela(rectbox[0],rectbox[1],documento,boxext,pixel);xyMax=i3GEO.calculo.dd2tela(rectbox[2],rectbox[3],documento,boxext,pixel);w=xyMax[0]-xyMin[0];h=xyMin[1]-xyMax[1];tl=i3GEO.calculo.dd2tela(rectbox[0],rectbox[3],documento,mapext,pixel);pos=i3GEO.util.pegaPosicaoObjeto(documento);t=tl[1]-pos[1];l=tl[0]-pos[0];d="block";if($i(idrect)){box=$i(idrect);box.style.width=w;box.style.height=h;box.style.top=t+"px";box.style.left=l+"px";box.style.display=d}return[w,h,xyMax[1],xyMin[0]]}}; |
149 | 149 | if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.desenho={richdraw:"",criaContainerRichdraw:function(){pontosdistobj={xpt:[],ypt:[],dist:[],xtela:[],ytela:[],ximg:[],yimg:[],linhas:[]};if(i3GEO.Interface.ATUAL==="googleearth"){return}try{var divgeo,renderer;divgeo=i3GEO.desenho.criaDivContainer();divgeo.innerHTML="";try{renderer=new VMLRenderer();i3GEO.desenho.richdraw=new RichDrawEditor(divgeo,renderer)}catch(erro){renderer=new SVGRenderer();i3GEO.desenho.richdraw=new RichDrawEditor(divgeo,renderer)}i3GEO.desenho.richdraw.editCommand('fillcolor','red');i3GEO.desenho.richdraw.editCommand('linecolor','gray');i3GEO.desenho.richdraw.editCommand('linewidth','1px');i3GEO.desenho.richdraw.editCommand('mode','line');divgeo.style.display="block";i3GEO.eventos.ativa(divgeo)}catch(erro){alert("Erro ao tentar criar container richdraw")}},criaDivContainer:function(){if(!$i("divGeometriasTemp")){var pos,novoel,ne;pos=[0,0];pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));novoel=document.createElement("div");novoel.id="divGeometriasTemp";ne=novoel.style;ne.cursor="crosshair";ne.zIndex=0;ne.position="absolute";ne.width=i3GEO.parametros.w;ne.height=i3GEO.parametros.h;ne.border="1px solid black";ne.display="none";ne.top=pos[1];ne.left=pos[0];document.body.appendChild(novoel)}return($i("divGeometriasTemp"))},aplica:function(tipo,objeto,n,texto){var pos,r,elemento,elementos,dy,dx,w;if(i3GEO.desenho.richdraw&&$i(i3GEO.Interface.IDCORPO)){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if((tipo==="resizeLinha")||(tipo==="resizePoligono")&&navn){try{i3GEO.desenho.richdraw.renderer.resize(objeto,0,0,objposicaocursor.imgx,objposicaocursor.imgy)}catch(erro){}}if((tipo==="resizeLinha")&&navm){try{r=$i(i3GEO.desenho.richdraw.container.id);elemento=r.lastChild;if(elemento.innerHTML!==""){elementos=r.childNodes;if(elementos.length>3){elemento=elementos[elementos.length-3]}else{elemento=elementos[elementos.length-2]}}r.removeChild(elemento);dy=objposicaocursor.imgy;dx=objposicaocursor.imgx-(i3GEO.parametros.w/2);i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2)-1,pontosdistobj.yimg[n-1]-3,dx,dy-3)}catch(erro){}}if((tipo==="resizePoligono")&&navm){try{r=$i(i3GEO.desenho.richdraw.container.id);r.removeChild(r.lastChild);r.removeChild(r.lastChild);dy=objposicaocursor.imgy;dx=objposicaocursor.imgx-(i3GEO.parametros.w/2);i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2)-1,pontosdistobj.yimg[n-1]-3,dx,dy-3);i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[0])-(i3GEO.parametros.w/2)-1,pontosdistobj.yimg[0]-3,dx,dy-3)}catch(erro){}}if(tipo==="insereCirculo"){dx=Math.pow(((pontosdistobj.xtela[n])*1)-((pontosdistobj.xtela[n-1])*1),2);dy=Math.pow(((pontosdistobj.ytela[n])*1)-((pontosdistobj.ytela[n-1])*1),2);w=Math.sqrt(dx+dy);if(navn){try{i3GEO.desenho.richdraw.renderer.create('circ','','rgb(250,250,250)',i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n-1],pontosdistobj.yimg[n-1],w,w)}catch(erro){}}else{try{i3GEO.desenho.richdraw.renderer.create('circ','','rgb(250,250,250)',i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n-1]-w,pontosdistobj.yimg[n-1]-w,w*2,w*2)}catch(erro){}}}if(tipo==="insereTexto"){try{i3GEO.desenho.richdraw.renderer.create('text','','rgb(250,250,250)',i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n-1],pontosdistobj.yimg[n-1],"","",texto)}catch(erro){}}}}}; |
150 | -if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.Interface={OUTPUTFORMAT:"AGG_Q",BARRABOTOESTOP:12,BARRABOTOESLEFT:3,ATUAL:"padrao",IDCORPO:"corpoMapa",ATIVAMENUCONTEXTO:false,IDMAPA:"",redesenha:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.redesenha()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.redesenha()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.redesenha()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.redesenha()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.redesenha()}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.adicionaKml("foo")}},cria:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.cria(w,h)}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.cria(w,h)}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.cria(w,h)}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.cria(w,h)}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.cria(w,h)}},inicia:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.inicia()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.inicia()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.inicia()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.inicia()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.inicia()}},ativaBotoes:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.ativaBotoes()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.ativaBotoes()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.ativaBotoes()}},padrao:{TRANSICAO:false,redesenha:function(){var ndiv,i;if(!$i("img")){i3GEO.janela.fechaAguarde();return}$i("img").onload=function(){var imagem,temp;imagem=$i("img");imagem.onload="";i3GEO.gadgets.quadros.grava("imagem",i3GEO.parametros.mapimagem);i3GEO.gadgets.quadros.grava("extensao",i3GEO.parametros.mapexten);temp=function(retorno){eval(retorno.data);i3GEO.gadgets.quadros.grava("legenda",legimagem)};if(i3GEO.gadgets.quadros.geraLegenda===true){i3GEO.mapa.legendaIMAGEM.obtem(temp)}if(i3GEO.Interface.padrao.TRANSICAO===true){if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",50,5,true)}i3GEO.util.aparece("img",50,5)}else{if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",15,5,true)}i3GEO.util.aparece("img",5,5)}i3GEO.janela.fechaAguarde("ajaxCorpoMapa")};if(!$i("imgtemp")){ndiv=document.createElement("div");ndiv.id="imgtemp";ndiv.style.position="absolute";ndiv.style.border="1px solid blue";document.getElementById("corpoMapa").appendChild(ndiv)}if(g_tipoacao==="pan"&&i3GEO.barraDeBotoes.BOTAOCLICADO==="pan"){$i("imgtemp").style.left=parseInt($i("img").style.left,10);$i("imgtemp").style.top=parseInt($i("img").style.top,10);$i("imgtemp").style.width=i3GEO.parametros.w;$i("imgtemp").style.height=i3GEO.parametros.h}$i("imgtemp").style.backgroundImage='url("'+$i("img").src+'")';$i("imgtemp").style.display="block";i=$i("img");i.style.display="none";i.style.left=0;i.style.top=0;i.src=i3GEO.parametros.mapimagem},cria:function(){var ins="<input style='position:relative;top:0px;left:0px'' type=image src='' id='img' />",temp=$i(i3GEO.Interface.IDCORPO);if(temp){temp.innerHTML=ins}i3GEO.Interface.IDMAPA="img"},ativaMenuContexto:function(){var temp,oFieldContextMenuItemData,oFieldContextMenu,onFieldMenuRender;temp=$i("contexto_"+i3GEO.Interface.IDMAPA);if(temp){temp.parentNode.removeChild(temp)}oFieldContextMenuItemData=[{text:" <span class='container-close'></span>"},{text:"<img class='rosamais' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Aproxima</span>",onclick:{fn:i3GEO.navega.zoomin}},{text:"<img class='rosamenos' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Afasta</span>",onclick:{fn:i3GEO.navega.zoomout}},{text:"<img class='rosanorte' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Norte</span>",onclick:{fn:i3GEO.navega.panFixoNorte}},{text:"<img class='rosasul' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Sul</span>",onclick:{fn:i3GEO.navega.panFixoSul}},{text:"<img class='rosaleste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Leste</span>",onclick:{fn:i3GEO.navega.panFixoLeste}},{text:"<img class='rosaoeste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Oeste</span>",onclick:{fn:i3GEO.navega.panFixoOeste}},{text:"Captura",onclick:{fn:i3GEO.gadgets.quadros.listaImagens}}];oFieldContextMenu=new YAHOO.widget.ContextMenu("contexto_"+i3GEO.Interface.IDMAPA,{trigger:i3GEO.Interface.IDMAPA,itemdata:oFieldContextMenuItemData,lazyload:true});onFieldMenuRender=function(){var id="contexto_"+i3GEO.Interface.IDMAPA;if(id){$i(id).style.zIndex=50000}};oFieldContextMenu.subscribe("render",onFieldMenuRender)},inicia:function(){var elemento,i,estilo;if($i("contemImg")){elemento="contemImg"}else{elemento="img"}i3GEO.mapa.ajustaPosicao(elemento);i=$i("img");if(!i){return}i.style.width=i3GEO.parametros.w+"px";i.style.height=i3GEO.parametros.h+"px";estilo=$i(i3GEO.Interface.IDCORPO).style;estilo.width=i3GEO.parametros.w+"px";estilo.height=i3GEO.parametros.h+"px";estilo.clip='rect('+0+" "+(i3GEO.parametros.w)+" "+(i3GEO.parametros.h)+" "+0+')';objmapaparado="nao";i3GEO.gadgets.mostraMenuSuspenso();i3GEO.eventos.ativa(i);i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.gadgets.mostraEscalaGrafica();i3GEO.gadgets.visual.inicia();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.Interface.padrao.ativaBotoes();i3GEO.idioma.mostraSeletor();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){var imagemxy,x1,y1,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y1=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if(($i("barraDeBotoes1")&&$i("barraDeBotoes2"))||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+40}if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes1","i3geo_barra1",true,x1,y1)}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes();if(document.getElementById("botao3d")){if(i3GEO.configura.map3d===""){document.getElementById("botao3d").style.display="none"}}if(i3GEO.Interface.ATIVAMENUCONTEXTO){i3GEO.Interface.padrao.ativaMenuContexto()}if(i3GEO.configura.visual!=="default"){i3GEO.gadgets.visual.troca(i3GEO.configura.visual)}}},flamingo:{redesenha:function(){var w=parseInt($i("flamingo").style.width,10);if(w===i3GEO.parametros.w){$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)+1}else{$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)-1}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("flamingo");if(!f){ins='<div id=flamingo style="width:0px;height:0px;text-align:left;background-image:url(/"'+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg/")"></div>';i.innerHTML=ins}f=$i("flamingo");f.style.width=w;f.style.height=h;i3GEO.Interface.IDMAPA="flamingo"}},inicia:function(){var monta=function(retorno){$i("flamingo").style.height=i3GEO.parametros.h+45;childPopups=[];childPopupNr=0;var so=new SWFObject(i3GEO.configura.locaplic+"/pacotes/flamingo/flamingo/flamingo.swf?config="+retorno.data,"flamingoi","100%","100%","8","#eaeaea");so.addParam("wmode","transparent");so.write("flamingo")};i3GEO.php.flamingo(monta);i3GEO.eventos.ativa($i("flamingo"));i3GEO.maparef.atualiza();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){}},openlayers:{TILES:false,GADGETS:{PanZoomBar:true,LayerSwitcher:true,ScaleLine:true,OverviewMap:true},redesenha:function(){if($i("openlayers_OpenLayers_Container")){var a,b,c,no,divs1,n1,divs2,n2,imgs,nimg;no=$i("openlayers_OpenLayers_Container");divs1=no.getElementsByTagName("div");n1=divs1.length;for(a=0;a<n1;a++){divs2=divs1[a].getElementsByTagName("div");n2=divs2.length;for(b=0;b<n2;b++){imgs=divs2[b].getElementsByTagName("img");nimg=imgs.length;for(c=0;c<nimg;c++){imgs[c].src+="&x"}}}i3GEO.Interface.openlayers.recalcPar()}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("openlayers");if(!f){ins='<div id=openlayers style="width:0px;height:0px;text-align:left;background-image:url('+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg)"></div>';i.innerHTML=ins}f=$i("openlayers");f.style.width=w;f.style.height=h}i3GEO.Interface.IDMAPA="openlayers"},inicia:function(){var montaMapa=function(){var url,pz,pos;url=window.location.protocol+"//"+window.location.host+i3GEO.parametros.cgi+"?";url+="map="+i3GEO.parametros.mapfile+"&mode=map&SRS=epsg:4326&";i3geoOL=new OpenLayers.Map('openlayers',{controls:[]});if(i3GEO.Interface.openlayers.TILES===true){i3geoOLlayer=new OpenLayers.Layer.MapServer("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}else{i3geoOLlayer=new OpenLayers.Layer.MapServer.Untiled("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}i3geoOLlayer.setVisibility(true);i3geoOLlayer.transitionEffect="resize";i3geoOL.addLayer(i3geoOLlayer);i3geoOL.events.register("moveend",i3geoOL,function(e){i3GEO.Interface.openlayers.recalcPar();g_operacao="";g_tipoacao=""});i3geoOL.events.register("mousemove",i3geoOL,function(e){var p,lonlat,d,dc;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3geoOL.getLonLatFromPixel(p);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{objposicaocursor.ddx=lonlat.lon;objposicaocursor.ddy=lonlat.lat;objposicaocursor.telax=p.x;objposicaocursor.telay=p.y;objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];dc=$i("i3geo");if($i("openlayers_OpenLayers_Container")){dc=$i("openlayers_OpenLayers_Container")}while(dc.offsetParent){dc=dc.offsetParent;objposicaocursor.telax=objposicaocursor.telax+dc.offsetLeft;objposicaocursor.telay=objposicaocursor.telay+dc.offsetTop}}catch(e){}});i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);if(i3GEO.Interface.openlayers.GADGETS.PanZoomBar==true){pz=new OpenLayers.Control.PanZoomBar({numZoomLevels:5});i3geoOL.addControl(pz);pz.div.style.zIndex=5000}if(i3GEO.Interface.openlayers.GADGETS.LayerSwitcher==true){i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher())}if(i3GEO.Interface.openlayers.GADGETS.ScaleLine==true){i3geoOL.addControl(new OpenLayers.Control.ScaleLine())}if(i3GEO.Interface.openlayers.GADGETS.OverviewMap==true){i3geoOL.addControl(new OpenLayers.Control.OverviewMap())}i3geoOL.addControl(new OpenLayers.Control.KeyboardDefaults());i3GEO.eventos.ativa($i("openlayers"));pos=i3GEO.util.pegaPosicaoObjeto($i("openlayers"));if($i("aguarde")){$top("aguarde",pos[1]);$left("aguarde",pos[0])}OLpan=new OpenLayers.Control.Navigation();OLzoom=new OpenLayers.Control.ZoomBox();OLpanel=new OpenLayers.Control.Panel();OLpanel.addControls([OLpan,OLzoom]);i3geoOL.addControl(OLpanel);i3GEO.Interface.openlayers.ativaBotoes()};i3GEO.php.openlayers(montaMapa);i3GEO.gadgets.mostraMenuSuspenso();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.idioma.mostraSeletor();i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica()},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},recalcPar:function(){g_operacao="";g_tipoacao="";var bounds=i3geoOL.getExtent().toBBOX().split(",");i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];i3GEO.parametros.mapscale=i3geoOL.getScale();atualizaEscalaNumerica(parseInt(i3GEO.parametros.mapscale,10))},zoom2ext:function(ext){var m,b;m=ext.split(" ");b=new OpenLayers.Bounds(m[0],m[1],m[2],m[3]);i3geoOL.zoomToExtent(b)}},googlemaps:{OPACIDADE:0.8,TIPOMAPA:"G_PHYSICAL_MAP",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],redesenha:function(){try{if(i3GeoMap!==""){posfixo=posfixo+"&";i3GeoMap.removeOverlay(i3GEOTileO);var i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile()+posfixo,isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO)}}catch(e){}},cria:function(w,h){var i,f,ins;posfixo="&";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");f.style.width=w;f.style.height=h}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv"},inicia:function(){var pos,myMapType,pol,ret,pt1,pt2,bottomLeft,bottomRight,sw,ne,z,i3GEOTile;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;i3GeoMap=new GMap2($i(i3GEO.Interface.IDMAPA));i3GeoMap.addMapType(G_PHYSICAL_MAP);if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_SATELLITE_MAP"){i3GeoMap.setMapType(G_SATELLITE_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_PHYSICAL_MAP"){i3GeoMap.setMapType(G_PHYSICAL_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_HYBRID_MAP"){i3GeoMap.setMapType(G_HYBRID_MAP)}i3GeoMap.addControl(new GLargeMapControl());i3GeoMap.addControl(new GMapTypeControl());bottomLeft=new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0,40));i3GeoMap.addControl(new GScaleControl(),bottomLeft);bottomRight=new GControlPosition(G_ANCHOR_BOTTOM_RIGHT);i3GeoMap.addControl(new GOverviewMapControl(),bottomRight);sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z);i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile(),isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO);myMapType=new GMapType([i3GEOTile],new GMercatorProjection(18),'i3Geo');i3GeoMap.addMapType(myMapType);GEvent.addListener(i3GeoMap,"dragstart",function(){g_operacao="";g_tipoacao=""});GEvent.addListener(i3GeoMap,"dragend",function(){i3GEO.Interface.googlemaps.recalcPar()});GEvent.addListener(i3GeoMap,"zoomend",function(){i3GEO.Interface.googlemaps.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googlemaps.ativaBotoes();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraMenuSuspenso();i3GEO.gadgets.mostraInserirKml();pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA));GEvent.addListener(i3GeoMap,"mousemove",function(ponto){var teladms,tela;teladms=i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());tela=i3GeoMap.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]}});g_operacao="";g_tipoacao="";if(i3GEO.parametros.kmlurl!==""){i3GEO.mapa.insereKml(true,i3GEO.parametros.kmlurl)}i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala();i3GEO.Interface.googlemaps.adicionaListaKml()},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)},criaWMS:function(){var cgi,parametros;cgi=i3GEO.configura.locaplic+"/classesphp/parse_cgi.php?g_sid="+i3GEO.configura.sid;parametros="&map_size="+parseInt($i(i3GEO.Interface.IDMAPA).style.width,10);parametros+=","+parseInt($i(i3GEO.Interface.IDMAPA).style.height,10);parametros+="&mapext="+i3GEO.Interface.googlemaps.bbox();parametros+="&map_imagecolor=-1 -1 -1&map_transparent=on";return(cgi+parametros)},criaTile:function(){var cgi,parametros;cgi=i3GEO.util.protocolo()+"://"+window.location.host+i3GEO.parametros.cgi+"?";parametros="map="+i3GEO.parametros.mapfile;parametros+='&mode=tile';parametros+='&tilemode=gmap';parametros+='&tile={X}+{Y}+{Z}';parametros+='&map_imagetype='+i3GEO.Interface.OUTPUTFORMAT;return(cgi+parametros)},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+70;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},mudaOpacidade:function(valor){i3GEO.Interface.googlemaps.OPACIDADE=valor/200;i3GEO.Interface.googlemaps.redesenha()},recalcPar:function(){var bounds,sw,ne;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getBounds();sw=bounds.getSouthWest();ne=bounds.getNorthEast();i3GEO.parametros.mapexten=sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala()},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 pol,ret,pt1,pt2,sw,ne,z;pol=mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z)},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;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(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);zoom=function(){if(pan){eval("var ll = "+ngeoxml+".getDefaultCenter()");eval(ngeoxml+".gotoDefaultViewport(i3GeoMap)")}};eval(ngeoxml+" = new GGeoXml(url,zoom)");if(ativo===true){eval("i3GeoMap.addOverlay("+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 root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googlemaps.ARVORE.getRoot();node=i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="<table><tr><td><b>Google Maps</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},ativaDesativaCamadaKml:function(obj){if(!obj.checked){eval("i3GeoMap.removeOverlay("+obj.value+")")}else{eval("i3GeoMap.addOverlay("+obj.value+")")}}},googleearth:{GADGETS:{setMouseNavigationEnabled:true,setStatusBarVisibility:true,setOverviewMapVisibility:true,setScaleLegendVisibility:true,setAtmosphereVisibility:true,setGridVisibility:false,getSun:false,LAYER_BORDERS:true,LAYER_BUILDINGS:false,LAYER_ROADS:false,LAYER_TERRAIN:true},POSICAOTELA:[0,0],aguarde:"",redesenha:function(){try{if(typeof(linki3geo)!=='undefined'){linki3geo.setHref(linki3geo.getHref()+"&")}}catch(e){}},cria:function(w,h){var i,i3GeoMap3d,i3GeoMap,texto;i3GEO.configura.listaDePropriedadesDoMapa={"propriedades":[]};texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setMouseNavigationEnabled(this.checked)'";texto+="> "+$trad("ge1");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setStatusBarVisibility(this.checked)'";texto+="> "+$trad("ge2");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setOverviewMapVisibility(this.checked)'";texto+="> "+$trad("ge3");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setScaleLegendVisibility(this.checked)'";texto+="> "+$trad("ge4");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setAtmosphereVisibility(this.checked)'";texto+="> "+$trad("ge5");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setGridVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setGridVisibility(this.checked)'";texto+="> "+$trad("ge6");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.getSun==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getSun().setVisibility(this.checked)'";texto+="> "+$trad("ge7");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BORDERS, this.checked)'";texto+="> "+$trad("ge8");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BUILDINGS, this.checked)'";texto+="> "+$trad("ge9");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_ROADS, this.checked)'";texto+="> "+$trad("ge10");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_TERRAIN, this.checked)'";texto+="> "+$trad("ge11");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});i=$i(i3GEO.Interface.IDCORPO);if(i){i3GeoMap3d=document.createElement("div");i3GeoMap3d.style.width=w;i3GeoMap3d.style.height=h+45;i.style.height=h+45;i3GeoMap3d.id="i3GeoMap3d";i.appendChild(i3GeoMap3d)}i3GEO.Interface.IDMAPA="i3GeoMap3d";google.load("earth","1");i3GeoMap=null},inicia:function(){google.earth.createInstance("i3GeoMap3d",i3GEO.Interface.googleearth.iniciaGE,i3GEO.Interface.googleearth.falha)},iniciaGE:function(object){i3GeoMap=object;i3GeoMap.getWindow().setVisibility(true);kmlUrl=i3GEO.configura.locaplic+"/pacotes/kmlmapserver/kmlservice.php?map="+i3GEO.parametros.mapfile+"&typename=estadosl&request=kml&mode=map&";linki3geo=i3GeoMap.createLink('');linki3geo.setHref(kmlUrl);nl=i3GeoMap.createNetworkLink('');nl.setLink(linki3geo);nl.setFlyToView(true);i3GeoMap.getFeatures().appendChild(nl);var options=i3GeoMap.getOptions(),layerRoot=i3GeoMap.getLayerRoot(),evento=function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""};options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled);options.setStatusBarVisibility(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility);options.setOverviewMapVisibility(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility);options.setScaleLegendVisibility(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility);options.setAtmosphereVisibility(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility);options.setGridVisibility(i3GEO.Interface.googleearth.GADGETS.setGridVisibility);layerRoot.enableLayerById(i3GeoMap.LAYER_BORDERS,i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS);layerRoot.enableLayerById(i3GeoMap.LAYER_BUILDINGS,i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS);layerRoot.enableLayerById(i3GeoMap.LAYER_ROADS,i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS);layerRoot.enableLayerById(i3GeoMap.LAYER_TERRAIN,i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN);i3GeoMap.getSun().setVisibility(i3GEO.Interface.googleearth.GADGETS.getSun);i3GeoMap.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW);google.earth.addEventListener(i3GeoMap.getView(),"viewchangeend",function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googleearth.POSICAOTELA=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO));google.earth.addEventListener(i3GeoMap.getGlobe(),'mousemove',function(event){objposicaocursor={ddx:event.getLongitude(),ddy:event.getLatitude(),dmsx:0,dmsy:0,imgx:event.getClientX(),imgy:event.getClientY(),telax:event.getClientX()+i3GEO.Interface.googleearth.POSICAOTELA[0],telay:event.getClientY()+i3GEO.Interface.googleearth.POSICAOTELA[1]};i3GEO.eventos.mousemoveMapa()});google.earth.addEventListener(i3GeoMap.getGlobe(),'click',function(event){if(i3GEO.Interface.googleearth.aguarde.visibility==="hidden"){i3GEO.eventos.mousecliqueMapa()}else{i3GEO.Interface.googleearth.aguarde.visibility="hidden"}});i3GEO.Interface.googleearth.ativaBotoes();i3GEO.gadgets.mostraInserirKml("inserirKml");i3GEO.Interface.googleearth.adicionaListaKml()},recalcPar:function(){var bounds;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getView().getViewportGlobeBounds();i3GEO.parametros.mapexten=bounds.getWest()+" "+bounds.getSouth()+" "+bounds.getEast()+" "+bounds.getNorth()},falha:function(){alert("Falhou. Vc precisa do plugin instalado")},ativaBotoes:function(){var cabecalho=function(){};var minimiza=function(){i3GEO.janela.minimiza("i3GEOF.ferramentasGE")};var janela=i3GEO.janela.cria("200px","70px","","","","Ferramentas","i3GEOF.ferramentasGE",false,"hd",cabecalho,minimiza);i3GEO.barraDeBotoes.TEMPLATEBOTAO='<div style="display:inline;background-color:rgb(250,250,250);"><img src="'+i3GEO.configura.locaplic+'/imagens/branco.gif" id="$$"/></div> ';i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id);i3GEO.barraDeBotoes.ativaBotoes();i3GEO.Interface.googleearth.aguarde=$i("i3GEOF.ferramentasGE_imagemCabecalho").style},balao:function(texto,ddx,ddy){var placemark=i3GeoMap.createPlacemark('');var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);var b=i3GeoMap.createHtmlStringBalloon('');b.setContentString("<div style=text-align:left >"+texto+"</div>");b.setFeature(placemark);i3GeoMap.setBalloon(b);i3GEO.Interface.googleearth.aguarde.visibility="hidden"},insereMarca:function(texto,ddx,ddy,name){var placemark=i3GeoMap.createPlacemark('');placemark.setName(name);var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);if(texto!=""){placemark.setDescription(texto)}i3GeoMap.getFeatures().appendChild(placemark)},removePlacemark:function(nome){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getName()==nome){features.getChildNodes().item(i).setVisibility(false)}}catch(e){}}},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=false}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);linki3geo=i3GeoMap.createLink('');linki3geo.setHref(url);eval(ngeoxml+" = i3GeoMap.createNetworkLink('')");eval(ngeoxml+".setLink(linki3geo)");i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googleearth.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googleearth.ARVORE.getRoot();node=i3GEO.Interface.googleearth.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googleearth.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googleearth.ARVORE.draw();i3GEO.Interface.googleearth.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googleearth.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googleearth.ARVORE.getRoot();titulo="<table><tr><td><b>Google Earth Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},existeLink:function(url){var existe=false,features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){existe=true}}catch(e){}}return(existe)},ativaDesativaLink:function(url,valor){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){features.getChildNodes().item(i).setVisibility(valor)}}catch(e){}}},ativaDesativaCamadaKml:function(obj){var url=eval(obj.value+".getLink().getHref()");var existe=i3GEO.Interface.googleearth.existeLink(url);if(!obj.checked){{i3GEO.Interface.googleearth.ativaDesativaLink(url,false)}}else{if(existe==false){eval("i3GeoMap.getFeatures().appendChild("+obj.value+")")}else{i3GEO.Interface.googleearth.ativaDesativaLink(url,true)}}}}};i3GEO.interface=i3GEO.Interface; | |
150 | +if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.Interface={OUTPUTFORMAT:"AGG_Q",BARRABOTOESTOP:12,BARRABOTOESLEFT:3,ATUAL:"padrao",IDCORPO:"corpoMapa",ATIVAMENUCONTEXTO:false,IDMAPA:"",redesenha:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.redesenha()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.redesenha()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.redesenha()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.redesenha()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.redesenha()}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.adicionaKml("foo")}},cria:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.cria(w,h)}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.cria(w,h)}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.cria(w,h)}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.cria(w,h)}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.cria(w,h)}},inicia:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.inicia()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.inicia()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.inicia()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.inicia()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.inicia()}},ativaBotoes:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.ativaBotoes()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.ativaBotoes()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.ativaBotoes()}},padrao:{TRANSICAO:false,redesenha:function(){var ndiv,i;if(!$i("img")){i3GEO.janela.fechaAguarde();return}$i("img").onload=function(){var imagem,temp;imagem=$i("img");imagem.onload="";i3GEO.gadgets.quadros.grava("imagem",i3GEO.parametros.mapimagem);i3GEO.gadgets.quadros.grava("extensao",i3GEO.parametros.mapexten);temp=function(retorno){eval(retorno.data);i3GEO.gadgets.quadros.grava("legenda",legimagem)};if(i3GEO.gadgets.quadros.geraLegenda===true){i3GEO.mapa.legendaIMAGEM.obtem(temp)}if(i3GEO.Interface.padrao.TRANSICAO===true){if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",50,5,true)}i3GEO.util.aparece("img",50,5)}else{if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",15,5,true)}i3GEO.util.aparece("img",5,5)}i3GEO.janela.fechaAguarde("ajaxCorpoMapa")};if(!$i("imgtemp")){ndiv=document.createElement("div");ndiv.id="imgtemp";ndiv.style.position="absolute";ndiv.style.border="1px solid blue";document.getElementById("corpoMapa").appendChild(ndiv)}if(g_tipoacao==="pan"&&i3GEO.barraDeBotoes.BOTAOCLICADO==="pan"){$i("imgtemp").style.left=parseInt($i("img").style.left,10);$i("imgtemp").style.top=parseInt($i("img").style.top,10);$i("imgtemp").style.width=i3GEO.parametros.w;$i("imgtemp").style.height=i3GEO.parametros.h}$i("imgtemp").style.backgroundImage='url("'+$i("img").src+'")';$i("imgtemp").style.display="block";i=$i("img");i.style.display="none";i.style.left=0;i.style.top=0;i.src=i3GEO.parametros.mapimagem},cria:function(){var ins="<input style='position:relative;top:0px;left:0px'' type=image src='' id='img' />",temp=$i(i3GEO.Interface.IDCORPO);if(temp){temp.innerHTML=ins}i3GEO.Interface.IDMAPA="img"},ativaMenuContexto:function(){var temp,oFieldContextMenuItemData,oFieldContextMenu,onFieldMenuRender;temp=$i("contexto_"+i3GEO.Interface.IDMAPA);if(temp){temp.parentNode.removeChild(temp)}oFieldContextMenuItemData=[{text:" <span class='container-close'></span>"},{text:"<img class='rosamais' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Aproxima</span>",onclick:{fn:i3GEO.navega.zoomin}},{text:"<img class='rosamenos' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Afasta</span>",onclick:{fn:i3GEO.navega.zoomout}},{text:"<img class='rosanorte' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Norte</span>",onclick:{fn:i3GEO.navega.panFixoNorte}},{text:"<img class='rosasul' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Sul</span>",onclick:{fn:i3GEO.navega.panFixoSul}},{text:"<img class='rosaleste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Leste</span>",onclick:{fn:i3GEO.navega.panFixoLeste}},{text:"<img class='rosaoeste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Oeste</span>",onclick:{fn:i3GEO.navega.panFixoOeste}},{text:"Captura",onclick:{fn:i3GEO.gadgets.quadros.listaImagens}}];oFieldContextMenu=new YAHOO.widget.ContextMenu("contexto_"+i3GEO.Interface.IDMAPA,{trigger:i3GEO.Interface.IDMAPA,itemdata:oFieldContextMenuItemData,lazyload:true});onFieldMenuRender=function(){var id="contexto_"+i3GEO.Interface.IDMAPA;if(id){$i(id).style.zIndex=50000}};oFieldContextMenu.subscribe("render",onFieldMenuRender)},inicia:function(){var elemento,i,estilo;if($i("contemImg")){elemento="contemImg"}else{elemento="img"}i3GEO.mapa.ajustaPosicao(elemento);i=$i("img");if(!i){return}i.style.width=i3GEO.parametros.w+"px";i.style.height=i3GEO.parametros.h+"px";estilo=$i(i3GEO.Interface.IDCORPO).style;estilo.width=i3GEO.parametros.w+"px";estilo.height=i3GEO.parametros.h+"px";estilo.clip='rect('+0+" "+(i3GEO.parametros.w)+" "+(i3GEO.parametros.h)+" "+0+')';objmapaparado="nao";i3GEO.gadgets.mostraMenuSuspenso();i3GEO.eventos.ativa(i);i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.gadgets.mostraEscalaGrafica();i3GEO.gadgets.visual.inicia();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.Interface.padrao.ativaBotoes();i3GEO.idioma.mostraSeletor();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){var imagemxy,x1,y1,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y1=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if(($i("barraDeBotoes1")&&$i("barraDeBotoes2"))||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+40}if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes1","i3geo_barra1",true,x1,y1)}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes();if(document.getElementById("botao3d")){if(i3GEO.configura.map3d===""){document.getElementById("botao3d").style.display="none"}}if(i3GEO.Interface.ATIVAMENUCONTEXTO){i3GEO.Interface.padrao.ativaMenuContexto()}if(i3GEO.configura.visual!=="default"){i3GEO.gadgets.visual.troca(i3GEO.configura.visual)}}},flamingo:{redesenha:function(){var w=parseInt($i("flamingo").style.width,10);if(w===i3GEO.parametros.w){$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)+1}else{$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)-1}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("flamingo");if(!f){ins='<div id=flamingo style="width:0px;height:0px;text-align:left;background-image:url(/"'+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg/")"></div>';i.innerHTML=ins}f=$i("flamingo");f.style.width=w;f.style.height=h;i3GEO.Interface.IDMAPA="flamingo"}},inicia:function(){var monta=function(retorno){$i("flamingo").style.height=i3GEO.parametros.h+45;childPopups=[];childPopupNr=0;var so=new SWFObject(i3GEO.configura.locaplic+"/pacotes/flamingo/flamingo/flamingo.swf?config="+retorno.data,"flamingoi","100%","100%","8","#eaeaea");so.addParam("wmode","transparent");so.write("flamingo")};i3GEO.php.flamingo(monta);i3GEO.eventos.ativa($i("flamingo"));i3GEO.maparef.atualiza();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){}},openlayers:{TILES:false,GADGETS:{PanZoomBar:true,LayerSwitcher:true,ScaleLine:true,OverviewMap:true},redesenha:function(){if($i("openlayers_OpenLayers_Container")){var a,b,c,no,divs1,n1,divs2,n2,imgs,nimg;no=$i("openlayers_OpenLayers_Container");divs1=no.getElementsByTagName("div");n1=divs1.length;for(a=0;a<n1;a++){divs2=divs1[a].getElementsByTagName("div");n2=divs2.length;for(b=0;b<n2;b++){imgs=divs2[b].getElementsByTagName("img");nimg=imgs.length;for(c=0;c<nimg;c++){imgs[c].src+="&x"}}}i3GEO.Interface.openlayers.recalcPar()}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("openlayers");if(!f){ins='<div id=openlayers style="width:0px;height:0px;text-align:left;background-image:url('+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg)"></div>';i.innerHTML=ins}f=$i("openlayers");f.style.width=w;f.style.height=h}i3GEO.Interface.IDMAPA="openlayers"},inicia:function(){var montaMapa=function(){var url,pz,pos;url=window.location.protocol+"//"+window.location.host+i3GEO.parametros.cgi+"?";url+="map="+i3GEO.parametros.mapfile+"&mode=map&SRS=epsg:4326&";i3geoOL=new OpenLayers.Map('openlayers',{controls:[]});if(i3GEO.Interface.openlayers.TILES===true){i3geoOLlayer=new OpenLayers.Layer.MapServer("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}else{i3geoOLlayer=new OpenLayers.Layer.MapServer.Untiled("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}i3geoOLlayer.setVisibility(true);i3geoOLlayer.transitionEffect="resize";i3geoOL.addLayer(i3geoOLlayer);i3geoOL.events.register("moveend",i3geoOL,function(e){i3GEO.Interface.openlayers.recalcPar();g_operacao="";g_tipoacao=""});i3geoOL.events.register("mousemove",i3geoOL,function(e){var p,lonlat,d,dc;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3geoOL.getLonLatFromPixel(p);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{objposicaocursor.ddx=lonlat.lon;objposicaocursor.ddy=lonlat.lat;objposicaocursor.telax=p.x;objposicaocursor.telay=p.y;objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];dc=$i("i3geo");if($i("openlayers_OpenLayers_Container")){dc=$i("openlayers_OpenLayers_Container")}while(dc.offsetParent){dc=dc.offsetParent;objposicaocursor.telax=objposicaocursor.telax+dc.offsetLeft;objposicaocursor.telay=objposicaocursor.telay+dc.offsetTop}}catch(e){}});i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);if(i3GEO.Interface.openlayers.GADGETS.PanZoomBar==true){pz=new OpenLayers.Control.PanZoomBar({numZoomLevels:5});i3geoOL.addControl(pz);pz.div.style.zIndex=5000}if(i3GEO.Interface.openlayers.GADGETS.LayerSwitcher==true){i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher())}if(i3GEO.Interface.openlayers.GADGETS.ScaleLine==true){i3geoOL.addControl(new OpenLayers.Control.ScaleLine())}if(i3GEO.Interface.openlayers.GADGETS.OverviewMap==true){i3geoOL.addControl(new OpenLayers.Control.OverviewMap())}i3geoOL.addControl(new OpenLayers.Control.KeyboardDefaults());i3GEO.eventos.ativa($i("openlayers"));pos=i3GEO.util.pegaPosicaoObjeto($i("openlayers"));if($i("aguarde")){$top("aguarde",pos[1]);$left("aguarde",pos[0])}OLpan=new OpenLayers.Control.Navigation();OLzoom=new OpenLayers.Control.ZoomBox();OLpanel=new OpenLayers.Control.Panel();OLpanel.addControls([OLpan,OLzoom]);i3geoOL.addControl(OLpanel);i3GEO.Interface.openlayers.ativaBotoes()};i3GEO.php.openlayers(montaMapa);i3GEO.gadgets.mostraMenuSuspenso();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.idioma.mostraSeletor();i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica()},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},recalcPar:function(){g_operacao="";g_tipoacao="";var bounds=i3geoOL.getExtent().toBBOX().split(",");i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];i3GEO.parametros.mapscale=i3geoOL.getScale();atualizaEscalaNumerica(parseInt(i3GEO.parametros.mapscale,10))},zoom2ext:function(ext){var m,b;m=ext.split(" ");b=new OpenLayers.Bounds(m[0],m[1],m[2],m[3]);i3geoOL.zoomToExtent(b)}},googlemaps:{OPACIDADE:0.8,TIPOMAPA:"G_PHYSICAL_MAP",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],redesenha:function(){try{if(i3GeoMap!==""){posfixo=posfixo+"&";i3GeoMap.removeOverlay(i3GEOTileO);var i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile()+posfixo,isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO)}}catch(e){}},cria:function(w,h){var i,f,ins;posfixo="&";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");f.style.width=w;f.style.height=h}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv"},inicia:function(){var pos,myMapType,pol,ret,pt1,pt2,bottomLeft,bottomRight,sw,ne,z,i3GEOTile;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;i3GeoMap=new GMap2($i(i3GEO.Interface.IDMAPA));i3GeoMap.addMapType(G_PHYSICAL_MAP);if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_SATELLITE_MAP"){i3GeoMap.setMapType(G_SATELLITE_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_PHYSICAL_MAP"){i3GeoMap.setMapType(G_PHYSICAL_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_HYBRID_MAP"){i3GeoMap.setMapType(G_HYBRID_MAP)}i3GeoMap.addControl(new GLargeMapControl());i3GeoMap.addControl(new GMapTypeControl());bottomLeft=new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0,40));i3GeoMap.addControl(new GScaleControl(),bottomLeft);bottomRight=new GControlPosition(G_ANCHOR_BOTTOM_RIGHT);i3GeoMap.addControl(new GOverviewMapControl(),bottomRight);sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z);i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile(),isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO);myMapType=new GMapType([i3GEOTile],new GMercatorProjection(18),'i3Geo');i3GeoMap.addMapType(myMapType);GEvent.addListener(i3GeoMap,"dragstart",function(){g_operacao="";g_tipoacao=""});GEvent.addListener(i3GeoMap,"dragend",function(){i3GEO.Interface.googlemaps.recalcPar()});GEvent.addListener(i3GeoMap,"zoomend",function(){i3GEO.Interface.googlemaps.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googlemaps.ativaBotoes();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraMenuSuspenso();i3GEO.gadgets.mostraInserirKml();pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA));GEvent.addListener(i3GeoMap,"mousemove",function(ponto){var teladms,tela;teladms=i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());tela=i3GeoMap.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]}});g_operacao="";g_tipoacao="";if(i3GEO.parametros.kmlurl!==""){i3GEO.mapa.insereKml(true,i3GEO.parametros.kmlurl)}i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala();i3GEO.Interface.googlemaps.adicionaListaKml()},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)},criaWMS:function(){var cgi,parametros;cgi=i3GEO.configura.locaplic+"/classesphp/parse_cgi.php?g_sid="+i3GEO.configura.sid;parametros="&map_size="+parseInt($i(i3GEO.Interface.IDMAPA).style.width,10);parametros+=","+parseInt($i(i3GEO.Interface.IDMAPA).style.height,10);parametros+="&mapext="+i3GEO.Interface.googlemaps.bbox();parametros+="&map_imagecolor=-1 -1 -1&map_transparent=on";return(cgi+parametros)},criaTile:function(){var cgi,parametros;cgi=i3GEO.util.protocolo()+"://"+window.location.host+i3GEO.parametros.cgi+"?";parametros="map="+i3GEO.parametros.mapfile;parametros+='&mode=tile';parametros+='&tilemode=gmap';parametros+='&tile={X}+{Y}+{Z}';parametros+='&map_imagetype='+i3GEO.Interface.OUTPUTFORMAT;return(cgi+parametros)},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+70;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},mudaOpacidade:function(valor){i3GEO.Interface.googlemaps.OPACIDADE=valor/200;i3GEO.Interface.googlemaps.redesenha()},recalcPar:function(){var bounds,sw,ne;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getBounds();sw=bounds.getSouthWest();ne=bounds.getNorthEast();i3GEO.parametros.mapexten=sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala()},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 pol,ret,pt1,pt2,sw,ne,z;pol=mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z)},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;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(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);zoom=function(){if(pan){eval("var ll = "+ngeoxml+".getDefaultCenter()");eval(ngeoxml+".gotoDefaultViewport(i3GeoMap)")}};eval(ngeoxml+" = new GGeoXml(url,zoom)");if(ativo===true){eval("i3GeoMap.addOverlay("+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 root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googlemaps.ARVORE.getRoot();node=i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="<table><tr><td><b>Google Maps</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},ativaDesativaCamadaKml:function(obj){if(!obj.checked){eval("i3GeoMap.removeOverlay("+obj.value+")")}else{eval("i3GeoMap.addOverlay("+obj.value+")")}}},googleearth:{GADGETS:{setMouseNavigationEnabled:true,setStatusBarVisibility:true,setOverviewMapVisibility:true,setScaleLegendVisibility:true,setAtmosphereVisibility:true,setGridVisibility:false,getSun:false,LAYER_BORDERS:true,LAYER_BUILDINGS:false,LAYER_ROADS:false,LAYER_TERRAIN:true},POSICAOTELA:[0,0],aguarde:"",redesenha:function(){try{if(linki3geo!==undefined){linki3geo.setHref(linki3geo.getHref()+"&")}}catch(e){}},cria:function(w,h){var i,i3GeoMap3d,i3GeoMap,texto;i3GEO.configura.listaDePropriedadesDoMapa={"propriedades":[]};texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setMouseNavigationEnabled(this.checked)'";texto+="> "+$trad("ge1");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setStatusBarVisibility(this.checked)'";texto+="> "+$trad("ge2");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setOverviewMapVisibility(this.checked)'";texto+="> "+$trad("ge3");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setScaleLegendVisibility(this.checked)'";texto+="> "+$trad("ge4");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setAtmosphereVisibility(this.checked)'";texto+="> "+$trad("ge5");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setGridVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setGridVisibility(this.checked)'";texto+="> "+$trad("ge6");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.getSun==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getSun().setVisibility(this.checked)'";texto+="> "+$trad("ge7");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BORDERS, this.checked)'";texto+="> "+$trad("ge8");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BUILDINGS, this.checked)'";texto+="> "+$trad("ge9");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_ROADS, this.checked)'";texto+="> "+$trad("ge10");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_TERRAIN, this.checked)'";texto+="> "+$trad("ge11");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});i=$i(i3GEO.Interface.IDCORPO);if(i){i3GeoMap3d=document.createElement("div");i3GeoMap3d.style.width=w;i3GeoMap3d.style.height=h+45;i.style.height=h+45;i3GeoMap3d.id="i3GeoMap3d";i.appendChild(i3GeoMap3d)}i3GEO.Interface.IDMAPA="i3GeoMap3d";google.load("earth","1");i3GeoMap=null},inicia:function(){google.earth.createInstance("i3GeoMap3d",i3GEO.Interface.googleearth.iniciaGE,i3GEO.Interface.googleearth.falha)},iniciaGE:function(object){i3GeoMap=object;i3GeoMap.getWindow().setVisibility(true);kmlUrl=i3GEO.configura.locaplic+"/pacotes/kmlmapserver/kmlservice.php?map="+i3GEO.parametros.mapfile+"&typename=estadosl&request=kml&mode=map&";linki3geo=i3GeoMap.createLink('');linki3geo.setHref(kmlUrl);nl=i3GeoMap.createNetworkLink('');nl.setLink(linki3geo);nl.setFlyToView(true);i3GeoMap.getFeatures().appendChild(nl);var options=i3GeoMap.getOptions(),layerRoot=i3GeoMap.getLayerRoot(),evento=function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""};options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled);options.setStatusBarVisibility(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility);options.setOverviewMapVisibility(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility);options.setScaleLegendVisibility(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility);options.setAtmosphereVisibility(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility);options.setGridVisibility(i3GEO.Interface.googleearth.GADGETS.setGridVisibility);layerRoot.enableLayerById(i3GeoMap.LAYER_BORDERS,i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS);layerRoot.enableLayerById(i3GeoMap.LAYER_BUILDINGS,i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS);layerRoot.enableLayerById(i3GeoMap.LAYER_ROADS,i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS);layerRoot.enableLayerById(i3GeoMap.LAYER_TERRAIN,i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN);i3GeoMap.getSun().setVisibility(i3GEO.Interface.googleearth.GADGETS.getSun);i3GeoMap.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW);google.earth.addEventListener(i3GeoMap.getView(),"viewchangeend",function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googleearth.POSICAOTELA=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO));google.earth.addEventListener(i3GeoMap.getGlobe(),'mousemove',function(event){objposicaocursor={ddx:event.getLongitude(),ddy:event.getLatitude(),dmsx:0,dmsy:0,imgx:event.getClientX(),imgy:event.getClientY(),telax:event.getClientX()+i3GEO.Interface.googleearth.POSICAOTELA[0],telay:event.getClientY()+i3GEO.Interface.googleearth.POSICAOTELA[1]};i3GEO.eventos.mousemoveMapa()});google.earth.addEventListener(i3GeoMap.getGlobe(),'click',function(event){if(i3GEO.Interface.googleearth.aguarde.visibility==="hidden"){i3GEO.eventos.mousecliqueMapa()}else{i3GEO.Interface.googleearth.aguarde.visibility="hidden"}});i3GEO.Interface.googleearth.ativaBotoes();i3GEO.gadgets.mostraInserirKml("inserirKml");i3GEO.Interface.googleearth.adicionaListaKml()},recalcPar:function(){var bounds;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getView().getViewportGlobeBounds();i3GEO.parametros.mapexten=bounds.getWest()+" "+bounds.getSouth()+" "+bounds.getEast()+" "+bounds.getNorth()},falha:function(){alert("Falhou. Vc precisa do plugin instalado")},ativaBotoes:function(){var cabecalho=function(){};var minimiza=function(){i3GEO.janela.minimiza("i3GEOF.ferramentasGE")};var janela=i3GEO.janela.cria("200px","70px","","","","Ferramentas","i3GEOF.ferramentasGE",false,"hd",cabecalho,minimiza);i3GEO.barraDeBotoes.TEMPLATEBOTAO='<div style="display:inline;background-color:rgb(250,250,250);"><img src="'+i3GEO.configura.locaplic+'/imagens/branco.gif" id="$$"/></div> ';i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id);i3GEO.barraDeBotoes.ativaBotoes();i3GEO.Interface.googleearth.aguarde=$i("i3GEOF.ferramentasGE_imagemCabecalho").style},balao:function(texto,ddx,ddy){var placemark=i3GeoMap.createPlacemark('');var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);var b=i3GeoMap.createHtmlStringBalloon('');b.setContentString("<div style=text-align:left >"+texto+"</div>");b.setFeature(placemark);i3GeoMap.setBalloon(b);i3GEO.Interface.googleearth.aguarde.visibility="hidden"},insereMarca:function(texto,ddx,ddy,name){var placemark=i3GeoMap.createPlacemark('');placemark.setName(name);var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);if(texto!=""){placemark.setDescription(texto)}i3GeoMap.getFeatures().appendChild(placemark)},removePlacemark:function(nome){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getName()==nome){features.getChildNodes().item(i).setVisibility(false)}}catch(e){}}},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=false}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);linki3geokml=i3GeoMap.createLink('');linki3geokml.setHref(url);eval(ngeoxml+" = i3GeoMap.createNetworkLink('')");eval(ngeoxml+".setLink(linki3geokml)");i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googleearth.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googleearth.ARVORE.getRoot();node=i3GEO.Interface.googleearth.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googleearth.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googleearth.ARVORE.draw();i3GEO.Interface.googleearth.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googleearth.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googleearth.ARVORE.getRoot();titulo="<table><tr><td><b>Google Earth Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},existeLink:function(url){var existe=false,features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){existe=true}}catch(e){}}return(existe)},ativaDesativaLink:function(url,valor){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){features.getChildNodes().item(i).setVisibility(valor)}}catch(e){}}},ativaDesativaCamadaKml:function(obj){var url=eval(obj.value+".getLink().getHref()");var existe=i3GEO.Interface.googleearth.existeLink(url);if(!obj.checked){{i3GEO.Interface.googleearth.ativaDesativaLink(url,false)}}else{if(existe==false){eval("i3GeoMap.getFeatures().appendChild("+obj.value+")")}else{i3GEO.Interface.googleearth.ativaDesativaLink(url,true)}}}}};i3GEO.interface=i3GEO.Interface; | |
151 | 151 | if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.mapa={GEOXML:[],ajustaPosicao:function(elemento){if(arguments.length===0){return}if(!$i(elemento)){return}var imagemxi,imagemyi,imagemxref,imagemyref,dc,c;try{imagemxi=0;imagemyi=0;imagemxref=0;imagemyref=0;dc=$i(elemento);while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi=imagemxi+dc.offsetLeft;imagemyi=imagemyi+dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{$left(i3GEO.Interface.IDCORPO,imagemxi)}$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){alert("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){var noArvoreCamadas=$i("arrastar_"+codigo),noAtualArvoreCamadas=$i("arrastar_"+i3GEO.temaAtivo);i3GEO.temaAtivo=codigo;if(noAtualArvoreCamadas){noAtualArvoreCamadas.style.textDecoration=""}if(noArvoreCamadas){noArvoreCamadas.style.textDecoration="underline"}},ativaLogo:function(){i3GEO.contadorAtualiza++;i3GEO.php.ativalogo(i3GEO.atualiza)},verifica:function(retorno){try{i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o3"));if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(retorno===undefined)){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.janela.fechaAguarde();return}if(i3GEO.mapa.recupera.TENTATIVA===0){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{alert("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(i3GEO.mapa.recupera.TENTATIVA===1){i3GEO.mapa.recupera.TENTATIVA=2;i3GEO.contadorAtualiza++;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(i3GEO.mapa.recupera.TENTATIVA===0){i3GEO.mapa.recupera.TENTATIVA++;i3GEO.mapa.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaHTML:{incluiBotaoLibera:true,ID:"",cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()")}i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var temp=function(retorno){var s,ins,elementos,i;if(i3GEO.mapa.legendaHTML.ID!==""&&$i(i3GEO.mapa.legendaHTML.ID)){if((retorno.data!=="erro")&&(retorno.data!==undefined)){s=i3GEO.configura.locaplic+"/imagens/solta.gif";ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+="<img onclick='i3GEO.mapa.legendaHTML.libera()' id=soltaLeg src="+s+" title='clique para liberar'/><br>"}ins+="<div id='corpoLegi' >"+retorno.data.legenda+"</div>";$i(i3GEO.mapa.legendaHTML.ID).innerHTML=ins}}if($i("wlegenda")){$i("wlegenda").innerHTML=retorno.data.legenda;elementos=$i("wlegenda").getElementsByTagName("input");for(i=0;i<elementos.length;i++){elementos[i].style.display="none"}}};i3GEO.mapa.legendaHTML.obtem(temp)},obtem:function(funcao){i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda)},ativaDesativaTema:function(inputbox){var temp=function(){i3GEO.contadorAtualiza++;i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem);i3GEO.arvoreDeCamadas.atualiza("");i3GEO.janela.fechaAguarde("redesenha")};i3GEO.janela.abreAguarde("redesenha",$trad("o1"));if(!inputbox.checked){i3GEO.php.ligatemas(temp,inputbox.value,"")}else{i3GEO.php.ligatemas(temp,"",inputbox.value)}},libera:function(){var temp=function(retorno){var novoel,temp,n,i;if(!$i("moveLegi")){novoel=document.createElement("div");novoel.id="moveLegi";novoel.style.display="block";temp='<div class="hd">Legenda</div>';temp+='<div id="wlegenda" style="text-align:left;background-color:white" ></div>';novoel.innerHTML=temp;document.body.appendChild(novoel);YAHOO.namespace("moveLegi.xp");YAHOO.moveLegi.xp.panel=new YAHOO.widget.Panel("moveLegi",{width:"300px",fixedcenter:true,constraintoviewport:false,underlay:"none",close:true,visible:true,draggable:true,modal:false,iframe:false});YAHOO.moveLegi.xp.panel.render()}$i("wlegenda").innerHTML=retorno.data.legenda;temp=$i("wlegenda").getElementsByTagName("input");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}YAHOO.moveLegi.xp.panel.show()};i3GEO.mapa.legendaHTML.obtem(temp)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},dialogo:{outputformat:function(){if(typeof(i3GEOF.outputformat)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/outputformat/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.outputformat.criaJanelaFlutuante()","i3GEOF.outputformat_script")}},autoredesenha:function(){if(typeof(i3GEOF.opcoesTempo)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_autoredesenha/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesTempo.criaJanelaFlutuante()","i3GEOF.opcoesTempo_script")}},salvaMapa:function(){if(i3GEO.parametros===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}if(typeof(i3GEOF.salvaMapa)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/salvamapa/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.salvaMapa.criaJanelaFlutuante()","i3GEOF.salvaMapa_script")}},carregaMapa:function(){if(typeof(i3GEOF.carregaMapa)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/carregamapa/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.carregaMapa.criaJanelaFlutuante()","i3GEOF.carregaMapa_script")}},convertews:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}if(typeof(i3GEOF.converteKml)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/convertews/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.converteMapaWS.criaJanelaFlutuante()","i3GEOF.converteMapaWS_script")}},convertekml:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}if(typeof(i3GEOF.converteKml)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/convertemapakml/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.converteMapaKml.criaJanelaFlutuante()","i3GEOF.converteMapaKml_script")}},queryMap:function(){if(typeof(i3GEOF.opcoesQuery)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_querymap/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesQuery.criaJanelaFlutuante()","i3GEOF.opcoesQuery_script")}},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","Template <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' > </a>")},tamanho:function(){if(typeof(i3GEOF.opcoesTamanho)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_tamanho/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesTamanho.criaJanelaFlutuante()","i3GEOF.opcoesTamanho_script")}},tipoimagem:function(){if(typeof(i3GEOF.tipoimagem)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/tipoimagem/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.tipoimagem.criaJanelaFlutuante()","i3GEOF.tipoimagem_script")}},corFundo:function(){if(typeof(i3GEOF.gradeCoord)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_fundo/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesFundo.criaJanelaFlutuante()","i3GEOF.opcoesFundo_script")}},opcoesEscala:function(){if(typeof(i3GEOF.opcoesEscala)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_escala/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesEscala.criaJanelaFlutuante()","i3GEOF.opcoesEscala_script")}},opcoesLegenda:function(){if(typeof(i3GEOF.opcoesLegenda)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_legenda/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesLegenda.criaJanelaFlutuante()","i3GEOF.opcoesLegenda_script")}},gradeCoord:function(){if(typeof(i3GEOF.gradeCoord)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/gradecoord/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.gradeCoord.criaJanelaFlutuante()","i3GEOF.gradeCoord_script")}},cliqueTexto:function(){if(typeof(i3GEOF.inseretxt)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/inseretxt/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.inseretxt.criaJanelaFlutuante()","i3GEOF.inseretxt_script")}},selecao:function(){if(typeof(i3GEOF.selecao)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/selecao/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.selecao.criaJanelaFlutuante()","i3GEOF.selecao_script")}},cliquePonto:function(){if(typeof(i3GEOF.inserexy)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/inserexy2/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.inserexy.criaJanelaFlutuante()","i3GEOF.inserexy_script")}},cliqueGrafico:function(){if(typeof(i3GEOF.insereGrafico)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/inseregrafico/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.insereGrafico.criaJanelaFlutuante()","i3GEOF.insereGrafico_script")}},cliqueIdentificaDefault:function(){if(g_tipoacao==="identifica"){i3GEO.eventos.MOUSEPARADO.remove("verificaTip()");if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.identifica.criaJanelaFlutuante()","i3GEOF.identifica_script")}else{i3GEOF.identifica.x=objposicaocursor.ddx;i3GEOF.identifica.y=objposicaocursor.ddy;i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo);return}}},verificaTipDefault:function(){var ntemas,etiquetas,j,retorna;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j++){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface.ATUAL==="padrao"){$i("img").style.cursor="wait"}if(i3GEO.Interface.ATUAL=="googleearth"){i3GEO.Interface.googleearth.aguarde.visibility="visible"}retorna=function(retorno){var temp,rfes,n,balloon,i,mostra,res,temas,ntemas,titulo,tips,j,ntips,ins,r,ds,nds,s;i=$i("i3geo_rosa");if(i){i.style.display="none"}mostra=false;try{retorno=retorno.data;if(retorno!==""){res="";temas=retorno;ntemas=temas.length;for(j=0;j<ntemas;j++){titulo=temas[j].nome;if(i3GEO.configura.tipotip==="completo"||i3GEO.configura.tipotip==="balao"){titulo="<span style='text-decoration:underline;text-align:left;font-size:9pt'><b>"+titulo+"</b></span><br>"}else{titulo=""}tips=(temas[j].resultado.tips).split(",");ntips=tips.length;ins="";for(r=0;r<ntips;r++){try{ds=temas[j].resultado.dados;if(ds!==" "){nds=ds.length;for(s=0;s<nds;s++){eval("var alias = ds[s]."+tips[r]+".alias");eval("var valor = ds[s]."+tips[r]+".valor");eval("var link = ds[s]."+tips[r]+".link");eval("var img = ds[s]."+tips[r]+".img");if(i3GEO.configura.tipotip==="completo"||i3GEO.configura.tipotip==="balao"){if(valor!==""&&link===""){ins+="<span class='tiptexto' style='text-align:left;font-size:8pt'>"+alias+" :"+valor+"</span><br>"}if(valor!==""&&link!==""){ins+="<span class='tiptexto' style='text-align:left;font-size:8pt'>"+alias+" : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){ins+=img+"<br>"}mostra=true}else{ins+="<span class='tiptexto' style='text-align:left;font-size:8pt'>"+valor+"</span><br>";mostra=true}}}}catch(e){}}if(ins!==""){res+=titulo+ins}}if(!mostra){if($i("tip")){$i("tip").style.display="none"}}else{if(i3GEO.configura.tipotip!=="balao"){n=i3GEO.janela.tip();$i(n).style.textAlign="left";$i(n).innerHTML+=res}else{if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.balao(res,objposicaocursor.ddx,objposicaocursor.ddy)}else{i3GEO.util.criaPin('marcaIdentifica',i3GEO.configura.locaplic+"/imagens/grabber.gif","12px","12px");i3GEO.util.posicionaImagemNoMapa("marcaIdentifica");balloon=new Balloon();balloon.delayTime=0;res="<div style=text-align:left >"+res+"</div>";balloon.showTooltip($i("marcaIdentifica"),res);$i('marcaIdentifica').onclick=$i("closeButton").onclick}}}}if(i3GEO.Interface.ATUAL==="padrao"){temp="zoom";if(i3GEO.Interface.ATIVAMENUCONTEXTO){temp="identifica_contexto"}i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic)}}catch(e){if(i3GEO.Interface.ATUAL==="padrao"){temp="identifica";if(i3GEO.Interface.ATIVAMENUCONTEXTO){temp="identifica_contexto"}i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic)}}};i3GEO.php.identifica2(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5")}}}; |
152 | 152 | if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.tema={exclui:function(tema){g_operacao="excluitema";var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p);i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.excluitema(i3GEO.atualiza,tema);i3GEO.mapa.ativaTema("")},fonte:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));var temp=function(retorno){i3GEO.janela.fechaAguarde();if(retorno.data!=="erro"){window.open(retorno.data)}else{alert("Não existe fonte registrada para esse tema")}};i3GEO.php.fontetema(temp,tema)},sobe:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.sobetema(i3GEO.atualiza,tema)},desce:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.descetema(i3GEO.atualiza,tema)},zoom:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){g_operacao="limpasel";i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.limpasel(i3GEO.atualiza,tema)},mudatransp:function(idtema){g_operacao="transparencia";var valor;if($i("tr"+idtema)){valor=$i("tr"+idtema).value}else{alert("Ocorreu um erro")}if(valor!==""){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.mudatransp(i3GEO.atualiza,idtema,valor)}else{alert("Valor não definido.")}},mudanome:function(idtema){g_operacao="mudanome";var valor;if($i("nn"+idtema)){valor=$i("nn"+idtema).value}else{alert("Ocorreu um erro")}if(valor!==""){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{alert("Nome não definido")}},mostralegendajanela:function(idtema,nome,tipoOperacao){var retorna,janela;if(tipoOperacao==="ativatimer"){mostralegendajanelaTimer=setTimeout("i3GEO.tema.mostralegendajanela('"+idtema+"','"+nome+"','abrejanela')",4000)}if(tipoOperacao==="abrejanela"){try{clearTimeout(mostralegendajanelaTimer)}catch(e){}retorna=function(retorno){$i("janelaLegenda"+idtema+"_corpo").innerHTML=retorno.data.legenda};if(!$i("janelaLegenda"+idtema)){janela=i3GEO.janela.cria("250px","","","","",nome,"janelaLegenda"+idtema,false);janela[2].style.textAlign="left";janela[2].style.background="white";janela[2].innerHTML=$trad("o1")}i3GEO.php.criaLegendaHTML(retorna,idtema,"legenda3.htm")}if(tipoOperacao==="desativatimer"){clearTimeout(mostralegendajanelaTimer)}},dialogo:{abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}},graficotema:function(idtema){if(typeof(i3GEOF.graficoTema)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/graficotema/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.graficoTema.criaJanelaFlutuante()","i3GEOF.graficoTema_script")}},toponimia:function(idtema){if(typeof(i3GEOF.toponimia)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/toponimia/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.toponimia.criaJanelaFlutuante()","i3GEOF.toponimia_script")}},filtro:function(idtema){if(typeof(i3GEOF.filtro)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/filtro/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.filtro.criaJanelaFlutuante()","i3GEOF.filtro_script")}},procuraratrib:function(idtema){if(typeof(i3GEOF.busca)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/busca/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.busca.criaJanelaFlutuante()","i3GEOF.busca_script")}},tabela:function(idtema){if(typeof(i3GEOF.tabela)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/tabela/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.tabela.criaJanelaFlutuante()","i3GEOF.tabela_script")}},etiquetas:function(idtema){if(typeof(i3GEOF.etiqueta)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/etiqueta/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.etiqueta.criaJanelaFlutuante()","i3GEOF.etiqueta_script")}},editaLegenda:function(idtema){if(typeof(i3GEOF.legenda)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/legenda/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.legenda.criaJanelaFlutuante()","i3GEOF.legenda_script")}},download:function(idtema){if(typeof(i3GEOF.download)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/download/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.download.criaJanelaFlutuante('"+idtema+"')","i3GEOF.download_script")}},sld:function(idtema){i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","SLD <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' > </a>")},editorsql:function(idtema){if(typeof(i3GEOF.editorsql)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/editorsql/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.editorsql.criaJanelaFlutuante('"+idtema+"')","i3GEOF.editorsql_script")}}}}; |
153 | 153 | if(typeof(i3GEO)=='undefined'){i3GEO=[]}i3GEO.analise={dialogo:{graficoInterativo:function(){if(typeof(i3GEOF.graficointerativo)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/graficointerativo/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.graficointerativo.criaJanelaFlutuante()","i3GEOF.graficointerativo_script")}},linhaDoTempo:function(){i3GEO.janela.cria("450px","300px",i3GEO.configura.locaplic+"/ferramentas/linhadotempo/index.php","","","Linha do tempo <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=88' > </a>");atualizaLinhaDoTempo=function(){var doc;try{if(navn){if($i("wdocai")){doc=$i("wdocai").contentDocument}}else{if(document.frames("wdocai")){doc=document.frames("wdocai").document}}if(doc.getElementById("tl")){window.parent.wdocai.carregaDados()}else{i3GEO.eventos.NAVEGAMAPA.remove("atualizaLinhaDoTempo()")}}catch(e){i3GEO.eventos.NAVEGAMAPA.remove("atualizaLinhaDoTempo()")}};if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaLinhaDoTempo()")<0){i3GEO.eventos.NAVEGAMAPA.push("atualizaLinhaDoTempo()")}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.events.register("moveend",i3geoOL,function(e){try{window.parent.wdocai.atualizaLinhaDoTempo()}catch(x){}})}},gradePontos:function(){if(typeof(i3GEOF.gradeDePontos)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/gradepontos/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.gradeDePontos.criaJanelaFlutuante()","i3GEOF.gradeDePontos_script")}},gradePol:function(){if(typeof(i3GEOF.gradeDePontos)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/gradepol/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.gradeDePoligonos.criaJanelaFlutuante()","i3GEOF.gradeDePoligonos_script")}},gradeHex:function(){if(typeof(i3GEOF.gradeDeHex)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/gradehex/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.gradeDeHex.criaJanelaFlutuante()","i3GEOF.gradeDePoligonos_script")}},analisaGeometrias:function(){if(typeof(i3GEOF.analisaGeometrias)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/analisageometrias/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.analisaGeometrias.criaJanelaFlutuante()","i3GEOF.analisaGeometrias_script")}},pontosdistri:function(){if(i3GEO.parametros.r=="nao"){alert("Opção não disponível")}else{if(typeof(i3GEOF.pontosDistri)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/pontosdistri/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.pontosDistri.criaJanelaFlutuante()","i3GEOF.pontosDistri_script")}}},pontoempoligono:function(){if(typeof(i3GEOF.pontoEmPoligono)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/pontoempoligono/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.pontoEmPoligono.criaJanelaFlutuante()","i3GEOF.pontoEmPoligono_script")}},nptPol:function(){if(typeof(i3GEOF.nptpol)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/nptpol/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.nptpol.criaJanelaFlutuante()","i3GEOF.nptpol_script")}},buffer:function(){if(typeof(i3GEOF.buffer)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/buffer/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.buffer.criaJanelaFlutuante()","i3GEOF.buffer_script")}},distanciaptpt:function(){if(typeof(i3GEOF.distanciaptpt)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/distanciaptpt/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.distanciaptpt.criaJanelaFlutuante()","i3GEOF.distanciaptpt_script")}},centroide:function(){if(typeof(i3GEOF.centroide)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/centroide/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.centroide.criaJanelaFlutuante()","i3GEOF.centroide_script")}},dissolve:function(){if(typeof(i3GEOF.agrupaElementos)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/dissolve/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.dissolve.criaJanelaFlutuante()","i3GEOF.dissolve_script")}},agrupaElementos:function(){if(typeof(i3GEOF.agrupaElementos)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/agrupaelementos/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.agrupaElementos.criaJanelaFlutuante()","i3GEOF.agrupaElementos_script")}}},medeDistancia:{inicia:function(){pontosdistobj={xpt:[],ypt:[],dist:[],xtela:[],ytela:[],ximg:[],yimg:[],linhas:[]};i3GEO.analise.medeDistancia.criaJanela();if(g_tipoacao!="mede"){if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.analise.medeDistancia.clique()")<0){i3GEO.eventos.MOUSECLIQUE.push("i3GEO.analise.medeDistancia.clique()")}if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.analise.medeDistancia.movimento()")<0){i3GEO.eventos.MOUSEMOVE.push("i3GEO.analise.medeDistancia.movimento()")}$i("mostradistancia").style.display="block";if(i3GEO.Interface.ATUAL!="googleearth"){i3GEO.desenho.criaContainerRichdraw();i3GEO.desenho.richdraw.lineColor="black";i3GEO.desenho.richdraw.lineWidth="1px"}g_tipoacao="mede"}else{if(i3GEO.Interface.ATUAL!="googleearth"){i3GEO.desenho.richdraw.fecha()}if($i("mostradistancia")){$i("mostradistancia").style.display="none"}if($i("pontosins")){$i("pontosins").style.display="none"}}},criaJanela:function(){var novoel,ins,imagemxy;if(!$i("mostradistancia")){novoel=document.createElement("div");novoel.id="mostradistancia";ins='<div class="hd" > <a class=ajuda_usuario target=_blank href="'+i3GEO.configura.locaplic+'/ajuda_usuario.php?idcategoria=6&idajuda=50" > </a></div>';ins+='<div class="bd" style="text-align:left;padding:3px;" >';ins+='<div style="text-align:left;padding:3px;" id="mostradistancia_calculo" ></div>';ins+='<div style="text-align:left;font-size:10px" >';ins+="<span style='color:navy;cursor:pointer;text-align:left;' >";ins+="<table><tr><td><input style='cursor:pointer' type='checkbox' id='pararraios' checked /></td><td>Raios</td><td> </td>";ins+="<td><input style='cursor:pointer' type='checkbox' id='parartextos' checked /></td><td>Textos<td></tr></table></span>";ins+='</div>';ins+='</div>';novoel.innerHTML=ins;novoel.style.borderColor="gray";document.body.appendChild(novoel)}else{if($i("mostradistancia_calculo")){$i("mostradistancia_calculo").innerHTML=""}}YAHOO.namespace("janelaDocamede.xp");YAHOO.janelaDocamede.xp.panel=new YAHOO.widget.Panel("mostradistancia",{width:300,fixedcenter:false,constraintoviewport:true,underlay:"none",close:true,visible:true,draggable:true,modal:false});YAHOO.janelaDocamede.xp.panel.render();imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));YAHOO.janelaDocamede.xp.panel.moveTo(imagemxy[0]+150,imagemxy[1]);YAHOO.util.Event.addListener(YAHOO.janelaDocamede.xp.panel.close,"click",i3GEO.analise.medeDistancia.fechaJanela)},fechaJanela:function(){if(i3GEO.Interface.ATUAL!="googleearth"){i3GEO.desenho.richdraw.fecha()}else{i3GEO.Interface.googleearth.removePlacemark("divGeometriasTemp")}if($i("pontosins")){document.body.removeChild($i("pontosins"))}YAHOO.util.Event.removeListener(YAHOO.janelaDocamede.xp.panel.close,"click");i3GEO.eventos.MOUSECLIQUE.remove("i3GEO.analise.medeDistancia.clique()");i3GEO.eventos.MOUSEMOVE.remove("i3GEO.analise.medeDistancia.movimento()");i3GEO.barraDeBotoes.ativaBotoes()},clique:function(){var n,d,decimal;if(g_tipoacao=="mede"){n=pontosdistobj.xpt.length;pontosdistobj.xpt[n]=objposicaocursor.ddx;pontosdistobj.ypt[n]=objposicaocursor.ddy;pontosdistobj.xtela[n]=objposicaocursor.telax;pontosdistobj.ytela[n]=objposicaocursor.telay;pontosdistobj.ximg[n]=objposicaocursor.imgx;pontosdistobj.yimg[n]=objposicaocursor.imgy;pontosdistobj.dist[n]=0;if(i3GEO.Interface.ATUAL!="googleearth"){try{if(navn){pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1),(pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1))}else{pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n])}}catch(e){}}if(n>0){d=i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);decimal=0;d=d+"";d=d.split(".");decimal=d[1].substr(0,5);d=d[0]+"."+decimal;d=d*1;pontosdistobj.dist[n]=d+pontosdistobj.dist[n-1];if(i3GEO.Interface.ATUAL!=="googleearth"){if($i("pararraios")&&$i("pararraios").checked===true){i3GEO.desenho.aplica("insereCirculo","",n);if(navm){pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n-1],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n])}}if($i("parartextos")&&$i("parartextos").checked===true){i3GEO.desenho.aplica("insereTexto","",n,d+" km")}}}if(i3GEO.Interface.ATUAL!=="googleearth"){i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.analise.medeDistancia.fechaJanela,"divGeometriasTemp")}else{i3GEO.util.insereMarca.cria(objposicaocursor.ddx,objposicaocursor.ddy,i3GEO.analise.medeDistancia.fechaJanela,"divGeometriasTemp")}}},movimento:function(){var n,d,r,decimal,da,mostra;if(g_tipoacao=="mede"){if($i("mostradistancia")){$i("mostradistancia").style.display="block"}n=pontosdistobj.xpt.length;try{if(n>0){d=i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);r=i3GEO.calculo.direcao(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);r=i3GEO.calculo.dd2dms(r,r);r=r[0];d=d+"";d=d.split(".");decimal=d[1].substr(0,5);d=d[0]+"."+decimal;d=d*1;da=d+pontosdistobj.dist[n-1];da=da+"";da=da.split(".");decimal=da[1].substr(0,5);da=da[0]+"."+decimal;da=da*1;mostra=$i("mostradistancia_calculo");if(mostra){mostra.innerHTML=" Dist acum.= "+da+" km <br>atual= "+d+" km <br> Direção (DMS)= "+r}if(i3GEO.Interface.ATUAL!="googleearth"){i3GEO.desenho.aplica("resizeLinha",pontosdistobj.linhas[n-1],n)}}}catch(e){}}}},medeArea:{inicia:function(){var temp;pontosdistobj=[];i3GEO.analise.medeArea.criaJanela();if(g_tipoacao!="area"){$i("mostraarea_calculo").innerHTML="";if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.analise.medeArea.clique()")<0){i3GEO.eventos.MOUSECLIQUE.push("i3GEO.analise.medeArea.clique()")}if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.analise.medeArea.movimento()")<0){i3GEO.eventos.MOUSEMOVE.push("i3GEO.analise.medeArea.movimento()")}YAHOO.util.Event.addListener(YAHOO.janelaDocaarea.xp.panel.close,"click",i3GEO.analise.medeArea.fechaJanela);temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.atualiza");g_areapixel=retorno.data;if(g_areapixel<0){alert("Nao e possivel calcular a area. Entre em contato com o administrador do sistema.")}else{$i("mostraarea_calculo").innerHTML="Clique no mapa para desenhar o poligono. Clique duas vezes para concluir";i3GEO.barraDeBotoes.ativaIcone("area");g_tipoacao="area";i3GEO.desenho.criaContainerRichdraw();i3GEO.desenho.richdraw.lineColor="green";i3GEO.desenho.richdraw.lineWidth="2px"}};if(i3GEO.Interface.ATUAL=="padrao"){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.php.areaPixel(temp,i3GEO.parametros.pixelsize)}else{alert("Operacao nao disponivel")}}else{i3GEO.desenho.richdraw.fecha()}},criaJanela:function(){var novoel,ins,imagemxy;if(!$i("mostraarea")){novoel=document.createElement("div");novoel.id="mostraarea";ins="<div class='hd' >Área aproximada <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=51' > </a></div>";ins+='<div class="bd" style="text-align:left;padding:3px;" >';ins+='<div style="text-align:left;padding:3px;font-size:10px" id="mostraarea_calculo" ></div>';ins+='</div>';novoel.innerHTML=ins;novoel.style.borderColor="gray";document.body.appendChild(novoel)}YAHOO.namespace("janelaDocaarea.xp");YAHOO.janelaDocaarea.xp.panel=new YAHOO.widget.Panel("mostraarea",{width:220,fixedcenter:false,constraintoviewport:true,underlay:"none",close:true,visible:true,draggable:true,modal:false});YAHOO.janelaDocaarea.xp.panel.render();imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));YAHOO.janelaDocaarea.xp.panel.moveTo(imagemxy[0]+150,imagemxy[1])},fechaJanela:function(){i3GEO.desenho.richdraw.fecha();if($i("pontosArea")){document.body.removeChild($i("pontosArea"))}i3GEO.eventos.MOUSECLIQUE.remove("cliqueArea()");i3GEO.eventos.MOUSEMOVE.remove("moveArea()");i3GEO.barraDeBotoes.ativaBotoes()},clique:function(){var n,m;if(g_tipoacao=="area"){n=pontosdistobj.xpt.length;pontosdistobj.xpt[n]=objposicaocursor.ddx;pontosdistobj.ypt[n]=objposicaocursor.ddy;pontosdistobj.xtela[n]=objposicaocursor.telax;pontosdistobj.ytela[n]=objposicaocursor.telay;pontosdistobj.ximg[n]=objposicaocursor.imgx;pontosdistobj.yimg[n]=objposicaocursor.imgy;pontosdistobj.dist[n]=0;if(n===0){try{if(navn){pontosdistobj.linhastemp=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[0]-1,pontosdistobj.yimg[0]-1)}else{pontosdistobj.linhastemp=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[0])-(i3GEO.parametros.w/2),pontosdistobj.yimg[0])}}catch(e){}}try{if(navn){pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1)}else{pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n])}}catch(e){}m=i3GEO.calculo.area(pontosdistobj,g_areapixel);if($i("mostraarea_calculo")){$i("mostraarea_calculo").innerHTML="<br>m2</b>= "+m.toFixed(2)+"<br><b>km2</b>= "+(m/1000000).toFixed(2)+"<br><b>ha</b>= "+(m/10000).toFixed(2)}i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.analise.medeArea.fechaJanela,"pontosArea")}},movimento:function(){var n,d,decimal,da;if(g_tipoacao=="area"){n=pontosdistobj.xpt.length;if(n>0){if(navm){i3GEO.desenho.aplica("resizePoligono",pontosdistobj.linhas[n-1],n)}else{i3GEO.desenho.aplica("resizePoligono",pontosdistobj.linhastemp,1);i3GEO.desenho.aplica("resizeLinha",pontosdistobj.linhas[n-1],n)}}}}}}; | ... | ... |
classesjs/i3geo_tudo_compacto.js.php
... | ... | @@ -147,7 +147,7 @@ if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.configura={grupoLayers:"",oMenuDa |
147 | 147 | function i3GEOmantemCompatibilidade(){try{i3GEO.configura.oMenuData=oMenuData}catch(e){}try{i3GEO.configura.tipoimagem=g_tipoimagem}catch(e){}try{i3GEO.configura.tipotip=g_tipotip}catch(e){}try{i3GEO.configura.funcaoTip=g_funcaoTip}catch(e){}try{i3GEO.configura.map3d=g_3dmap}catch(e){}try{i3GEO.configura.embedLegenda=g_embedLegenda}catch(e){}try{i3GEO.configura.templateLegenda=g_templateLegenda}catch(e){}try{if(objmapa.finaliza!="")i3GEO.finaliza=objmapa.finaliza}catch(e){};g_arvoreClick="";g_arvoreClicks="";if($i("longlat")){atualizalonglat=function(){$i("longlat").innerHTML=objposicaocursor.dmsx+" "+objposicaocursor.dmsy};YAHOO.util.Event.addListener($i("img"),"mousemove",atualizalonglat)}try{if(g_opcoesTemas=="nao"){i3GEO.arvoreDeCamadas.OPCOESTEMAS=false}}catch(e){};try{i3GEO.maparef.fatorZoomDinamico=g_zoomRefDinamico}catch(e){};try{i3GEO.configura.mashuppar=g_mashuppar}catch(e){};try{if(!$i("arvoreAdicionaTema")){i3GEO.arvoreDeTemas.IDHTML=objmapa.guiaMenu+"obj"}else{i3GEO.arvoreDeTemas.IDHTML="arvoreAdicionaTema"}}catch(e){};try{if(g_uploaddbf=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.uploaddbf=false}}catch(e){};try{if(g_uploadlocal=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.uploadlocal=false}}catch(e){};try{if(g_downloadbase=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.downloadbase=false}}catch(e){};try{if(g_conectarwms=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.conectarwms=false}}catch(e){};try{if(g_conectargeorss=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.conectargeorss=false}}catch(e){};try{if(g_nuvemTags=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.nuvemTags=false}}catch(e){};try{if(g_kml=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.kml=false}}catch(e){};try{if(g_qrcode=="nao"){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.qrcode=false}}catch(e){};try{if(g_tipoacao!=""){i3GEO.barraDeBotoes.BOTAOPADRAO=g_tipoacao}}catch(e){}try{if(g_listaPropriedades){i3GEO.configura.listaDePropriedadesDoMapa=g_listaPropriedades}}catch(e){};try{if(g_tempo_aplicar){i3GEO.configura.tempoAplicar=g_tempo_aplicar}}catch(e){};try{if(g_janelaMen=="nao"){i3GEO.configura.iniciaJanelaMensagens=false}}catch(e){};try{if(g_locaplic){i3GEO.configura.locaplic=g_locaplic}}catch(e){};try{if(g_tempotip){i3GEO.configura.tempoMouseParado=g_tempotip}}catch(e){};try{if(g_mostraRosa){i3GEO.configura.mostraRosaDosVentos=g_mostraRosa}}catch(e){};try{if(g_visual){i3GEO.configura.visual=g_visual}}catch(e){};try{if(g_mapaRefDisplay){i3GEO.configura.mapaRefDisplay=g_mapaRefDisplay}}catch(e){};try{if(g_docaguias){i3GEO.configura.liberaGuias=g_docaguias}}catch(e){};if(window.location.href.split("?")[1]){g_sid=window.location.href.split("?")[1];if(g_sid.split("#")[0]){g_sid=g_sid.split("#")[0]}}else{g_sid=""}i3GEO.configura.sid=g_sid;try{i3GEO.guias.ATUAL=g_guiaativa}catch(e){}try{i3GEO.navega.autoRedesenho.INTERVALO=g_autoRedesenho}catch(e){}try{i3GEO.eventos.NAVEGAMAPA=g_funcoesNavegaMapaDefault}catch(e){}try{i3GEO.eventos.MOUSEMOVE=g_funcoesMousemoveMapaDefault}catch(e){}try{i3GEO.eventos.MOUSECLIQUE=g_funcoesClickMapaDefault}catch(e){}try{i3GEO.configura.entorno=g_entorno}catch(e){}try{i3GEO.navega.lente.POSICAOX=g_posicaoLenteX=0}catch(e){}try{i3GEO.navega.lente.POSICAOY=g_posicaoLenteY}catch(e){}try{i3GEO.navega.destacaTema.TAMANHO=destacaTamanho}catch(e){}if(!$i("tip")){var novoel=document.createElement("div");novoel.id="tip";novoel.style.position="absolute";novoel.style.zIndex=5000;if(navm){novoel.style.filter="alpha(opacity=90)"}document.body.appendChild(novoel)}try{objmapa.atualizaListaTemas=function(temas){alert("atualizaListaTemas foi depreciado. Utilize i3GEO.arvoreDeCamadas")}}catch(e){}}if(typeof(i3GEO)=='undefined'){i3GEO=[]}cpObj=new cpaint();cpObj.set_async("true");cpObj.set_response_type("JSON");function Mapa(e,m){i3GEO.cria();this.inicializa=function(){i3GEO.finaliza=this.finaliza;i3GEO.inicia()}}objaguarde={abre:function(){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"))},fecha:function(){i3GEO.janela.fechaAguarde("i3GEO.atualiza")}};function iCookie(nome,valor){i3GEO.util.insereCookie(nome,valor)}function pCookie(nome){i3GEO.util.pegaCookie(nome)}function trocalingua(l){i3GEO.idioma.trocaIdioma(l);alert("trocalingua foi depreciado utilize i3GEO.idioma")}function initJanelaMen(){i3GEO.ajuda.abreJanela();alert("initJanelaMen foi depreciado utilize i3GEO.ajuda")}function pegalistademenus(retorno){alert("Funcao pegalistademenus foi depreciado. Utilize i3GEO.arvoreDeTemas")}function wdocaf(wlargura,waltura,wsrc,nx,ny,texto){var janela=i3GEO.janela.cria(wlargura,waltura,wsrc,nx,ny,texto)}function redimwdocaf(w,h){i3GEO.janela.alteraTamanho(w,h);alert("redimwdocaf foi depreciado utilize i3GEO.janela")}function wdocaf2(wlargura,waltura,wsrc,nx,ny,texto){var id=YAHOO.util.Dom.generateId();i3GEO.janela.cria(wlargura,waltura,wsrc,nx,ny,texto,id,true)}function wdocafechaf(odoca){alert("wdocafechaf foi depreciado")}function mostradicasf(objeto,dica,hlpt){i3GEO.ajuda.mostraJanela(dica);alert("mostradicasf foi depreciado utilize i3GEO.ajuda")}function mudaboxnf(tipo,obj,nomeFuncao){alert("mudaboxnf foi depreciado")}function procurartemas(texto){alert("procurartemas foi depreciado")}function expandeTema(itemID){var tema=itemID.split("legenda");if(tema.length==2){g_arvoreClick=itemID;tema=tema[1];var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=criaLegendaHTML&template=legenda2.htm&tema="+tema+"&g_sid="+g_sid;cpObj.call(p,"criaLegenda",expandeLegendaVer)}alert("expandeTema foi depreciado")}function pegavalSistemas(sis){alert("Funcao pegavalSistemas foi depreciada - veja i3GEO.arvoreDeTemas")}function processevent1(exy1){}function removeAcentos(palavra){return(i3GEO.util.removeAcentos(palavra));alert("removeAcentos foi depreciado utilize i3GEO.util")}function ativaMensagemBanner(){alert("ativaMensagemBanner fooi depreciado utilize i3GEO.ajuda")}function mensagemBanner(){}function mensagemf(m){alert("mensagemf foi depreciado");try{if(!$i("mensagem")){var novoel=document.createElement("div");novoel.id='mensagem';novoel.innerHTML='<table width="50" style="border: 1px solid #000000;"> <tr> <td onclick="mensagemf()" style="text-align:left;cursor:pointer" class="tdclara"> <img src="'+g_locaplic+'/imagens/excluir.png" /> </td> <td style="text-align:left" class="tdclara"> <input style="text-align:left" class="textocb" type="text" id="mensagemt" size="70" value="" /> </td></tr> </table>';if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}}if(m==null){$i("mensagem").style.visibility="hidden"}else{$i("mensagemt").value=m;$i("mensagem").style.visibility="visible"}var pos=pegaPosicaoObjeto($i("img"));pos[1]=pos[1]+parseInt($i("img").style.height)-22;eval('document.getElementById("mensagem").style.'+g_tipoleft+' = pos[0] + g_postpx');eval('document.getElementById("mensagem").style.'+g_tipotop+' = pos[1] + g_postpx')}catch(e){alert("Impossivel criar mensagem."+e)}}function aguarde(){alert("aguarde foi depreciado utilize i3GEO.janela");this.abre=function(aguardeId,texto){i3GEO.janela.abreAguarde(aguardeId,texto)};this.fecha=function(aguardeId){i3GEO.janela.fechaAguarde(aguardeId)}}function zoomiauto(){alert("zoomiauto foi depreciado utilize i3GEO.navega");i3GEO.navega.zoomin(g_locaplic,g_sid)}function zoomoauto(){alert("zoomoauto foi depreciado utilize i3GEO.navega");i3GEO.navega.zoomout(g_locaplic,g_sid)}function convdmsddf(cd,cm,cs){alert("convdmsddf foi depreciado utilize i3GEO.calculo");return(i3GEO.calculo.dsm2dd(cd,cm,cs))}function zoomPonto(){alert("utilize i3GEO.navega.zoomponto")}function zoomIP(){alert("zoomIP foi depreciado. Utilize i3GEO.navega.zoomIP")}function zoomtot(){alert("zoomtot foi depreciado. Utilize i3GEO.navega.zoomExt")}function panFixo(direcao,w,h,escala){alert("panFixo foi depreciado. Utilize i3GEO.navega.panFixo")}function protocolo(){alert("protocolo foi depreciado utilize i3GEO.util");return(i3GEO.util.protocolo())}function borra(){}function pegaPosicaoObjeto(obj){alert("pegaPosicaoObjeto foi depreciado utilize i3GEO.util");return(i3GEO.util.pegaPosicaoObjeto(obj))}function i3geo_pegaElementoPai(e){alert("i3geo_pegaElementoPai foi depreciado utilize i3GEO.util");return(i3GEO.util.pegaElementoPai(e))}function convddtela(vx,vy,docmapa){alert("convddtela foi depreciado utilize i3GEO.calculo");return(i3GEO.calculo.dd2tela(vx,vy,docmapa,i3GEO.parametros.extent,i3GEO.parametros.pixelsize))}function convdmsf(x,y){alert("convdmsf foi depreciado utilize i3GEO.calculo");return(i3GEO.calculo.dd2dms(x,y))}function calcddf(xfign,yfign,g_celula,imgext){alert("calcddf foi depreciado utilize i3GEO.calculo");return(i3GEO.calculo.tela2dd(xfign,yfign,g_celula,imgext))}function movecursor(){if($i("obj")){if($i("openlayers")||$i("flamingo")){$i("obj").style.display="none"}else{var obje=$i("obj").style;if($i("img")){eval("obje."+g_tipotop+"= objposicaocursor.telay + 9 + g_postpx");eval("obje."+g_tipoleft+"= objposicaocursor.telax + 9 + g_postpx")}else{eval("obje."+g_tipotop+"= objposicaocursor.telay - 15 + g_postpx");eval("obje."+g_tipoleft+"= objposicaocursor.telax + 15 + g_postpx")}}}if($i("box1")){var bx=$i("box1");if(bx.style.visibility!="visible"){bx.style.left=objposicaocursor.telax+g_postpx;bx.style.top=objposicaocursor.telay+g_postpx}}}function pegaCoordenadaUTM(){alert("pegaCoordenadaUTM foi depreciado utilize i3GEO.gadgets");i3GEO.gadgets.mostraCoordenadasUTM(g_locaplic,"mostraUTM")}function ativaLocalizarxy(iddiv){alert("ativaLocalizarxy foi depreciado utilize i3GEO.gadgets");i3GEO.gadgets.mostraCoordenadasGEO(iddiv)}function ativaEscalaNumerica(iddiv){alert("ativaEscalaNumerica foi depreciado utilize i3GEO.gadgets");i3GEO.gadgets.mostraEscalaNumerica(iddiv)}function ativaBuscaRapida(iddiv){alert("ativaBuscaRapida foi depreciado utilize i3GEO.gadgets");i3GEO.gadgets.mostraBuscaRapida(iddiv)}function buscaRapida(){i3geo_buscarapida()}function criaboxg(){i3GEO.util.criaBox();i3GEO.util.criaPin();alert("criaboxg foi depreciado utilize i3GEO.util")}function initJanelaZoom(qual){i3GEO.barraDeBotoes.reativa(qual-1)}function sobeferramentas(){}function desceferramentas(){}function mostraRosaDosVentos(){alert("mostraRosaDosVentos foi depreciado utilize i3GEO.navega");i3GEO.navega.mostraRosaDosVentos()}function mudaVisual(visual){alert("visual foi depreciado utilize i3GEO.visual");i3GEO.gadgets.visual.troca(visual)}function visual(iddiv){alert("visual foi depreciado utilize i3GEO.visual");i3GEO.gadgets.visual.inicia(iddiv)}function arvoreclick(itemID){if(itemID.search("tema")==0){if($i(itemID).checked==true){$i(itemID).checked=false}else{$i(itemID).checked=true}}}function pegaTema(celula){var nos=celula.parentNode.childNodes;var tempi=nos.length;for(var no=0;no<tempi;no++){if(nos[no].type=="checkbox"){return nos[no].value}}}function gerafilmef(qs){}function gravaQuadro(variavel,valor){i3GEO.gadgets.quadros.grava(variavel,valor)}function avancaQuadro(){i3GEO.gadgets.quadros.avanca()}function zoomAnterior(){}function zoomProximo(){}function opcoesQuadros(){}function filmef(o){}function rebobinaf(){}function filmezf(o){}function quadrofilme(){}function filmeanimaf(){}function filmeanimarodaf(janima){}function pegaimagens(){}function calculaArea(pontos,pixel){return(i3GEO.calculo.area(pontos,pixel))}function calculadistancia(lga,lta,lgb,ltb){return(i3GEO.calculo.distancia(lga,lta,lgb,ltb))}function initJanelaRef(){i3GEO.maparef.inicia()}function ajaxReferencia(retorno){i3GEO.maparef.processaImagem(retorno)}function clicouRef(){}function movimentoRef(obj){}function mostraTip(retorno){if(!$i("tip")){var novoel=document.createElement("div");novoel.id="tip";novoel.style.position="absolute";novoel.style.zIndex=5000;if(navm){novoel.style.filter="alpha(opacity=90)"}document.body.appendChild(novoel)}var i=$i("i3geo_rosa");if(i)i.style.display="none";var mostra=false;var retorno=retorno.data;if((retorno!="erro")&&(retorno!=undefined)){if($i("img")){$i("img").title=""}if(retorno!=""){var res="<div id='cabecatip' style='text-align:left;background-color:rgb(240,240,240)'><span style='color:navy;cursor:pointer;text-align:left' onclick='javascript:objmapaparado=\"cancela\"'>parar </span>";res+="<span style='color:navy;cursor:pointer;text-align:left' onclick='javascript:i3GEO.janela.TIPS.push($i(\"tip\"));$i(\"tip\").id=\"\";$i(\"cabecatip\").innerHTML =\"\";$i(\"cabecatip\").id =\"\"' >fixar</span></div>";var temas=retorno.split("!");var tema=temas.length-1;if(tema>=0){do{var titulo=temas[tema].split("@");if(g_tipotip=="completo"){res+="<span style='text-align:left;font-size:9pt'><b>"+titulo[0]+"</b></span><br>"}var ocorrencias=titulo[1].split("*");var ocorrencia=ocorrencias.length-1;if(ocorrencia>=0){do{if(ocorrencias[ocorrencia]!=""){var pares=ocorrencias[ocorrencia].split("##");var paresi=pares.length;for(var par=0;par<paresi;par++){var valores=pares[par].split("#");if(g_tipotip=="completo"){res=res+"<span class='tiptexto' style='text-align:left;font-size:9pt'>"+valores[0]+" <i>"+valores[1]+"</i></span><br>";var mostra=true}else{res=res+"<span class='tiptexto' style='text-align:left;font-size:9pt'><i>"+valores[1]+"</i></span><br>";var mostra=true}}}}while(ocorrencia--)}}while(tema--)}if(!mostra){$i("tip").style.display="none";return}if($i("janelaMen")){$i("janelaMenTexto").innerHTML=res}else{var i=$i("tip");i.innerHTML="<table style='text-align:left'><tr><td style='text-align:left'>"+res+"</td></tr></table>";ist=i.style;ist.top=objposicaocursor.telay-10;ist.left=objposicaocursor.telax-20;ist.display="block"}}}}function trataErro(){i3GEO.janela.fechaAguarde()}function mostraguiaf(guia){i3GEO.guias.mostra(guia)}function ativaGuias(){for(var g=0;g<12;g++){if($i("guia"+g))var gpai=$i("guia"+g).parentNode}if(gpai){gpai.id="guiasYUI";gpai.className="yui-navset";var ins='<ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">';try{if($i(objmapa.guiaTemas)){$i(objmapa.guiaTemas).innerHTML=$trad("g1")}if($i(objmapa.guiaMenu)){$i(objmapa.guiaMenu).innerHTML=$trad("g2")}if($i(objmapa.guiaLegenda)){$i(objmapa.guiaLegenda).innerHTML=$trad("g3")}if($i(objmapa.guiaListaMapas)){$i(objmapa.guiaListaMapas).innerHTML=$trad("g4")}}catch(e){};for(var g=0;g<12;g++){if($i("guia"+g)){var tituloguia=$i("guia"+g).innerHTML;var re=new RegExp(" ","g");var tituloguia=tituloguia.replace(re,'');ins+='<li><a href="#"><em><div id="guia'+g+'" >'+tituloguia+'</div></em></a></li>'}}ins+="</ul>";gpai.innerHTML=ins;for(var g=0;g<12;g++){if($i("guia"+g)){eval('$i("guia'+g+'").onclick = function(){g_guiaativa = "guia'+g+'";mostraguiaf('+g+');}');$i("guia"+g).onmouseover=function(){var bcg=this.parentNode.parentNode.style;var cor=bcg.background.split(" ")[0];if(cor!="white")bcg.background="#bfdaff"};$i("guia"+g).onmouseout=function(){var bcg=this.parentNode.parentNode.style;var cor=bcg.background.split(" ")[0];if(cor!="white")bcg.background="transparent"};if($i("guia"+g+"obj")){$i("guia"+g+"obj").style.overflow="auto";$i("guia"+g+"obj").style.height=i3GEO.parametros.h}}}}if($i(objmapa.guiaTemas)){$i(objmapa.guiaTemas).onclick=function(){g_guiaativa=objmapa.guiaTemas;mostraguiaf(1)}}if($i(objmapa.guiaMenu)){$i(objmapa.guiaMenu).onclick=function(){g_guiaativa=objmapa.guiaMenu;mostraguiaf(2);if(!$i("arvoreAdicionaTema")){var ondeArvore=objmapa.guiaMenu+"obj"}else{var ondeArvore="arvoreAdicionaTema"}if(document.getElementById("outrasOpcoesAdiciona")){i3GEO.arvoreDeTemas.OPCOESADICIONAIS.idonde="outrasOpcoesAdiciona";i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluiArvore=false}i3GEO.arvoreDeTemas.cria(i3GEO.configura.sid,i3GEO.configura.locaplic,ondeArvore)}}if($i(objmapa.guiaLegenda)){$i(objmapa.guiaLegenda).onclick=function(){g_guiaativa=objmapa.guiaLegenda;mostraguiaf(4);objmapa.atualizaLegendaHTML()}}if($i(objmapa.guiaListaMapas)){$i(objmapa.guiaListaMapas).onclick=function(){g_guiaativa=objmapa.guiaListaMapas;mostraguiaf(5);if($i("banners")){$i("banners").innerHTML==$trad("o1");var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaMapas&g_sid="+i3GEO.configura.sid;cpObj.call(p,"pegaMapas",pegaMapas)}else{alert("id banners nao encontrado")}}}}function docaguias(){i3GEO.guias.libera()}function autoRedesenho(opcao){}function movePan(){alert("movePan foi depreciado")}function selecao(){}function cliqueSelecao(){}function zoomboxf(tipo){}function i3geo_comboGruposMenu(funcaoOnchange,idDestino,idCombo,largura,altura){}function i3geo_comboSubGruposMenu(funcaoOnchange,idDestino,idCombo,idGrupo,largura,altura){}function i3geo_comboTemasMenu(funcaoOnchange,idDestino,idCombo,idGrupo,idSubGrupo,largura,altura){}function remapaf(){i3GEO.atualiza("")}function limpacontainerf(){}function inseremarcaf(xi,yi,funcaoOnclick,container){i3GEO.utl.insereMarca.cria(xi,yi,funcaoOnclick,container)}function moveSelecaoPoli(){}function cliqueSelecaoPoli(){}function capturaposicao(e){alert("capturaposicao foi depreciado utilize i3GEO.eventos")}function ativaEntorno(){}function geraURLentorno(){}function ajustaEntorno(){}function lenteDeAumento(){alert("lenteDeAumento foi depreciado utilize i3GEO.navega.lente.ativaDesativa()")}function ajaxabrelente(retorno){}function movelentef(){}function destacaTema(tema){alert("destacaTema foi depreciado utilize i3GEO.navega")}function ajaxdestaca(){alert("ajaxdestaca foi depreciado, utilize i3GEO.navega")}function ativaClicks(docMapa){}function incluir(path){i3GEO.util.adicionaSHP(path)}function pontosdist(){this.xpt=[];this.ypt=[];this.dist=[];this.xtela=[];this.ytela=[];this.ximg=[];this.yimg=[];this.linhas=[]}function mudaiconf(i){i3GEO.barraDeBotoes.ativaIcone(i)}function calcposf(){i3GEO.mapa.ajustaPosicao()}function recuperamapa(){}function criaContainerRichdraw(){alert("criaContainerRichdraw foi depreciado utilize i3GEO.desenho")}function desenhoRichdraw(tipo,objeto,n){}function ajaxhttp(){try{var objhttp1=new XMLHttpRequest()}catch(ee){try{var objhttp1=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{var objhttp1=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){var objhttp1=false}}}return(objhttp1)}function ajaxexecAS(programa,funcao){var ohttp=ajaxhttp();ohttp.open("POST",programa,true);var retorno="";ohttp.onreadystatechange=function(){if(ohttp.readyState==4){retorno=ohttp.responseText;var reg=/Warning/gi;if(retorno.search(reg)!=-1){alert("OOps! Ocorreu um erro\n"+retorno);return}var reg=/erro/gi;if(retorno.search(reg)!=-1){alert("OOps! Ocorreu um erro\n"+retorno);return}if(funcao!="volta"){eval(funcao+'("'+retorno+'")')}}};ohttp.send(null)}function ajaxexec(programa,funcao){var objhttp=ajaxhttp();objhttp.open('GET',programa,false);objhttp.send(null);if(objhttp.status==200){if(funcao!="volta"){eval(funcao+'("'+objhttp.responseText+'")')}else{return objhttp.responseText}}}function ajaxLegendaHTML(retorno){}function ajaxLegendaImagem(retorno){}function mede(){}function cliqueMede(){}function moveMede(){}function area(){}function cliqueArea(){}function moveArea(){}function textofid(){}function inserexy(){}function cliqueInseretoponimo(){}function cliqueInserexy(){}function inseregrafico(){}function cliqueInseregrafico(){}function ativaHistoricoZoom(iddiv){}function ajaxhttp(){return i3GEO.util.ajaxhttp()}function ajaxCorpoMapa(retorno){i3GEO.mapa.corpo.veirifca(retorno)}function ajaxredesenha(retorno){i3GEO.atualiza(retorno)}function ajaxIniciaParametros(retorno){i3GEO.atualiza(retorno)}function montaMenuSuspenso(iddiv){i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.idhtml=iddiv;i3GEO.gadgets.mostraMenuSuspenso()} |
148 | 148 | if(typeof(i3GEO)=='undefined'){i3GEO=[]}i3GEO.calculo={dms2dd:function(cd,cm,cs){try{var sinal,spm,mpg,dd;sinal='positivo';if(cd<0){cd=cd*-1;sinal='negativo'}spm=cs/3600;mpg=cm/60;dd=(cd*1)+(mpg*1)+(spm*1);if(sinal=='negativo'){dd=dd*-1}return(dd)}catch(e){return(0)}},dd2tela:function(vx,vy,docmapa,ext,cellsize){try{var pos,latlng,xyn,dc,imgext,c,xy;if(i3GEO.Interface.ATUAL=="googlemaps"){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));latlng=new GLatLng(vy,vx);xyn=i3GeoMap.fromLatLngToContainerPixel(latlng);xy=[];return[(xyn.x)+pos[0],(xyn.y)+pos[1]]}if(i3GEO.Interface.ATUAL=="openlayers"){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xy=i3geoOL.getViewPortPxFromLonLat(new OpenLayers.LonLat(vx,vy));return[(xy.x)+pos[0],(xy.y)+pos[1]]}if(arguments.length==3){ext=i3GEO.parametros.mapexten;cellsize=i3GEO.parametros.pixelsize}if(arguments.length==4){cellsize=i3GEO.parametros.pixelsize}if(!docmapa){docmapa=window.document}dc=docmapa;pos=i3GEO.util.pegaPosicaoObjeto(dc);imgext=ext.split(" ");vx=(vx*1)-(imgext[0]*1);vy=(vy*-1)+(imgext[3]*1);c=cellsize*1;return[(vx/c)+pos[0],(vy/c)+pos[1]]}catch(e){return([])}},dd2dms:function(x,y){var restod,mx,sx,mm,restos,my,sy,s,dx,dy;dx=parseInt(x,10);if(dx>0){restod=x-dx}if(dx<0){restod=(x*-1)-(dx*-1)}if(restod!==0){mm=restod*60;mx=parseInt(restod*60,10);restos=mm-mx;if(restos!==0){s=restos*60;s=(s+"_").substring(0,5);sx=s}}else{mx="00";sx="00.00"}dy=parseInt(y,10);if(dy>0){restod=y-dy}if(dy<0){restod=(y*-1)-(dy*-1)}if(restod!==0){mm=restod*60;my=parseInt(restod*60,10);restos=mm-my;if(restos!==0){s=restos*60;s=(s+"_").substring(0,5);sy=s}}else{my="00";sy="00.00"}return[dx+" "+mx+" "+sx,dy+" "+my+" "+sy]},tela2dd:function(xfign,yfign,g_celula,imgext){try{var amext,longdd,latdd;if(navm){xfign=xfign-2.2;yfign=yfign-2.7}else{xfign=xfign-0.12;yfign=yfign-1.05}amext=imgext.split(" ");longdd=(amext[0]*1)+(g_celula*xfign);latdd=(amext[3]*1)-(g_celula*yfign);return[longdd,latdd]}catch(e){return(0)}},area:function(pontos,pixel){var $polygon_area,$i,$array_length;try{if(pontos.xpt.length>2){$array_length=pontos.xpt.length;pontos.xtela.push(pontos.xtela[0]);pontos.ytela.push(pontos.ytela[0]);pontos.xtela.push(pontos.xtela[0]);pontos.ytela.push(pontos.ytela[1]);$polygon_area=0;for($i=0;$i<=$array_length;$i++){$polygon_area+=((pontos.xtela[$i]*pontos.ytela[$i+1])-(pontos.ytela[$i]*pontos.xtela[$i+1]))}$polygon_area=Math.abs($polygon_area)/2}else{$polygon_area="Sao necessarios pelo menos tres pontos para o calculo"}return $polygon_area*pixel}catch(e){return(0)}},distancia:function(lon1,lat1,lon2,lat2){var dLat,dLon,a,c,d;dLat=((lat2-lat1))*Math.PI/180;dLon=((lon2-lon1))*Math.PI/180;a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(lat1*Math.PI/180)*Math.cos(lat2*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2);c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));d=6371*c;return d},direcao:function(lon1,lat1,lon2,lat2){var dLon,y,x,r;lat1=lat1*(Math.PI/180);lat2=lat2*(Math.PI/180);dLon=(lon2-lon1)*(Math.PI/180);y=Math.sin(dLon)*Math.cos(lat2);x=Math.cos(lat1)*Math.sin(lat2)-Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);r=Math.atan2(y,x);r=r*180/Math.PI;r=r+360;return r%360},destinoDD:function(lon,lat,d,direcao){var R,lat1,lon1,brng,lat2,lon2;R=6371;lat1=lat*(Math.PI/180);lon1=lon*(Math.PI/180);brng=direcao*(Math.PI/180);lat2=Math.asin(Math.sin(lat1)*Math.cos(d/R)+Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng));lon2=lon1+Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));lon2=(lon2+Math.PI)%(2*Math.PI)-Math.PI;if(isNaN(lat2)||isNaN(lon2)){return null}return[(lon2*180/Math.PI),(lat2*180/Math.PI)]},rect2ext:function(idrect,mapext,pixel){var bx,bxs,xfig,yfig,nx,ny,pix,piy,pos,amext,dx,dy,x1,y1,x2,y2;eval('pix = parseInt(document.getElementById("'+idrect+'").style.'+g_tipoleft+")");eval('piy = parseInt(document.getElementById("'+idrect+'").style.'+g_tipotop+")");if($i(idrect)){bx=$i(idrect);bxs=bx.style}else{alert("Box nao encontrado");return}pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xfig=pix+(parseInt(bxs.width,10))-pos[0];yfig=piy+(parseInt(bxs.height,10))-pos[1];amext=mapext.split(" ");dx=((amext[0]*-1)-(amext[2]*-1))/-1;dy=((amext[1]*1)-(amext[3]*1))/-1;if(dy<0){dy=dy*-1}nx=pixel*xfig;ny=pixel*yfig;x1=(amext[0]*1)+nx;y1=(amext[3]*1)-ny;xfig=pix-pos[0];yfig=piy-pos[1];if(dy<0){dy=dy*-1}nx=pixel*xfig;ny=pixel*yfig;x2=(amext[0]*1)+nx;y2=(amext[3]*1)-ny;return[x2+" "+y2+" "+x1+" "+y1,x1,y1,x2,y2]},ext2rect:function(idrect,mapext,boxext,pixel,documento){var rectbox,rectmap,xyMin,xyMax,w,h,tl,pos,t,l,d,box;rectbox=boxext.split(" ");rectmap=mapext.split(" ");xyMin=i3GEO.calculo.dd2tela(rectbox[0],rectbox[1],documento,boxext,pixel);xyMax=i3GEO.calculo.dd2tela(rectbox[2],rectbox[3],documento,boxext,pixel);w=xyMax[0]-xyMin[0];h=xyMin[1]-xyMax[1];tl=i3GEO.calculo.dd2tela(rectbox[0],rectbox[3],documento,mapext,pixel);pos=i3GEO.util.pegaPosicaoObjeto(documento);t=tl[1]-pos[1];l=tl[0]-pos[0];d="block";if($i(idrect)){box=$i(idrect);box.style.width=w;box.style.height=h;box.style.top=t+"px";box.style.left=l+"px";box.style.display=d}return[w,h,xyMax[1],xyMin[0]]}}; |
149 | 149 | if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.desenho={richdraw:"",criaContainerRichdraw:function(){pontosdistobj={xpt:[],ypt:[],dist:[],xtela:[],ytela:[],ximg:[],yimg:[],linhas:[]};if(i3GEO.Interface.ATUAL==="googleearth"){return}try{var divgeo,renderer;divgeo=i3GEO.desenho.criaDivContainer();divgeo.innerHTML="";try{renderer=new VMLRenderer();i3GEO.desenho.richdraw=new RichDrawEditor(divgeo,renderer)}catch(erro){renderer=new SVGRenderer();i3GEO.desenho.richdraw=new RichDrawEditor(divgeo,renderer)}i3GEO.desenho.richdraw.editCommand('fillcolor','red');i3GEO.desenho.richdraw.editCommand('linecolor','gray');i3GEO.desenho.richdraw.editCommand('linewidth','1px');i3GEO.desenho.richdraw.editCommand('mode','line');divgeo.style.display="block";i3GEO.eventos.ativa(divgeo)}catch(erro){alert("Erro ao tentar criar container richdraw")}},criaDivContainer:function(){if(!$i("divGeometriasTemp")){var pos,novoel,ne;pos=[0,0];pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));novoel=document.createElement("div");novoel.id="divGeometriasTemp";ne=novoel.style;ne.cursor="crosshair";ne.zIndex=0;ne.position="absolute";ne.width=i3GEO.parametros.w;ne.height=i3GEO.parametros.h;ne.border="1px solid black";ne.display="none";ne.top=pos[1];ne.left=pos[0];document.body.appendChild(novoel)}return($i("divGeometriasTemp"))},aplica:function(tipo,objeto,n,texto){var pos,r,elemento,elementos,dy,dx,w;if(i3GEO.desenho.richdraw&&$i(i3GEO.Interface.IDCORPO)){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if((tipo==="resizeLinha")||(tipo==="resizePoligono")&&navn){try{i3GEO.desenho.richdraw.renderer.resize(objeto,0,0,objposicaocursor.imgx,objposicaocursor.imgy)}catch(erro){}}if((tipo==="resizeLinha")&&navm){try{r=$i(i3GEO.desenho.richdraw.container.id);elemento=r.lastChild;if(elemento.innerHTML!==""){elementos=r.childNodes;if(elementos.length>3){elemento=elementos[elementos.length-3]}else{elemento=elementos[elementos.length-2]}}r.removeChild(elemento);dy=objposicaocursor.imgy;dx=objposicaocursor.imgx-(i3GEO.parametros.w/2);i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2)-1,pontosdistobj.yimg[n-1]-3,dx,dy-3)}catch(erro){}}if((tipo==="resizePoligono")&&navm){try{r=$i(i3GEO.desenho.richdraw.container.id);r.removeChild(r.lastChild);r.removeChild(r.lastChild);dy=objposicaocursor.imgy;dx=objposicaocursor.imgx-(i3GEO.parametros.w/2);i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2)-1,pontosdistobj.yimg[n-1]-3,dx,dy-3);i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[0])-(i3GEO.parametros.w/2)-1,pontosdistobj.yimg[0]-3,dx,dy-3)}catch(erro){}}if(tipo==="insereCirculo"){dx=Math.pow(((pontosdistobj.xtela[n])*1)-((pontosdistobj.xtela[n-1])*1),2);dy=Math.pow(((pontosdistobj.ytela[n])*1)-((pontosdistobj.ytela[n-1])*1),2);w=Math.sqrt(dx+dy);if(navn){try{i3GEO.desenho.richdraw.renderer.create('circ','','rgb(250,250,250)',i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n-1],pontosdistobj.yimg[n-1],w,w)}catch(erro){}}else{try{i3GEO.desenho.richdraw.renderer.create('circ','','rgb(250,250,250)',i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n-1]-w,pontosdistobj.yimg[n-1]-w,w*2,w*2)}catch(erro){}}}if(tipo==="insereTexto"){try{i3GEO.desenho.richdraw.renderer.create('text','','rgb(250,250,250)',i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n-1],pontosdistobj.yimg[n-1],"","",texto)}catch(erro){}}}}}; |
150 | -if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.Interface={OUTPUTFORMAT:"AGG_Q",BARRABOTOESTOP:12,BARRABOTOESLEFT:3,ATUAL:"padrao",IDCORPO:"corpoMapa",ATIVAMENUCONTEXTO:false,IDMAPA:"",redesenha:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.redesenha()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.redesenha()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.redesenha()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.redesenha()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.redesenha()}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.adicionaKml("foo")}},cria:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.cria(w,h)}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.cria(w,h)}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.cria(w,h)}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.cria(w,h)}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.cria(w,h)}},inicia:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.inicia()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.inicia()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.inicia()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.inicia()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.inicia()}},ativaBotoes:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.ativaBotoes()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.ativaBotoes()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.ativaBotoes()}},padrao:{TRANSICAO:false,redesenha:function(){var ndiv,i;if(!$i("img")){i3GEO.janela.fechaAguarde();return}$i("img").onload=function(){var imagem,temp;imagem=$i("img");imagem.onload="";i3GEO.gadgets.quadros.grava("imagem",i3GEO.parametros.mapimagem);i3GEO.gadgets.quadros.grava("extensao",i3GEO.parametros.mapexten);temp=function(retorno){eval(retorno.data);i3GEO.gadgets.quadros.grava("legenda",legimagem)};if(i3GEO.gadgets.quadros.geraLegenda===true){i3GEO.mapa.legendaIMAGEM.obtem(temp)}if(i3GEO.Interface.padrao.TRANSICAO===true){if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",50,5,true)}i3GEO.util.aparece("img",50,5)}else{if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",15,5,true)}i3GEO.util.aparece("img",5,5)}i3GEO.janela.fechaAguarde("ajaxCorpoMapa")};if(!$i("imgtemp")){ndiv=document.createElement("div");ndiv.id="imgtemp";ndiv.style.position="absolute";ndiv.style.border="1px solid blue";document.getElementById("corpoMapa").appendChild(ndiv)}if(g_tipoacao==="pan"&&i3GEO.barraDeBotoes.BOTAOCLICADO==="pan"){$i("imgtemp").style.left=parseInt($i("img").style.left,10);$i("imgtemp").style.top=parseInt($i("img").style.top,10);$i("imgtemp").style.width=i3GEO.parametros.w;$i("imgtemp").style.height=i3GEO.parametros.h}$i("imgtemp").style.backgroundImage='url("'+$i("img").src+'")';$i("imgtemp").style.display="block";i=$i("img");i.style.display="none";i.style.left=0;i.style.top=0;i.src=i3GEO.parametros.mapimagem},cria:function(){var ins="<input style='position:relative;top:0px;left:0px'' type=image src='' id='img' />",temp=$i(i3GEO.Interface.IDCORPO);if(temp){temp.innerHTML=ins}i3GEO.Interface.IDMAPA="img"},ativaMenuContexto:function(){var temp,oFieldContextMenuItemData,oFieldContextMenu,onFieldMenuRender;temp=$i("contexto_"+i3GEO.Interface.IDMAPA);if(temp){temp.parentNode.removeChild(temp)}oFieldContextMenuItemData=[{text:" <span class='container-close'></span>"},{text:"<img class='rosamais' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Aproxima</span>",onclick:{fn:i3GEO.navega.zoomin}},{text:"<img class='rosamenos' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Afasta</span>",onclick:{fn:i3GEO.navega.zoomout}},{text:"<img class='rosanorte' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Norte</span>",onclick:{fn:i3GEO.navega.panFixoNorte}},{text:"<img class='rosasul' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Sul</span>",onclick:{fn:i3GEO.navega.panFixoSul}},{text:"<img class='rosaleste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Leste</span>",onclick:{fn:i3GEO.navega.panFixoLeste}},{text:"<img class='rosaoeste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Oeste</span>",onclick:{fn:i3GEO.navega.panFixoOeste}},{text:"Captura",onclick:{fn:i3GEO.gadgets.quadros.listaImagens}}];oFieldContextMenu=new YAHOO.widget.ContextMenu("contexto_"+i3GEO.Interface.IDMAPA,{trigger:i3GEO.Interface.IDMAPA,itemdata:oFieldContextMenuItemData,lazyload:true});onFieldMenuRender=function(){var id="contexto_"+i3GEO.Interface.IDMAPA;if(id){$i(id).style.zIndex=50000}};oFieldContextMenu.subscribe("render",onFieldMenuRender)},inicia:function(){var elemento,i,estilo;if($i("contemImg")){elemento="contemImg"}else{elemento="img"}i3GEO.mapa.ajustaPosicao(elemento);i=$i("img");if(!i){return}i.style.width=i3GEO.parametros.w+"px";i.style.height=i3GEO.parametros.h+"px";estilo=$i(i3GEO.Interface.IDCORPO).style;estilo.width=i3GEO.parametros.w+"px";estilo.height=i3GEO.parametros.h+"px";estilo.clip='rect('+0+" "+(i3GEO.parametros.w)+" "+(i3GEO.parametros.h)+" "+0+')';objmapaparado="nao";i3GEO.gadgets.mostraMenuSuspenso();i3GEO.eventos.ativa(i);i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.gadgets.mostraEscalaGrafica();i3GEO.gadgets.visual.inicia();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.Interface.padrao.ativaBotoes();i3GEO.idioma.mostraSeletor();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){var imagemxy,x1,y1,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y1=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if(($i("barraDeBotoes1")&&$i("barraDeBotoes2"))||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+40}if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes1","i3geo_barra1",true,x1,y1)}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes();if(document.getElementById("botao3d")){if(i3GEO.configura.map3d===""){document.getElementById("botao3d").style.display="none"}}if(i3GEO.Interface.ATIVAMENUCONTEXTO){i3GEO.Interface.padrao.ativaMenuContexto()}if(i3GEO.configura.visual!=="default"){i3GEO.gadgets.visual.troca(i3GEO.configura.visual)}}},flamingo:{redesenha:function(){var w=parseInt($i("flamingo").style.width,10);if(w===i3GEO.parametros.w){$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)+1}else{$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)-1}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("flamingo");if(!f){ins='<div id=flamingo style="width:0px;height:0px;text-align:left;background-image:url(/"'+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg/")"></div>';i.innerHTML=ins}f=$i("flamingo");f.style.width=w;f.style.height=h;i3GEO.Interface.IDMAPA="flamingo"}},inicia:function(){var monta=function(retorno){$i("flamingo").style.height=i3GEO.parametros.h+45;childPopups=[];childPopupNr=0;var so=new SWFObject(i3GEO.configura.locaplic+"/pacotes/flamingo/flamingo/flamingo.swf?config="+retorno.data,"flamingoi","100%","100%","8","#eaeaea");so.addParam("wmode","transparent");so.write("flamingo")};i3GEO.php.flamingo(monta);i3GEO.eventos.ativa($i("flamingo"));i3GEO.maparef.atualiza();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){}},openlayers:{TILES:false,GADGETS:{PanZoomBar:true,LayerSwitcher:true,ScaleLine:true,OverviewMap:true},redesenha:function(){if($i("openlayers_OpenLayers_Container")){var a,b,c,no,divs1,n1,divs2,n2,imgs,nimg;no=$i("openlayers_OpenLayers_Container");divs1=no.getElementsByTagName("div");n1=divs1.length;for(a=0;a<n1;a++){divs2=divs1[a].getElementsByTagName("div");n2=divs2.length;for(b=0;b<n2;b++){imgs=divs2[b].getElementsByTagName("img");nimg=imgs.length;for(c=0;c<nimg;c++){imgs[c].src+="&x"}}}i3GEO.Interface.openlayers.recalcPar()}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("openlayers");if(!f){ins='<div id=openlayers style="width:0px;height:0px;text-align:left;background-image:url('+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg)"></div>';i.innerHTML=ins}f=$i("openlayers");f.style.width=w;f.style.height=h}i3GEO.Interface.IDMAPA="openlayers"},inicia:function(){var montaMapa=function(){var url,pz,pos;url=window.location.protocol+"//"+window.location.host+i3GEO.parametros.cgi+"?";url+="map="+i3GEO.parametros.mapfile+"&mode=map&SRS=epsg:4326&";i3geoOL=new OpenLayers.Map('openlayers',{controls:[]});if(i3GEO.Interface.openlayers.TILES===true){i3geoOLlayer=new OpenLayers.Layer.MapServer("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}else{i3geoOLlayer=new OpenLayers.Layer.MapServer.Untiled("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}i3geoOLlayer.setVisibility(true);i3geoOLlayer.transitionEffect="resize";i3geoOL.addLayer(i3geoOLlayer);i3geoOL.events.register("moveend",i3geoOL,function(e){i3GEO.Interface.openlayers.recalcPar();g_operacao="";g_tipoacao=""});i3geoOL.events.register("mousemove",i3geoOL,function(e){var p,lonlat,d,dc;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3geoOL.getLonLatFromPixel(p);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{objposicaocursor.ddx=lonlat.lon;objposicaocursor.ddy=lonlat.lat;objposicaocursor.telax=p.x;objposicaocursor.telay=p.y;objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];dc=$i("i3geo");if($i("openlayers_OpenLayers_Container")){dc=$i("openlayers_OpenLayers_Container")}while(dc.offsetParent){dc=dc.offsetParent;objposicaocursor.telax=objposicaocursor.telax+dc.offsetLeft;objposicaocursor.telay=objposicaocursor.telay+dc.offsetTop}}catch(e){}});i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);if(i3GEO.Interface.openlayers.GADGETS.PanZoomBar==true){pz=new OpenLayers.Control.PanZoomBar({numZoomLevels:5});i3geoOL.addControl(pz);pz.div.style.zIndex=5000}if(i3GEO.Interface.openlayers.GADGETS.LayerSwitcher==true){i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher())}if(i3GEO.Interface.openlayers.GADGETS.ScaleLine==true){i3geoOL.addControl(new OpenLayers.Control.ScaleLine())}if(i3GEO.Interface.openlayers.GADGETS.OverviewMap==true){i3geoOL.addControl(new OpenLayers.Control.OverviewMap())}i3geoOL.addControl(new OpenLayers.Control.KeyboardDefaults());i3GEO.eventos.ativa($i("openlayers"));pos=i3GEO.util.pegaPosicaoObjeto($i("openlayers"));if($i("aguarde")){$top("aguarde",pos[1]);$left("aguarde",pos[0])}OLpan=new OpenLayers.Control.Navigation();OLzoom=new OpenLayers.Control.ZoomBox();OLpanel=new OpenLayers.Control.Panel();OLpanel.addControls([OLpan,OLzoom]);i3geoOL.addControl(OLpanel);i3GEO.Interface.openlayers.ativaBotoes()};i3GEO.php.openlayers(montaMapa);i3GEO.gadgets.mostraMenuSuspenso();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.idioma.mostraSeletor();i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica()},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},recalcPar:function(){g_operacao="";g_tipoacao="";var bounds=i3geoOL.getExtent().toBBOX().split(",");i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];i3GEO.parametros.mapscale=i3geoOL.getScale();atualizaEscalaNumerica(parseInt(i3GEO.parametros.mapscale,10))},zoom2ext:function(ext){var m,b;m=ext.split(" ");b=new OpenLayers.Bounds(m[0],m[1],m[2],m[3]);i3geoOL.zoomToExtent(b)}},googlemaps:{OPACIDADE:0.8,TIPOMAPA:"G_PHYSICAL_MAP",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],redesenha:function(){try{if(i3GeoMap!==""){posfixo=posfixo+"&";i3GeoMap.removeOverlay(i3GEOTileO);var i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile()+posfixo,isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO)}}catch(e){}},cria:function(w,h){var i,f,ins;posfixo="&";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");f.style.width=w;f.style.height=h}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv"},inicia:function(){var pos,myMapType,pol,ret,pt1,pt2,bottomLeft,bottomRight,sw,ne,z,i3GEOTile;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;i3GeoMap=new GMap2($i(i3GEO.Interface.IDMAPA));i3GeoMap.addMapType(G_PHYSICAL_MAP);if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_SATELLITE_MAP"){i3GeoMap.setMapType(G_SATELLITE_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_PHYSICAL_MAP"){i3GeoMap.setMapType(G_PHYSICAL_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_HYBRID_MAP"){i3GeoMap.setMapType(G_HYBRID_MAP)}i3GeoMap.addControl(new GLargeMapControl());i3GeoMap.addControl(new GMapTypeControl());bottomLeft=new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0,40));i3GeoMap.addControl(new GScaleControl(),bottomLeft);bottomRight=new GControlPosition(G_ANCHOR_BOTTOM_RIGHT);i3GeoMap.addControl(new GOverviewMapControl(),bottomRight);sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z);i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile(),isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO);myMapType=new GMapType([i3GEOTile],new GMercatorProjection(18),'i3Geo');i3GeoMap.addMapType(myMapType);GEvent.addListener(i3GeoMap,"dragstart",function(){g_operacao="";g_tipoacao=""});GEvent.addListener(i3GeoMap,"dragend",function(){i3GEO.Interface.googlemaps.recalcPar()});GEvent.addListener(i3GeoMap,"zoomend",function(){i3GEO.Interface.googlemaps.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googlemaps.ativaBotoes();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraMenuSuspenso();i3GEO.gadgets.mostraInserirKml();pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA));GEvent.addListener(i3GeoMap,"mousemove",function(ponto){var teladms,tela;teladms=i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());tela=i3GeoMap.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]}});g_operacao="";g_tipoacao="";if(i3GEO.parametros.kmlurl!==""){i3GEO.mapa.insereKml(true,i3GEO.parametros.kmlurl)}i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala();i3GEO.Interface.googlemaps.adicionaListaKml()},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)},criaWMS:function(){var cgi,parametros;cgi=i3GEO.configura.locaplic+"/classesphp/parse_cgi.php?g_sid="+i3GEO.configura.sid;parametros="&map_size="+parseInt($i(i3GEO.Interface.IDMAPA).style.width,10);parametros+=","+parseInt($i(i3GEO.Interface.IDMAPA).style.height,10);parametros+="&mapext="+i3GEO.Interface.googlemaps.bbox();parametros+="&map_imagecolor=-1 -1 -1&map_transparent=on";return(cgi+parametros)},criaTile:function(){var cgi,parametros;cgi=i3GEO.util.protocolo()+"://"+window.location.host+i3GEO.parametros.cgi+"?";parametros="map="+i3GEO.parametros.mapfile;parametros+='&mode=tile';parametros+='&tilemode=gmap';parametros+='&tile={X}+{Y}+{Z}';parametros+='&map_imagetype='+i3GEO.Interface.OUTPUTFORMAT;return(cgi+parametros)},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+70;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},mudaOpacidade:function(valor){i3GEO.Interface.googlemaps.OPACIDADE=valor/200;i3GEO.Interface.googlemaps.redesenha()},recalcPar:function(){var bounds,sw,ne;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getBounds();sw=bounds.getSouthWest();ne=bounds.getNorthEast();i3GEO.parametros.mapexten=sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala()},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 pol,ret,pt1,pt2,sw,ne,z;pol=mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z)},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;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(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);zoom=function(){if(pan){eval("var ll = "+ngeoxml+".getDefaultCenter()");eval(ngeoxml+".gotoDefaultViewport(i3GeoMap)")}};eval(ngeoxml+" = new GGeoXml(url,zoom)");if(ativo===true){eval("i3GeoMap.addOverlay("+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 root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googlemaps.ARVORE.getRoot();node=i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="<table><tr><td><b>Google Maps</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},ativaDesativaCamadaKml:function(obj){if(!obj.checked){eval("i3GeoMap.removeOverlay("+obj.value+")")}else{eval("i3GeoMap.addOverlay("+obj.value+")")}}},googleearth:{GADGETS:{setMouseNavigationEnabled:true,setStatusBarVisibility:true,setOverviewMapVisibility:true,setScaleLegendVisibility:true,setAtmosphereVisibility:true,setGridVisibility:false,getSun:false,LAYER_BORDERS:true,LAYER_BUILDINGS:false,LAYER_ROADS:false,LAYER_TERRAIN:true},POSICAOTELA:[0,0],aguarde:"",redesenha:function(){try{if(typeof(linki3geo)!=='undefined'){linki3geo.setHref(linki3geo.getHref()+"&")}}catch(e){}},cria:function(w,h){var i,i3GeoMap3d,i3GeoMap,texto;i3GEO.configura.listaDePropriedadesDoMapa={"propriedades":[]};texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setMouseNavigationEnabled(this.checked)'";texto+="> "+$trad("ge1");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setStatusBarVisibility(this.checked)'";texto+="> "+$trad("ge2");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setOverviewMapVisibility(this.checked)'";texto+="> "+$trad("ge3");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setScaleLegendVisibility(this.checked)'";texto+="> "+$trad("ge4");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setAtmosphereVisibility(this.checked)'";texto+="> "+$trad("ge5");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setGridVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setGridVisibility(this.checked)'";texto+="> "+$trad("ge6");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.getSun==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getSun().setVisibility(this.checked)'";texto+="> "+$trad("ge7");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BORDERS, this.checked)'";texto+="> "+$trad("ge8");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BUILDINGS, this.checked)'";texto+="> "+$trad("ge9");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_ROADS, this.checked)'";texto+="> "+$trad("ge10");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_TERRAIN, this.checked)'";texto+="> "+$trad("ge11");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});i=$i(i3GEO.Interface.IDCORPO);if(i){i3GeoMap3d=document.createElement("div");i3GeoMap3d.style.width=w;i3GeoMap3d.style.height=h+45;i.style.height=h+45;i3GeoMap3d.id="i3GeoMap3d";i.appendChild(i3GeoMap3d)}i3GEO.Interface.IDMAPA="i3GeoMap3d";google.load("earth","1");i3GeoMap=null},inicia:function(){google.earth.createInstance("i3GeoMap3d",i3GEO.Interface.googleearth.iniciaGE,i3GEO.Interface.googleearth.falha)},iniciaGE:function(object){i3GeoMap=object;i3GeoMap.getWindow().setVisibility(true);kmlUrl=i3GEO.configura.locaplic+"/pacotes/kmlmapserver/kmlservice.php?map="+i3GEO.parametros.mapfile+"&typename=estadosl&request=kml&mode=map&";linki3geo=i3GeoMap.createLink('');linki3geo.setHref(kmlUrl);nl=i3GeoMap.createNetworkLink('');nl.setLink(linki3geo);nl.setFlyToView(true);i3GeoMap.getFeatures().appendChild(nl);var options=i3GeoMap.getOptions(),layerRoot=i3GeoMap.getLayerRoot(),evento=function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""};options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled);options.setStatusBarVisibility(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility);options.setOverviewMapVisibility(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility);options.setScaleLegendVisibility(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility);options.setAtmosphereVisibility(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility);options.setGridVisibility(i3GEO.Interface.googleearth.GADGETS.setGridVisibility);layerRoot.enableLayerById(i3GeoMap.LAYER_BORDERS,i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS);layerRoot.enableLayerById(i3GeoMap.LAYER_BUILDINGS,i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS);layerRoot.enableLayerById(i3GeoMap.LAYER_ROADS,i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS);layerRoot.enableLayerById(i3GeoMap.LAYER_TERRAIN,i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN);i3GeoMap.getSun().setVisibility(i3GEO.Interface.googleearth.GADGETS.getSun);i3GeoMap.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW);google.earth.addEventListener(i3GeoMap.getView(),"viewchangeend",function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googleearth.POSICAOTELA=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO));google.earth.addEventListener(i3GeoMap.getGlobe(),'mousemove',function(event){objposicaocursor={ddx:event.getLongitude(),ddy:event.getLatitude(),dmsx:0,dmsy:0,imgx:event.getClientX(),imgy:event.getClientY(),telax:event.getClientX()+i3GEO.Interface.googleearth.POSICAOTELA[0],telay:event.getClientY()+i3GEO.Interface.googleearth.POSICAOTELA[1]};i3GEO.eventos.mousemoveMapa()});google.earth.addEventListener(i3GeoMap.getGlobe(),'click',function(event){if(i3GEO.Interface.googleearth.aguarde.visibility==="hidden"){i3GEO.eventos.mousecliqueMapa()}else{i3GEO.Interface.googleearth.aguarde.visibility="hidden"}});i3GEO.Interface.googleearth.ativaBotoes();i3GEO.gadgets.mostraInserirKml("inserirKml");i3GEO.Interface.googleearth.adicionaListaKml()},recalcPar:function(){var bounds;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getView().getViewportGlobeBounds();i3GEO.parametros.mapexten=bounds.getWest()+" "+bounds.getSouth()+" "+bounds.getEast()+" "+bounds.getNorth()},falha:function(){alert("Falhou. Vc precisa do plugin instalado")},ativaBotoes:function(){var cabecalho=function(){};var minimiza=function(){i3GEO.janela.minimiza("i3GEOF.ferramentasGE")};var janela=i3GEO.janela.cria("200px","70px","","","","Ferramentas","i3GEOF.ferramentasGE",false,"hd",cabecalho,minimiza);i3GEO.barraDeBotoes.TEMPLATEBOTAO='<div style="display:inline;background-color:rgb(250,250,250);"><img src="'+i3GEO.configura.locaplic+'/imagens/branco.gif" id="$$"/></div> ';i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id);i3GEO.barraDeBotoes.ativaBotoes();i3GEO.Interface.googleearth.aguarde=$i("i3GEOF.ferramentasGE_imagemCabecalho").style},balao:function(texto,ddx,ddy){var placemark=i3GeoMap.createPlacemark('');var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);var b=i3GeoMap.createHtmlStringBalloon('');b.setContentString("<div style=text-align:left >"+texto+"</div>");b.setFeature(placemark);i3GeoMap.setBalloon(b);i3GEO.Interface.googleearth.aguarde.visibility="hidden"},insereMarca:function(texto,ddx,ddy,name){var placemark=i3GeoMap.createPlacemark('');placemark.setName(name);var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);if(texto!=""){placemark.setDescription(texto)}i3GeoMap.getFeatures().appendChild(placemark)},removePlacemark:function(nome){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getName()==nome){features.getChildNodes().item(i).setVisibility(false)}}catch(e){}}},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=false}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);linki3geo=i3GeoMap.createLink('');linki3geo.setHref(url);eval(ngeoxml+" = i3GeoMap.createNetworkLink('')");eval(ngeoxml+".setLink(linki3geo)");i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googleearth.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googleearth.ARVORE.getRoot();node=i3GEO.Interface.googleearth.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googleearth.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googleearth.ARVORE.draw();i3GEO.Interface.googleearth.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googleearth.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googleearth.ARVORE.getRoot();titulo="<table><tr><td><b>Google Earth Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},existeLink:function(url){var existe=false,features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){existe=true}}catch(e){}}return(existe)},ativaDesativaLink:function(url,valor){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){features.getChildNodes().item(i).setVisibility(valor)}}catch(e){}}},ativaDesativaCamadaKml:function(obj){var url=eval(obj.value+".getLink().getHref()");var existe=i3GEO.Interface.googleearth.existeLink(url);if(!obj.checked){{i3GEO.Interface.googleearth.ativaDesativaLink(url,false)}}else{if(existe==false){eval("i3GeoMap.getFeatures().appendChild("+obj.value+")")}else{i3GEO.Interface.googleearth.ativaDesativaLink(url,true)}}}}};i3GEO.interface=i3GEO.Interface; | |
150 | +if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.Interface={OUTPUTFORMAT:"AGG_Q",BARRABOTOESTOP:12,BARRABOTOESLEFT:3,ATUAL:"padrao",IDCORPO:"corpoMapa",ATIVAMENUCONTEXTO:false,IDMAPA:"",redesenha:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.redesenha()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.redesenha()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.redesenha()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.redesenha()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.redesenha()}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.adicionaKml("foo")}},cria:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.cria(w,h)}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.cria(w,h)}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.cria(w,h)}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.cria(w,h)}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.cria(w,h)}},inicia:function(w,h){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.inicia()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.inicia()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.inicia()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.inicia()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.inicia()}},ativaBotoes:function(){if(i3GEO.Interface.ATUAL==="padrao"){i3GEO.Interface.padrao.ativaBotoes()}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.ativaBotoes()}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.ativaBotoes()}if(i3GEO.Interface.ATUAL==="flamingo"){i3GEO.Interface.flamingo.ativaBotoes()}},padrao:{TRANSICAO:false,redesenha:function(){var ndiv,i;if(!$i("img")){i3GEO.janela.fechaAguarde();return}$i("img").onload=function(){var imagem,temp;imagem=$i("img");imagem.onload="";i3GEO.gadgets.quadros.grava("imagem",i3GEO.parametros.mapimagem);i3GEO.gadgets.quadros.grava("extensao",i3GEO.parametros.mapexten);temp=function(retorno){eval(retorno.data);i3GEO.gadgets.quadros.grava("legenda",legimagem)};if(i3GEO.gadgets.quadros.geraLegenda===true){i3GEO.mapa.legendaIMAGEM.obtem(temp)}if(i3GEO.Interface.padrao.TRANSICAO===true){if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",50,5,true)}i3GEO.util.aparece("img",50,5)}else{if($i("imgtemp")){i3GEO.util.desaparece("imgtemp",15,5,true)}i3GEO.util.aparece("img",5,5)}i3GEO.janela.fechaAguarde("ajaxCorpoMapa")};if(!$i("imgtemp")){ndiv=document.createElement("div");ndiv.id="imgtemp";ndiv.style.position="absolute";ndiv.style.border="1px solid blue";document.getElementById("corpoMapa").appendChild(ndiv)}if(g_tipoacao==="pan"&&i3GEO.barraDeBotoes.BOTAOCLICADO==="pan"){$i("imgtemp").style.left=parseInt($i("img").style.left,10);$i("imgtemp").style.top=parseInt($i("img").style.top,10);$i("imgtemp").style.width=i3GEO.parametros.w;$i("imgtemp").style.height=i3GEO.parametros.h}$i("imgtemp").style.backgroundImage='url("'+$i("img").src+'")';$i("imgtemp").style.display="block";i=$i("img");i.style.display="none";i.style.left=0;i.style.top=0;i.src=i3GEO.parametros.mapimagem},cria:function(){var ins="<input style='position:relative;top:0px;left:0px'' type=image src='' id='img' />",temp=$i(i3GEO.Interface.IDCORPO);if(temp){temp.innerHTML=ins}i3GEO.Interface.IDMAPA="img"},ativaMenuContexto:function(){var temp,oFieldContextMenuItemData,oFieldContextMenu,onFieldMenuRender;temp=$i("contexto_"+i3GEO.Interface.IDMAPA);if(temp){temp.parentNode.removeChild(temp)}oFieldContextMenuItemData=[{text:" <span class='container-close'></span>"},{text:"<img class='rosamais' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Aproxima</span>",onclick:{fn:i3GEO.navega.zoomin}},{text:"<img class='rosamenos' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-4px;'> Afasta</span>",onclick:{fn:i3GEO.navega.zoomout}},{text:"<img class='rosanorte' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Norte</span>",onclick:{fn:i3GEO.navega.panFixoNorte}},{text:"<img class='rosasul' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Sul</span>",onclick:{fn:i3GEO.navega.panFixoSul}},{text:"<img class='rosaleste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Leste</span>",onclick:{fn:i3GEO.navega.panFixoLeste}},{text:"<img class='rosaoeste' style='height:18px;' src='"+$im("branco.gif")+"'><span style='position:relative;top:-7px;'> Oeste</span>",onclick:{fn:i3GEO.navega.panFixoOeste}},{text:"Captura",onclick:{fn:i3GEO.gadgets.quadros.listaImagens}}];oFieldContextMenu=new YAHOO.widget.ContextMenu("contexto_"+i3GEO.Interface.IDMAPA,{trigger:i3GEO.Interface.IDMAPA,itemdata:oFieldContextMenuItemData,lazyload:true});onFieldMenuRender=function(){var id="contexto_"+i3GEO.Interface.IDMAPA;if(id){$i(id).style.zIndex=50000}};oFieldContextMenu.subscribe("render",onFieldMenuRender)},inicia:function(){var elemento,i,estilo;if($i("contemImg")){elemento="contemImg"}else{elemento="img"}i3GEO.mapa.ajustaPosicao(elemento);i=$i("img");if(!i){return}i.style.width=i3GEO.parametros.w+"px";i.style.height=i3GEO.parametros.h+"px";estilo=$i(i3GEO.Interface.IDCORPO).style;estilo.width=i3GEO.parametros.w+"px";estilo.height=i3GEO.parametros.h+"px";estilo.clip='rect('+0+" "+(i3GEO.parametros.w)+" "+(i3GEO.parametros.h)+" "+0+')';objmapaparado="nao";i3GEO.gadgets.mostraMenuSuspenso();i3GEO.eventos.ativa(i);i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica();i3GEO.gadgets.mostraEscalaGrafica();i3GEO.gadgets.visual.inicia();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.Interface.padrao.ativaBotoes();i3GEO.idioma.mostraSeletor();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){var imagemxy,x1,y1,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y1=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if(($i("barraDeBotoes1")&&$i("barraDeBotoes2"))||i3GEO.barraDeBotoes.AUTO===true){x1=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+40}if($i("barraDeBotoes1")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes1","i3geo_barra1",true,x1,y1)}if($i("barraDeBotoes2")||i3GEO.barraDeBotoes.AUTO===true){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes();if(document.getElementById("botao3d")){if(i3GEO.configura.map3d===""){document.getElementById("botao3d").style.display="none"}}if(i3GEO.Interface.ATIVAMENUCONTEXTO){i3GEO.Interface.padrao.ativaMenuContexto()}if(i3GEO.configura.visual!=="default"){i3GEO.gadgets.visual.troca(i3GEO.configura.visual)}}},flamingo:{redesenha:function(){var w=parseInt($i("flamingo").style.width,10);if(w===i3GEO.parametros.w){$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)+1}else{$i("flamingo").style.height=parseInt($i("flamingo").style.height,10)-1}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("flamingo");if(!f){ins='<div id=flamingo style="width:0px;height:0px;text-align:left;background-image:url(/"'+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg/")"></div>';i.innerHTML=ins}f=$i("flamingo");f.style.width=w;f.style.height=h;i3GEO.Interface.IDMAPA="flamingo"}},inicia:function(){var monta=function(retorno){$i("flamingo").style.height=i3GEO.parametros.h+45;childPopups=[];childPopupNr=0;var so=new SWFObject(i3GEO.configura.locaplic+"/pacotes/flamingo/flamingo/flamingo.swf?config="+retorno.data,"flamingoi","100%","100%","8","#eaeaea");so.addParam("wmode","transparent");so.write("flamingo")};i3GEO.php.flamingo(monta);i3GEO.eventos.ativa($i("flamingo"));i3GEO.maparef.atualiza();if(i3GEO.configura.mapaRefDisplay!=="none"){if(i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")){i3GEO.configura.mapaRefDisplay=i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")}if(i3GEO.configura.mapaRefDisplay==="block"){i3GEO.maparef.inicia()}}},ativaBotoes:function(){}},openlayers:{TILES:false,GADGETS:{PanZoomBar:true,LayerSwitcher:true,ScaleLine:true,OverviewMap:true},redesenha:function(){if($i("openlayers_OpenLayers_Container")){var a,b,c,no,divs1,n1,divs2,n2,imgs,nimg;no=$i("openlayers_OpenLayers_Container");divs1=no.getElementsByTagName("div");n1=divs1.length;for(a=0;a<n1;a++){divs2=divs1[a].getElementsByTagName("div");n2=divs2.length;for(b=0;b<n2;b++){imgs=divs2[b].getElementsByTagName("img");nimg=imgs.length;for(c=0;c<nimg;c++){imgs[c].src+="&x"}}}i3GEO.Interface.openlayers.recalcPar()}i3GEO.janela.fechaAguarde()},cria:function(w,h){var i,f,ins;i=$i(i3GEO.Interface.IDCORPO);if(i){f=$i("openlayers");if(!f){ins='<div id=openlayers style="width:0px;height:0px;text-align:left;background-image:url('+i3GEO.configura.locaplic+'/imagens/i3geo1bw.jpg)"></div>';i.innerHTML=ins}f=$i("openlayers");f.style.width=w;f.style.height=h}i3GEO.Interface.IDMAPA="openlayers"},inicia:function(){var montaMapa=function(){var url,pz,pos;url=window.location.protocol+"//"+window.location.host+i3GEO.parametros.cgi+"?";url+="map="+i3GEO.parametros.mapfile+"&mode=map&SRS=epsg:4326&";i3geoOL=new OpenLayers.Map('openlayers',{controls:[]});if(i3GEO.Interface.openlayers.TILES===true){i3geoOLlayer=new OpenLayers.Layer.MapServer("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}else{i3geoOLlayer=new OpenLayers.Layer.MapServer.Untiled("Temas I3Geo",url,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{'buffer':1},{isBaseLayer:true,opacity:1})}i3geoOLlayer.setVisibility(true);i3geoOLlayer.transitionEffect="resize";i3geoOL.addLayer(i3geoOLlayer);i3geoOL.events.register("moveend",i3geoOL,function(e){i3GEO.Interface.openlayers.recalcPar();g_operacao="";g_tipoacao=""});i3geoOL.events.register("mousemove",i3geoOL,function(e){var p,lonlat,d,dc;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3geoOL.getLonLatFromPixel(p);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{objposicaocursor.ddx=lonlat.lon;objposicaocursor.ddy=lonlat.lat;objposicaocursor.telax=p.x;objposicaocursor.telay=p.y;objposicaocursor.dmsx=d[0];objposicaocursor.dmsy=d[1];dc=$i("i3geo");if($i("openlayers_OpenLayers_Container")){dc=$i("openlayers_OpenLayers_Container")}while(dc.offsetParent){dc=dc.offsetParent;objposicaocursor.telax=objposicaocursor.telax+dc.offsetLeft;objposicaocursor.telay=objposicaocursor.telay+dc.offsetTop}}catch(e){}});i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);if(i3GEO.Interface.openlayers.GADGETS.PanZoomBar==true){pz=new OpenLayers.Control.PanZoomBar({numZoomLevels:5});i3geoOL.addControl(pz);pz.div.style.zIndex=5000}if(i3GEO.Interface.openlayers.GADGETS.LayerSwitcher==true){i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher())}if(i3GEO.Interface.openlayers.GADGETS.ScaleLine==true){i3geoOL.addControl(new OpenLayers.Control.ScaleLine())}if(i3GEO.Interface.openlayers.GADGETS.OverviewMap==true){i3geoOL.addControl(new OpenLayers.Control.OverviewMap())}i3geoOL.addControl(new OpenLayers.Control.KeyboardDefaults());i3GEO.eventos.ativa($i("openlayers"));pos=i3GEO.util.pegaPosicaoObjeto($i("openlayers"));if($i("aguarde")){$top("aguarde",pos[1]);$left("aguarde",pos[0])}OLpan=new OpenLayers.Control.Navigation();OLzoom=new OpenLayers.Control.ZoomBox();OLpanel=new OpenLayers.Control.Panel();OLpanel.addControls([OLpan,OLzoom]);i3geoOL.addControl(OLpanel);i3GEO.Interface.openlayers.ativaBotoes()};i3GEO.php.openlayers(montaMapa);i3GEO.gadgets.mostraMenuSuspenso();i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);i3GEO.idioma.mostraSeletor();i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraCoordenadasUTM();i3GEO.gadgets.mostraEscalaNumerica()},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},recalcPar:function(){g_operacao="";g_tipoacao="";var bounds=i3geoOL.getExtent().toBBOX().split(",");i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];i3GEO.parametros.mapscale=i3geoOL.getScale();atualizaEscalaNumerica(parseInt(i3GEO.parametros.mapscale,10))},zoom2ext:function(ext){var m,b;m=ext.split(" ");b=new OpenLayers.Bounds(m[0],m[1],m[2],m[3]);i3geoOL.zoomToExtent(b)}},googlemaps:{OPACIDADE:0.8,TIPOMAPA:"G_PHYSICAL_MAP",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],redesenha:function(){try{if(i3GeoMap!==""){posfixo=posfixo+"&";i3GeoMap.removeOverlay(i3GEOTileO);var i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile()+posfixo,isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO)}}catch(e){}},cria:function(w,h){var i,f,ins;posfixo="&";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");f.style.width=w;f.style.height=h}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv"},inicia:function(){var pos,myMapType,pol,ret,pt1,pt2,bottomLeft,bottomRight,sw,ne,z,i3GEOTile;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;i3GeoMap=new GMap2($i(i3GEO.Interface.IDMAPA));i3GeoMap.addMapType(G_PHYSICAL_MAP);if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_SATELLITE_MAP"){i3GeoMap.setMapType(G_SATELLITE_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_PHYSICAL_MAP"){i3GeoMap.setMapType(G_PHYSICAL_MAP)}if(i3GEO.Interface.googlemaps.TIPOMAPA==="G_HYBRID_MAP"){i3GeoMap.setMapType(G_HYBRID_MAP)}i3GeoMap.addControl(new GLargeMapControl());i3GeoMap.addControl(new GMapTypeControl());bottomLeft=new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0,40));i3GeoMap.addControl(new GScaleControl(),bottomLeft);bottomRight=new GControlPosition(G_ANCHOR_BOTTOM_RIGHT);i3GeoMap.addControl(new GOverviewMapControl(),bottomRight);sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z);i3GEOTile=new GTileLayer(null,0,18,{tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile(),isPng:true,opacity:i3GEO.Interface.googlemaps.OPACIDADE});i3GEOTileO=new GTileLayerOverlay(i3GEOTile);i3GeoMap.addOverlay(i3GEOTileO);myMapType=new GMapType([i3GEOTile],new GMercatorProjection(18),'i3Geo');i3GeoMap.addMapType(myMapType);GEvent.addListener(i3GeoMap,"dragstart",function(){g_operacao="";g_tipoacao=""});GEvent.addListener(i3GeoMap,"dragend",function(){i3GEO.Interface.googlemaps.recalcPar()});GEvent.addListener(i3GeoMap,"zoomend",function(){i3GEO.Interface.googlemaps.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googlemaps.ativaBotoes();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));i3GEO.gadgets.mostraCoordenadasGEO();i3GEO.gadgets.mostraMenuSuspenso();i3GEO.gadgets.mostraInserirKml();pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA));GEvent.addListener(i3GeoMap,"mousemove",function(ponto){var teladms,tela;teladms=i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());tela=i3GeoMap.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]}});g_operacao="";g_tipoacao="";if(i3GEO.parametros.kmlurl!==""){i3GEO.mapa.insereKml(true,i3GEO.parametros.kmlurl)}i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala();i3GEO.Interface.googlemaps.adicionaListaKml()},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)},criaWMS:function(){var cgi,parametros;cgi=i3GEO.configura.locaplic+"/classesphp/parse_cgi.php?g_sid="+i3GEO.configura.sid;parametros="&map_size="+parseInt($i(i3GEO.Interface.IDMAPA).style.width,10);parametros+=","+parseInt($i(i3GEO.Interface.IDMAPA).style.height,10);parametros+="&mapext="+i3GEO.Interface.googlemaps.bbox();parametros+="&map_imagecolor=-1 -1 -1&map_transparent=on";return(cgi+parametros)},criaTile:function(){var cgi,parametros;cgi=i3GEO.util.protocolo()+"://"+window.location.host+i3GEO.parametros.cgi+"?";parametros="map="+i3GEO.parametros.mapfile;parametros+='&mode=tile';parametros+='&tilemode=gmap';parametros+='&tile={X}+{Y}+{Z}';parametros+='&map_imagetype='+i3GEO.Interface.OUTPUTFORMAT;return(cgi+parametros)},ativaBotoes:function(){var imagemxy,x2,y2;imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));if($i("barraDeBotoes2")){x2=imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+70;y2=imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP}if($i("barraDeBotoes2")){i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2)}i3GEO.barraDeBotoes.ativaBotoes()},mudaOpacidade:function(valor){i3GEO.Interface.googlemaps.OPACIDADE=valor/200;i3GEO.Interface.googlemaps.redesenha()},recalcPar:function(){var bounds,sw,ne;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getBounds();sw=bounds.getSouthWest();ne=bounds.getNorthEast();i3GEO.parametros.mapexten=sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();i3GEO.parametros.mapscale=i3GEO.Interface.googlemaps.calcescala()},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 pol,ret,pt1,pt2,sw,ne,z;pol=mapexten;ret=pol.split(" ");pt1=(((ret[0]*-1)-(ret[2]*-1))/2)+ret[0]*1;pt2=(((ret[1]-ret[3])/2)*-1)+ret[1]*1;sw=new GLatLng(ret[1],ret[0]);ne=new GLatLng(ret[3],ret[2]);z=i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));i3GeoMap.setCenter(new GLatLng(pt2,pt1),z)},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;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(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);zoom=function(){if(pan){eval("var ll = "+ngeoxml+".getDefaultCenter()");eval(ngeoxml+".gotoDefaultViewport(i3GeoMap)")}};eval(ngeoxml+" = new GGeoXml(url,zoom)");if(ativo===true){eval("i3GeoMap.addOverlay("+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 root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googlemaps.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googlemaps.ARVORE.getRoot();node=i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="<table><tr><td><b>Google Maps</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},ativaDesativaCamadaKml:function(obj){if(!obj.checked){eval("i3GeoMap.removeOverlay("+obj.value+")")}else{eval("i3GeoMap.addOverlay("+obj.value+")")}}},googleearth:{GADGETS:{setMouseNavigationEnabled:true,setStatusBarVisibility:true,setOverviewMapVisibility:true,setScaleLegendVisibility:true,setAtmosphereVisibility:true,setGridVisibility:false,getSun:false,LAYER_BORDERS:true,LAYER_BUILDINGS:false,LAYER_ROADS:false,LAYER_TERRAIN:true},POSICAOTELA:[0,0],aguarde:"",redesenha:function(){try{if(linki3geo!==undefined){linki3geo.setHref(linki3geo.getHref()+"&")}}catch(e){}},cria:function(w,h){var i,i3GeoMap3d,i3GeoMap,texto;i3GEO.configura.listaDePropriedadesDoMapa={"propriedades":[]};texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setMouseNavigationEnabled(this.checked)'";texto+="> "+$trad("ge1");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setStatusBarVisibility(this.checked)'";texto+="> "+$trad("ge2");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setOverviewMapVisibility(this.checked)'";texto+="> "+$trad("ge3");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setScaleLegendVisibility(this.checked)'";texto+="> "+$trad("ge4");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setAtmosphereVisibility(this.checked)'";texto+="> "+$trad("ge5");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.setGridVisibility==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getOptions().setGridVisibility(this.checked)'";texto+="> "+$trad("ge6");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.getSun==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getSun().setVisibility(this.checked)'";texto+="> "+$trad("ge7");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BORDERS, this.checked)'";texto+="> "+$trad("ge8");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_BUILDINGS, this.checked)'";texto+="> "+$trad("ge9");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_ROADS, this.checked)'";texto+="> "+$trad("ge10");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});texto="<input type=checkbox style='vertical-align:top;cursor:pointer' ";if(i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN==true){texto+="CHECKED "}texto+=" onclick='javascript:i3GeoMap.getLayerRoot().enableLayerById(i3GeoMap.LAYER_TERRAIN, this.checked)'";texto+="> "+$trad("ge11");i3GEO.configura.listaDePropriedadesDoMapa.propriedades.push({text:texto,url:""});i=$i(i3GEO.Interface.IDCORPO);if(i){i3GeoMap3d=document.createElement("div");i3GeoMap3d.style.width=w;i3GeoMap3d.style.height=h+45;i.style.height=h+45;i3GeoMap3d.id="i3GeoMap3d";i.appendChild(i3GeoMap3d)}i3GEO.Interface.IDMAPA="i3GeoMap3d";google.load("earth","1");i3GeoMap=null},inicia:function(){google.earth.createInstance("i3GeoMap3d",i3GEO.Interface.googleearth.iniciaGE,i3GEO.Interface.googleearth.falha)},iniciaGE:function(object){i3GeoMap=object;i3GeoMap.getWindow().setVisibility(true);kmlUrl=i3GEO.configura.locaplic+"/pacotes/kmlmapserver/kmlservice.php?map="+i3GEO.parametros.mapfile+"&typename=estadosl&request=kml&mode=map&";linki3geo=i3GeoMap.createLink('');linki3geo.setHref(kmlUrl);nl=i3GeoMap.createNetworkLink('');nl.setLink(linki3geo);nl.setFlyToView(true);i3GeoMap.getFeatures().appendChild(nl);var options=i3GeoMap.getOptions(),layerRoot=i3GeoMap.getLayerRoot(),evento=function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""};options.setMouseNavigationEnabled(i3GEO.Interface.googleearth.GADGETS.setMouseNavigationEnabled);options.setStatusBarVisibility(i3GEO.Interface.googleearth.GADGETS.setStatusBarVisibility);options.setOverviewMapVisibility(i3GEO.Interface.googleearth.GADGETS.setOverviewMapVisibility);options.setScaleLegendVisibility(i3GEO.Interface.googleearth.GADGETS.setScaleLegendVisibility);options.setAtmosphereVisibility(i3GEO.Interface.googleearth.GADGETS.setAtmosphereVisibility);options.setGridVisibility(i3GEO.Interface.googleearth.GADGETS.setGridVisibility);layerRoot.enableLayerById(i3GeoMap.LAYER_BORDERS,i3GEO.Interface.googleearth.GADGETS.LAYER_BORDERS);layerRoot.enableLayerById(i3GeoMap.LAYER_BUILDINGS,i3GEO.Interface.googleearth.GADGETS.LAYER_BUILDINGS);layerRoot.enableLayerById(i3GeoMap.LAYER_ROADS,i3GEO.Interface.googleearth.GADGETS.LAYER_ROADS);layerRoot.enableLayerById(i3GeoMap.LAYER_TERRAIN,i3GEO.Interface.googleearth.GADGETS.LAYER_TERRAIN);i3GeoMap.getSun().setVisibility(i3GEO.Interface.googleearth.GADGETS.getSun);i3GeoMap.getNavigationControl().setVisibility(i3GeoMap.VISIBILITY_SHOW);google.earth.addEventListener(i3GeoMap.getView(),"viewchangeend",function(e){i3GEO.Interface.googleearth.recalcPar();g_operacao="";g_tipoacao=""});i3GEO.Interface.googleearth.POSICAOTELA=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO));google.earth.addEventListener(i3GeoMap.getGlobe(),'mousemove',function(event){objposicaocursor={ddx:event.getLongitude(),ddy:event.getLatitude(),dmsx:0,dmsy:0,imgx:event.getClientX(),imgy:event.getClientY(),telax:event.getClientX()+i3GEO.Interface.googleearth.POSICAOTELA[0],telay:event.getClientY()+i3GEO.Interface.googleearth.POSICAOTELA[1]};i3GEO.eventos.mousemoveMapa()});google.earth.addEventListener(i3GeoMap.getGlobe(),'click',function(event){if(i3GEO.Interface.googleearth.aguarde.visibility==="hidden"){i3GEO.eventos.mousecliqueMapa()}else{i3GEO.Interface.googleearth.aguarde.visibility="hidden"}});i3GEO.Interface.googleearth.ativaBotoes();i3GEO.gadgets.mostraInserirKml("inserirKml");i3GEO.Interface.googleearth.adicionaListaKml()},recalcPar:function(){var bounds;g_operacao="";g_tipoacao="";bounds=i3GeoMap.getView().getViewportGlobeBounds();i3GEO.parametros.mapexten=bounds.getWest()+" "+bounds.getSouth()+" "+bounds.getEast()+" "+bounds.getNorth()},falha:function(){alert("Falhou. Vc precisa do plugin instalado")},ativaBotoes:function(){var cabecalho=function(){};var minimiza=function(){i3GEO.janela.minimiza("i3GEOF.ferramentasGE")};var janela=i3GEO.janela.cria("200px","70px","","","","Ferramentas","i3GEOF.ferramentasGE",false,"hd",cabecalho,minimiza);i3GEO.barraDeBotoes.TEMPLATEBOTAO='<div style="display:inline;background-color:rgb(250,250,250);"><img src="'+i3GEO.configura.locaplic+'/imagens/branco.gif" id="$$"/></div> ';i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","",false,"200","200",janela[2].id);i3GEO.barraDeBotoes.ativaBotoes();i3GEO.Interface.googleearth.aguarde=$i("i3GEOF.ferramentasGE_imagemCabecalho").style},balao:function(texto,ddx,ddy){var placemark=i3GeoMap.createPlacemark('');var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);var b=i3GeoMap.createHtmlStringBalloon('');b.setContentString("<div style=text-align:left >"+texto+"</div>");b.setFeature(placemark);i3GeoMap.setBalloon(b);i3GEO.Interface.googleearth.aguarde.visibility="hidden"},insereMarca:function(texto,ddx,ddy,name){var placemark=i3GeoMap.createPlacemark('');placemark.setName(name);var point=i3GeoMap.createPoint('');point.setLatitude(ddy);point.setLongitude(ddx);placemark.setGeometry(point);if(texto!=""){placemark.setDescription(texto)}i3GeoMap.getFeatures().appendChild(placemark)},removePlacemark:function(nome){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getName()==nome){features.getChildNodes().item(i).setVisibility(false)}}catch(e){}}},adicionaKml:function(pan,url,titulo,ativo){var ngeoxml,i,zoom;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}ngeoxml="geoXml_"+i3GEO.mapa.GEOXML.length;if(arguments.length===1){i=$i("i3geo_urlkml");if(i){url=i.value}else{url=""}titulo=ngeoxml;ativo=false}if(arguments.length===2){titulo=ngeoxml;ativo=true}if(arguments.length===2){ativo=true}if(url===""){return}i3GEO.mapa.GEOXML.push(ngeoxml);linki3geokml=i3GeoMap.createLink('');linki3geokml.setHref(url);eval(ngeoxml+" = i3GeoMap.createNetworkLink('')");eval(ngeoxml+".setLink(linki3geokml)");i3GEO.Interface.googleearth.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml)},adicionaListaKml:function(){var monta=function(retorno){var raiz,nraiz,i;raiz=retorno.data.canais;nraiz=raiz.length;for(i=0;i<nraiz;i++){i3GEO.Interface.googleearth.adicionaKml(false,raiz[i].link,raiz[i].title,false)}};i3GEO.php.listaRSSwsARRAY(monta,"KML")},adicionaNoArvoreGoogle:function(url,nomeOverlay,ativo,id){var root,node,d,nodekml;if(!$i("arvoreCamadasKml")){i3GEO.Interface.googleearth.criaArvoreKML()}if(arguments.length===2){ativo=true;id=nomeOverlay}if(arguments.length===2){id=nomeOverlay}root=i3GEO.Interface.googleearth.ARVORE.getRoot();node=i3GEO.Interface.googleearth.ARVORE.getNodeByProperty("idkml","raiz");html="<input onclick='i3GEO.Interface.googleearth.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";if(ativo===true){html+=" checked "}html+="/>";html+=" <span style='cursor:move'>"+nomeOverlay+"</span>";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googleearth.ARVORE.draw();i3GEO.Interface.googleearth.ARVORE.collapseAll();node.expand()},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{alert("Arvore de camadas nao encontrada. Nao e possivel adicionar a arvore de KML");return}}i3GEO.Interface.googleearth.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googleearth.ARVORE.getRoot();titulo="<table><tr><td><b>Google Earth Kml</b></td></tr></table>";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},existeLink:function(url){var existe=false,features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){existe=true}}catch(e){}}return(existe)},ativaDesativaLink:function(url,valor){var features=i3GeoMap.getFeatures(),n=features.getChildNodes().getLength(),i;for(i=0;i<n;i++){try{if(features.getChildNodes().item(i).getLink().getHref()==url){features.getChildNodes().item(i).setVisibility(valor)}}catch(e){}}},ativaDesativaCamadaKml:function(obj){var url=eval(obj.value+".getLink().getHref()");var existe=i3GEO.Interface.googleearth.existeLink(url);if(!obj.checked){{i3GEO.Interface.googleearth.ativaDesativaLink(url,false)}}else{if(existe==false){eval("i3GeoMap.getFeatures().appendChild("+obj.value+")")}else{i3GEO.Interface.googleearth.ativaDesativaLink(url,true)}}}}};i3GEO.interface=i3GEO.Interface; | |
151 | 151 | if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.mapa={GEOXML:[],ajustaPosicao:function(elemento){if(arguments.length===0){return}if(!$i(elemento)){return}var imagemxi,imagemyi,imagemxref,imagemyref,dc,c;try{imagemxi=0;imagemyi=0;imagemxref=0;imagemyref=0;dc=$i(elemento);while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi=imagemxi+dc.offsetLeft;imagemyi=imagemyi+dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{$left(i3GEO.Interface.IDCORPO,imagemxi)}$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){alert("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){var noArvoreCamadas=$i("arrastar_"+codigo),noAtualArvoreCamadas=$i("arrastar_"+i3GEO.temaAtivo);i3GEO.temaAtivo=codigo;if(noAtualArvoreCamadas){noAtualArvoreCamadas.style.textDecoration=""}if(noArvoreCamadas){noArvoreCamadas.style.textDecoration="underline"}},ativaLogo:function(){i3GEO.contadorAtualiza++;i3GEO.php.ativalogo(i3GEO.atualiza)},verifica:function(retorno){try{i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o3"));if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(retorno===undefined)){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.janela.fechaAguarde();return}if(i3GEO.mapa.recupera.TENTATIVA===0){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{alert("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(i3GEO.mapa.recupera.TENTATIVA===1){i3GEO.mapa.recupera.TENTATIVA=2;i3GEO.contadorAtualiza++;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(i3GEO.mapa.recupera.TENTATIVA===0){i3GEO.mapa.recupera.TENTATIVA++;i3GEO.mapa.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaHTML:{incluiBotaoLibera:true,ID:"",cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()")}i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var temp=function(retorno){var s,ins,elementos,i;if(i3GEO.mapa.legendaHTML.ID!==""&&$i(i3GEO.mapa.legendaHTML.ID)){if((retorno.data!=="erro")&&(retorno.data!==undefined)){s=i3GEO.configura.locaplic+"/imagens/solta.gif";ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+="<img onclick='i3GEO.mapa.legendaHTML.libera()' id=soltaLeg src="+s+" title='clique para liberar'/><br>"}ins+="<div id='corpoLegi' >"+retorno.data.legenda+"</div>";$i(i3GEO.mapa.legendaHTML.ID).innerHTML=ins}}if($i("wlegenda")){$i("wlegenda").innerHTML=retorno.data.legenda;elementos=$i("wlegenda").getElementsByTagName("input");for(i=0;i<elementos.length;i++){elementos[i].style.display="none"}}};i3GEO.mapa.legendaHTML.obtem(temp)},obtem:function(funcao){i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda)},ativaDesativaTema:function(inputbox){var temp=function(){i3GEO.contadorAtualiza++;i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem);i3GEO.arvoreDeCamadas.atualiza("");i3GEO.janela.fechaAguarde("redesenha")};i3GEO.janela.abreAguarde("redesenha",$trad("o1"));if(!inputbox.checked){i3GEO.php.ligatemas(temp,inputbox.value,"")}else{i3GEO.php.ligatemas(temp,"",inputbox.value)}},libera:function(){var temp=function(retorno){var novoel,temp,n,i;if(!$i("moveLegi")){novoel=document.createElement("div");novoel.id="moveLegi";novoel.style.display="block";temp='<div class="hd">Legenda</div>';temp+='<div id="wlegenda" style="text-align:left;background-color:white" ></div>';novoel.innerHTML=temp;document.body.appendChild(novoel);YAHOO.namespace("moveLegi.xp");YAHOO.moveLegi.xp.panel=new YAHOO.widget.Panel("moveLegi",{width:"300px",fixedcenter:true,constraintoviewport:false,underlay:"none",close:true,visible:true,draggable:true,modal:false,iframe:false});YAHOO.moveLegi.xp.panel.render()}$i("wlegenda").innerHTML=retorno.data.legenda;temp=$i("wlegenda").getElementsByTagName("input");n=temp.length;for(i=0;i<n;i++){temp[i].style.display="none"}YAHOO.moveLegi.xp.panel.show()};i3GEO.mapa.legendaHTML.obtem(temp)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},dialogo:{outputformat:function(){if(typeof(i3GEOF.outputformat)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/outputformat/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.outputformat.criaJanelaFlutuante()","i3GEOF.outputformat_script")}},autoredesenha:function(){if(typeof(i3GEOF.opcoesTempo)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_autoredesenha/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesTempo.criaJanelaFlutuante()","i3GEOF.opcoesTempo_script")}},salvaMapa:function(){if(i3GEO.parametros===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}if(typeof(i3GEOF.salvaMapa)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/salvamapa/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.salvaMapa.criaJanelaFlutuante()","i3GEOF.salvaMapa_script")}},carregaMapa:function(){if(typeof(i3GEOF.carregaMapa)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/carregamapa/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.carregaMapa.criaJanelaFlutuante()","i3GEOF.carregaMapa_script")}},convertews:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}if(typeof(i3GEOF.converteKml)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/convertews/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.converteMapaWS.criaJanelaFlutuante()","i3GEOF.converteMapaWS_script")}},convertekml:function(){if(i3GEO.parametros.mapfile===""){alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}if(typeof(i3GEOF.converteKml)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/convertemapakml/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.converteMapaKml.criaJanelaFlutuante()","i3GEOF.converteMapaKml_script")}},queryMap:function(){if(typeof(i3GEOF.opcoesQuery)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_querymap/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesQuery.criaJanelaFlutuante()","i3GEOF.opcoesQuery_script")}},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","Template <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' > </a>")},tamanho:function(){if(typeof(i3GEOF.opcoesTamanho)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_tamanho/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesTamanho.criaJanelaFlutuante()","i3GEOF.opcoesTamanho_script")}},tipoimagem:function(){if(typeof(i3GEOF.tipoimagem)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/tipoimagem/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.tipoimagem.criaJanelaFlutuante()","i3GEOF.tipoimagem_script")}},corFundo:function(){if(typeof(i3GEOF.gradeCoord)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_fundo/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesFundo.criaJanelaFlutuante()","i3GEOF.opcoesFundo_script")}},opcoesEscala:function(){if(typeof(i3GEOF.opcoesEscala)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_escala/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesEscala.criaJanelaFlutuante()","i3GEOF.opcoesEscala_script")}},opcoesLegenda:function(){if(typeof(i3GEOF.opcoesLegenda)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/opcoes_legenda/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.opcoesLegenda.criaJanelaFlutuante()","i3GEOF.opcoesLegenda_script")}},gradeCoord:function(){if(typeof(i3GEOF.gradeCoord)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/gradecoord/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.gradeCoord.criaJanelaFlutuante()","i3GEOF.gradeCoord_script")}},cliqueTexto:function(){if(typeof(i3GEOF.inseretxt)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/inseretxt/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.inseretxt.criaJanelaFlutuante()","i3GEOF.inseretxt_script")}},selecao:function(){if(typeof(i3GEOF.selecao)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/selecao/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.selecao.criaJanelaFlutuante()","i3GEOF.selecao_script")}},cliquePonto:function(){if(typeof(i3GEOF.inserexy)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/inserexy2/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.inserexy.criaJanelaFlutuante()","i3GEOF.inserexy_script")}},cliqueGrafico:function(){if(typeof(i3GEOF.insereGrafico)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/inseregrafico/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.insereGrafico.criaJanelaFlutuante()","i3GEOF.insereGrafico_script")}},cliqueIdentificaDefault:function(){if(g_tipoacao==="identifica"){i3GEO.eventos.MOUSEPARADO.remove("verificaTip()");if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.identifica.criaJanelaFlutuante()","i3GEOF.identifica_script")}else{i3GEOF.identifica.x=objposicaocursor.ddx;i3GEOF.identifica.y=objposicaocursor.ddy;i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo);return}}},verificaTipDefault:function(){var ntemas,etiquetas,j,retorna;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j++){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface.ATUAL==="padrao"){$i("img").style.cursor="wait"}if(i3GEO.Interface.ATUAL=="googleearth"){i3GEO.Interface.googleearth.aguarde.visibility="visible"}retorna=function(retorno){var temp,rfes,n,balloon,i,mostra,res,temas,ntemas,titulo,tips,j,ntips,ins,r,ds,nds,s;i=$i("i3geo_rosa");if(i){i.style.display="none"}mostra=false;try{retorno=retorno.data;if(retorno!==""){res="";temas=retorno;ntemas=temas.length;for(j=0;j<ntemas;j++){titulo=temas[j].nome;if(i3GEO.configura.tipotip==="completo"||i3GEO.configura.tipotip==="balao"){titulo="<span style='text-decoration:underline;text-align:left;font-size:9pt'><b>"+titulo+"</b></span><br>"}else{titulo=""}tips=(temas[j].resultado.tips).split(",");ntips=tips.length;ins="";for(r=0;r<ntips;r++){try{ds=temas[j].resultado.dados;if(ds!==" "){nds=ds.length;for(s=0;s<nds;s++){eval("var alias = ds[s]."+tips[r]+".alias");eval("var valor = ds[s]."+tips[r]+".valor");eval("var link = ds[s]."+tips[r]+".link");eval("var img = ds[s]."+tips[r]+".img");if(i3GEO.configura.tipotip==="completo"||i3GEO.configura.tipotip==="balao"){if(valor!==""&&link===""){ins+="<span class='tiptexto' style='text-align:left;font-size:8pt'>"+alias+" :"+valor+"</span><br>"}if(valor!==""&&link!==""){ins+="<span class='tiptexto' style='text-align:left;font-size:8pt'>"+alias+" : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){ins+=img+"<br>"}mostra=true}else{ins+="<span class='tiptexto' style='text-align:left;font-size:8pt'>"+valor+"</span><br>";mostra=true}}}}catch(e){}}if(ins!==""){res+=titulo+ins}}if(!mostra){if($i("tip")){$i("tip").style.display="none"}}else{if(i3GEO.configura.tipotip!=="balao"){n=i3GEO.janela.tip();$i(n).style.textAlign="left";$i(n).innerHTML+=res}else{if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.balao(res,objposicaocursor.ddx,objposicaocursor.ddy)}else{i3GEO.util.criaPin('marcaIdentifica',i3GEO.configura.locaplic+"/imagens/grabber.gif","12px","12px");i3GEO.util.posicionaImagemNoMapa("marcaIdentifica");balloon=new Balloon();balloon.delayTime=0;res="<div style=text-align:left >"+res+"</div>";balloon.showTooltip($i("marcaIdentifica"),res);$i('marcaIdentifica').onclick=$i("closeButton").onclick}}}}if(i3GEO.Interface.ATUAL==="padrao"){temp="zoom";if(i3GEO.Interface.ATIVAMENUCONTEXTO){temp="identifica_contexto"}i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic)}}catch(e){if(i3GEO.Interface.ATUAL==="padrao"){temp="identifica";if(i3GEO.Interface.ATIVAMENUCONTEXTO){temp="identifica_contexto"}i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic)}}};i3GEO.php.identifica2(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5")}}}; |
152 | 152 | if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.tema={exclui:function(tema){g_operacao="excluitema";var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p);i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.excluitema(i3GEO.atualiza,tema);i3GEO.mapa.ativaTema("")},fonte:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));var temp=function(retorno){i3GEO.janela.fechaAguarde();if(retorno.data!=="erro"){window.open(retorno.data)}else{alert("Não existe fonte registrada para esse tema")}};i3GEO.php.fontetema(temp,tema)},sobe:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.sobetema(i3GEO.atualiza,tema)},desce:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.descetema(i3GEO.atualiza,tema)},zoom:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){g_operacao="limpasel";i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.limpasel(i3GEO.atualiza,tema)},mudatransp:function(idtema){g_operacao="transparencia";var valor;if($i("tr"+idtema)){valor=$i("tr"+idtema).value}else{alert("Ocorreu um erro")}if(valor!==""){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.mudatransp(i3GEO.atualiza,idtema,valor)}else{alert("Valor não definido.")}},mudanome:function(idtema){g_operacao="mudanome";var valor;if($i("nn"+idtema)){valor=$i("nn"+idtema).value}else{alert("Ocorreu um erro")}if(valor!==""){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.contadorAtualiza++;i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{alert("Nome não definido")}},mostralegendajanela:function(idtema,nome,tipoOperacao){var retorna,janela;if(tipoOperacao==="ativatimer"){mostralegendajanelaTimer=setTimeout("i3GEO.tema.mostralegendajanela('"+idtema+"','"+nome+"','abrejanela')",4000)}if(tipoOperacao==="abrejanela"){try{clearTimeout(mostralegendajanelaTimer)}catch(e){}retorna=function(retorno){$i("janelaLegenda"+idtema+"_corpo").innerHTML=retorno.data.legenda};if(!$i("janelaLegenda"+idtema)){janela=i3GEO.janela.cria("250px","","","","",nome,"janelaLegenda"+idtema,false);janela[2].style.textAlign="left";janela[2].style.background="white";janela[2].innerHTML=$trad("o1")}i3GEO.php.criaLegendaHTML(retorna,idtema,"legenda3.htm")}if(tipoOperacao==="desativatimer"){clearTimeout(mostralegendajanelaTimer)}},dialogo:{abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}},graficotema:function(idtema){if(typeof(i3GEOF.graficoTema)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/graficotema/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.graficoTema.criaJanelaFlutuante()","i3GEOF.graficoTema_script")}},toponimia:function(idtema){if(typeof(i3GEOF.toponimia)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/toponimia/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.toponimia.criaJanelaFlutuante()","i3GEOF.toponimia_script")}},filtro:function(idtema){if(typeof(i3GEOF.filtro)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/filtro/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.filtro.criaJanelaFlutuante()","i3GEOF.filtro_script")}},procuraratrib:function(idtema){if(typeof(i3GEOF.busca)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/busca/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.busca.criaJanelaFlutuante()","i3GEOF.busca_script")}},tabela:function(idtema){if(typeof(i3GEOF.tabela)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/tabela/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.tabela.criaJanelaFlutuante()","i3GEOF.tabela_script")}},etiquetas:function(idtema){if(typeof(i3GEOF.etiqueta)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/etiqueta/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.etiqueta.criaJanelaFlutuante()","i3GEOF.etiqueta_script")}},editaLegenda:function(idtema){if(typeof(i3GEOF.legenda)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/legenda/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.legenda.criaJanelaFlutuante()","i3GEOF.legenda_script")}},download:function(idtema){if(typeof(i3GEOF.download)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/download/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.download.criaJanelaFlutuante('"+idtema+"')","i3GEOF.download_script")}},sld:function(idtema){i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","SLD <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' > </a>")},editorsql:function(idtema){if(typeof(i3GEOF.editorsql)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/editorsql/index.js.php";i3GEO.mapa.ativaTema(idtema);i3GEO.util.scriptTag(js,"i3GEOF.editorsql.criaJanelaFlutuante('"+idtema+"')","i3GEOF.editorsql_script")}}}}; |
153 | 153 | if(typeof(i3GEO)=='undefined'){i3GEO=[]}i3GEO.analise={dialogo:{graficoInterativo:function(){if(typeof(i3GEOF.graficointerativo)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/graficointerativo/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.graficointerativo.criaJanelaFlutuante()","i3GEOF.graficointerativo_script")}},linhaDoTempo:function(){i3GEO.janela.cria("450px","300px",i3GEO.configura.locaplic+"/ferramentas/linhadotempo/index.php","","","Linha do tempo <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=88' > </a>");atualizaLinhaDoTempo=function(){var doc;try{if(navn){if($i("wdocai")){doc=$i("wdocai").contentDocument}}else{if(document.frames("wdocai")){doc=document.frames("wdocai").document}}if(doc.getElementById("tl")){window.parent.wdocai.carregaDados()}else{i3GEO.eventos.NAVEGAMAPA.remove("atualizaLinhaDoTempo()")}}catch(e){i3GEO.eventos.NAVEGAMAPA.remove("atualizaLinhaDoTempo()")}};if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaLinhaDoTempo()")<0){i3GEO.eventos.NAVEGAMAPA.push("atualizaLinhaDoTempo()")}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.events.register("moveend",i3geoOL,function(e){try{window.parent.wdocai.atualizaLinhaDoTempo()}catch(x){}})}},gradePontos:function(){if(typeof(i3GEOF.gradeDePontos)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/gradepontos/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.gradeDePontos.criaJanelaFlutuante()","i3GEOF.gradeDePontos_script")}},gradePol:function(){if(typeof(i3GEOF.gradeDePontos)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/gradepol/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.gradeDePoligonos.criaJanelaFlutuante()","i3GEOF.gradeDePoligonos_script")}},gradeHex:function(){if(typeof(i3GEOF.gradeDeHex)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/gradehex/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.gradeDeHex.criaJanelaFlutuante()","i3GEOF.gradeDePoligonos_script")}},analisaGeometrias:function(){if(typeof(i3GEOF.analisaGeometrias)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/analisageometrias/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.analisaGeometrias.criaJanelaFlutuante()","i3GEOF.analisaGeometrias_script")}},pontosdistri:function(){if(i3GEO.parametros.r=="nao"){alert("Opção não disponível")}else{if(typeof(i3GEOF.pontosDistri)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/pontosdistri/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.pontosDistri.criaJanelaFlutuante()","i3GEOF.pontosDistri_script")}}},pontoempoligono:function(){if(typeof(i3GEOF.pontoEmPoligono)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/pontoempoligono/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.pontoEmPoligono.criaJanelaFlutuante()","i3GEOF.pontoEmPoligono_script")}},nptPol:function(){if(typeof(i3GEOF.nptpol)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/nptpol/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.nptpol.criaJanelaFlutuante()","i3GEOF.nptpol_script")}},buffer:function(){if(typeof(i3GEOF.buffer)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/buffer/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.buffer.criaJanelaFlutuante()","i3GEOF.buffer_script")}},distanciaptpt:function(){if(typeof(i3GEOF.distanciaptpt)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/distanciaptpt/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.distanciaptpt.criaJanelaFlutuante()","i3GEOF.distanciaptpt_script")}},centroide:function(){if(typeof(i3GEOF.centroide)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/centroide/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.centroide.criaJanelaFlutuante()","i3GEOF.centroide_script")}},dissolve:function(){if(typeof(i3GEOF.agrupaElementos)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/dissolve/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.dissolve.criaJanelaFlutuante()","i3GEOF.dissolve_script")}},agrupaElementos:function(){if(typeof(i3GEOF.agrupaElementos)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/agrupaelementos/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.agrupaElementos.criaJanelaFlutuante()","i3GEOF.agrupaElementos_script")}}},medeDistancia:{inicia:function(){pontosdistobj={xpt:[],ypt:[],dist:[],xtela:[],ytela:[],ximg:[],yimg:[],linhas:[]};i3GEO.analise.medeDistancia.criaJanela();if(g_tipoacao!="mede"){if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.analise.medeDistancia.clique()")<0){i3GEO.eventos.MOUSECLIQUE.push("i3GEO.analise.medeDistancia.clique()")}if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.analise.medeDistancia.movimento()")<0){i3GEO.eventos.MOUSEMOVE.push("i3GEO.analise.medeDistancia.movimento()")}$i("mostradistancia").style.display="block";if(i3GEO.Interface.ATUAL!="googleearth"){i3GEO.desenho.criaContainerRichdraw();i3GEO.desenho.richdraw.lineColor="black";i3GEO.desenho.richdraw.lineWidth="1px"}g_tipoacao="mede"}else{if(i3GEO.Interface.ATUAL!="googleearth"){i3GEO.desenho.richdraw.fecha()}if($i("mostradistancia")){$i("mostradistancia").style.display="none"}if($i("pontosins")){$i("pontosins").style.display="none"}}},criaJanela:function(){var novoel,ins,imagemxy;if(!$i("mostradistancia")){novoel=document.createElement("div");novoel.id="mostradistancia";ins='<div class="hd" > <a class=ajuda_usuario target=_blank href="'+i3GEO.configura.locaplic+'/ajuda_usuario.php?idcategoria=6&idajuda=50" > </a></div>';ins+='<div class="bd" style="text-align:left;padding:3px;" >';ins+='<div style="text-align:left;padding:3px;" id="mostradistancia_calculo" ></div>';ins+='<div style="text-align:left;font-size:10px" >';ins+="<span style='color:navy;cursor:pointer;text-align:left;' >";ins+="<table><tr><td><input style='cursor:pointer' type='checkbox' id='pararraios' checked /></td><td>Raios</td><td> </td>";ins+="<td><input style='cursor:pointer' type='checkbox' id='parartextos' checked /></td><td>Textos<td></tr></table></span>";ins+='</div>';ins+='</div>';novoel.innerHTML=ins;novoel.style.borderColor="gray";document.body.appendChild(novoel)}else{if($i("mostradistancia_calculo")){$i("mostradistancia_calculo").innerHTML=""}}YAHOO.namespace("janelaDocamede.xp");YAHOO.janelaDocamede.xp.panel=new YAHOO.widget.Panel("mostradistancia",{width:300,fixedcenter:false,constraintoviewport:true,underlay:"none",close:true,visible:true,draggable:true,modal:false});YAHOO.janelaDocamede.xp.panel.render();imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));YAHOO.janelaDocamede.xp.panel.moveTo(imagemxy[0]+150,imagemxy[1]);YAHOO.util.Event.addListener(YAHOO.janelaDocamede.xp.panel.close,"click",i3GEO.analise.medeDistancia.fechaJanela)},fechaJanela:function(){if(i3GEO.Interface.ATUAL!="googleearth"){i3GEO.desenho.richdraw.fecha()}else{i3GEO.Interface.googleearth.removePlacemark("divGeometriasTemp")}if($i("pontosins")){document.body.removeChild($i("pontosins"))}YAHOO.util.Event.removeListener(YAHOO.janelaDocamede.xp.panel.close,"click");i3GEO.eventos.MOUSECLIQUE.remove("i3GEO.analise.medeDistancia.clique()");i3GEO.eventos.MOUSEMOVE.remove("i3GEO.analise.medeDistancia.movimento()");i3GEO.barraDeBotoes.ativaBotoes()},clique:function(){var n,d,decimal;if(g_tipoacao=="mede"){n=pontosdistobj.xpt.length;pontosdistobj.xpt[n]=objposicaocursor.ddx;pontosdistobj.ypt[n]=objposicaocursor.ddy;pontosdistobj.xtela[n]=objposicaocursor.telax;pontosdistobj.ytela[n]=objposicaocursor.telay;pontosdistobj.ximg[n]=objposicaocursor.imgx;pontosdistobj.yimg[n]=objposicaocursor.imgy;pontosdistobj.dist[n]=0;if(i3GEO.Interface.ATUAL!="googleearth"){try{if(navn){pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1),(pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1))}else{pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n])}}catch(e){}}if(n>0){d=i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);decimal=0;d=d+"";d=d.split(".");decimal=d[1].substr(0,5);d=d[0]+"."+decimal;d=d*1;pontosdistobj.dist[n]=d+pontosdistobj.dist[n-1];if(i3GEO.Interface.ATUAL!=="googleearth"){if($i("pararraios")&&$i("pararraios").checked===true){i3GEO.desenho.aplica("insereCirculo","",n);if(navm){pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n-1],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n])}}if($i("parartextos")&&$i("parartextos").checked===true){i3GEO.desenho.aplica("insereTexto","",n,d+" km")}}}if(i3GEO.Interface.ATUAL!=="googleearth"){i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.analise.medeDistancia.fechaJanela,"divGeometriasTemp")}else{i3GEO.util.insereMarca.cria(objposicaocursor.ddx,objposicaocursor.ddy,i3GEO.analise.medeDistancia.fechaJanela,"divGeometriasTemp")}}},movimento:function(){var n,d,r,decimal,da,mostra;if(g_tipoacao=="mede"){if($i("mostradistancia")){$i("mostradistancia").style.display="block"}n=pontosdistobj.xpt.length;try{if(n>0){d=i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);r=i3GEO.calculo.direcao(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);r=i3GEO.calculo.dd2dms(r,r);r=r[0];d=d+"";d=d.split(".");decimal=d[1].substr(0,5);d=d[0]+"."+decimal;d=d*1;da=d+pontosdistobj.dist[n-1];da=da+"";da=da.split(".");decimal=da[1].substr(0,5);da=da[0]+"."+decimal;da=da*1;mostra=$i("mostradistancia_calculo");if(mostra){mostra.innerHTML=" Dist acum.= "+da+" km <br>atual= "+d+" km <br> Direção (DMS)= "+r}if(i3GEO.Interface.ATUAL!="googleearth"){i3GEO.desenho.aplica("resizeLinha",pontosdistobj.linhas[n-1],n)}}}catch(e){}}}},medeArea:{inicia:function(){var temp;pontosdistobj=[];i3GEO.analise.medeArea.criaJanela();if(g_tipoacao!="area"){$i("mostraarea_calculo").innerHTML="";if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.analise.medeArea.clique()")<0){i3GEO.eventos.MOUSECLIQUE.push("i3GEO.analise.medeArea.clique()")}if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.analise.medeArea.movimento()")<0){i3GEO.eventos.MOUSEMOVE.push("i3GEO.analise.medeArea.movimento()")}YAHOO.util.Event.addListener(YAHOO.janelaDocaarea.xp.panel.close,"click",i3GEO.analise.medeArea.fechaJanela);temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.atualiza");g_areapixel=retorno.data;if(g_areapixel<0){alert("Nao e possivel calcular a area. Entre em contato com o administrador do sistema.")}else{$i("mostraarea_calculo").innerHTML="Clique no mapa para desenhar o poligono. Clique duas vezes para concluir";i3GEO.barraDeBotoes.ativaIcone("area");g_tipoacao="area";i3GEO.desenho.criaContainerRichdraw();i3GEO.desenho.richdraw.lineColor="green";i3GEO.desenho.richdraw.lineWidth="2px"}};if(i3GEO.Interface.ATUAL=="padrao"){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.php.areaPixel(temp,i3GEO.parametros.pixelsize)}else{alert("Operacao nao disponivel")}}else{i3GEO.desenho.richdraw.fecha()}},criaJanela:function(){var novoel,ins,imagemxy;if(!$i("mostraarea")){novoel=document.createElement("div");novoel.id="mostraarea";ins="<div class='hd' >Área aproximada <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=51' > </a></div>";ins+='<div class="bd" style="text-align:left;padding:3px;" >';ins+='<div style="text-align:left;padding:3px;font-size:10px" id="mostraarea_calculo" ></div>';ins+='</div>';novoel.innerHTML=ins;novoel.style.borderColor="gray";document.body.appendChild(novoel)}YAHOO.namespace("janelaDocaarea.xp");YAHOO.janelaDocaarea.xp.panel=new YAHOO.widget.Panel("mostraarea",{width:220,fixedcenter:false,constraintoviewport:true,underlay:"none",close:true,visible:true,draggable:true,modal:false});YAHOO.janelaDocaarea.xp.panel.render();imagemxy=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));YAHOO.janelaDocaarea.xp.panel.moveTo(imagemxy[0]+150,imagemxy[1])},fechaJanela:function(){i3GEO.desenho.richdraw.fecha();if($i("pontosArea")){document.body.removeChild($i("pontosArea"))}i3GEO.eventos.MOUSECLIQUE.remove("cliqueArea()");i3GEO.eventos.MOUSEMOVE.remove("moveArea()");i3GEO.barraDeBotoes.ativaBotoes()},clique:function(){var n,m;if(g_tipoacao=="area"){n=pontosdistobj.xpt.length;pontosdistobj.xpt[n]=objposicaocursor.ddx;pontosdistobj.ypt[n]=objposicaocursor.ddy;pontosdistobj.xtela[n]=objposicaocursor.telax;pontosdistobj.ytela[n]=objposicaocursor.telay;pontosdistobj.ximg[n]=objposicaocursor.imgx;pontosdistobj.yimg[n]=objposicaocursor.imgy;pontosdistobj.dist[n]=0;if(n===0){try{if(navn){pontosdistobj.linhastemp=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[0]-1,pontosdistobj.yimg[0]-1)}else{pontosdistobj.linhastemp=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[0])-(i3GEO.parametros.w/2),pontosdistobj.yimg[0])}}catch(e){}}try{if(navn){pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1)}else{pontosdistobj.linhas[n]=i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode,i3GEO.desenho.richdraw.fillColor,i3GEO.desenho.richdraw.lineColor,i3GEO.desenho.richdraw.lineWidth,(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n])}}catch(e){}m=i3GEO.calculo.area(pontosdistobj,g_areapixel);if($i("mostraarea_calculo")){$i("mostraarea_calculo").innerHTML="<br>m2</b>= "+m.toFixed(2)+"<br><b>km2</b>= "+(m/1000000).toFixed(2)+"<br><b>ha</b>= "+(m/10000).toFixed(2)}i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.analise.medeArea.fechaJanela,"pontosArea")}},movimento:function(){var n,d,decimal,da;if(g_tipoacao=="area"){n=pontosdistobj.xpt.length;if(n>0){if(navm){i3GEO.desenho.aplica("resizePoligono",pontosdistobj.linhas[n-1],n)}else{i3GEO.desenho.aplica("resizePoligono",pontosdistobj.linhastemp,1);i3GEO.desenho.aplica("resizeLinha",pontosdistobj.linhas[n-1],n)}}}}}}; | ... | ... |