if(typeof(i3GEO)==='undefined'){var i3GEO={}}var i3GEOtouchesPosMapa="";var i3geoOL;i3GEO.Interface={LAYERPROGRESSBAR:true,RESTRICTATT:true,LAYEROPACITY:"",INFOOVERLAY:"",ATUAL:"openlayers",IDCORPO:"openlayers",IDMAPA:"",STATUS:{atualizando:[],trocando:false,pan:false},LAYERSUTFGRID:{},aposAdicNovaCamada:function(camada){i3GEO.tema.ativaFerramentas(camada)},redesenha:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].redesenha()},grade:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].grade()},aplicaOpacidade:function(opacidade,layer){i3GEO.Interface[i3GEO.Interface.ATUAL].aplicaOpacidade(opacidade,layer)},atualizaMapa:function(){switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;default:i3GEO.Interface[i3GEO.Interface.ATUAL].redesenha()}},atualizaTema:function(retorno,tema){i3GEO.Interface[i3GEO.Interface.ATUAL].atualizaTema(retorno,tema)},ligaDesliga:function(obj){i3GEO.Interface[i3GEO.Interface.ATUAL].ligaDesliga(obj);if(obj.checked&&obj.value!=""){i3GEO.mapa.ativaTema(obj.value)}},adicionaKml:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.Interface.googlemaps.adicionaKml("foo")}if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.adicionaKml("foo")}},cria:function(w,h){i3GEO.Interface[i3GEO.Interface.ATUAL].cria(w,h)},inicia:function(w,h){var temp=window.location.href.split("?")[0],gadgets=i3GEO.gadgets;if($i("i3GEOcompartilhar")){i3GEO.social.compartilhar("i3GEOcompartilhar",temp,temp,"semtotal")}if($i("mst")){$i("mst").style.display="block"}i3GEO.navega.autoRedesenho.ativa();i3GEO.util.defineValor("i3geo_escalanum","value",i3GEO.parametros.mapscale);if((i3GEO.parametros.geoip==="nao")&&($i("ondeestou"))){$i("ondeestou").style.display="none"}i3GEO.Interface[i3GEO.Interface.ATUAL].inicia();i3GEO.desenho.criaLayerGrafico();if($i(i3GEO.login.divnomelogin)&&i3GEO.util.pegaCookie("i3geousuarionome")){$i(i3GEO.login.divnomelogin).innerHTML=i3GEO.util.pegaCookie("i3geousuarionome")}},alteraParametroLayers:function(parametro,valor){i3GEO.Interface[i3GEO.Interface.ATUAL].alteraParametroLayers(parametro,valor)},ativaBotoes:function(){},zoom2ext:function(mapexten){if(!mapexten){mapexten=i3GEO.parametros.mapexten}i3GEO.Interface[i3GEO.Interface.ATUAL].zoom2ext(mapexten)},zoomli:function(){i3GEO.Interface[i3GEO.Interface.ATUAL].zoomli()},getZoom:function(){return i3GEO.Interface[i3GEO.Interface.ATUAL].getZoom()},openlayers:{parametrosMap:{target:"openlayers",layers:[],controls:[],interactions:[],loadTilesWhileAnimating:true,loadTilesWhileInteracting:true},parametrosView:{},TILES:true,LAYERSADICIONAIS:[],googleLike:false,BALAOPROP:{url:"",templateModal:"",removeAoAdicionar:true,classeCadeado:"i3GEOiconeAberto",autoPan:false,autoPanAnimation:{duration:250,easing:ol.easing.inAndOut},minWidth:'200px',modal:false,simple:true,openTipNoData:true,baloes:[]},GRADE:"",FULLSCREEN:"",fullscreen:function(){if(i3GEO.Interface.openlayers.FULLSCREEN==""){i3GEO.Interface.openlayers.FULLSCREEN=new ol.control.FullScreen();i3GEO.Interface.openlayers.FULLSCREEN.setMap(i3geoOL);return}if(i3GEO.Interface.openlayers.FULLSCREEN.getMap()==null){i3GEO.Interface.openlayers.FULLSCREEN.setMap(i3geoOL)}else{i3GEO.Interface.openlayers.FULLSCREEN.setMap(null)}},grade:function(){if(i3GEO.Interface.openlayers.GRADE==""){i3GEO.Interface.openlayers.GRADE=new ol.Graticule({strokeStyle:new ol.style.Stroke({color:'rgba(105,105,105,0.9)',width:2,lineDash:[0.5,4]}),showLabels:true,targetSize:200});i3GEO.Interface.openlayers.GRADE.setMap(i3geoOL);return}if(i3GEO.Interface.openlayers.GRADE.getMap()==null){i3GEO.Interface.openlayers.GRADE.setMap(i3geoOL)}else{i3GEO.Interface.openlayers.GRADE.setMap(null)}},zoomli:function(){if(DetectaMobile("DetectMobileLong")){i3GEO.janela.tempoMsg($trad("x70"))}else{i3GEO.janela.tempoMsg($trad("zoomliShift"))}},getZoom:function(){return i3geoOL.getZoom()},balao:function(texto,textCopy,x,y,botaoProp,nwkts){var hash={"x":x,"y":y,"xtxt":$.number(x,3,$trad("dec"),$trad("mil")),"ytxt":$.number(y,3,$trad("dec"),$trad("mil")),"resolution":i3GEO.configura.ferramentas.identifica.resolution,"tolerancia":$trad("tolerancia")};if(botaoProp===undefined){botaoProp=true}hash.texto=texto;var createinfotooltip=function(){var icone,painel,b,cabecalho,conteudo,removeBaloes,html,p=i3GEO.Interface.openlayers.BALAOPROP,removeBaloes=function(removeWkt){var nd,t,n=i3GEO.Interface.openlayers.BALAOPROP.baloes.length,i;for(i=0;i0){hash.wkt=""}painel=document.createElement("div");$(painel).hover(function(){$(this).find(".i3GEOCabecalhoInfoWindow").removeClass("hiddenInfo")},function(){$(this).find(".i3GEOCabecalhoInfoWindow").addClass("hiddenInfo")});painel.innerHTML=Mustache.render(i3GEO.template.infotooltip,hash);$(painel).find("[data-info='close']").on("click",removeBaloes);$(painel).find("[data-info='wkt']").on("click",function(){removeBaloes(false)});$(painel).find("[data-info='info']").on("click",function(){i3GEO.mapa.dialogo.cliqueIdentificaDefault(x,y,"");return false});$(painel).find("[data-info='settings']").on("click",function(){i3GEO.janela.prompt($trad("tolerancia"),function(){i3GEO.configura.ferramentas.identifica.resolution=$i("i3GEOjanelaprompt").value},i3GEO.configura.ferramentas.identifica.resolution);return false});$(painel).find("[data-info='lockopen']").on("click",function(e){var p=i3GEO.Interface.openlayers.BALAOPROP;$(e.target).addClass("hidden");$(e.target.parentNode).find("[data-info='lock']").removeClass("hidden");p.removeAoAdicionar=false;return false});$(painel).find("[data-info='lock']").on("click",function(e){var p=i3GEO.Interface.openlayers.BALAOPROP;$(e.target).addClass("hidden");$(e.target.parentNode).find("[data-info='lockopen']").removeClass("hidden");p.removeAoAdicionar=true;return false});$(painel).find('.dropdown-toggle').dropdown();$(painel).find("[data-info='copy']").on("click",function(e){i3GEO.util.copyToClipboard(textCopy.join("\n"))});b=new ol.Overlay({element:painel,stopEvent:true,autoPan:false,autoPanAnimation:p.autoPanAnimation});b.setProperties({origem:"balao"});p.baloes.push(b);i3geoOL.addOverlay(b);b.setPosition(i3GEO.util.projGeo2OSM(new ol.geom.Point([x,y])).getCoordinates());if(p.autoPan==true){i3GEO.Interface.openlayers.pan2ponto(x,y,p.autoPanAnimation)}else{i3GEO.Interface.openlayers.pan2ponto(x,y,false)}};if(i3GEO.template.infotooltip==false){$.get(i3GEO.configura.locaplic+"/js/templates/infotooltip.html").done(function(r){i3GEO.template.infotooltip=r;createinfotooltip()})}else{createinfotooltip()}},redesenha:function(){var openlayers=i3GEO.Interface.openlayers;openlayers.criaLayers();openlayers.ordenaLayers();openlayers.recalcPar();i3GEO.janela.fechaAguarde()},fundoDefault:function(){},cria:function(w,h){var f,ins,i=$i(i3GEO.Interface.IDCORPO);if(i){if(!i.style.height){i.style.width="100vw";i.style.height="100vh"}f=$i("openlayers");if(!f){ins='
';i.innerHTML=ins;f=$i("openlayers")}}i3GEO.Interface.IDMAPA="openlayers";i3GEO.Interface.openlayers.parametrosMap.target="openlayers";if(i3GEO.Interface.openlayers.googleLike===false){i3GEO.Interface.openlayers.parametrosView.projection="EPSG:4326"}else{i3GEO.Interface.openlayers.parametrosView.projection="EPSG:3857"}i3GEO.Interface.openlayers.parametrosMap.view=new ol.View(i3GEO.Interface.openlayers.parametrosView);i3geoOL=new ol.Map(i3GEO.Interface.openlayers.parametrosMap);ol.layer.Layer.prototype.setVisibility=function(v){this.setVisible(v)};ol.layer.Layer.prototype.getVisibility=function(v){this.getVisible(v)};i3geoOL.panTo=function(x,y,anim){if(anim){this.getView().animate({center:[x,y],duration:anim.duration,easing:anim.easing})}else{this.getView().setCenter([x,y])}};i3geoOL.getLayersByName=function(nome){var res=[],layers=this.getLayers(),n=layers.getLength(),i;for(i=0;i1){opacidade=opacidade/100}if(layer){i3geoOL.getLayersByName(layer)[0].setOpacity(opacidade*1);return}else{layer=""}var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,l,i,camada;if(!layer){layer=""}for(i=nlayers-1;i>=0;i--){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];l=i3geoOL.getLayersByName(camada.name)[0];if(l&&l.get("isBaseLayer")===false){if(layer==""||layer==camada.name){l.setOpacity(opacidade)}}}},criaLayers:function(){var matrixIds,resolutions,size,z,projectionExtent,source,configura=i3GEO.configura,url,nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,layer,camada,urllayer,opcoes,i,temp;temp=$i("i3GEOprogressoDiv");if(temp){i3GEO.Interface.STATUS.atualizando=[];temp.style.display="none"}if(i3GEO.Interface.openlayers.googleLike===true){url=configura.locaplic+"/classesphp/mapa_googlemaps.php?";projectionExtent=ol.proj.get('EPSG:3857').getExtent()}else{url=configura.locaplic+"/classesphp/mapa_openlayers.php?";projectionExtent=ol.proj.get('EPSG:4326').getExtent()}url+="TIPOIMAGEM="+configura.tipoimagem;size=ol.extent.getWidth(projectionExtent)/256;resolutions=new Array(40);matrixIds=new Array(40);for(z=0;z<40;++z){resolutions[z]=size/Math.pow(2,z);matrixIds[z]=z}$i("openlayers").style.backgroundColor="rgb("+i3GEO.parametros.cordefundo+")";i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS);opcoes={gutter:0,isBaseLayer:false,opacity:1,visible:false,singleTile:!(i3GEO.Interface.openlayers.TILES),tilePixelRatio:1,preload:0,projection:'EPSG:4326'};if(i3GEO.Interface.openlayers.googleLike===true){opcoes.projection='EPSG:3857'}for(i=nlayers-1;i>=0;i--){layer="";camada=i3GEO.arvoreDeCamadas.CAMADAS[i];opcoes.singleTile=!(i3GEO.Interface.openlayers.TILES);if(camada.transparency!=""){opcoes.opacity=camada.transparency/100}if(i3geoOL.getLayersByName(camada.name).length===0&&camada.name.toLowerCase()!="copyright"){if(camada.plugini3geo&&camada.plugini3geo!=""&&camada.plugini3geo.parametros!=undefined){i3GEO.pluginI3geo.inicia(camada);continue}else{try{temp=camada.transitioneffect==="nao"?opcoes.preload=0:opcoes.preload=Infinity;if(camada.connectiontype===7&&camada.wmsurl!==""&&camada.wmstile==1){urllayer=camada.wmsurl;if(camada.wmstile==10){source=new ol.source.WMTS({crossOrigin:"anonymous",url:urllayer,matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,tileGrid:new ol.tilegrid.WMTS({origin:ol.extent.getTopLeft(projectionExtent),resolutions:resolutions,matrixIds:matrixIds}),wrapX:true});source.set("tipoServico","WMTS");opcoes.singleTile=false}else{source=new ol.source.TileWMS({crossOrigin:"anonymous",url:urllayer,params:{'VERSION':'1.1.0'},projection:opcoes.projection});source.set("tipoServico","ImageWMS");opcoes.singleTile=false}opcoes.title=camada.tema;opcoes.name=camada.name;opcoes.isBaseLayer=false;opcoes.visible=true}else{if(i3GEO.Interface.openlayers.TILES==false){opcoes.singleTile=true}else{if(camada.tiles==="nao"||camada.escondido.toLowerCase()==="sim"||camada.connectiontype===10||(camada.type===0&&camada.cache==="nao")||camada.type===8){opcoes.singleTile=true}else{temp=camada.type===3?opcoes.singleTile=false:opcoes.singleTile=!(i3GEO.Interface.openlayers.TILES)}if(camada.tiles==="nao"){opcoes.singleTile=true}if(camada.tiles==="sim"||camada.cache==="sim"||(camada.cortepixels&&camada.cortepixels>0)){opcoes.singleTile=false}}if(camada.cache){urllayer=url+"&cache="+camada.cache+"&cacheprefixo="+camada.cacheprefixo}else{urllayer=url+"&cache=nao"}urllayer+="&layer="+camada.name;if(camada.utfgrid=="sim"&&i3GEO.parametros.w>500){if(i3GEO.Interface.openlayers.googleLike===false){source=new ol.source.TileUTFGrid({projection:opcoes.projection,wrapX:true,tileJSON:{"tilejson":"2.1.0","scheme":"xyz","grids":[urllayer+"&FORMAT=utfgrid&tms=&TileCol={x}&TileRow={y}&TileMatrix={z}"]}})}else{source=new ol.source.TileUTFGrid({projection:opcoes.projection,wrapX:true,tileJSON:{"tilejson":"2.1.0","scheme":"xyz","grids":[urllayer+"&FORMAT=utfgrid&tms=&X={x}&Y={y}&Z={z}"]}})}source.set("tipoServico","WMTS");opcoes.singleTile=false;opcoes.title="";opcoes.name=camada.name+"_utfgrid";opcoes.source=source;opcoes.isBaseLayer=false;opcoes.visible=true;source.set("name",camada.name+"_utfgrid");var layerutfgrid=new ol.layer.Tile(opcoes);camada.status==0?layerutfgrid.setVisible(false):layerutfgrid.setVisible(true);i3GEO.Interface.LAYERSUTFGRID[camada.name+"_utfgrid"]=layerutfgrid;if(i3GEO.Interface.INFOOVERLAY==""){$("#"+i3GEO.Interface.IDMAPA).after(i3GEO.template.utfGridInfo);i3GEO.Interface.INFOOVERLAY=new ol.Overlay({element:$i("i3GEOoverlayInfo"),offset:[3,-3],stopEvent:true,positioning:'bottom-left'});i3GEO.Interface.INFOOVERLAY.setProperties({origem:"infoOverlay"});i3geoOL.addOverlay(i3GEO.Interface.INFOOVERLAY)}i3geoOL.addLayer(layerutfgrid)}if(opcoes.singleTile===true){source=new ol.source.ImageWMS({url:urllayer,crossOrigin:"anonymous",params:{'LAYERS':camada.name,'VERSION':'1.1.0'},projection:opcoes.projection,ratio:1});source.set("tipoServico","ImageWMS")}else{if(i3GEO.Interface.openlayers.googleLike===false){source=new ol.source.WMTS({url:urllayer+"&WIDTH=256&HEIGHT=256",crossOrigin:"anonymous",matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,tileGrid:new ol.tilegrid.WMTS({origin:ol.extent.getTopLeft(projectionExtent),resolutions:resolutions,matrixIds:matrixIds,tileSize:[256,256]}),wrapX:true});source.set("tipoServico","WMTS")}else{source=new ol.source.XYZ({crossOrigin:"anonymous",url:urllayer+"&X={x}&Y={y}&Z={z}",matrixSet:opcoes.projection,format:'image/png',projection:opcoes.projection,wrapX:true});source.set("tipoServico","WMTS")}}opcoes.title=camada.tema;opcoes.name=camada.name}if(camada.link_tema!=""&&i3GEO.Interface.RESTRICTATT==false){source.setAttributions([new ol.Attribution({html:'
  • '+camada.tema+'
  • '})])}source.set("name",camada.name);source.set("parametrosUrl",{par:""});opcoes.source=source;opcoes.isBaseLayer=false;opcoes.visible=true;if(i3GEO.Interface.LAYERPROGRESSBAR==true&&$i("i3GEOprogressoCamadas")){source.on('tileloadstart',function(event){i3GEO.Interface.openlayers.loadStartLayer(source.get("name"))});source.on('tileloadend',function(event){i3GEO.Interface.openlayers.loadStopLayer(source.get("name"))});source.on('tileloaderror',function(event){i3GEO.Interface.openlayers.loadStopLayer(source.get("name"))})}if(opcoes.singleTile===true){layer=new ol.layer.Image(opcoes)}else{layer=new ol.layer.Tile(opcoes)}}catch(e){}}if(layer&&layer!=""){if(camada.escondido.toLowerCase()==="sim"){layer.preload=0}if(camada.type>1&&i3GEO.Interface.LAYEROPACITY!=""){layer.setOpacity(i3GEO.Interface.LAYEROPACITY)}i3geoOL.addLayer(layer);i3GEO.Interface.aposAdicNovaCamada(camada)}}else{layer=i3geoOL.getLayersByName(camada.name)[0]}if(layer&&layer!=""){temp=camada.status==0?layer.setVisible(false):layer.setVisible(true)}}if(i3GEO.parametros.copyright!=""&&!$i("i3GEOcopyright")){temp=document.createElement("div");temp.id="i3GEOcopyright";temp.innerHTML="

    "+i3GEO.parametros.copyright+"

    ";if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).appendChild(temp)}}else if(i3GEO.parametros.copyright!=""&&$i("i3GEOcopyright")){$i("i3GEOcopyright").innerHTML=i3GEO.parametros.copyright}},sobeLayersGraficos:function(){},inverteModoTile:function(){if(i3GEO.Interface.openlayers.TILES===true){i3GEO.Interface.openlayers.TILES=false}else{i3GEO.Interface.openlayers.TILES=true}i3GEO.Interface.openlayers.removeTodosOsLayers();i3GEO.Interface.openlayers.criaLayers()},removeTodosOsLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,layer,i,camada;for(i=nlayers-1;i>=0;i--){camada=i3GEO.arvoreDeCamadas.CAMADAS[i];layer=i3geoOL.getLayersByName(camada.name)[0];if(layer){i3geoOL.removeLayer(layer,false);i3GEO.pluginI3geo.removeCamada(camada.name)}}},alteraParametroLayers:function(parametro,valor){var layer,layers=i3GEO.arvoreDeCamadas.CAMADAS,nlayers=layers.length,i,param,source,k,url="",n,j;for(i=0;i=0;i--){layer=i3geoOL.getLayersByName(ordem[i].name);layer=layer[0];if(layer){layers.remove(layer);layers.push(layer)}}},ligaDesliga:function(obj){var layers=i3geoOL.getLayersByName(obj.value),desligar="",ligar="",b;if(layers.length>0){layers[0].setVisibility(obj.checked);if(obj.checked===true){i3GEO.pluginI3geo.ligaCamada(obj.value)}else{i3GEO.pluginI3geo.desligaCamada(obj.value)}}if(obj.checked){ligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value);if(i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"]){i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value+"_utfgrid");i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"].setVisibility(true)}}else{desligar=obj.value;i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value);if(i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"]){i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value+"_utfgrid");i3GEO.Interface.LAYERSUTFGRID[obj.value+"_utfgrid"].setVisibility(false)}}i3GEO.php.ligatemas(i3GEO.legenda.atualiza,desligar,ligar)},ativaFundo:function(nome,obj){var baseLayers,n,i,t,ck=true;baseLayers=i3geoOL.getLayersBase();n=baseLayers.length;if(obj){ck=obj.checked}if(obj&&obj.type!="checkbox"){for(i=0;i"+data.text+"";i3GEO.Interface.INFOOVERLAY.setPosition(e.coordinate);i3GEO.eventos.mouseOverData()}else if(ei.innerHTML==""){ei.style.visibility="hidden";i3GEO.Interface.INFOOVERLAY.setPosition(undefined);i3GEO.eventos.mouseOutData()}})}}}});i3geoOL.on("touchend",function(e){e.preventDefault();calcCoord(e);if(i3GEO.eventos.cliquePerm.status===true&&i3GEO.eventos.CONTATOUCH<10){i3GEO.eventos.mouseupMapa(e)}i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.CONTATOUCH=0;i3GEO.Interface.STATUS.pan=false})},ativaBotoes:function(){},recalcPar:function(){i3GEOtouchesPosMapa="";var bounds=i3geoOL.getExtent().toBBOX().split(","),escalaAtual=i3geoOL.getScale();i3GEO.parametros.mapexten=bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3];if(i3GEO.parametros.mapscale!==escalaAtual){i3GEO.arvoreDeCamadas.atualizaFarol(escalaAtual)}i3GEO.parametros.pixelsize=i3geoOL.getView().getResolution();i3GEO.navega.atualizaEscalaNumerica(parseInt(escalaAtual,10));i3GEO.parametros.mapscale=escalaAtual},zoom2ext:function(ext){var m,v;if(!ext){ext=i3GEO.parametros.extentTotal}ext=i3GEO.util.extGeo2OSM(ext);m=ext.split(" ");m=[m[0]*1,m[1]*1,m[2]*1,m[3]*1];v=i3geoOL.getView();v.fit(m,i3geoOL.getSize());i3GEO.eventos.cliquePerm.status=true},pan2ponto:function(x,y,anim){if(i3GEO.Interface.openlayers.googleLike===true){var metrica;if(x<180&&x>-180){metrica=ol.proj.transform([x,y],'EPSG:4326','EPSG:3857');x=metrica[0];y=metrica[1]}}i3geoOL.panTo(x,y,anim)}},googlemaps:{ESTILOS:{'Red':[{featureType:'all',stylers:[{hue:'#ff0000'}]}],'Countries':[{featureType:'all',stylers:[{visibility:'off'}]},{featureType:'water',stylers:[{visibility:'on'},{lightness:-100}]}],'Night':[{featureType:'all',stylers:[{invert_lightness:'true'}]}],'Blue':[{featureType:'all',elementType:'geometry',stylers:[{hue:'#0000b0'},{invert_lightness:'true'},{saturation:-30}]}],'Greyscale':[{featureType:'all',stylers:[{saturation:-100},{gamma:0.50}]}],'No roads':[{featureType:'road',stylers:[{visibility:'off'}]}],'Mixed':[{featureType:'landscape',stylers:[{hue:'#00dd00'}]},{featureType:'road',stylers:[{hue:'#dd0000'}]},{featureType:'water',stylers:[{hue:'#000040'}]},{featureType:'poi.park',stylers:[{visibility:'off'}]},{featureType:'road.arterial',stylers:[{hue:'#ffff00'}]},{featureType:'road.local',stylers:[{visibility:'off'}]}],'Chilled':[{featureType:'road',elementType:'geometry',stylers:[{'visibility':'simplified'}]},{featureType:'road.arterial',stylers:[{hue:149},{saturation:-78},{lightness:0}]},{featureType:'road.highway',stylers:[{hue:-31},{saturation:-40},{lightness:2.8}]},{featureType:'poi',elementType:'label',stylers:[{'visibility':'off'}]},{featureType:'landscape',stylers:[{hue:163},{saturation:-26},{lightness:-1.1}]},{featureType:'transit',stylers:[{'visibility':'off'}]},{featureType:'water',stylers:[{hue:3},{saturation:-24.24},{lightness:-38.57}]}]},ESTILOPADRAO:"",MAPOPTIONS:{scaleControl:true,mapTypeControlOptions:{position:1}},OPACIDADE:0.8,TIPOMAPA:"terrain",ZOOMSCALE:[591657550,295828775,147914387,73957193,36978596,18489298,9244649,4622324,2311162,1155581,577790,288895,144447,72223,36111,18055,9027,4513,2256,1128],PARAMETROSLAYER:"&TIPOIMAGEM="+i3GEO.configura.tipoimagem,posfixo:0,BALAOPROP:{url:"",templateModal:"",removeAoAdicionar:true,modal:false,simple:true,classeCadeado:"i3GEOiconeAberto",baloes:[]},grade:function(){return false},barraProgressoStart:function(){var p=$i("i3GEOprogressoCamadas");if(p){p.style.width="100%"}},barraProgressoStop:function(){var p=$i("i3GEOprogressoCamadas"),n=0,d=0;if(p){n=i3GeoMap.overlayMapTypes.length;d=parseInt(p.style.width,10);if(d<10||n==0){p.style.width="0%"}else{p.style.width=d-(100/n)+"%";if(d-(100/n)<0){p.style.width="0%"}}}},zoomli:function(){if(DetectaMobile("DetectMobileLong")){i3GEO.janela.tempoMsg($trad("x70"))}else{i3GEO.janela.tempoMsg($trad("zoomliCtrl"))}},getZoom:function(){return i3GeoMap.getZoom()},removeBaloes:function(){var p=i3GEO.Interface.googlemaps.BALAOPROP.baloes,n=p.length,i;for(i=0;i';i.innerHTML=ins}f=$i("googlemapsdiv");if(w){f.style.width=w+"px";f.style.height=h+"px"}}i3GeoMap="";i3GEO.Interface.IDMAPA="googlemapsdiv"},ativaZoomBox:function(){i3GeoMap.enableKeyDragZoom({key:'ctrl'})},inicia:function(){var pol,ret,montaMapa;pol=i3GEO.parametros.mapexten;ret=pol.split(" ");if($i("i3GEOprogressoDiv")){$i("i3GEOprogressoDiv").style.display="block"}montaMapa=function(retorno){var sw,ne,estilo,dobra=$i("i3GEOdobraPagina");try{i3GeoMap=new google.maps.Map($i(i3GEO.Interface.IDMAPA),i3GEO.Interface.googlemaps.MAPOPTIONS)}catch(e){alert(e);return}if(i3GEO.Interface.googlemaps.ESTILOS&&i3GEO.Interface.googlemaps.ESTILOPADRAO!=""){estilo=i3GEO.Interface.googlemaps.ESTILOS[i3GEO.Interface.googlemaps.ESTILOPADRAO];i3GeoMap.mapTypes.set(i3GEO.Interface.googlemaps.ESTILOPADRAO,new google.maps.StyledMapType(estilo,{name:i3GEO.Interface.googlemaps.ESTILOPADRAO}))}else{i3GeoMap.setMapTypeId(i3GEO.Interface.googlemaps.TIPOMAPA)}if(dobra){$i(i3GEO.Interface.IDMAPA).appendChild(dobra)}if(!i3GEO.Interface.googlemaps.MAPOPTIONS.center&&!i3GEO.Interface.googlemaps.MAPOPTIONS.zoom){sw=new google.maps.LatLng(ret[1],ret[0]);ne=new google.maps.LatLng(ret[3],ret[2]);i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne))}if(!$i("keydragzoom_script")){js=i3GEO.configura.locaplic+"/pacotes/google/keydragzoom.js";i3GEO.util.scriptTag(js,"i3GEO.Interface.googlemaps.ativaZoomBox()","keydragzoom_script")}i3GeoMapOverlay=new google.maps.OverlayView();i3GeoMapOverlay.draw=function(){};i3GEO.Interface.googlemaps.criaLayers();i3GeoMapOverlay.setMap(i3GeoMap);i3GEO.Interface.googlemaps.registraEventos();i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));if(i3GEO.Interface.STATUS.trocando===false){i3GEO.idioma.mostraSeletor()}if(i3GEO.Interface.STATUS.trocando===true&&$i(i3GEO.arvoreDeCamadas.IDHTML)){$i(i3GEO.arvoreDeCamadas.IDHTML).innerHTML=""}if(i3GEO.arvoreDeCamadas.ATIVATEMA===""){i3GEO.arvoreDeCamadas.ATIVATEMA="i3GEO.Interface.ligaDesliga(this)"}if(i3GEO.parametros.kmlurl!==""){i3GEO.Interface.googlemaps.adicionaKml(true,i3GEO.parametros.kmlurl)}if(jQuery.isFunction(i3GEO.finalizaAPI)){i3GEO.finalizaAPI.call()}else{if(i3GEO.finalizaAPI!=""){eval(i3GEO.finalizaAPI)}}google.maps.event.addListenerOnce(i3GeoMap,'idle',function(){var z=i3GeoMap.getZoom();if(z!=undefined){i3GeoMap.setZoom(parseInt(z,10)+1)}});i3GEO.coordenadas.ativaEventos()};i3GEO.php.googlemaps(montaMapa)},criaLayers:function(){var nlayers=i3GEO.arvoreDeCamadas.CAMADAS.length,i,camada,indice;for(i=0;i0){for(i=0;i0){return divimg[i].parentNode.parentNode.parentNode}}}return false},ligaDesliga:function(obj){var plugin,indice,temp,desligar="",ligar="",n,i,lista=[],listatemp;indice=i3GEO.Interface.googlemaps.retornaIndiceLayer(obj.value);temp=function(){i3GEO.legenda.atualiza()};plugin=i3GEO.pluginI3geo.existeObjeto(obj.value);if(obj.checked&&(!indice||plugin===true)){ligar=obj.value;listatemp=i3GEO.arvoreDeCamadas.listaLigadosDesligados()[0];n=i3GEO.arvoreDeCamadas.CAMADAS.length;for(i=0;i"+nomeOverlay+"";d={html:html};nodekml=new YAHOO.widget.HTMLNode(d,node,true,true);nodekml.enableHighlight=false;nodekml.isleaf=true;i3GEO.Interface.googlemaps.ARVORE.draw();i3GEO.Interface.googlemaps.ARVORE.collapseAll();node.expand();if(ativo===true){eval(id+" = new google.maps.KmlLayer('"+url+"',{map:i3GeoMap,preserveViewport:true});")}},criaArvoreKML:function(){var arvore,a,root,titulo,d,node;arvore=$i("arvoreCamadasKml");if(!arvore){d=document.createElement("div");d.id="arvoreCamadasKml";d.style.top="40px";a=$i(i3GEO.arvoreDeCamadas.IDHTML);if(a){a.parentNode.appendChild(d)}else{return}}i3GEO.Interface.googlemaps.ARVORE=new YAHOO.widget.TreeView("arvoreCamadasKml");root=i3GEO.Interface.googlemaps.ARVORE.getRoot();titulo="
    Kml
    ";d={html:titulo,idkml:"raiz"};node=new YAHOO.widget.HTMLNode(d,root,true,true);node.enableHighlight=false},ativaDesativaCamadaKml:function(obj,url){if(!obj.checked){eval(obj.value+".setMap(null);")}else{eval(obj.value+" = new google.maps.KmlLayer(url,{map:i3GeoMap,preserveViewport:true});")}},alteraParametroLayers:function(parametro,valor){parametro=parametro.toUpperCase();var reg=new RegExp(parametro+"([=])+([a-zA-Z0-9_]*)");i3GEO.Interface.googlemaps.PARAMETROSLAYER=i3GEO.Interface.googlemaps.PARAMETROSLAYER.replace(reg,"");i3GEO.Interface.googlemaps.PARAMETROSLAYER+="&"+parametro+"="+valor;i3GEO.Interface.googlemaps.redesenha()}}};