Commit a2518c11ea72026bb6eb517d68abb9280a90e5d6

Authored by Edmar Moretti
1 parent fd7cc211

Inclusão de parâmetro de inicialização, que permite adicionar camadas advindas d…

…o sistema de metadados estatísticos, diretamente nas configurações de abertura de um mapa
classesphp/classe_metaestatinfo.php
... ... @@ -506,7 +506,9 @@ class MetaestatInfo{
506 506 //Layers adicionados aqui sao marcados com o metadata METAESTAT "SIM"
507 507 //O codigo_tipo_regiao e marcado com o metadata METAESTAT_CODIGO_TIPO_REGIAO
508 508 //O id da medida da variavel e marcado com o metadata METAESTAT_ID_MEDIDA_VARIAVEL
509   -
  509 + if($cachemapfile == false){
  510 + $this->nomecache = $this->nomecache . $this->nomeRandomico(5);
  511 + }
510 512 $arq = $this->dir_tmp."/".$this->nomecache.".map";
511 513 if(!file_exists($arq)){
512 514 $meta = $this->listaMedidaVariavel("",$id_medida_variavel);
... ... @@ -1021,8 +1023,8 @@ class MetaestatInfo{
1021 1023 * @param coluna
1022 1024 * @return array
1023 1025 */
1024   - function valorUnicoMedidaVariavel($id_medida_variavel,$coluna){
1025   - $sqlf = $this->sqlMedidaVariavel($id_medida_variavel,0,$coluna);
  1026 + function valorUnicoMedidaVariavel($id_medida_variavel,$coluna,$filtro=""){
  1027 + $sqlf = $this->sqlMedidaVariavel($id_medida_variavel,0,$coluna,"polygon","",false,$filtro);
1026 1028 $sqlf = $sqlf["sqlagrupamento"];
1027 1029 $metaVariavel = $this->listaMedidaVariavel("",$id_medida_variavel);
1028 1030 if(!empty($metaVariavel["codigo_estat_conexao"])){
... ...
ferramentas/metaestat/index.js
... ... @@ -1497,8 +1497,9 @@ i3GEOF.metaestat = {
1497 1497 novoel = document.createElement("div");
1498 1498 novoel.className = "paragrafo";
1499 1499 novoel.innerHTML = ins;
1500   - i3GEOF.metaestat.comum.aguarde("hidden");
  1500 +
1501 1501 onde.appendChild(novoel);
  1502 + i3GEOF.metaestat.comum.aguarde("hidden");
1502 1503 };
1503 1504 i3GEO.php.listaValoresParametroMedidaVariavel(id_parametro_medida,temp);
1504 1505 },
... ...
interface/openlayersdebug.htm
... ... @@ -649,10 +649,13 @@
649 649 layers : {
650 650 //array com a lista dos layers que serao adicionados e ligados (visiveis)
651 651 add : [],
652   - //array com a lista dos layers que serao adicionados mas nao ligados
  652 + //array com a lista dos layers que serao adicionados mas nao ligados. Inclusive IDs do sistema de metadados estatisticos
653 653 on : [],
654 654 //array com os layers desligados
655   - off : []
  655 + off : [],
  656 + //array com a lista de IDs que identificam medidas registradas no sistema de metadados
  657 + //estatisticos
  658 + metaestat : []
656 659 },
657 660 //lista de coordenadas x e y que serao adicionadas como pontos no mapa
658 661 points : {
... ...
js/compactados/ini_i3geo_compacto.js
1   -var i3GEOF=[];var i3GEOadmin=[];if(typeof YAHOO!="undefined"){YAHOO.namespace("i3GEO")}var i3GEO={tamanhodoc:[],parametros:{mapexten:"",mapscale:"",mapres:"",pixelsize:"",mapfile:"",cgi:"",extentTotal:"",mapimagem:"",geoip:"",utilizacgi:"",versaoms:"",versaomscompleta:"",mensagens:"",w:"",h:"",locsistemas:"",locidentifica:"",r:"",locmapas:"",celularef:"",kmlurl:"",mensageminicia:"",interfacePadrao:"openlayers.htm",autenticadoopenid:"nao",cordefundo:"",copyright:"",editor:"nao"},scrollerWidth:"",finaliza:"",finalizaAPI:"",temaAtivo:"",contadorAtualiza:0,init:function(parametrosMapa,configMapa){if($.material){$.material.init()}if(configMapa&&configMapa!=""){i3GEO.configMapa(configMapa)}if(parametrosMapa&&parametrosMapa!=""){i3GEO.configura.mashuppar=i3GEO.parametrosMapa2mashuppar(parametrosMapa)}else{i3GEO.configura.mashuppar=""}i3GEO.cria();i3GEO.inicia()},configMapa:function(c){i3GEO.configura.guardaExtensao=(c.hasOwnProperty("saveExtension")&&c.saveExtension==true)?true:false;i3GEO.configura.tipoimagem=(c.hasOwnProperty("posRenderType")&&c.posRenderType!="")?c.posRenderType:"nenhum";i3GEO.configura.locaplic=(c.hasOwnProperty("i3GeoServer")&&c.i3GeoServer!="")?c.i3GeoServer:i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";if(c.hasOwnProperty("tools")){i3GEO.configura.ferramentas=c.tools}if(c.hasOwnProperty("layerOpacity")&&c.hasOwnProperty("layerOpacity")!=""){i3GEO.Interface.LAYEROPACITY=c.layerOpacity}i3GEO.Interface.IDCORPO=(c.hasOwnProperty("mapBody")&&c.mapBody!="")?c.mapBody:"mapai3Geo";i3GEO.finalizaAPI=(c.hasOwnProperty("afterStart")&&c.afterStart!="")?c.afterStart:"";if(c.hasOwnProperty("components")){i3GEO.arvoreDeTemas.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.catalogoMenus.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.busca.SERVICO=(c.components.hasOwnProperty("searchService"))?c.components.searchService:"";i3GEO.busca.SERVICOWMS=(c.components.hasOwnProperty("searchWms"))?c.components.searchWms:"";i3GEO.mapa.BALAOATIVO=(c.components.hasOwnProperty("info"))?c.components.info:true;if(c.components.referenceMapPosition){i3GEO.maparef.TOP=c.components.referenceMapPosition[0];i3GEO.maparef.RIGHT=c.components.referenceMapPosition[1]}if(c.components.scrollBar){i3GEO.janela.scrollBar=c.components.scrollBar}if(c.components.tooltip){var p=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP;p.removeAoAdicionar=(c.components.tooltip.hasOwnProperty("removeAoAdicionar"))?c.components.tooltip.removeAoAdicionar:true;p.autoPan=(c.components.tooltip.hasOwnProperty("autoPan"))?c.components.tooltip.autoPan:true;p.modal=(c.components.tooltip.hasOwnProperty("modal"))?c.components.tooltip.modal:false;p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:"";p.templateModal=(c.components.tooltip.hasOwnProperty("templateModal"))?c.components.tooltip.templateModal:"";p.simple=(c.components.tooltip.hasOwnProperty("simple"))?c.components.tooltip.simple:true;p.minWidth=(c.components.tooltip.hasOwnProperty("minWidth"))?c.components.tooltip.minWidth:'';p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:'200px';p.autoPanAnimation=(c.components.tooltip.hasOwnProperty("autoPanAnimation"))?c.components.tooltip.autoPanAnimation:p.autoPanAnimation;if(c.components.tooltip.hasOwnProperty("toolTipSize")){i3GEO.configura.alturatip=c.components.tooltip.toolTipSize[0];i3GEO.configura.larguratip=c.components.tooltip.toolTipSize[1]}}}if(c.hasOwnProperty("openLayers")&&c.mapType!=="GM"){var d=c.openLayers;i3GEO.Interface.ATUAL="openlayers";i3GEO.Interface.openlayers.googleLike=(c.mapType=="OSM")?true:false;i3GEO.Interface.openlayers.TILES=(d.hasOwnProperty("singleTile")&&d.singleTile!="")?!d.singleTile:true;i3GEO.Interface.openlayers.parametrosMap=d.MapOptions;i3GEO.Interface.openlayers.parametrosView=d.ViewOptions;if(d.hasOwnProperty("editorButtons")&&d.editorButtons!=""){i3GEO.editor.botoes=d.editorButtons}}if(c.hasOwnProperty("googleMaps")&&c.mapType=="GM"){i3GEO.Interface.ATUAL="googlemaps";i3GEO.Interface.googlemaps.ESTILOPADRAO=c.googleMaps.MapOptions.mapTypeId;i3GEO.Interface.googlemaps.MAPOPTIONS=c.googleMaps.MapOptions}},parametrosMapa2mashuppar:function(p){var par=[],temp;if(p.hasOwnProperty("mapfilebase")&&p.mapfilebase!=""){par.push("&base="+p.mapfilebase)}if(p.hasOwnProperty("mapext")&&p.mapext!=""&&p.mapext.length==4){par.push("&mapext="+p.mapext.join(","));i3GEO.configura.guardaExtensao=false}if(p.hasOwnProperty("perfil")&&p.perfil!=""){par.push("&perfil="+p.perfil)}if(p.hasOwnProperty("layers")){if(p.layers.add&&p.layers.add.length>0){par.push("&temasa="+p.layers.add.join(","))}if(p.layers.on&&p.layers.on.length>0){par.push("&layers="+p.layers.on.join(","))}if(p.layers.off&&p.layers.off.length>0){par.push("&desligar="+p.layers.off.join(","))}}if(p.hasOwnProperty("points")&&p.points.coord.length>0){par.push("&nometemapontos="+p.points.title);par.push("&pontos="+p.points.coord.join(","))}if(p.hasOwnProperty("cacheOff")&&p.cacheOff=="sim"){par.push("&DESLIGACACHE=sim")}if(p.hasOwnProperty("lines")){var n=[];jQuery.each(p.lines.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemalinhas="+p.lines.title);par.push("&linhas="+n.join(","))}}if(p.hasOwnProperty("polygons")){var n=[];jQuery.each(p.polygons.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemapoligonos="+p.polygons.title);par.push("&poligonos="+n.join(","))}}if(p.hasOwnProperty("wkt")&&p.wkt.coord!=""){par.push("&nometemawkt="+p.wkt.title);par.push("&wkt="+p.wkt.coord)}if(p.hasOwnProperty("symbol")){if(p.symbol.name!=""){par.push("&simbolo="+p.symbol.name)}if(p.symbol.color!=""){par.push("&corsimbolo="+p.symbol.color)}if(p.symbol.size!=""){par.push("&tamanhosimbolo="+p.symbol.size)}}if(p.kml&&p.kml.url!=""){par.push("&kmlurl="+p.kml.url)}if(p.hasOwnProperty("wms")&&p.wms.url!=""){if(p.wms.url!=""){par.push("&url_wms="+p.wms.url)}if(p.wms.layer!=""){par.push("&layer_wms="+p.wms.layer)}if(p.wms.style!=""){par.push("&style_wms="+p.wms.style)}if(p.wms.title!=""){par.push("&nome_wms="+p.wms.title)}if(p.wms.srs!=""){par.push("&srs_wms="+p.wms.srs)}if(p.wms.imagetype!=""){par.push("&image_wms="+p.wms.imagetype)}if(p.wms.version!=""){par.push("&versao_wms="+p.wms.version)}}if(p.hasOwnProperty("filters")){var n=[];jQuery.each(p.filters,function(index,value){if(value.layer!=""){n.push("&map_layer_"+value.layer+"_filter="+value.expression)}});if(n.length>0){par.push(n.join(""))}}if(p.hasOwnProperty("restoreMapId")&&p.restoreMapId!=""){par.push("&restauramapa="+p.restoreMapId)}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width){par.push("&largura="+parseInt(temp.style.width,10))}if(temp&&temp.style&&temp.style.height){par.push("&altura="+parseInt(temp.style.height,10))}return par.join("")},cria:function(){i3GEO.scrollerWidth=i3GEO.util.getScrollerWidth();$('[data-traduzir="true"]').each(function(){this.innerHTML=Mustache.to_html(this.innerHTML,i3GEO.idioma.OBJETOIDIOMA)});var tamanho,temp;temp=window.location.href.split("?&");if(temp[1]){temp=temp[1].split("&");if(temp[0]&&temp[0]!=""&&temp.length==1){i3GEO.configura.sid=temp[0];if(i3GEO.configura.sid.split("#")[0]){i3GEO.configura.sid=i3GEO.configura.sid.split("#")[0]}}}else{i3GEO.configura.sid=""}if(i3GEO.configura.sid==='undefined'){i3GEO.configura.sid=""}i3GEO.mapa.aplicaPreferencias();if(!i3GEO.configura.locaplic||i3GEO.configura.locaplic===""){i3GEO.util.localizai3GEO()}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.Interface.cria(parseInt(temp.style.width,10),parseInt(temp.style.height,10))}else{tamanho=i3GEO.calculaTamanho();i3GEO.Interface.cria(tamanho[0],tamanho[1])}},inicia:function(retorno){i3GEO.eventos.cliquePerm.ativoinicial=i3GEO.eventos.cliquePerm.ativo;var montaMapa,mashup,tamanho,temp;i3GEO.mapa.aplicaPreferencias();montaMapa=function(retorno){try{delete i3GEO.parametrosMapa2mashuppar;delete i3GEO.configMapa;delete i3GEO.init;var temp,nomecookie="i3geoOLUltimaExtensao",preferencias="";if(retorno.bloqueado){alert(retorno.bloqueado);return}if(retorno===""){alert("Ocorreu um erro no mapa - i3GEO.inicia.montaMapa");retorno={data:{erro:"erro"}}}if(retorno.data.erro){document.body.style.backgroundColor="white";document.body.innerHTML="<br>Para abrir o i3Geo utilize o link:<br><a href="+i3GEO.configura.locaplic+"/ms_criamapa.php >"+i3GEO.configura.locaplic+"/ms_criamapa.php</a>";return("linkquebrado")}else{if(retorno.data.variaveis){i3GEO.parametros=retorno.data.variaveis;i3GEO.parametros.mapscale=i3GEO.parametros.mapscale*1;i3GEO.parametros.mapres=i3GEO.parametros.mapres*1;i3GEO.parametros.pixelsize=i3GEO.parametros.pixelsize*1;i3GEO.parametros.w=i3GEO.parametros.w*1;i3GEO.parametros.h=i3GEO.parametros.h*1;if(retorno.data.customizacoesinit){preferencias=JSON.parse(retorno.data.customizacoesinit);temp=i3GEO.util.base64decode(preferencias.preferenciasbase64);i3GEO.mapa.aplicaPreferencias(temp)}if(i3GEO.configura.guardaExtensao===true){if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}temp=i3GEO.util.pegaCookie(nomecookie);if(temp&&temp!=""){temp=temp.replace(/[\+]/g," ");i3GEO.parametros.mapexten=temp}i3GEO.eventos.NAVEGAMAPA.push(function(){i3GEO.util.insereCookie(nomecookie,i3GEO.parametros.mapexten)})}if(i3GEO.parametros.logado==="nao"){i3GEO.login.anulaCookie()}i3GEO.arvoreDeCamadas.registaCamadas(retorno.data.temas);if(i3GEO.parametros.editor==="sim"){i3GEO.listaDeFerramentas=i3GEO.login.adicionaMenuSuspenso(i3GEO.listaDeFerramentas)}i3GEO.Interface.inicia();if(retorno.data.customizacoesinit){if(preferencias.geometriasbase64&&preferencias.geometriasbase64!=""){temp=i3GEO.util.base64decode(preferencias.geometriasbase64);i3GEO.mapa.desCompactaLayerGrafico(temp)}if(preferencias.graficosbase64&&preferencias.graficosbase64!=""){i3GEO.mapa.restauraGraficos(preferencias.graficosbase64)}if(preferencias.tabelasbase64&&preferencias.tabelasbase64!=""){i3GEO.mapa.restauraTabelas(preferencias.tabelasbase64)}}}else{alert("Erro. Impossivel criar o mapa "+retorno.data);return}}i3GEO.aposIniciar()}catch(e){}};if(!$i("i3geo")){document.body.id="i3geo"}temp=$i("i3geo");temp.className="yui-skin-sam";if(document.body.id==="i3geo"&&temp.style&&!temp.style.overflow&&i3GEO.Interface.ATUAL==="openlayers"){temp.style.overflow="hidden"}if(i3GEO.configura.sid===""){mashup=function(retorno){if(retorno.bloqueado){alert(retorno.bloqueado);return}i3GEO.configura.sid=retorno.data;i3GEO.inicia(retorno)};i3GEO.configura.mashuppar+="&interface="+i3GEO.Interface.ATUAL;if(i3GEO.mapa.TEMASINICIAIS.length>0){i3GEO.configura.mashuppar+="&temasa="+i3GEO.mapa.TEMASINICIAIS}if(i3GEO.mapa.TEMASINICIAISLIGADOS.length>0){i3GEO.configura.mashuppar+="&layers="+i3GEO.mapa.TEMASINICIAISLIGADOS}i3GEO.php.criamapa(mashup,i3GEO.configura.mashuppar)}else{if(i3GEO.parametros.w===""||i3GEO.parametros.h===""){tamanho=i3GEO.calculaTamanho();i3GEO.parametros.w=tamanho[0];i3GEO.parametros.h=tamanho[1]}i3GEO.php.inicia(montaMapa,i3GEO.parametros.w,i3GEO.parametros.h)}},aposIniciar:function(){if(jQuery.isFunction(i3GEO.finaliza)){i3GEO.finaliza.call()}else{if(i3GEO.finaliza!=""){eval(i3GEO.finaliza)}}i3GEO.guias.inicia();i3GEO.mapa.ativaAutoResize()},atualiza:function(retorno){var corpoMapa,erro,mapscale,temp;if(i3GEO.contadorAtualiza>1){i3GEO.contadorAtualiza--;return}if(i3GEO.contadorAtualiza>0){i3GEO.contadorAtualiza--}i3GEO.contadorAtualiza++;corpoMapa=function(){if($i("ajaxCorpoMapa")){return}i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem)};if(arguments.length===0){i3GEO.janela.fechaAguarde("ajaxCorpoMapa");corpoMapa.call();return}if(!retorno.data){alert("Ocorreu um erro ao carregar o mapa"+retorno);i3GEO.mapa.recupera.inicia();return}try{if(retorno.data==="erro"){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia();return}else if(retorno.data==="ok"||retorno.data===""){corpoMapa.call();return}}catch(e){}erro=function(){var c=confirm("Ocorreu um erro, quer tentar novamente?");if(c){corpoMapa.call()}else{i3GEO.janela.fechaAguarde()}return};if(arguments.length===0||retorno===""||retorno.data.variaveis===undefined){erro.call();return}else{if(arguments.length===0){return}i3GEO.mapa.verifica(retorno);mapscale=i3GEO.parametros.mapscale;i3GEO.atualizaParametros(retorno.data.variaveis);if(retorno.data.variaveis.erro!==""){alert(retorno.data.variaveis.erro)}temp=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);try{i3GEO.arvoreDeCamadas.atualiza(temp);if(i3GEO.parametros.mapscale!==mapscale){i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale)}}catch(e){}i3GEO.arvoreDeCamadas.registaCamadas(temp);i3GEO.Interface.redesenha();if($i("mensagemt")){$i("mensagemt").value=i3GEO.parametros.mapexten}i3GEO.eventos.navegaMapa();temp=i3GEO.arvoreDeCamadas.verificaAplicaExtensao();if(temp!==""){i3GEO.tema.zoom(temp)}}},calculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=(antigoh-novoh);document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;i3GEO.parametros.w=w;i3GEO.parametros.h=h;return[w,h]},reCalculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);i3GEO.eventos.resizeMapa();return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=antigoh-novoh;document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;temp=$i(i3GEO.Interface.IDMAPA);if(temp){temp.style.height=h+"px";temp.style.width=w+"px"}i3GEO.parametros.w=w;i3GEO.parametros.h=h;temp=function(){switch(i3GEO.Interface.ATUAL){case"googlemaps":i3GEO.Interface.googlemaps.zoom2extent(i3GEO.parametros.mapexten);break;case"openlayers":i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);i3geoOL.updateSize();if(i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px";if(i3GEO.Interface.BARRADEZOOMLEFT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}}break};i3GEO.guias.ALTURACORPOGUIAS=h;i3GEO.eventos.resizeMapa();return[w,h]};i3GEO.php.mudatamanho(temp,h,w)},atualizaParametros:function(variaveis){i3GEO.parametros.mapscale=variaveis.mapscale*1;i3GEO.parametros.mapres=variaveis.mapres*1;i3GEO.parametros.pixelsize=variaveis.pixelsize*1;i3GEO.parametros.mapexten=variaveis.mapexten;i3GEO.parametros.mapimagem=variaveis.mapimagem;i3GEO.parametros.w=variaveis.w*1;i3GEO.parametros.h=variaveis.h*1;i3GEO.parametros.mappath=variaveis.mappath;i3GEO.parametros.mapurl=variaveis.mapurl;if(i3GEO.login.verificaCookieLogin()){i3GEO.parametros.editor="sim"}else{i3GEO.parametros.editor="nao"}}};
2 1 \ No newline at end of file
  2 +var i3GEOF=[];var i3GEOadmin=[];if(typeof YAHOO!="undefined"){YAHOO.namespace("i3GEO")}var i3GEO={tamanhodoc:[],parametros:{mapexten:"",mapscale:"",mapres:"",pixelsize:"",mapfile:"",cgi:"",extentTotal:"",mapimagem:"",geoip:"",utilizacgi:"",versaoms:"",versaomscompleta:"",mensagens:"",w:"",h:"",locsistemas:"",locidentifica:"",r:"",locmapas:"",celularef:"",kmlurl:"",mensageminicia:"",interfacePadrao:"openlayers.htm",autenticadoopenid:"nao",cordefundo:"",copyright:"",editor:"nao"},scrollerWidth:"",finaliza:"",finalizaAPI:"",temaAtivo:"",contadorAtualiza:0,init:function(parametrosMapa,configMapa){if($.material){$.material.init()}if(configMapa&&configMapa!=""){i3GEO.configMapa(configMapa)}if(parametrosMapa&&parametrosMapa!=""){i3GEO.configura.mashuppar=i3GEO.parametrosMapa2mashuppar(parametrosMapa)}else{i3GEO.configura.mashuppar=""}i3GEO.cria();i3GEO.inicia()},configMapa:function(c){i3GEO.configura.guardaExtensao=(c.hasOwnProperty("saveExtension")&&c.saveExtension==true)?true:false;i3GEO.configura.tipoimagem=(c.hasOwnProperty("posRenderType")&&c.posRenderType!="")?c.posRenderType:"nenhum";i3GEO.configura.locaplic=(c.hasOwnProperty("i3GeoServer")&&c.i3GeoServer!="")?c.i3GeoServer:i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";if(c.hasOwnProperty("tools")){i3GEO.configura.ferramentas=c.tools}if(c.hasOwnProperty("layerOpacity")&&c.hasOwnProperty("layerOpacity")!=""){i3GEO.Interface.LAYEROPACITY=c.layerOpacity}i3GEO.Interface.IDCORPO=(c.hasOwnProperty("mapBody")&&c.mapBody!="")?c.mapBody:"mapai3Geo";i3GEO.finalizaAPI=(c.hasOwnProperty("afterStart")&&c.afterStart!="")?c.afterStart:"";if(c.hasOwnProperty("components")){i3GEO.arvoreDeTemas.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.catalogoMenus.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.busca.SERVICO=(c.components.hasOwnProperty("searchService"))?c.components.searchService:"";i3GEO.busca.SERVICOWMS=(c.components.hasOwnProperty("searchWms"))?c.components.searchWms:"";i3GEO.mapa.BALAOATIVO=(c.components.hasOwnProperty("info"))?c.components.info:true;if(c.components.referenceMapPosition){i3GEO.maparef.TOP=c.components.referenceMapPosition[0];i3GEO.maparef.RIGHT=c.components.referenceMapPosition[1]}if(c.components.scrollBar){i3GEO.janela.scrollBar=c.components.scrollBar}if(c.components.tooltip){var p=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP;p.removeAoAdicionar=(c.components.tooltip.hasOwnProperty("removeAoAdicionar"))?c.components.tooltip.removeAoAdicionar:true;p.autoPan=(c.components.tooltip.hasOwnProperty("autoPan"))?c.components.tooltip.autoPan:true;p.modal=(c.components.tooltip.hasOwnProperty("modal"))?c.components.tooltip.modal:false;p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:"";p.templateModal=(c.components.tooltip.hasOwnProperty("templateModal"))?c.components.tooltip.templateModal:"";p.simple=(c.components.tooltip.hasOwnProperty("simple"))?c.components.tooltip.simple:true;p.minWidth=(c.components.tooltip.hasOwnProperty("minWidth"))?c.components.tooltip.minWidth:'';p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:'200px';p.autoPanAnimation=(c.components.tooltip.hasOwnProperty("autoPanAnimation"))?c.components.tooltip.autoPanAnimation:p.autoPanAnimation;if(c.components.tooltip.hasOwnProperty("toolTipSize")){i3GEO.configura.alturatip=c.components.tooltip.toolTipSize[0];i3GEO.configura.larguratip=c.components.tooltip.toolTipSize[1]}}}if(c.hasOwnProperty("openLayers")&&c.mapType!=="GM"){var d=c.openLayers;i3GEO.Interface.ATUAL="openlayers";i3GEO.Interface.openlayers.googleLike=(c.mapType=="OSM")?true:false;i3GEO.Interface.openlayers.TILES=(d.hasOwnProperty("singleTile")&&d.singleTile!="")?!d.singleTile:true;i3GEO.Interface.openlayers.parametrosMap=d.MapOptions;i3GEO.Interface.openlayers.parametrosView=d.ViewOptions;if(d.hasOwnProperty("editorButtons")&&d.editorButtons!=""){i3GEO.editor.botoes=d.editorButtons}}if(c.hasOwnProperty("googleMaps")&&c.mapType=="GM"){i3GEO.Interface.ATUAL="googlemaps";i3GEO.Interface.googlemaps.ESTILOPADRAO=c.googleMaps.MapOptions.mapTypeId;i3GEO.Interface.googlemaps.MAPOPTIONS=c.googleMaps.MapOptions}},parametrosMapa2mashuppar:function(p){var par=[],temp;if(p.hasOwnProperty("mapfilebase")&&p.mapfilebase!=""){par.push("&base="+p.mapfilebase)}if(p.hasOwnProperty("mapext")&&p.mapext!=""&&p.mapext.length==4){par.push("&mapext="+p.mapext.join(","));i3GEO.configura.guardaExtensao=false}if(p.hasOwnProperty("perfil")&&p.perfil!=""){par.push("&perfil="+p.perfil)}if(p.hasOwnProperty("layers")){if(p.layers.add&&p.layers.add.length>0){par.push("&temasa="+p.layers.add.join(","))}if(p.layers.on&&p.layers.on.length>0){par.push("&layers="+p.layers.on.join(","))}if(p.layers.off&&p.layers.off.length>0){par.push("&desligar="+p.layers.off.join(","))}if(p.layers.metaestat&&p.layers.metaestat.length>0){par.push("&metaestatids="+p.layers.metaestat.join(","))}}if(p.hasOwnProperty("points")&&p.points.coord.length>0){par.push("&nometemapontos="+p.points.title);par.push("&pontos="+p.points.coord.join(","))}if(p.hasOwnProperty("cacheOff")&&p.cacheOff=="sim"){par.push("&DESLIGACACHE=sim")}if(p.hasOwnProperty("lines")){var n=[];jQuery.each(p.lines.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemalinhas="+p.lines.title);par.push("&linhas="+n.join(","))}}if(p.hasOwnProperty("polygons")){var n=[];jQuery.each(p.polygons.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemapoligonos="+p.polygons.title);par.push("&poligonos="+n.join(","))}}if(p.hasOwnProperty("wkt")&&p.wkt.coord!=""){par.push("&nometemawkt="+p.wkt.title);par.push("&wkt="+p.wkt.coord)}if(p.hasOwnProperty("symbol")){if(p.symbol.name!=""){par.push("&simbolo="+p.symbol.name)}if(p.symbol.color!=""){par.push("&corsimbolo="+p.symbol.color)}if(p.symbol.size!=""){par.push("&tamanhosimbolo="+p.symbol.size)}}if(p.kml&&p.kml.url!=""){par.push("&kmlurl="+p.kml.url)}if(p.hasOwnProperty("wms")&&p.wms.url!=""){if(p.wms.url!=""){par.push("&url_wms="+p.wms.url)}if(p.wms.layer!=""){par.push("&layer_wms="+p.wms.layer)}if(p.wms.style!=""){par.push("&style_wms="+p.wms.style)}if(p.wms.title!=""){par.push("&nome_wms="+p.wms.title)}if(p.wms.srs!=""){par.push("&srs_wms="+p.wms.srs)}if(p.wms.imagetype!=""){par.push("&image_wms="+p.wms.imagetype)}if(p.wms.version!=""){par.push("&versao_wms="+p.wms.version)}}if(p.hasOwnProperty("filters")){var n=[];jQuery.each(p.filters,function(index,value){if(value.layer!=""){n.push("&map_layer_"+value.layer+"_filter="+value.expression)}});if(n.length>0){par.push(n.join(""))}}if(p.hasOwnProperty("restoreMapId")&&p.restoreMapId!=""){par.push("&restauramapa="+p.restoreMapId)}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width){par.push("&largura="+parseInt(temp.style.width,10))}if(temp&&temp.style&&temp.style.height){par.push("&altura="+parseInt(temp.style.height,10))}return par.join("")},cria:function(){i3GEO.scrollerWidth=i3GEO.util.getScrollerWidth();$('[data-traduzir="true"]').each(function(){this.innerHTML=Mustache.to_html(this.innerHTML,i3GEO.idioma.OBJETOIDIOMA)});var tamanho,temp;temp=window.location.href.split("?&");if(temp[1]){temp=temp[1].split("&");if(temp[0]&&temp[0]!=""&&temp.length==1){i3GEO.configura.sid=temp[0];if(i3GEO.configura.sid.split("#")[0]){i3GEO.configura.sid=i3GEO.configura.sid.split("#")[0]}}}else{i3GEO.configura.sid=""}if(i3GEO.configura.sid==='undefined'){i3GEO.configura.sid=""}i3GEO.mapa.aplicaPreferencias();if(!i3GEO.configura.locaplic||i3GEO.configura.locaplic===""){i3GEO.util.localizai3GEO()}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.Interface.cria(parseInt(temp.style.width,10),parseInt(temp.style.height,10))}else{tamanho=i3GEO.calculaTamanho();i3GEO.Interface.cria(tamanho[0],tamanho[1])}},inicia:function(retorno){i3GEO.eventos.cliquePerm.ativoinicial=i3GEO.eventos.cliquePerm.ativo;var montaMapa,mashup,tamanho,temp;i3GEO.mapa.aplicaPreferencias();montaMapa=function(retorno){try{delete i3GEO.parametrosMapa2mashuppar;delete i3GEO.configMapa;delete i3GEO.init;var temp,nomecookie="i3geoOLUltimaExtensao",preferencias="";if(retorno.bloqueado){alert(retorno.bloqueado);return}if(retorno===""){alert("Ocorreu um erro no mapa - i3GEO.inicia.montaMapa");retorno={data:{erro:"erro"}}}if(retorno.data.erro){document.body.style.backgroundColor="white";document.body.innerHTML="<br>Para abrir o i3Geo utilize o link:<br><a href="+i3GEO.configura.locaplic+"/ms_criamapa.php >"+i3GEO.configura.locaplic+"/ms_criamapa.php</a>";return("linkquebrado")}else{if(retorno.data.variaveis){i3GEO.parametros=retorno.data.variaveis;i3GEO.parametros.mapscale=i3GEO.parametros.mapscale*1;i3GEO.parametros.mapres=i3GEO.parametros.mapres*1;i3GEO.parametros.pixelsize=i3GEO.parametros.pixelsize*1;i3GEO.parametros.w=i3GEO.parametros.w*1;i3GEO.parametros.h=i3GEO.parametros.h*1;if(retorno.data.customizacoesinit){preferencias=JSON.parse(retorno.data.customizacoesinit);temp=i3GEO.util.base64decode(preferencias.preferenciasbase64);i3GEO.mapa.aplicaPreferencias(temp)}if(i3GEO.configura.guardaExtensao===true){if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}temp=i3GEO.util.pegaCookie(nomecookie);if(temp&&temp!=""){temp=temp.replace(/[\+]/g," ");i3GEO.parametros.mapexten=temp}i3GEO.eventos.NAVEGAMAPA.push(function(){i3GEO.util.insereCookie(nomecookie,i3GEO.parametros.mapexten)})}if(i3GEO.parametros.logado==="nao"){i3GEO.login.anulaCookie()}i3GEO.arvoreDeCamadas.registaCamadas(retorno.data.temas);if(i3GEO.parametros.editor==="sim"){i3GEO.listaDeFerramentas=i3GEO.login.adicionaMenuSuspenso(i3GEO.listaDeFerramentas)}i3GEO.Interface.inicia();if(retorno.data.customizacoesinit){if(preferencias.geometriasbase64&&preferencias.geometriasbase64!=""){temp=i3GEO.util.base64decode(preferencias.geometriasbase64);i3GEO.mapa.desCompactaLayerGrafico(temp)}if(preferencias.graficosbase64&&preferencias.graficosbase64!=""){i3GEO.mapa.restauraGraficos(preferencias.graficosbase64)}if(preferencias.tabelasbase64&&preferencias.tabelasbase64!=""){i3GEO.mapa.restauraTabelas(preferencias.tabelasbase64)}}}else{alert("Erro. Impossivel criar o mapa "+retorno.data);return}}i3GEO.aposIniciar()}catch(e){}};if(!$i("i3geo")){document.body.id="i3geo"}temp=$i("i3geo");temp.className="yui-skin-sam";if(document.body.id==="i3geo"&&temp.style&&!temp.style.overflow&&i3GEO.Interface.ATUAL==="openlayers"){temp.style.overflow="hidden"}if(i3GEO.configura.sid===""){mashup=function(retorno){if(retorno.bloqueado){alert(retorno.bloqueado);return}i3GEO.configura.sid=retorno.data;i3GEO.inicia(retorno)};i3GEO.configura.mashuppar+="&interface="+i3GEO.Interface.ATUAL;if(i3GEO.mapa.TEMASINICIAIS.length>0){i3GEO.configura.mashuppar+="&temasa="+i3GEO.mapa.TEMASINICIAIS}if(i3GEO.mapa.TEMASINICIAISLIGADOS.length>0){i3GEO.configura.mashuppar+="&layers="+i3GEO.mapa.TEMASINICIAISLIGADOS}i3GEO.php.criamapa(mashup,i3GEO.configura.mashuppar)}else{if(i3GEO.parametros.w===""||i3GEO.parametros.h===""){tamanho=i3GEO.calculaTamanho();i3GEO.parametros.w=tamanho[0];i3GEO.parametros.h=tamanho[1]}i3GEO.php.inicia(montaMapa,i3GEO.parametros.w,i3GEO.parametros.h)}},aposIniciar:function(){if(jQuery.isFunction(i3GEO.finaliza)){i3GEO.finaliza.call()}else{if(i3GEO.finaliza!=""){eval(i3GEO.finaliza)}}i3GEO.guias.inicia();i3GEO.mapa.ativaAutoResize()},atualiza:function(retorno){var corpoMapa,erro,mapscale,temp;if(i3GEO.contadorAtualiza>1){i3GEO.contadorAtualiza--;return}if(i3GEO.contadorAtualiza>0){i3GEO.contadorAtualiza--}i3GEO.contadorAtualiza++;corpoMapa=function(){if($i("ajaxCorpoMapa")){return}i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem)};if(arguments.length===0){i3GEO.janela.fechaAguarde("ajaxCorpoMapa");corpoMapa.call();return}if(!retorno.data){alert("Ocorreu um erro ao carregar o mapa"+retorno);i3GEO.mapa.recupera.inicia();return}try{if(retorno.data==="erro"){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia();return}else if(retorno.data==="ok"||retorno.data===""){corpoMapa.call();return}}catch(e){}erro=function(){var c=confirm("Ocorreu um erro, quer tentar novamente?");if(c){corpoMapa.call()}else{i3GEO.janela.fechaAguarde()}return};if(arguments.length===0||retorno===""||retorno.data.variaveis===undefined){erro.call();return}else{if(arguments.length===0){return}i3GEO.mapa.verifica(retorno);mapscale=i3GEO.parametros.mapscale;i3GEO.atualizaParametros(retorno.data.variaveis);if(retorno.data.variaveis.erro!==""){alert(retorno.data.variaveis.erro)}temp=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);try{i3GEO.arvoreDeCamadas.atualiza(temp);if(i3GEO.parametros.mapscale!==mapscale){i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale)}}catch(e){}i3GEO.arvoreDeCamadas.registaCamadas(temp);i3GEO.Interface.redesenha();if($i("mensagemt")){$i("mensagemt").value=i3GEO.parametros.mapexten}i3GEO.eventos.navegaMapa();temp=i3GEO.arvoreDeCamadas.verificaAplicaExtensao();if(temp!==""){i3GEO.tema.zoom(temp)}}},calculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=(antigoh-novoh);document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;i3GEO.parametros.w=w;i3GEO.parametros.h=h;return[w,h]},reCalculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);i3GEO.eventos.resizeMapa();return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=antigoh-novoh;document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;temp=$i(i3GEO.Interface.IDMAPA);if(temp){temp.style.height=h+"px";temp.style.width=w+"px"}i3GEO.parametros.w=w;i3GEO.parametros.h=h;temp=function(){switch(i3GEO.Interface.ATUAL){case"googlemaps":i3GEO.Interface.googlemaps.zoom2extent(i3GEO.parametros.mapexten);break;case"openlayers":i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);i3geoOL.updateSize();if(i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px";if(i3GEO.Interface.BARRADEZOOMLEFT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}}break};i3GEO.guias.ALTURACORPOGUIAS=h;i3GEO.eventos.resizeMapa();return[w,h]};i3GEO.php.mudatamanho(temp,h,w)},atualizaParametros:function(variaveis){i3GEO.parametros.mapscale=variaveis.mapscale*1;i3GEO.parametros.mapres=variaveis.mapres*1;i3GEO.parametros.pixelsize=variaveis.pixelsize*1;i3GEO.parametros.mapexten=variaveis.mapexten;i3GEO.parametros.mapimagem=variaveis.mapimagem;i3GEO.parametros.w=variaveis.w*1;i3GEO.parametros.h=variaveis.h*1;i3GEO.parametros.mappath=variaveis.mappath;i3GEO.parametros.mapurl=variaveis.mapurl;if(i3GEO.login.verificaCookieLogin()){i3GEO.parametros.editor="sim"}else{i3GEO.parametros.editor="nao"}}};
3 3 \ No newline at end of file
... ...
js/i3geo_tudo_compacto7.js
... ... @@ -206,7 +206,7 @@ d.parent(&quot;.dropdown-menu&quot;).length&amp;&amp;(d=d.closest(&quot;li.dropdown&quot;).addClass(&quot;active&quot;
206 206 (function(global){var beginsWith,endsWith,root,Wkt;root=this;Wkt=function(obj){if(obj instanceof Wkt)return obj;if(!(this instanceof Wkt))return new Wkt(obj);this._wrapped=obj};if(typeof exports!=='undefined'){if(typeof module!=='undefined'&&module.exports){exports=module.exports=Wkt}exports.Wkt=Wkt}else{root.Wkt=Wkt}beginsWith=function(str,sub){return str.substring(0,sub.length)===sub};endsWith=function(str,sub){return str.substring(str.length-sub.length)===sub};Wkt.delimiter=' ';Wkt.isArray=function(obj){return!!(obj&&obj.constructor===Array)};Wkt.trim=function(str,sub){sub=sub||' ';while(beginsWith(str,sub)){str=str.substring(1)}while(endsWith(str,sub)){str=str.substring(0,str.length-1)}return str};Wkt.Wkt=function(initializer){this.delimiter=Wkt.delimiter||' ';this.wrapVertices=true;this.regExes={'typeStr':/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,'spaces':/\s+|\+/, 'numeric':/-*\d+(\.*\d+)?/,'comma':/\s*,\s*/,'parenComma':/\)\s*,\s*\(/,'coord':/-*\d+\.*\d+ -*\d+\.*\d+/, 'doubleParenComma':/\)\s*\)\s*,\s*\(\s*\(/,'trimParens':/^\s*\(?(.*?)\)?\s*$/,'ogcTypes':/^(multi)?(point|line|polygon|box)?(string)?$/i,'crudeJson':/^{.*"(type|coordinates|geometries|features)":.*}$/};this.components=undefined;if(initializer&&typeof initializer==='string'){this.read(initializer)}else if(initializer&&typeof initializer!==undefined){this.fromObject(initializer)}};global.Wkt=Wkt;Wkt.Wkt.prototype.isCollection=function(){switch(this.type.slice(0,5)){case'multi':return true;case'polyg':return true;default:return false}};Wkt.Wkt.prototype.sameCoords=function(a,b){return(a.x===b.x&&a.y===b.y)};Wkt.Wkt.prototype.fromObject=function(obj){var result;if(obj.hasOwnProperty('type')&&obj.hasOwnProperty('coordinates')){result=this.fromJson(obj)}else{result=this.deconstruct.call(this,obj)}this.components=result.components;this.isRectangle=result.isRectangle||false;this.type=result.type;return this};Wkt.Wkt.prototype.toObject=function(config){var obj=this.construct[this.type].call(this,config);if(typeof obj==='object'&&!Wkt.isArray(obj)){obj.properties=this.properties}return obj};Wkt.Wkt.prototype.toString=function(config){return this.write()};Wkt.Wkt.prototype.fromJson=function(obj){var i,j,k,coords,iring,oring;this.type=obj.type.toLowerCase();this.components=[];if(obj.hasOwnProperty('geometry')){this.fromJson(obj.geometry);this.properties=obj.properties;return this}coords=obj.coordinates;if(!Wkt.isArray(coords[0])){this.components.push({x:coords[0],y:coords[1]})}else{for(i in coords){if(coords.hasOwnProperty(i)){if(!Wkt.isArray(coords[i][0])){if(this.type==='multipoint'){this.components.push([{x:coords[i][0],y:coords[i][1]}])}else{this.components.push({x:coords[i][0],y:coords[i][1]})}}else{oring=[];for(j in coords[i]){if(coords[i].hasOwnProperty(j)){if(!Wkt.isArray(coords[i][j][0])){oring.push({x:coords[i][j][0],y:coords[i][j][1]})}else{iring=[];for(k in coords[i][j]){if(coords[i][j].hasOwnProperty(k)){iring.push({x:coords[i][j][k][0],y:coords[i][j][k][1]})}}oring.push(iring)}}}this.components.push(oring)}}}}return this};Wkt.Wkt.prototype.toJson=function(){var cs,json,i,j,k,ring,rings;cs=this.components;json={coordinates:[],type:(function(){var i,type,s;type=this.regExes.ogcTypes.exec(this.type).slice(1);s=[];for(i in type){if(type.hasOwnProperty(i)){if(type[i]!==undefined){s.push(type[i].toLowerCase().slice(0,1).toUpperCase()+type[i].toLowerCase().slice(1))}}}return s}.call(this)).join('')};if(this.type.toLowerCase()==='box'){json.type='Polygon';json.bbox=[];for(i in cs){if(cs.hasOwnProperty(i)){json.bbox=json.bbox.concat([cs[i].x,cs[i].y])}}json.coordinates=[[[cs[0].x,cs[0].y],[cs[0].x,cs[1].y],[cs[1].x,cs[1].y],[cs[1].x,cs[0].y],[cs[0].x,cs[0].y]]];return json}for(i in cs){if(cs.hasOwnProperty(i)){if(Wkt.isArray(cs[i])){rings=[];for(j in cs[i]){if(cs[i].hasOwnProperty(j)){if(Wkt.isArray(cs[i][j])){ring=[];for(k in cs[i][j]){if(cs[i][j].hasOwnProperty(k)){ring.push([cs[i][j][k].x,cs[i][j][k].y])}}rings.push(ring)}else{if(cs[i].length>1){rings.push([cs[i][j].x,cs[i][j].y])}else{rings=rings.concat([cs[i][j].x,cs[i][j].y])}}}}json.coordinates.push(rings)}else{if(cs.length>1){json.coordinates.push([cs[i].x,cs[i].y])}else{json.coordinates=json.coordinates.concat([cs[i].x,cs[i].y])}}}}return json};Wkt.Wkt.prototype.merge=function(wkt){var prefix=this.type.slice(0,5);if(this.type!==wkt.type){if(this.type.slice(5,this.type.length)!==wkt.type){throw TypeError('The input geometry types must agree or the calling this.Wkt.Wkt instance must be a multigeometry of the other')}}switch(prefix){case'point':this.components=[this.components.concat(wkt.components)];break;case'multi':this.components=this.components.concat((wkt.type.slice(0,5)==='multi')?wkt.components:[wkt.components]);break;default:this.components=[this.components,wkt.components];break}if(prefix!=='multi'){this.type='multi'+this.type}return this};Wkt.Wkt.prototype.read=function(str){var matches;matches=this.regExes.typeStr.exec(str);if(matches){this.type=matches[1].toLowerCase();this.base=matches[2];if(this.ingest[this.type]){this.components=this.ingest[this.type].apply(this,[this.base])}}else{if(this.regExes.crudeJson.test(str)){if(typeof JSON==='object'&&typeof JSON.parse==='function'){this.fromJson(JSON.parse(str))}else{console.log('JSON.parse() is not available; cannot parse GeoJSON strings');throw{name:'JSONError',message:'JSON.parse() is not available; cannot parse GeoJSON strings'}}}else{console.log('Invalid WKT string provided to read()');throw{name:'WKTError',message:'Invalid WKT string provided to read()'}}}return this};Wkt.Wkt.prototype.write=function(components){var i,pieces,data;components=components||this.components;pieces=[];pieces.push(this.type.toUpperCase()+'(');for(i=0;i<components.length;i+=1){if(this.isCollection()&&i>0){pieces.push(',')}if(!this.extract[this.type]){return null}data=this.extract[this.type].apply(this,[components[i]]);if(this.isCollection()&&this.type!=='multipoint'){pieces.push('('+data+')')}else{pieces.push(data);if(i!==(components.length-1)&&this.type!=='multipoint'){pieces.push(',')}}}pieces.push(')');return pieces.join('')};Wkt.Wkt.prototype.extract={point:function(point){return String(point.x)+this.delimiter+String(point.y)},multipoint:function(multipoint){var i,parts=[],s;for(i=0;i<multipoint.length;i+=1){s=this.extract.point.apply(this,[multipoint[i]]);if(this.wrapVertices){s='('+s+')'}parts.push(s)}return parts.join(',')},linestring:function(linestring){return this.extract.point.apply(this,[linestring])},multilinestring:function(multilinestring){var i,parts=[];for(i=0;i<multilinestring.length;i+=1){parts.push(this.extract.linestring.apply(this,[multilinestring[i]]))}return parts.join(',')},polygon:function(polygon){return this.extract.multilinestring.apply(this,[polygon])},multipolygon:function(multipolygon){var i,parts=[];for(i=0;i<multipolygon.length;i+=1){parts.push('('+this.extract.polygon.apply(this,[multipolygon[i]])+')')}return parts.join(',')},box:function(box){return this.extract.linestring.apply(this,[box])},geometrycollection:function(str){console.log('The geometrycollection WKT type is not yet supported.')}};Wkt.Wkt.prototype.ingest={point:function(str){var coords=Wkt.trim(str).split(this.regExes.spaces);return[{x:parseFloat(this.regExes.numeric.exec(coords[0])[0]),y:parseFloat(this.regExes.numeric.exec(coords[1])[0])}]},multipoint:function(str){var i,components,points;components=[];points=Wkt.trim(str).split(this.regExes.comma);for(i=0;i<points.length;i+=1){components.push(this.ingest.point.apply(this,[points[i]]))}return components},linestring:function(str){var i,multipoints,components;multipoints=this.ingest.multipoint.apply(this,[str]);components=[];for(i=0;i<multipoints.length;i+=1){components=components.concat(multipoints[i])}return components},multilinestring:function(str){var i,components,line,lines;components=[];lines=Wkt.trim(str).split(this.regExes.doubleParenComma);if(lines.length===1){lines=Wkt.trim(str).split(this.regExes.parenComma)}for(i=0;i<lines.length;i+=1){line=lines[i].replace(this.regExes.trimParens,'$1');components.push(this.ingest.linestring.apply(this,[line]))}return components},polygon:function(str){var i,j,components,subcomponents,ring,rings;rings=Wkt.trim(str).split(this.regExes.parenComma);components=[];for(i=0;i<rings.length;i+=1){ring=rings[i].replace(this.regExes.trimParens,'$1').split(this.regExes.comma);subcomponents=[];for(j=0;j<ring.length;j+=1){var split=ring[j].split(this.regExes.spaces);if(split.length>2){split=split.filter(function(n){return n!=""})}if(split.length===2){var x_cord=split[0];var y_cord=split[1];subcomponents.push({x:parseFloat(x_cord),y:parseFloat(y_cord)})}}components.push(subcomponents)}return components},box:function(str){var i,multipoints,components;multipoints=this.ingest.multipoint.apply(this,[str]);components=[];for(i=0;i<multipoints.length;i+=1){components=components.concat(multipoints[i])}return components},multipolygon:function(str){var i,components,polygon,polygons;components=[];polygons=Wkt.trim(str).split(this.regExes.doubleParenComma);for(i=0;i<polygons.length;i+=1){polygon=polygons[i].replace(this.regExes.trimParens,'$1');components.push(this.ingest.polygon.apply(this,[polygon]))}return components},geometrycollection:function(str){console.log('The geometrycollection WKT type is not yet supported.')}};return this}(this));
207 207 //
208 208 //compactados/ini_i3geo_compacto.js
209   -var i3GEOF=[];var i3GEOadmin=[];if(typeof YAHOO!="undefined"){YAHOO.namespace("i3GEO")}var i3GEO={tamanhodoc:[],parametros:{mapexten:"",mapscale:"",mapres:"",pixelsize:"",mapfile:"",cgi:"",extentTotal:"",mapimagem:"",geoip:"",utilizacgi:"",versaoms:"",versaomscompleta:"",mensagens:"",w:"",h:"",locsistemas:"",locidentifica:"",r:"",locmapas:"",celularef:"",kmlurl:"",mensageminicia:"",interfacePadrao:"openlayers.htm",autenticadoopenid:"nao",cordefundo:"",copyright:"",editor:"nao"},scrollerWidth:"",finaliza:"",finalizaAPI:"",temaAtivo:"",contadorAtualiza:0,init:function(parametrosMapa,configMapa){if($.material){$.material.init()}if(configMapa&&configMapa!=""){i3GEO.configMapa(configMapa)}if(parametrosMapa&&parametrosMapa!=""){i3GEO.configura.mashuppar=i3GEO.parametrosMapa2mashuppar(parametrosMapa)}else{i3GEO.configura.mashuppar=""}i3GEO.cria();i3GEO.inicia()},configMapa:function(c){i3GEO.configura.guardaExtensao=(c.hasOwnProperty("saveExtension")&&c.saveExtension==true)?true:false;i3GEO.configura.tipoimagem=(c.hasOwnProperty("posRenderType")&&c.posRenderType!="")?c.posRenderType:"nenhum";i3GEO.configura.locaplic=(c.hasOwnProperty("i3GeoServer")&&c.i3GeoServer!="")?c.i3GeoServer:i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";if(c.hasOwnProperty("tools")){i3GEO.configura.ferramentas=c.tools}if(c.hasOwnProperty("layerOpacity")&&c.hasOwnProperty("layerOpacity")!=""){i3GEO.Interface.LAYEROPACITY=c.layerOpacity}i3GEO.Interface.IDCORPO=(c.hasOwnProperty("mapBody")&&c.mapBody!="")?c.mapBody:"mapai3Geo";i3GEO.finalizaAPI=(c.hasOwnProperty("afterStart")&&c.afterStart!="")?c.afterStart:"";if(c.hasOwnProperty("components")){i3GEO.arvoreDeTemas.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.catalogoMenus.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.busca.SERVICO=(c.components.hasOwnProperty("searchService"))?c.components.searchService:"";i3GEO.busca.SERVICOWMS=(c.components.hasOwnProperty("searchWms"))?c.components.searchWms:"";i3GEO.mapa.BALAOATIVO=(c.components.hasOwnProperty("info"))?c.components.info:true;if(c.components.referenceMapPosition){i3GEO.maparef.TOP=c.components.referenceMapPosition[0];i3GEO.maparef.RIGHT=c.components.referenceMapPosition[1]}if(c.components.scrollBar){i3GEO.janela.scrollBar=c.components.scrollBar}if(c.components.tooltip){var p=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP;p.removeAoAdicionar=(c.components.tooltip.hasOwnProperty("removeAoAdicionar"))?c.components.tooltip.removeAoAdicionar:true;p.autoPan=(c.components.tooltip.hasOwnProperty("autoPan"))?c.components.tooltip.autoPan:true;p.modal=(c.components.tooltip.hasOwnProperty("modal"))?c.components.tooltip.modal:false;p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:"";p.templateModal=(c.components.tooltip.hasOwnProperty("templateModal"))?c.components.tooltip.templateModal:"";p.simple=(c.components.tooltip.hasOwnProperty("simple"))?c.components.tooltip.simple:true;p.minWidth=(c.components.tooltip.hasOwnProperty("minWidth"))?c.components.tooltip.minWidth:'';p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:'200px';p.autoPanAnimation=(c.components.tooltip.hasOwnProperty("autoPanAnimation"))?c.components.tooltip.autoPanAnimation:p.autoPanAnimation;if(c.components.tooltip.hasOwnProperty("toolTipSize")){i3GEO.configura.alturatip=c.components.tooltip.toolTipSize[0];i3GEO.configura.larguratip=c.components.tooltip.toolTipSize[1]}}}if(c.hasOwnProperty("openLayers")&&c.mapType!=="GM"){var d=c.openLayers;i3GEO.Interface.ATUAL="openlayers";i3GEO.Interface.openlayers.googleLike=(c.mapType=="OSM")?true:false;i3GEO.Interface.openlayers.TILES=(d.hasOwnProperty("singleTile")&&d.singleTile!="")?!d.singleTile:true;i3GEO.Interface.openlayers.parametrosMap=d.MapOptions;i3GEO.Interface.openlayers.parametrosView=d.ViewOptions;if(d.hasOwnProperty("editorButtons")&&d.editorButtons!=""){i3GEO.editor.botoes=d.editorButtons}}if(c.hasOwnProperty("googleMaps")&&c.mapType=="GM"){i3GEO.Interface.ATUAL="googlemaps";i3GEO.Interface.googlemaps.ESTILOPADRAO=c.googleMaps.MapOptions.mapTypeId;i3GEO.Interface.googlemaps.MAPOPTIONS=c.googleMaps.MapOptions}},parametrosMapa2mashuppar:function(p){var par=[],temp;if(p.hasOwnProperty("mapfilebase")&&p.mapfilebase!=""){par.push("&base="+p.mapfilebase)}if(p.hasOwnProperty("mapext")&&p.mapext!=""&&p.mapext.length==4){par.push("&mapext="+p.mapext.join(","));i3GEO.configura.guardaExtensao=false}if(p.hasOwnProperty("perfil")&&p.perfil!=""){par.push("&perfil="+p.perfil)}if(p.hasOwnProperty("layers")){if(p.layers.add&&p.layers.add.length>0){par.push("&temasa="+p.layers.add.join(","))}if(p.layers.on&&p.layers.on.length>0){par.push("&layers="+p.layers.on.join(","))}if(p.layers.off&&p.layers.off.length>0){par.push("&desligar="+p.layers.off.join(","))}}if(p.hasOwnProperty("points")&&p.points.coord.length>0){par.push("&nometemapontos="+p.points.title);par.push("&pontos="+p.points.coord.join(","))}if(p.hasOwnProperty("cacheOff")&&p.cacheOff=="sim"){par.push("&DESLIGACACHE=sim")}if(p.hasOwnProperty("lines")){var n=[];jQuery.each(p.lines.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemalinhas="+p.lines.title);par.push("&linhas="+n.join(","))}}if(p.hasOwnProperty("polygons")){var n=[];jQuery.each(p.polygons.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemapoligonos="+p.polygons.title);par.push("&poligonos="+n.join(","))}}if(p.hasOwnProperty("wkt")&&p.wkt.coord!=""){par.push("&nometemawkt="+p.wkt.title);par.push("&wkt="+p.wkt.coord)}if(p.hasOwnProperty("symbol")){if(p.symbol.name!=""){par.push("&simbolo="+p.symbol.name)}if(p.symbol.color!=""){par.push("&corsimbolo="+p.symbol.color)}if(p.symbol.size!=""){par.push("&tamanhosimbolo="+p.symbol.size)}}if(p.kml&&p.kml.url!=""){par.push("&kmlurl="+p.kml.url)}if(p.hasOwnProperty("wms")&&p.wms.url!=""){if(p.wms.url!=""){par.push("&url_wms="+p.wms.url)}if(p.wms.layer!=""){par.push("&layer_wms="+p.wms.layer)}if(p.wms.style!=""){par.push("&style_wms="+p.wms.style)}if(p.wms.title!=""){par.push("&nome_wms="+p.wms.title)}if(p.wms.srs!=""){par.push("&srs_wms="+p.wms.srs)}if(p.wms.imagetype!=""){par.push("&image_wms="+p.wms.imagetype)}if(p.wms.version!=""){par.push("&versao_wms="+p.wms.version)}}if(p.hasOwnProperty("filters")){var n=[];jQuery.each(p.filters,function(index,value){if(value.layer!=""){n.push("&map_layer_"+value.layer+"_filter="+value.expression)}});if(n.length>0){par.push(n.join(""))}}if(p.hasOwnProperty("restoreMapId")&&p.restoreMapId!=""){par.push("&restauramapa="+p.restoreMapId)}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width){par.push("&largura="+parseInt(temp.style.width,10))}if(temp&&temp.style&&temp.style.height){par.push("&altura="+parseInt(temp.style.height,10))}return par.join("")},cria:function(){i3GEO.scrollerWidth=i3GEO.util.getScrollerWidth();$('[data-traduzir="true"]').each(function(){this.innerHTML=Mustache.to_html(this.innerHTML,i3GEO.idioma.OBJETOIDIOMA)});var tamanho,temp;temp=window.location.href.split("?&");if(temp[1]){temp=temp[1].split("&");if(temp[0]&&temp[0]!=""&&temp.length==1){i3GEO.configura.sid=temp[0];if(i3GEO.configura.sid.split("#")[0]){i3GEO.configura.sid=i3GEO.configura.sid.split("#")[0]}}}else{i3GEO.configura.sid=""}if(i3GEO.configura.sid==='undefined'){i3GEO.configura.sid=""}i3GEO.mapa.aplicaPreferencias();if(!i3GEO.configura.locaplic||i3GEO.configura.locaplic===""){i3GEO.util.localizai3GEO()}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.Interface.cria(parseInt(temp.style.width,10),parseInt(temp.style.height,10))}else{tamanho=i3GEO.calculaTamanho();i3GEO.Interface.cria(tamanho[0],tamanho[1])}},inicia:function(retorno){i3GEO.eventos.cliquePerm.ativoinicial=i3GEO.eventos.cliquePerm.ativo;var montaMapa,mashup,tamanho,temp;i3GEO.mapa.aplicaPreferencias();montaMapa=function(retorno){try{delete i3GEO.parametrosMapa2mashuppar;delete i3GEO.configMapa;delete i3GEO.init;var temp,nomecookie="i3geoOLUltimaExtensao",preferencias="";if(retorno.bloqueado){alert(retorno.bloqueado);return}if(retorno===""){alert("Ocorreu um erro no mapa - i3GEO.inicia.montaMapa");retorno={data:{erro:"erro"}}}if(retorno.data.erro){document.body.style.backgroundColor="white";document.body.innerHTML="<br>Para abrir o i3Geo utilize o link:<br><a href="+i3GEO.configura.locaplic+"/ms_criamapa.php >"+i3GEO.configura.locaplic+"/ms_criamapa.php</a>";return("linkquebrado")}else{if(retorno.data.variaveis){i3GEO.parametros=retorno.data.variaveis;i3GEO.parametros.mapscale=i3GEO.parametros.mapscale*1;i3GEO.parametros.mapres=i3GEO.parametros.mapres*1;i3GEO.parametros.pixelsize=i3GEO.parametros.pixelsize*1;i3GEO.parametros.w=i3GEO.parametros.w*1;i3GEO.parametros.h=i3GEO.parametros.h*1;if(retorno.data.customizacoesinit){preferencias=JSON.parse(retorno.data.customizacoesinit);temp=i3GEO.util.base64decode(preferencias.preferenciasbase64);i3GEO.mapa.aplicaPreferencias(temp)}if(i3GEO.configura.guardaExtensao===true){if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}temp=i3GEO.util.pegaCookie(nomecookie);if(temp&&temp!=""){temp=temp.replace(/[]/g," ");i3GEO.parametros.mapexten=temp}i3GEO.eventos.NAVEGAMAPA.push(function(){i3GEO.util.insereCookie(nomecookie,i3GEO.parametros.mapexten)})}if(i3GEO.parametros.logado==="nao"){i3GEO.login.anulaCookie()}i3GEO.arvoreDeCamadas.registaCamadas(retorno.data.temas);if(i3GEO.parametros.editor==="sim"){i3GEO.listaDeFerramentas=i3GEO.login.adicionaMenuSuspenso(i3GEO.listaDeFerramentas)}i3GEO.Interface.inicia();if(retorno.data.customizacoesinit){if(preferencias.geometriasbase64&&preferencias.geometriasbase64!=""){temp=i3GEO.util.base64decode(preferencias.geometriasbase64);i3GEO.mapa.desCompactaLayerGrafico(temp)}if(preferencias.graficosbase64&&preferencias.graficosbase64!=""){i3GEO.mapa.restauraGraficos(preferencias.graficosbase64)}if(preferencias.tabelasbase64&&preferencias.tabelasbase64!=""){i3GEO.mapa.restauraTabelas(preferencias.tabelasbase64)}}}else{alert("Erro. Impossivel criar o mapa "+retorno.data);return}}i3GEO.aposIniciar()}catch(e){}};if(!$i("i3geo")){document.body.id="i3geo"}temp=$i("i3geo");temp.className="yui-skin-sam";if(document.body.id==="i3geo"&&temp.style&&!temp.style.overflow&&i3GEO.Interface.ATUAL==="openlayers"){temp.style.overflow="hidden"}if(i3GEO.configura.sid===""){mashup=function(retorno){if(retorno.bloqueado){alert(retorno.bloqueado);return}i3GEO.configura.sid=retorno.data;i3GEO.inicia(retorno)};i3GEO.configura.mashuppar+="&interface="+i3GEO.Interface.ATUAL;if(i3GEO.mapa.TEMASINICIAIS.length>0){i3GEO.configura.mashuppar+="&temasa="+i3GEO.mapa.TEMASINICIAIS}if(i3GEO.mapa.TEMASINICIAISLIGADOS.length>0){i3GEO.configura.mashuppar+="&layers="+i3GEO.mapa.TEMASINICIAISLIGADOS}i3GEO.php.criamapa(mashup,i3GEO.configura.mashuppar)}else{if(i3GEO.parametros.w===""||i3GEO.parametros.h===""){tamanho=i3GEO.calculaTamanho();i3GEO.parametros.w=tamanho[0];i3GEO.parametros.h=tamanho[1]}i3GEO.php.inicia(montaMapa,i3GEO.parametros.w,i3GEO.parametros.h)}},aposIniciar:function(){if(jQuery.isFunction(i3GEO.finaliza)){i3GEO.finaliza.call()}else{if(i3GEO.finaliza!=""){eval(i3GEO.finaliza)}}i3GEO.guias.inicia();i3GEO.mapa.ativaAutoResize()},atualiza:function(retorno){var corpoMapa,erro,mapscale,temp;if(i3GEO.contadorAtualiza>1){i3GEO.contadorAtualiza--;return}if(i3GEO.contadorAtualiza>0){i3GEO.contadorAtualiza--}i3GEO.contadorAtualiza++;corpoMapa=function(){if($i("ajaxCorpoMapa")){return}i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem)};if(arguments.length===0){i3GEO.janela.fechaAguarde("ajaxCorpoMapa");corpoMapa.call();return}if(!retorno.data){alert("Ocorreu um erro ao carregar o mapa"+retorno);i3GEO.mapa.recupera.inicia();return}try{if(retorno.data==="erro"){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia();return}else if(retorno.data==="ok"||retorno.data===""){corpoMapa.call();return}}catch(e){}erro=function(){var c=confirm("Ocorreu um erro, quer tentar novamente?");if(c){corpoMapa.call()}else{i3GEO.janela.fechaAguarde()}return};if(arguments.length===0||retorno===""||retorno.data.variaveis===undefined){erro.call();return}else{if(arguments.length===0){return}i3GEO.mapa.verifica(retorno);mapscale=i3GEO.parametros.mapscale;i3GEO.atualizaParametros(retorno.data.variaveis);if(retorno.data.variaveis.erro!==""){alert(retorno.data.variaveis.erro)}temp=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);try{i3GEO.arvoreDeCamadas.atualiza(temp);if(i3GEO.parametros.mapscale!==mapscale){i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale)}}catch(e){}i3GEO.arvoreDeCamadas.registaCamadas(temp);i3GEO.Interface.redesenha();if($i("mensagemt")){$i("mensagemt").value=i3GEO.parametros.mapexten}i3GEO.eventos.navegaMapa();temp=i3GEO.arvoreDeCamadas.verificaAplicaExtensao();if(temp!==""){i3GEO.tema.zoom(temp)}}},calculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=(antigoh-novoh);document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;i3GEO.parametros.w=w;i3GEO.parametros.h=h;return[w,h]},reCalculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);i3GEO.eventos.resizeMapa();return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=antigoh-novoh;document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;temp=$i(i3GEO.Interface.IDMAPA);if(temp){temp.style.height=h+"px";temp.style.width=w+"px"}i3GEO.parametros.w=w;i3GEO.parametros.h=h;temp=function(){switch(i3GEO.Interface.ATUAL){case"googlemaps":i3GEO.Interface.googlemaps.zoom2extent(i3GEO.parametros.mapexten);break;case"openlayers":i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);i3geoOL.updateSize();if(i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px";if(i3GEO.Interface.BARRADEZOOMLEFT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}}break};i3GEO.guias.ALTURACORPOGUIAS=h;i3GEO.eventos.resizeMapa();return[w,h]};i3GEO.php.mudatamanho(temp,h,w)},atualizaParametros:function(variaveis){i3GEO.parametros.mapscale=variaveis.mapscale*1;i3GEO.parametros.mapres=variaveis.mapres*1;i3GEO.parametros.pixelsize=variaveis.pixelsize*1;i3GEO.parametros.mapexten=variaveis.mapexten;i3GEO.parametros.mapimagem=variaveis.mapimagem;i3GEO.parametros.w=variaveis.w*1;i3GEO.parametros.h=variaveis.h*1;i3GEO.parametros.mappath=variaveis.mappath;i3GEO.parametros.mapurl=variaveis.mapurl;if(i3GEO.login.verificaCookieLogin()){i3GEO.parametros.editor="sim"}else{i3GEO.parametros.editor="nao"}}};
  209 +var i3GEOF=[];var i3GEOadmin=[];if(typeof YAHOO!="undefined"){YAHOO.namespace("i3GEO")}var i3GEO={tamanhodoc:[],parametros:{mapexten:"",mapscale:"",mapres:"",pixelsize:"",mapfile:"",cgi:"",extentTotal:"",mapimagem:"",geoip:"",utilizacgi:"",versaoms:"",versaomscompleta:"",mensagens:"",w:"",h:"",locsistemas:"",locidentifica:"",r:"",locmapas:"",celularef:"",kmlurl:"",mensageminicia:"",interfacePadrao:"openlayers.htm",autenticadoopenid:"nao",cordefundo:"",copyright:"",editor:"nao"},scrollerWidth:"",finaliza:"",finalizaAPI:"",temaAtivo:"",contadorAtualiza:0,init:function(parametrosMapa,configMapa){if($.material){$.material.init()}if(configMapa&&configMapa!=""){i3GEO.configMapa(configMapa)}if(parametrosMapa&&parametrosMapa!=""){i3GEO.configura.mashuppar=i3GEO.parametrosMapa2mashuppar(parametrosMapa)}else{i3GEO.configura.mashuppar=""}i3GEO.cria();i3GEO.inicia()},configMapa:function(c){i3GEO.configura.guardaExtensao=(c.hasOwnProperty("saveExtension")&&c.saveExtension==true)?true:false;i3GEO.configura.tipoimagem=(c.hasOwnProperty("posRenderType")&&c.posRenderType!="")?c.posRenderType:"nenhum";i3GEO.configura.locaplic=(c.hasOwnProperty("i3GeoServer")&&c.i3GeoServer!="")?c.i3GeoServer:i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";if(c.hasOwnProperty("tools")){i3GEO.configura.ferramentas=c.tools}if(c.hasOwnProperty("layerOpacity")&&c.hasOwnProperty("layerOpacity")!=""){i3GEO.Interface.LAYEROPACITY=c.layerOpacity}i3GEO.Interface.IDCORPO=(c.hasOwnProperty("mapBody")&&c.mapBody!="")?c.mapBody:"mapai3Geo";i3GEO.finalizaAPI=(c.hasOwnProperty("afterStart")&&c.afterStart!="")?c.afterStart:"";if(c.hasOwnProperty("components")){i3GEO.arvoreDeTemas.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.catalogoMenus.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.busca.SERVICO=(c.components.hasOwnProperty("searchService"))?c.components.searchService:"";i3GEO.busca.SERVICOWMS=(c.components.hasOwnProperty("searchWms"))?c.components.searchWms:"";i3GEO.mapa.BALAOATIVO=(c.components.hasOwnProperty("info"))?c.components.info:true;if(c.components.referenceMapPosition){i3GEO.maparef.TOP=c.components.referenceMapPosition[0];i3GEO.maparef.RIGHT=c.components.referenceMapPosition[1]}if(c.components.scrollBar){i3GEO.janela.scrollBar=c.components.scrollBar}if(c.components.tooltip){var p=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP;p.removeAoAdicionar=(c.components.tooltip.hasOwnProperty("removeAoAdicionar"))?c.components.tooltip.removeAoAdicionar:true;p.autoPan=(c.components.tooltip.hasOwnProperty("autoPan"))?c.components.tooltip.autoPan:true;p.modal=(c.components.tooltip.hasOwnProperty("modal"))?c.components.tooltip.modal:false;p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:"";p.templateModal=(c.components.tooltip.hasOwnProperty("templateModal"))?c.components.tooltip.templateModal:"";p.simple=(c.components.tooltip.hasOwnProperty("simple"))?c.components.tooltip.simple:true;p.minWidth=(c.components.tooltip.hasOwnProperty("minWidth"))?c.components.tooltip.minWidth:'';p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:'200px';p.autoPanAnimation=(c.components.tooltip.hasOwnProperty("autoPanAnimation"))?c.components.tooltip.autoPanAnimation:p.autoPanAnimation;if(c.components.tooltip.hasOwnProperty("toolTipSize")){i3GEO.configura.alturatip=c.components.tooltip.toolTipSize[0];i3GEO.configura.larguratip=c.components.tooltip.toolTipSize[1]}}}if(c.hasOwnProperty("openLayers")&&c.mapType!=="GM"){var d=c.openLayers;i3GEO.Interface.ATUAL="openlayers";i3GEO.Interface.openlayers.googleLike=(c.mapType=="OSM")?true:false;i3GEO.Interface.openlayers.TILES=(d.hasOwnProperty("singleTile")&&d.singleTile!="")?!d.singleTile:true;i3GEO.Interface.openlayers.parametrosMap=d.MapOptions;i3GEO.Interface.openlayers.parametrosView=d.ViewOptions;if(d.hasOwnProperty("editorButtons")&&d.editorButtons!=""){i3GEO.editor.botoes=d.editorButtons}}if(c.hasOwnProperty("googleMaps")&&c.mapType=="GM"){i3GEO.Interface.ATUAL="googlemaps";i3GEO.Interface.googlemaps.ESTILOPADRAO=c.googleMaps.MapOptions.mapTypeId;i3GEO.Interface.googlemaps.MAPOPTIONS=c.googleMaps.MapOptions}},parametrosMapa2mashuppar:function(p){var par=[],temp;if(p.hasOwnProperty("mapfilebase")&&p.mapfilebase!=""){par.push("&base="+p.mapfilebase)}if(p.hasOwnProperty("mapext")&&p.mapext!=""&&p.mapext.length==4){par.push("&mapext="+p.mapext.join(","));i3GEO.configura.guardaExtensao=false}if(p.hasOwnProperty("perfil")&&p.perfil!=""){par.push("&perfil="+p.perfil)}if(p.hasOwnProperty("layers")){if(p.layers.add&&p.layers.add.length>0){par.push("&temasa="+p.layers.add.join(","))}if(p.layers.on&&p.layers.on.length>0){par.push("&layers="+p.layers.on.join(","))}if(p.layers.off&&p.layers.off.length>0){par.push("&desligar="+p.layers.off.join(","))}if(p.layers.metaestat&&p.layers.metaestat.length>0){par.push("&metaestatids="+p.layers.metaestat.join(","))}}if(p.hasOwnProperty("points")&&p.points.coord.length>0){par.push("&nometemapontos="+p.points.title);par.push("&pontos="+p.points.coord.join(","))}if(p.hasOwnProperty("cacheOff")&&p.cacheOff=="sim"){par.push("&DESLIGACACHE=sim")}if(p.hasOwnProperty("lines")){var n=[];jQuery.each(p.lines.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemalinhas="+p.lines.title);par.push("&linhas="+n.join(","))}}if(p.hasOwnProperty("polygons")){var n=[];jQuery.each(p.polygons.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemapoligonos="+p.polygons.title);par.push("&poligonos="+n.join(","))}}if(p.hasOwnProperty("wkt")&&p.wkt.coord!=""){par.push("&nometemawkt="+p.wkt.title);par.push("&wkt="+p.wkt.coord)}if(p.hasOwnProperty("symbol")){if(p.symbol.name!=""){par.push("&simbolo="+p.symbol.name)}if(p.symbol.color!=""){par.push("&corsimbolo="+p.symbol.color)}if(p.symbol.size!=""){par.push("&tamanhosimbolo="+p.symbol.size)}}if(p.kml&&p.kml.url!=""){par.push("&kmlurl="+p.kml.url)}if(p.hasOwnProperty("wms")&&p.wms.url!=""){if(p.wms.url!=""){par.push("&url_wms="+p.wms.url)}if(p.wms.layer!=""){par.push("&layer_wms="+p.wms.layer)}if(p.wms.style!=""){par.push("&style_wms="+p.wms.style)}if(p.wms.title!=""){par.push("&nome_wms="+p.wms.title)}if(p.wms.srs!=""){par.push("&srs_wms="+p.wms.srs)}if(p.wms.imagetype!=""){par.push("&image_wms="+p.wms.imagetype)}if(p.wms.version!=""){par.push("&versao_wms="+p.wms.version)}}if(p.hasOwnProperty("filters")){var n=[];jQuery.each(p.filters,function(index,value){if(value.layer!=""){n.push("&map_layer_"+value.layer+"_filter="+value.expression)}});if(n.length>0){par.push(n.join(""))}}if(p.hasOwnProperty("restoreMapId")&&p.restoreMapId!=""){par.push("&restauramapa="+p.restoreMapId)}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width){par.push("&largura="+parseInt(temp.style.width,10))}if(temp&&temp.style&&temp.style.height){par.push("&altura="+parseInt(temp.style.height,10))}return par.join("")},cria:function(){i3GEO.scrollerWidth=i3GEO.util.getScrollerWidth();$('[data-traduzir="true"]').each(function(){this.innerHTML=Mustache.to_html(this.innerHTML,i3GEO.idioma.OBJETOIDIOMA)});var tamanho,temp;temp=window.location.href.split("?&");if(temp[1]){temp=temp[1].split("&");if(temp[0]&&temp[0]!=""&&temp.length==1){i3GEO.configura.sid=temp[0];if(i3GEO.configura.sid.split("#")[0]){i3GEO.configura.sid=i3GEO.configura.sid.split("#")[0]}}}else{i3GEO.configura.sid=""}if(i3GEO.configura.sid==='undefined'){i3GEO.configura.sid=""}i3GEO.mapa.aplicaPreferencias();if(!i3GEO.configura.locaplic||i3GEO.configura.locaplic===""){i3GEO.util.localizai3GEO()}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.Interface.cria(parseInt(temp.style.width,10),parseInt(temp.style.height,10))}else{tamanho=i3GEO.calculaTamanho();i3GEO.Interface.cria(tamanho[0],tamanho[1])}},inicia:function(retorno){i3GEO.eventos.cliquePerm.ativoinicial=i3GEO.eventos.cliquePerm.ativo;var montaMapa,mashup,tamanho,temp;i3GEO.mapa.aplicaPreferencias();montaMapa=function(retorno){try{delete i3GEO.parametrosMapa2mashuppar;delete i3GEO.configMapa;delete i3GEO.init;var temp,nomecookie="i3geoOLUltimaExtensao",preferencias="";if(retorno.bloqueado){alert(retorno.bloqueado);return}if(retorno===""){alert("Ocorreu um erro no mapa - i3GEO.inicia.montaMapa");retorno={data:{erro:"erro"}}}if(retorno.data.erro){document.body.style.backgroundColor="white";document.body.innerHTML="<br>Para abrir o i3Geo utilize o link:<br><a href="+i3GEO.configura.locaplic+"/ms_criamapa.php >"+i3GEO.configura.locaplic+"/ms_criamapa.php</a>";return("linkquebrado")}else{if(retorno.data.variaveis){i3GEO.parametros=retorno.data.variaveis;i3GEO.parametros.mapscale=i3GEO.parametros.mapscale*1;i3GEO.parametros.mapres=i3GEO.parametros.mapres*1;i3GEO.parametros.pixelsize=i3GEO.parametros.pixelsize*1;i3GEO.parametros.w=i3GEO.parametros.w*1;i3GEO.parametros.h=i3GEO.parametros.h*1;if(retorno.data.customizacoesinit){preferencias=JSON.parse(retorno.data.customizacoesinit);temp=i3GEO.util.base64decode(preferencias.preferenciasbase64);i3GEO.mapa.aplicaPreferencias(temp)}if(i3GEO.configura.guardaExtensao===true){if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}temp=i3GEO.util.pegaCookie(nomecookie);if(temp&&temp!=""){temp=temp.replace(/[]/g," ");i3GEO.parametros.mapexten=temp}i3GEO.eventos.NAVEGAMAPA.push(function(){i3GEO.util.insereCookie(nomecookie,i3GEO.parametros.mapexten)})}if(i3GEO.parametros.logado==="nao"){i3GEO.login.anulaCookie()}i3GEO.arvoreDeCamadas.registaCamadas(retorno.data.temas);if(i3GEO.parametros.editor==="sim"){i3GEO.listaDeFerramentas=i3GEO.login.adicionaMenuSuspenso(i3GEO.listaDeFerramentas)}i3GEO.Interface.inicia();if(retorno.data.customizacoesinit){if(preferencias.geometriasbase64&&preferencias.geometriasbase64!=""){temp=i3GEO.util.base64decode(preferencias.geometriasbase64);i3GEO.mapa.desCompactaLayerGrafico(temp)}if(preferencias.graficosbase64&&preferencias.graficosbase64!=""){i3GEO.mapa.restauraGraficos(preferencias.graficosbase64)}if(preferencias.tabelasbase64&&preferencias.tabelasbase64!=""){i3GEO.mapa.restauraTabelas(preferencias.tabelasbase64)}}}else{alert("Erro. Impossivel criar o mapa "+retorno.data);return}}i3GEO.aposIniciar()}catch(e){}};if(!$i("i3geo")){document.body.id="i3geo"}temp=$i("i3geo");temp.className="yui-skin-sam";if(document.body.id==="i3geo"&&temp.style&&!temp.style.overflow&&i3GEO.Interface.ATUAL==="openlayers"){temp.style.overflow="hidden"}if(i3GEO.configura.sid===""){mashup=function(retorno){if(retorno.bloqueado){alert(retorno.bloqueado);return}i3GEO.configura.sid=retorno.data;i3GEO.inicia(retorno)};i3GEO.configura.mashuppar+="&interface="+i3GEO.Interface.ATUAL;if(i3GEO.mapa.TEMASINICIAIS.length>0){i3GEO.configura.mashuppar+="&temasa="+i3GEO.mapa.TEMASINICIAIS}if(i3GEO.mapa.TEMASINICIAISLIGADOS.length>0){i3GEO.configura.mashuppar+="&layers="+i3GEO.mapa.TEMASINICIAISLIGADOS}i3GEO.php.criamapa(mashup,i3GEO.configura.mashuppar)}else{if(i3GEO.parametros.w===""||i3GEO.parametros.h===""){tamanho=i3GEO.calculaTamanho();i3GEO.parametros.w=tamanho[0];i3GEO.parametros.h=tamanho[1]}i3GEO.php.inicia(montaMapa,i3GEO.parametros.w,i3GEO.parametros.h)}},aposIniciar:function(){if(jQuery.isFunction(i3GEO.finaliza)){i3GEO.finaliza.call()}else{if(i3GEO.finaliza!=""){eval(i3GEO.finaliza)}}i3GEO.guias.inicia();i3GEO.mapa.ativaAutoResize()},atualiza:function(retorno){var corpoMapa,erro,mapscale,temp;if(i3GEO.contadorAtualiza>1){i3GEO.contadorAtualiza--;return}if(i3GEO.contadorAtualiza>0){i3GEO.contadorAtualiza--}i3GEO.contadorAtualiza++;corpoMapa=function(){if($i("ajaxCorpoMapa")){return}i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem)};if(arguments.length===0){i3GEO.janela.fechaAguarde("ajaxCorpoMapa");corpoMapa.call();return}if(!retorno.data){alert("Ocorreu um erro ao carregar o mapa"+retorno);i3GEO.mapa.recupera.inicia();return}try{if(retorno.data==="erro"){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia();return}else if(retorno.data==="ok"||retorno.data===""){corpoMapa.call();return}}catch(e){}erro=function(){var c=confirm("Ocorreu um erro, quer tentar novamente?");if(c){corpoMapa.call()}else{i3GEO.janela.fechaAguarde()}return};if(arguments.length===0||retorno===""||retorno.data.variaveis===undefined){erro.call();return}else{if(arguments.length===0){return}i3GEO.mapa.verifica(retorno);mapscale=i3GEO.parametros.mapscale;i3GEO.atualizaParametros(retorno.data.variaveis);if(retorno.data.variaveis.erro!==""){alert(retorno.data.variaveis.erro)}temp=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);try{i3GEO.arvoreDeCamadas.atualiza(temp);if(i3GEO.parametros.mapscale!==mapscale){i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale)}}catch(e){}i3GEO.arvoreDeCamadas.registaCamadas(temp);i3GEO.Interface.redesenha();if($i("mensagemt")){$i("mensagemt").value=i3GEO.parametros.mapexten}i3GEO.eventos.navegaMapa();temp=i3GEO.arvoreDeCamadas.verificaAplicaExtensao();if(temp!==""){i3GEO.tema.zoom(temp)}}},calculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=(antigoh-novoh);document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;i3GEO.parametros.w=w;i3GEO.parametros.h=h;return[w,h]},reCalculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);i3GEO.eventos.resizeMapa();return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=antigoh-novoh;document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;temp=$i(i3GEO.Interface.IDMAPA);if(temp){temp.style.height=h+"px";temp.style.width=w+"px"}i3GEO.parametros.w=w;i3GEO.parametros.h=h;temp=function(){switch(i3GEO.Interface.ATUAL){case"googlemaps":i3GEO.Interface.googlemaps.zoom2extent(i3GEO.parametros.mapexten);break;case"openlayers":i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);i3geoOL.updateSize();if(i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px";if(i3GEO.Interface.BARRADEZOOMLEFT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}}break};i3GEO.guias.ALTURACORPOGUIAS=h;i3GEO.eventos.resizeMapa();return[w,h]};i3GEO.php.mudatamanho(temp,h,w)},atualizaParametros:function(variaveis){i3GEO.parametros.mapscale=variaveis.mapscale*1;i3GEO.parametros.mapres=variaveis.mapres*1;i3GEO.parametros.pixelsize=variaveis.pixelsize*1;i3GEO.parametros.mapexten=variaveis.mapexten;i3GEO.parametros.mapimagem=variaveis.mapimagem;i3GEO.parametros.w=variaveis.w*1;i3GEO.parametros.h=variaveis.h*1;i3GEO.parametros.mappath=variaveis.mappath;i3GEO.parametros.mapurl=variaveis.mapurl;if(i3GEO.login.verificaCookieLogin()){i3GEO.parametros.editor="sim"}else{i3GEO.parametros.editor="nao"}}};
210 210 //
211 211 //compactados/mustache.js
212 212 (function(global,factory){if(typeof exports==="object"&&exports){factory(exports)}else if(typeof define==="function"&&define.amd){define(['exports'],factory)}else{factory(global.Mustache={})}}(this,function(mustache){var Object_toString=Object.prototype.toString;var isArray=Array.isArray||function(object){return Object_toString.call(object)==='[object Array]'};function isFunction(object){return typeof object==='function'}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var RegExp_test=RegExp.prototype.test;function testRegExp(re,string){return RegExp_test.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':'&quot;',"'":'&#39;',"/":'&#x2F;'};function escapeHtml(string){return String(string).replace(/[&<>"'\/]/g,function(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tags){if(typeof tags==='string')tags=tags.split(spaceRe,2);if(!isArray(tags)||tags.length!==2)throw new Error('Invalid tags: '+tags);openingTagRe=new RegExp(escapeRegExp(tags[0])+'\\s*');closingTagRe=new RegExp('\\s*'+escapeRegExp(tags[1]));closingCurlyRe=new RegExp('\\s*'+escapeRegExp('}'+tags[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i<valueLength;++i){chr=value.charAt(i);if(isWhitespace(chr)){spaces.push(tokens.length)}else{nonSpace=true}tokens.push(['text',chr,start,start+1]);start+=1;if(chr==='\n')stripSpace()}}if(!scanner.scan(openingTagRe))break;hasTag=true;type=scanner.scan(tagRe)||'name';scanner.scan(whiteRe);if(type==='='){value=scanner.scanUntil(equalsRe);scanner.scan(equalsRe);scanner.scanUntil(closingTagRe)}else if(type==='{'){value=scanner.scanUntil(closingCurlyRe);scanner.scan(curlyRe);scanner.scanUntil(closingTagRe);type='&'}else{value=scanner.scanUntil(closingTagRe)}if(!scanner.scan(closingTagRe))throw new Error('Unclosed tag at '+scanner.pos);token=[type,value,start,scanner.pos];tokens.push(token);if(type==='#'||type==='^'){sections.push(token)}else if(type==='/'){openSection=sections.pop();if(!openSection)throw new Error('Unopened section "'+value+'" at '+start);if(openSection[1]!==value)throw new Error('Unclosed section "'+openSection[1]+'" at '+start)}else if(type==='name'||type==='{'||type==='&'){nonSpace=true}else if(type==='='){compileTags(value)}}openSection=sections.pop();if(openSection)throw new Error('Unclosed section "'+openSection[1]+'" at '+scanner.pos);return nestTokens(squashTokens(tokens))}function squashTokens(tokens){var squashedTokens=[];var token,lastToken;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];if(token){if(token[0]==='text'&&lastToken&&lastToken[0]==='text'){lastToken[1]+=token[1];lastToken[3]=token[3]}else{squashedTokens.push(token);lastToken=token}}}return squashedTokens}function nestTokens(tokens){var nestedTokens=[];var collector=nestedTokens;var sections=[];var token,section;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];switch(token[0]){case'#':case'^':collector.push(token);sections.push(token);collector=token[4]=[];break;case'/':section=sections.pop();section[5]=token[2];collector=sections.length>0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function(){return this.tail===""};Scanner.prototype.scan=function(re){var match=this.tail.match(re);if(!match||match.index!==0)return'';var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view==null?{}:view;this.cache={'.':this.view};this.parent=parentContext}Context.prototype.push=function(view){return new Context(view,this)};Context.prototype.lookup=function(name){var cache=this.cache;var value;if(name in cache){value=cache[name]}else{var context=this,names,index;while(context){if(name.indexOf('.')>0){value=context.view;names=name.split('.');index=0;while(value!=null&&index<names.length)value=value[names[index++]]}else{value=context.view[name]}if(value!=null)break;context=context.parent}cache[name]=value}if(isFunction(value))value=value.call(this.view);return value};function Writer(){this.cache={}}Writer.prototype.clearCache=function(){this.cache={}};Writer.prototype.parse=function(template,tags){var cache=this.cache;var tokens=cache[template];if(tokens==null)tokens=cache[template]=parseTemplate(template,tags);return tokens};Writer.prototype.render=function(template,view,partials){var tokens=this.parse(template);var context=(view instanceof Context)?view:new Context(view);return this.renderTokens(tokens,context,partials,template)};Writer.prototype.renderTokens=function(tokens,context,partials,originalTemplate){var buffer='';var self=this;function subRender(template){return self.render(template,context,partials)}var token,value;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];switch(token[0]){case'#':value=context.lookup(token[1]);if(!value)continue;if(isArray(value)){for(var j=0,valueLength=value.length;j<valueLength;++j){buffer+=this.renderTokens(token[4],context.push(value[j]),partials,originalTemplate)}}else if(typeof value==='object'||typeof value==='string'){buffer+=this.renderTokens(token[4],context.push(value),partials,originalTemplate)}else if(isFunction(value)){if(typeof originalTemplate!=='string')throw new Error('Cannot use higher-order sections without the original template');value=value.call(context.view,originalTemplate.slice(token[3],token[5]),subRender);if(value!=null)buffer+=value}else{buffer+=this.renderTokens(token[4],context,partials,originalTemplate)}break;case'^':value=context.lookup(token[1]);if(!value||(isArray(value)&&value.length===0))buffer+=this.renderTokens(token[4],context,partials,originalTemplate);break;case'>':if(!partials)continue;value=isFunction(partials)?partials(token[1]):partials[token[1]];if(value!=null)buffer+=this.renderTokens(this.parse(value),context,partials,value);break;case'&':value=context.lookup(token[1]);if(value!=null)buffer+=value;break;case'name':value=context.lookup(token[1]);if(value!=null)buffer+=mustache.escape(value);break;case'text':buffer+=token[1];break}}return buffer};mustache.name="mustache.js";mustache.version="0.8.1";mustache.tags=["{{","}}"];var defaultWriter=new Writer();mustache.clearCache=function(){return defaultWriter.clearCache()};mustache.parse=function(template,tags){return defaultWriter.parse(template,tags)};mustache.render=function(template,view,partials){return defaultWriter.render(template,view,partials)};mustache.to_html=function(template,view,partials,send){var result=mustache.render(template,view,partials);if(isFunction(send)){send(result)}else{return result}};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context;mustache.Writer=Writer}));
... ...
js/i3geo_tudo_compacto7.js.php
... ... @@ -206,7 +206,7 @@ d.parent(&quot;.dropdown-menu&quot;).length&amp;&amp;(d=d.closest(&quot;li.dropdown&quot;).addClass(&quot;active&quot;
206 206 (function(global){var beginsWith,endsWith,root,Wkt;root=this;Wkt=function(obj){if(obj instanceof Wkt)return obj;if(!(this instanceof Wkt))return new Wkt(obj);this._wrapped=obj};if(typeof exports!=='undefined'){if(typeof module!=='undefined'&&module.exports){exports=module.exports=Wkt}exports.Wkt=Wkt}else{root.Wkt=Wkt}beginsWith=function(str,sub){return str.substring(0,sub.length)===sub};endsWith=function(str,sub){return str.substring(str.length-sub.length)===sub};Wkt.delimiter=' ';Wkt.isArray=function(obj){return!!(obj&&obj.constructor===Array)};Wkt.trim=function(str,sub){sub=sub||' ';while(beginsWith(str,sub)){str=str.substring(1)}while(endsWith(str,sub)){str=str.substring(0,str.length-1)}return str};Wkt.Wkt=function(initializer){this.delimiter=Wkt.delimiter||' ';this.wrapVertices=true;this.regExes={'typeStr':/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,'spaces':/\s+|\+/, 'numeric':/-*\d+(\.*\d+)?/,'comma':/\s*,\s*/,'parenComma':/\)\s*,\s*\(/,'coord':/-*\d+\.*\d+ -*\d+\.*\d+/, 'doubleParenComma':/\)\s*\)\s*,\s*\(\s*\(/,'trimParens':/^\s*\(?(.*?)\)?\s*$/,'ogcTypes':/^(multi)?(point|line|polygon|box)?(string)?$/i,'crudeJson':/^{.*"(type|coordinates|geometries|features)":.*}$/};this.components=undefined;if(initializer&&typeof initializer==='string'){this.read(initializer)}else if(initializer&&typeof initializer!==undefined){this.fromObject(initializer)}};global.Wkt=Wkt;Wkt.Wkt.prototype.isCollection=function(){switch(this.type.slice(0,5)){case'multi':return true;case'polyg':return true;default:return false}};Wkt.Wkt.prototype.sameCoords=function(a,b){return(a.x===b.x&&a.y===b.y)};Wkt.Wkt.prototype.fromObject=function(obj){var result;if(obj.hasOwnProperty('type')&&obj.hasOwnProperty('coordinates')){result=this.fromJson(obj)}else{result=this.deconstruct.call(this,obj)}this.components=result.components;this.isRectangle=result.isRectangle||false;this.type=result.type;return this};Wkt.Wkt.prototype.toObject=function(config){var obj=this.construct[this.type].call(this,config);if(typeof obj==='object'&&!Wkt.isArray(obj)){obj.properties=this.properties}return obj};Wkt.Wkt.prototype.toString=function(config){return this.write()};Wkt.Wkt.prototype.fromJson=function(obj){var i,j,k,coords,iring,oring;this.type=obj.type.toLowerCase();this.components=[];if(obj.hasOwnProperty('geometry')){this.fromJson(obj.geometry);this.properties=obj.properties;return this}coords=obj.coordinates;if(!Wkt.isArray(coords[0])){this.components.push({x:coords[0],y:coords[1]})}else{for(i in coords){if(coords.hasOwnProperty(i)){if(!Wkt.isArray(coords[i][0])){if(this.type==='multipoint'){this.components.push([{x:coords[i][0],y:coords[i][1]}])}else{this.components.push({x:coords[i][0],y:coords[i][1]})}}else{oring=[];for(j in coords[i]){if(coords[i].hasOwnProperty(j)){if(!Wkt.isArray(coords[i][j][0])){oring.push({x:coords[i][j][0],y:coords[i][j][1]})}else{iring=[];for(k in coords[i][j]){if(coords[i][j].hasOwnProperty(k)){iring.push({x:coords[i][j][k][0],y:coords[i][j][k][1]})}}oring.push(iring)}}}this.components.push(oring)}}}}return this};Wkt.Wkt.prototype.toJson=function(){var cs,json,i,j,k,ring,rings;cs=this.components;json={coordinates:[],type:(function(){var i,type,s;type=this.regExes.ogcTypes.exec(this.type).slice(1);s=[];for(i in type){if(type.hasOwnProperty(i)){if(type[i]!==undefined){s.push(type[i].toLowerCase().slice(0,1).toUpperCase()+type[i].toLowerCase().slice(1))}}}return s}.call(this)).join('')};if(this.type.toLowerCase()==='box'){json.type='Polygon';json.bbox=[];for(i in cs){if(cs.hasOwnProperty(i)){json.bbox=json.bbox.concat([cs[i].x,cs[i].y])}}json.coordinates=[[[cs[0].x,cs[0].y],[cs[0].x,cs[1].y],[cs[1].x,cs[1].y],[cs[1].x,cs[0].y],[cs[0].x,cs[0].y]]];return json}for(i in cs){if(cs.hasOwnProperty(i)){if(Wkt.isArray(cs[i])){rings=[];for(j in cs[i]){if(cs[i].hasOwnProperty(j)){if(Wkt.isArray(cs[i][j])){ring=[];for(k in cs[i][j]){if(cs[i][j].hasOwnProperty(k)){ring.push([cs[i][j][k].x,cs[i][j][k].y])}}rings.push(ring)}else{if(cs[i].length>1){rings.push([cs[i][j].x,cs[i][j].y])}else{rings=rings.concat([cs[i][j].x,cs[i][j].y])}}}}json.coordinates.push(rings)}else{if(cs.length>1){json.coordinates.push([cs[i].x,cs[i].y])}else{json.coordinates=json.coordinates.concat([cs[i].x,cs[i].y])}}}}return json};Wkt.Wkt.prototype.merge=function(wkt){var prefix=this.type.slice(0,5);if(this.type!==wkt.type){if(this.type.slice(5,this.type.length)!==wkt.type){throw TypeError('The input geometry types must agree or the calling this.Wkt.Wkt instance must be a multigeometry of the other')}}switch(prefix){case'point':this.components=[this.components.concat(wkt.components)];break;case'multi':this.components=this.components.concat((wkt.type.slice(0,5)==='multi')?wkt.components:[wkt.components]);break;default:this.components=[this.components,wkt.components];break}if(prefix!=='multi'){this.type='multi'+this.type}return this};Wkt.Wkt.prototype.read=function(str){var matches;matches=this.regExes.typeStr.exec(str);if(matches){this.type=matches[1].toLowerCase();this.base=matches[2];if(this.ingest[this.type]){this.components=this.ingest[this.type].apply(this,[this.base])}}else{if(this.regExes.crudeJson.test(str)){if(typeof JSON==='object'&&typeof JSON.parse==='function'){this.fromJson(JSON.parse(str))}else{console.log('JSON.parse() is not available; cannot parse GeoJSON strings');throw{name:'JSONError',message:'JSON.parse() is not available; cannot parse GeoJSON strings'}}}else{console.log('Invalid WKT string provided to read()');throw{name:'WKTError',message:'Invalid WKT string provided to read()'}}}return this};Wkt.Wkt.prototype.write=function(components){var i,pieces,data;components=components||this.components;pieces=[];pieces.push(this.type.toUpperCase()+'(');for(i=0;i<components.length;i+=1){if(this.isCollection()&&i>0){pieces.push(',')}if(!this.extract[this.type]){return null}data=this.extract[this.type].apply(this,[components[i]]);if(this.isCollection()&&this.type!=='multipoint'){pieces.push('('+data+')')}else{pieces.push(data);if(i!==(components.length-1)&&this.type!=='multipoint'){pieces.push(',')}}}pieces.push(')');return pieces.join('')};Wkt.Wkt.prototype.extract={point:function(point){return String(point.x)+this.delimiter+String(point.y)},multipoint:function(multipoint){var i,parts=[],s;for(i=0;i<multipoint.length;i+=1){s=this.extract.point.apply(this,[multipoint[i]]);if(this.wrapVertices){s='('+s+')'}parts.push(s)}return parts.join(',')},linestring:function(linestring){return this.extract.point.apply(this,[linestring])},multilinestring:function(multilinestring){var i,parts=[];for(i=0;i<multilinestring.length;i+=1){parts.push(this.extract.linestring.apply(this,[multilinestring[i]]))}return parts.join(',')},polygon:function(polygon){return this.extract.multilinestring.apply(this,[polygon])},multipolygon:function(multipolygon){var i,parts=[];for(i=0;i<multipolygon.length;i+=1){parts.push('('+this.extract.polygon.apply(this,[multipolygon[i]])+')')}return parts.join(',')},box:function(box){return this.extract.linestring.apply(this,[box])},geometrycollection:function(str){console.log('The geometrycollection WKT type is not yet supported.')}};Wkt.Wkt.prototype.ingest={point:function(str){var coords=Wkt.trim(str).split(this.regExes.spaces);return[{x:parseFloat(this.regExes.numeric.exec(coords[0])[0]),y:parseFloat(this.regExes.numeric.exec(coords[1])[0])}]},multipoint:function(str){var i,components,points;components=[];points=Wkt.trim(str).split(this.regExes.comma);for(i=0;i<points.length;i+=1){components.push(this.ingest.point.apply(this,[points[i]]))}return components},linestring:function(str){var i,multipoints,components;multipoints=this.ingest.multipoint.apply(this,[str]);components=[];for(i=0;i<multipoints.length;i+=1){components=components.concat(multipoints[i])}return components},multilinestring:function(str){var i,components,line,lines;components=[];lines=Wkt.trim(str).split(this.regExes.doubleParenComma);if(lines.length===1){lines=Wkt.trim(str).split(this.regExes.parenComma)}for(i=0;i<lines.length;i+=1){line=lines[i].replace(this.regExes.trimParens,'$1');components.push(this.ingest.linestring.apply(this,[line]))}return components},polygon:function(str){var i,j,components,subcomponents,ring,rings;rings=Wkt.trim(str).split(this.regExes.parenComma);components=[];for(i=0;i<rings.length;i+=1){ring=rings[i].replace(this.regExes.trimParens,'$1').split(this.regExes.comma);subcomponents=[];for(j=0;j<ring.length;j+=1){var split=ring[j].split(this.regExes.spaces);if(split.length>2){split=split.filter(function(n){return n!=""})}if(split.length===2){var x_cord=split[0];var y_cord=split[1];subcomponents.push({x:parseFloat(x_cord),y:parseFloat(y_cord)})}}components.push(subcomponents)}return components},box:function(str){var i,multipoints,components;multipoints=this.ingest.multipoint.apply(this,[str]);components=[];for(i=0;i<multipoints.length;i+=1){components=components.concat(multipoints[i])}return components},multipolygon:function(str){var i,components,polygon,polygons;components=[];polygons=Wkt.trim(str).split(this.regExes.doubleParenComma);for(i=0;i<polygons.length;i+=1){polygon=polygons[i].replace(this.regExes.trimParens,'$1');components.push(this.ingest.polygon.apply(this,[polygon]))}return components},geometrycollection:function(str){console.log('The geometrycollection WKT type is not yet supported.')}};return this}(this));
207 207 //
208 208 //compactados/ini_i3geo_compacto.js
209   -var i3GEOF=[];var i3GEOadmin=[];if(typeof YAHOO!="undefined"){YAHOO.namespace("i3GEO")}var i3GEO={tamanhodoc:[],parametros:{mapexten:"",mapscale:"",mapres:"",pixelsize:"",mapfile:"",cgi:"",extentTotal:"",mapimagem:"",geoip:"",utilizacgi:"",versaoms:"",versaomscompleta:"",mensagens:"",w:"",h:"",locsistemas:"",locidentifica:"",r:"",locmapas:"",celularef:"",kmlurl:"",mensageminicia:"",interfacePadrao:"openlayers.htm",autenticadoopenid:"nao",cordefundo:"",copyright:"",editor:"nao"},scrollerWidth:"",finaliza:"",finalizaAPI:"",temaAtivo:"",contadorAtualiza:0,init:function(parametrosMapa,configMapa){if($.material){$.material.init()}if(configMapa&&configMapa!=""){i3GEO.configMapa(configMapa)}if(parametrosMapa&&parametrosMapa!=""){i3GEO.configura.mashuppar=i3GEO.parametrosMapa2mashuppar(parametrosMapa)}else{i3GEO.configura.mashuppar=""}i3GEO.cria();i3GEO.inicia()},configMapa:function(c){i3GEO.configura.guardaExtensao=(c.hasOwnProperty("saveExtension")&&c.saveExtension==true)?true:false;i3GEO.configura.tipoimagem=(c.hasOwnProperty("posRenderType")&&c.posRenderType!="")?c.posRenderType:"nenhum";i3GEO.configura.locaplic=(c.hasOwnProperty("i3GeoServer")&&c.i3GeoServer!="")?c.i3GeoServer:i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";if(c.hasOwnProperty("tools")){i3GEO.configura.ferramentas=c.tools}if(c.hasOwnProperty("layerOpacity")&&c.hasOwnProperty("layerOpacity")!=""){i3GEO.Interface.LAYEROPACITY=c.layerOpacity}i3GEO.Interface.IDCORPO=(c.hasOwnProperty("mapBody")&&c.mapBody!="")?c.mapBody:"mapai3Geo";i3GEO.finalizaAPI=(c.hasOwnProperty("afterStart")&&c.afterStart!="")?c.afterStart:"";if(c.hasOwnProperty("components")){i3GEO.arvoreDeTemas.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.catalogoMenus.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.busca.SERVICO=(c.components.hasOwnProperty("searchService"))?c.components.searchService:"";i3GEO.busca.SERVICOWMS=(c.components.hasOwnProperty("searchWms"))?c.components.searchWms:"";i3GEO.mapa.BALAOATIVO=(c.components.hasOwnProperty("info"))?c.components.info:true;if(c.components.referenceMapPosition){i3GEO.maparef.TOP=c.components.referenceMapPosition[0];i3GEO.maparef.RIGHT=c.components.referenceMapPosition[1]}if(c.components.scrollBar){i3GEO.janela.scrollBar=c.components.scrollBar}if(c.components.tooltip){var p=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP;p.removeAoAdicionar=(c.components.tooltip.hasOwnProperty("removeAoAdicionar"))?c.components.tooltip.removeAoAdicionar:true;p.autoPan=(c.components.tooltip.hasOwnProperty("autoPan"))?c.components.tooltip.autoPan:true;p.modal=(c.components.tooltip.hasOwnProperty("modal"))?c.components.tooltip.modal:false;p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:"";p.templateModal=(c.components.tooltip.hasOwnProperty("templateModal"))?c.components.tooltip.templateModal:"";p.simple=(c.components.tooltip.hasOwnProperty("simple"))?c.components.tooltip.simple:true;p.minWidth=(c.components.tooltip.hasOwnProperty("minWidth"))?c.components.tooltip.minWidth:'';p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:'200px';p.autoPanAnimation=(c.components.tooltip.hasOwnProperty("autoPanAnimation"))?c.components.tooltip.autoPanAnimation:p.autoPanAnimation;if(c.components.tooltip.hasOwnProperty("toolTipSize")){i3GEO.configura.alturatip=c.components.tooltip.toolTipSize[0];i3GEO.configura.larguratip=c.components.tooltip.toolTipSize[1]}}}if(c.hasOwnProperty("openLayers")&&c.mapType!=="GM"){var d=c.openLayers;i3GEO.Interface.ATUAL="openlayers";i3GEO.Interface.openlayers.googleLike=(c.mapType=="OSM")?true:false;i3GEO.Interface.openlayers.TILES=(d.hasOwnProperty("singleTile")&&d.singleTile!="")?!d.singleTile:true;i3GEO.Interface.openlayers.parametrosMap=d.MapOptions;i3GEO.Interface.openlayers.parametrosView=d.ViewOptions;if(d.hasOwnProperty("editorButtons")&&d.editorButtons!=""){i3GEO.editor.botoes=d.editorButtons}}if(c.hasOwnProperty("googleMaps")&&c.mapType=="GM"){i3GEO.Interface.ATUAL="googlemaps";i3GEO.Interface.googlemaps.ESTILOPADRAO=c.googleMaps.MapOptions.mapTypeId;i3GEO.Interface.googlemaps.MAPOPTIONS=c.googleMaps.MapOptions}},parametrosMapa2mashuppar:function(p){var par=[],temp;if(p.hasOwnProperty("mapfilebase")&&p.mapfilebase!=""){par.push("&base="+p.mapfilebase)}if(p.hasOwnProperty("mapext")&&p.mapext!=""&&p.mapext.length==4){par.push("&mapext="+p.mapext.join(","));i3GEO.configura.guardaExtensao=false}if(p.hasOwnProperty("perfil")&&p.perfil!=""){par.push("&perfil="+p.perfil)}if(p.hasOwnProperty("layers")){if(p.layers.add&&p.layers.add.length>0){par.push("&temasa="+p.layers.add.join(","))}if(p.layers.on&&p.layers.on.length>0){par.push("&layers="+p.layers.on.join(","))}if(p.layers.off&&p.layers.off.length>0){par.push("&desligar="+p.layers.off.join(","))}}if(p.hasOwnProperty("points")&&p.points.coord.length>0){par.push("&nometemapontos="+p.points.title);par.push("&pontos="+p.points.coord.join(","))}if(p.hasOwnProperty("cacheOff")&&p.cacheOff=="sim"){par.push("&DESLIGACACHE=sim")}if(p.hasOwnProperty("lines")){var n=[];jQuery.each(p.lines.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemalinhas="+p.lines.title);par.push("&linhas="+n.join(","))}}if(p.hasOwnProperty("polygons")){var n=[];jQuery.each(p.polygons.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemapoligonos="+p.polygons.title);par.push("&poligonos="+n.join(","))}}if(p.hasOwnProperty("wkt")&&p.wkt.coord!=""){par.push("&nometemawkt="+p.wkt.title);par.push("&wkt="+p.wkt.coord)}if(p.hasOwnProperty("symbol")){if(p.symbol.name!=""){par.push("&simbolo="+p.symbol.name)}if(p.symbol.color!=""){par.push("&corsimbolo="+p.symbol.color)}if(p.symbol.size!=""){par.push("&tamanhosimbolo="+p.symbol.size)}}if(p.kml&&p.kml.url!=""){par.push("&kmlurl="+p.kml.url)}if(p.hasOwnProperty("wms")&&p.wms.url!=""){if(p.wms.url!=""){par.push("&url_wms="+p.wms.url)}if(p.wms.layer!=""){par.push("&layer_wms="+p.wms.layer)}if(p.wms.style!=""){par.push("&style_wms="+p.wms.style)}if(p.wms.title!=""){par.push("&nome_wms="+p.wms.title)}if(p.wms.srs!=""){par.push("&srs_wms="+p.wms.srs)}if(p.wms.imagetype!=""){par.push("&image_wms="+p.wms.imagetype)}if(p.wms.version!=""){par.push("&versao_wms="+p.wms.version)}}if(p.hasOwnProperty("filters")){var n=[];jQuery.each(p.filters,function(index,value){if(value.layer!=""){n.push("&map_layer_"+value.layer+"_filter="+value.expression)}});if(n.length>0){par.push(n.join(""))}}if(p.hasOwnProperty("restoreMapId")&&p.restoreMapId!=""){par.push("&restauramapa="+p.restoreMapId)}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width){par.push("&largura="+parseInt(temp.style.width,10))}if(temp&&temp.style&&temp.style.height){par.push("&altura="+parseInt(temp.style.height,10))}return par.join("")},cria:function(){i3GEO.scrollerWidth=i3GEO.util.getScrollerWidth();$('[data-traduzir="true"]').each(function(){this.innerHTML=Mustache.to_html(this.innerHTML,i3GEO.idioma.OBJETOIDIOMA)});var tamanho,temp;temp=window.location.href.split("?&");if(temp[1]){temp=temp[1].split("&");if(temp[0]&&temp[0]!=""&&temp.length==1){i3GEO.configura.sid=temp[0];if(i3GEO.configura.sid.split("#")[0]){i3GEO.configura.sid=i3GEO.configura.sid.split("#")[0]}}}else{i3GEO.configura.sid=""}if(i3GEO.configura.sid==='undefined'){i3GEO.configura.sid=""}i3GEO.mapa.aplicaPreferencias();if(!i3GEO.configura.locaplic||i3GEO.configura.locaplic===""){i3GEO.util.localizai3GEO()}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.Interface.cria(parseInt(temp.style.width,10),parseInt(temp.style.height,10))}else{tamanho=i3GEO.calculaTamanho();i3GEO.Interface.cria(tamanho[0],tamanho[1])}},inicia:function(retorno){i3GEO.eventos.cliquePerm.ativoinicial=i3GEO.eventos.cliquePerm.ativo;var montaMapa,mashup,tamanho,temp;i3GEO.mapa.aplicaPreferencias();montaMapa=function(retorno){try{delete i3GEO.parametrosMapa2mashuppar;delete i3GEO.configMapa;delete i3GEO.init;var temp,nomecookie="i3geoOLUltimaExtensao",preferencias="";if(retorno.bloqueado){alert(retorno.bloqueado);return}if(retorno===""){alert("Ocorreu um erro no mapa - i3GEO.inicia.montaMapa");retorno={data:{erro:"erro"}}}if(retorno.data.erro){document.body.style.backgroundColor="white";document.body.innerHTML="<br>Para abrir o i3Geo utilize o link:<br><a href="+i3GEO.configura.locaplic+"/ms_criamapa.php >"+i3GEO.configura.locaplic+"/ms_criamapa.php</a>";return("linkquebrado")}else{if(retorno.data.variaveis){i3GEO.parametros=retorno.data.variaveis;i3GEO.parametros.mapscale=i3GEO.parametros.mapscale*1;i3GEO.parametros.mapres=i3GEO.parametros.mapres*1;i3GEO.parametros.pixelsize=i3GEO.parametros.pixelsize*1;i3GEO.parametros.w=i3GEO.parametros.w*1;i3GEO.parametros.h=i3GEO.parametros.h*1;if(retorno.data.customizacoesinit){preferencias=JSON.parse(retorno.data.customizacoesinit);temp=i3GEO.util.base64decode(preferencias.preferenciasbase64);i3GEO.mapa.aplicaPreferencias(temp)}if(i3GEO.configura.guardaExtensao===true){if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}temp=i3GEO.util.pegaCookie(nomecookie);if(temp&&temp!=""){temp=temp.replace(/[]/g," ");i3GEO.parametros.mapexten=temp}i3GEO.eventos.NAVEGAMAPA.push(function(){i3GEO.util.insereCookie(nomecookie,i3GEO.parametros.mapexten)})}if(i3GEO.parametros.logado==="nao"){i3GEO.login.anulaCookie()}i3GEO.arvoreDeCamadas.registaCamadas(retorno.data.temas);if(i3GEO.parametros.editor==="sim"){i3GEO.listaDeFerramentas=i3GEO.login.adicionaMenuSuspenso(i3GEO.listaDeFerramentas)}i3GEO.Interface.inicia();if(retorno.data.customizacoesinit){if(preferencias.geometriasbase64&&preferencias.geometriasbase64!=""){temp=i3GEO.util.base64decode(preferencias.geometriasbase64);i3GEO.mapa.desCompactaLayerGrafico(temp)}if(preferencias.graficosbase64&&preferencias.graficosbase64!=""){i3GEO.mapa.restauraGraficos(preferencias.graficosbase64)}if(preferencias.tabelasbase64&&preferencias.tabelasbase64!=""){i3GEO.mapa.restauraTabelas(preferencias.tabelasbase64)}}}else{alert("Erro. Impossivel criar o mapa "+retorno.data);return}}i3GEO.aposIniciar()}catch(e){}};if(!$i("i3geo")){document.body.id="i3geo"}temp=$i("i3geo");temp.className="yui-skin-sam";if(document.body.id==="i3geo"&&temp.style&&!temp.style.overflow&&i3GEO.Interface.ATUAL==="openlayers"){temp.style.overflow="hidden"}if(i3GEO.configura.sid===""){mashup=function(retorno){if(retorno.bloqueado){alert(retorno.bloqueado);return}i3GEO.configura.sid=retorno.data;i3GEO.inicia(retorno)};i3GEO.configura.mashuppar+="&interface="+i3GEO.Interface.ATUAL;if(i3GEO.mapa.TEMASINICIAIS.length>0){i3GEO.configura.mashuppar+="&temasa="+i3GEO.mapa.TEMASINICIAIS}if(i3GEO.mapa.TEMASINICIAISLIGADOS.length>0){i3GEO.configura.mashuppar+="&layers="+i3GEO.mapa.TEMASINICIAISLIGADOS}i3GEO.php.criamapa(mashup,i3GEO.configura.mashuppar)}else{if(i3GEO.parametros.w===""||i3GEO.parametros.h===""){tamanho=i3GEO.calculaTamanho();i3GEO.parametros.w=tamanho[0];i3GEO.parametros.h=tamanho[1]}i3GEO.php.inicia(montaMapa,i3GEO.parametros.w,i3GEO.parametros.h)}},aposIniciar:function(){if(jQuery.isFunction(i3GEO.finaliza)){i3GEO.finaliza.call()}else{if(i3GEO.finaliza!=""){eval(i3GEO.finaliza)}}i3GEO.guias.inicia();i3GEO.mapa.ativaAutoResize()},atualiza:function(retorno){var corpoMapa,erro,mapscale,temp;if(i3GEO.contadorAtualiza>1){i3GEO.contadorAtualiza--;return}if(i3GEO.contadorAtualiza>0){i3GEO.contadorAtualiza--}i3GEO.contadorAtualiza++;corpoMapa=function(){if($i("ajaxCorpoMapa")){return}i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem)};if(arguments.length===0){i3GEO.janela.fechaAguarde("ajaxCorpoMapa");corpoMapa.call();return}if(!retorno.data){alert("Ocorreu um erro ao carregar o mapa"+retorno);i3GEO.mapa.recupera.inicia();return}try{if(retorno.data==="erro"){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia();return}else if(retorno.data==="ok"||retorno.data===""){corpoMapa.call();return}}catch(e){}erro=function(){var c=confirm("Ocorreu um erro, quer tentar novamente?");if(c){corpoMapa.call()}else{i3GEO.janela.fechaAguarde()}return};if(arguments.length===0||retorno===""||retorno.data.variaveis===undefined){erro.call();return}else{if(arguments.length===0){return}i3GEO.mapa.verifica(retorno);mapscale=i3GEO.parametros.mapscale;i3GEO.atualizaParametros(retorno.data.variaveis);if(retorno.data.variaveis.erro!==""){alert(retorno.data.variaveis.erro)}temp=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);try{i3GEO.arvoreDeCamadas.atualiza(temp);if(i3GEO.parametros.mapscale!==mapscale){i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale)}}catch(e){}i3GEO.arvoreDeCamadas.registaCamadas(temp);i3GEO.Interface.redesenha();if($i("mensagemt")){$i("mensagemt").value=i3GEO.parametros.mapexten}i3GEO.eventos.navegaMapa();temp=i3GEO.arvoreDeCamadas.verificaAplicaExtensao();if(temp!==""){i3GEO.tema.zoom(temp)}}},calculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=(antigoh-novoh);document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;i3GEO.parametros.w=w;i3GEO.parametros.h=h;return[w,h]},reCalculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);i3GEO.eventos.resizeMapa();return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=antigoh-novoh;document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;temp=$i(i3GEO.Interface.IDMAPA);if(temp){temp.style.height=h+"px";temp.style.width=w+"px"}i3GEO.parametros.w=w;i3GEO.parametros.h=h;temp=function(){switch(i3GEO.Interface.ATUAL){case"googlemaps":i3GEO.Interface.googlemaps.zoom2extent(i3GEO.parametros.mapexten);break;case"openlayers":i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);i3geoOL.updateSize();if(i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px";if(i3GEO.Interface.BARRADEZOOMLEFT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}}break};i3GEO.guias.ALTURACORPOGUIAS=h;i3GEO.eventos.resizeMapa();return[w,h]};i3GEO.php.mudatamanho(temp,h,w)},atualizaParametros:function(variaveis){i3GEO.parametros.mapscale=variaveis.mapscale*1;i3GEO.parametros.mapres=variaveis.mapres*1;i3GEO.parametros.pixelsize=variaveis.pixelsize*1;i3GEO.parametros.mapexten=variaveis.mapexten;i3GEO.parametros.mapimagem=variaveis.mapimagem;i3GEO.parametros.w=variaveis.w*1;i3GEO.parametros.h=variaveis.h*1;i3GEO.parametros.mappath=variaveis.mappath;i3GEO.parametros.mapurl=variaveis.mapurl;if(i3GEO.login.verificaCookieLogin()){i3GEO.parametros.editor="sim"}else{i3GEO.parametros.editor="nao"}}};
  209 +var i3GEOF=[];var i3GEOadmin=[];if(typeof YAHOO!="undefined"){YAHOO.namespace("i3GEO")}var i3GEO={tamanhodoc:[],parametros:{mapexten:"",mapscale:"",mapres:"",pixelsize:"",mapfile:"",cgi:"",extentTotal:"",mapimagem:"",geoip:"",utilizacgi:"",versaoms:"",versaomscompleta:"",mensagens:"",w:"",h:"",locsistemas:"",locidentifica:"",r:"",locmapas:"",celularef:"",kmlurl:"",mensageminicia:"",interfacePadrao:"openlayers.htm",autenticadoopenid:"nao",cordefundo:"",copyright:"",editor:"nao"},scrollerWidth:"",finaliza:"",finalizaAPI:"",temaAtivo:"",contadorAtualiza:0,init:function(parametrosMapa,configMapa){if($.material){$.material.init()}if(configMapa&&configMapa!=""){i3GEO.configMapa(configMapa)}if(parametrosMapa&&parametrosMapa!=""){i3GEO.configura.mashuppar=i3GEO.parametrosMapa2mashuppar(parametrosMapa)}else{i3GEO.configura.mashuppar=""}i3GEO.cria();i3GEO.inicia()},configMapa:function(c){i3GEO.configura.guardaExtensao=(c.hasOwnProperty("saveExtension")&&c.saveExtension==true)?true:false;i3GEO.configura.tipoimagem=(c.hasOwnProperty("posRenderType")&&c.posRenderType!="")?c.posRenderType:"nenhum";i3GEO.configura.locaplic=(c.hasOwnProperty("i3GeoServer")&&c.i3GeoServer!="")?c.i3GeoServer:i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";if(c.hasOwnProperty("tools")){i3GEO.configura.ferramentas=c.tools}if(c.hasOwnProperty("layerOpacity")&&c.hasOwnProperty("layerOpacity")!=""){i3GEO.Interface.LAYEROPACITY=c.layerOpacity}i3GEO.Interface.IDCORPO=(c.hasOwnProperty("mapBody")&&c.mapBody!="")?c.mapBody:"mapai3Geo";i3GEO.finalizaAPI=(c.hasOwnProperty("afterStart")&&c.afterStart!="")?c.afterStart:"";if(c.hasOwnProperty("components")){i3GEO.arvoreDeTemas.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.catalogoMenus.IDSMENUS=(c.components.hasOwnProperty("idsMenus"))?c.components.idsMenus:[];i3GEO.busca.SERVICO=(c.components.hasOwnProperty("searchService"))?c.components.searchService:"";i3GEO.busca.SERVICOWMS=(c.components.hasOwnProperty("searchWms"))?c.components.searchWms:"";i3GEO.mapa.BALAOATIVO=(c.components.hasOwnProperty("info"))?c.components.info:true;if(c.components.referenceMapPosition){i3GEO.maparef.TOP=c.components.referenceMapPosition[0];i3GEO.maparef.RIGHT=c.components.referenceMapPosition[1]}if(c.components.scrollBar){i3GEO.janela.scrollBar=c.components.scrollBar}if(c.components.tooltip){var p=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP;p.removeAoAdicionar=(c.components.tooltip.hasOwnProperty("removeAoAdicionar"))?c.components.tooltip.removeAoAdicionar:true;p.autoPan=(c.components.tooltip.hasOwnProperty("autoPan"))?c.components.tooltip.autoPan:true;p.modal=(c.components.tooltip.hasOwnProperty("modal"))?c.components.tooltip.modal:false;p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:"";p.templateModal=(c.components.tooltip.hasOwnProperty("templateModal"))?c.components.tooltip.templateModal:"";p.simple=(c.components.tooltip.hasOwnProperty("simple"))?c.components.tooltip.simple:true;p.minWidth=(c.components.tooltip.hasOwnProperty("minWidth"))?c.components.tooltip.minWidth:'';p.url=(c.components.tooltip.hasOwnProperty("url"))?c.components.tooltip.url:'200px';p.autoPanAnimation=(c.components.tooltip.hasOwnProperty("autoPanAnimation"))?c.components.tooltip.autoPanAnimation:p.autoPanAnimation;if(c.components.tooltip.hasOwnProperty("toolTipSize")){i3GEO.configura.alturatip=c.components.tooltip.toolTipSize[0];i3GEO.configura.larguratip=c.components.tooltip.toolTipSize[1]}}}if(c.hasOwnProperty("openLayers")&&c.mapType!=="GM"){var d=c.openLayers;i3GEO.Interface.ATUAL="openlayers";i3GEO.Interface.openlayers.googleLike=(c.mapType=="OSM")?true:false;i3GEO.Interface.openlayers.TILES=(d.hasOwnProperty("singleTile")&&d.singleTile!="")?!d.singleTile:true;i3GEO.Interface.openlayers.parametrosMap=d.MapOptions;i3GEO.Interface.openlayers.parametrosView=d.ViewOptions;if(d.hasOwnProperty("editorButtons")&&d.editorButtons!=""){i3GEO.editor.botoes=d.editorButtons}}if(c.hasOwnProperty("googleMaps")&&c.mapType=="GM"){i3GEO.Interface.ATUAL="googlemaps";i3GEO.Interface.googlemaps.ESTILOPADRAO=c.googleMaps.MapOptions.mapTypeId;i3GEO.Interface.googlemaps.MAPOPTIONS=c.googleMaps.MapOptions}},parametrosMapa2mashuppar:function(p){var par=[],temp;if(p.hasOwnProperty("mapfilebase")&&p.mapfilebase!=""){par.push("&base="+p.mapfilebase)}if(p.hasOwnProperty("mapext")&&p.mapext!=""&&p.mapext.length==4){par.push("&mapext="+p.mapext.join(","));i3GEO.configura.guardaExtensao=false}if(p.hasOwnProperty("perfil")&&p.perfil!=""){par.push("&perfil="+p.perfil)}if(p.hasOwnProperty("layers")){if(p.layers.add&&p.layers.add.length>0){par.push("&temasa="+p.layers.add.join(","))}if(p.layers.on&&p.layers.on.length>0){par.push("&layers="+p.layers.on.join(","))}if(p.layers.off&&p.layers.off.length>0){par.push("&desligar="+p.layers.off.join(","))}if(p.layers.metaestat&&p.layers.metaestat.length>0){par.push("&metaestatids="+p.layers.metaestat.join(","))}}if(p.hasOwnProperty("points")&&p.points.coord.length>0){par.push("&nometemapontos="+p.points.title);par.push("&pontos="+p.points.coord.join(","))}if(p.hasOwnProperty("cacheOff")&&p.cacheOff=="sim"){par.push("&DESLIGACACHE=sim")}if(p.hasOwnProperty("lines")){var n=[];jQuery.each(p.lines.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemalinhas="+p.lines.title);par.push("&linhas="+n.join(","))}}if(p.hasOwnProperty("polygons")){var n=[];jQuery.each(p.polygons.coord,function(index,value){if(value.length>0){n.push(value.join(" "))}});if(n.length>0){par.push("&nometemapoligonos="+p.polygons.title);par.push("&poligonos="+n.join(","))}}if(p.hasOwnProperty("wkt")&&p.wkt.coord!=""){par.push("&nometemawkt="+p.wkt.title);par.push("&wkt="+p.wkt.coord)}if(p.hasOwnProperty("symbol")){if(p.symbol.name!=""){par.push("&simbolo="+p.symbol.name)}if(p.symbol.color!=""){par.push("&corsimbolo="+p.symbol.color)}if(p.symbol.size!=""){par.push("&tamanhosimbolo="+p.symbol.size)}}if(p.kml&&p.kml.url!=""){par.push("&kmlurl="+p.kml.url)}if(p.hasOwnProperty("wms")&&p.wms.url!=""){if(p.wms.url!=""){par.push("&url_wms="+p.wms.url)}if(p.wms.layer!=""){par.push("&layer_wms="+p.wms.layer)}if(p.wms.style!=""){par.push("&style_wms="+p.wms.style)}if(p.wms.title!=""){par.push("&nome_wms="+p.wms.title)}if(p.wms.srs!=""){par.push("&srs_wms="+p.wms.srs)}if(p.wms.imagetype!=""){par.push("&image_wms="+p.wms.imagetype)}if(p.wms.version!=""){par.push("&versao_wms="+p.wms.version)}}if(p.hasOwnProperty("filters")){var n=[];jQuery.each(p.filters,function(index,value){if(value.layer!=""){n.push("&map_layer_"+value.layer+"_filter="+value.expression)}});if(n.length>0){par.push(n.join(""))}}if(p.hasOwnProperty("restoreMapId")&&p.restoreMapId!=""){par.push("&restauramapa="+p.restoreMapId)}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width){par.push("&largura="+parseInt(temp.style.width,10))}if(temp&&temp.style&&temp.style.height){par.push("&altura="+parseInt(temp.style.height,10))}return par.join("")},cria:function(){i3GEO.scrollerWidth=i3GEO.util.getScrollerWidth();$('[data-traduzir="true"]').each(function(){this.innerHTML=Mustache.to_html(this.innerHTML,i3GEO.idioma.OBJETOIDIOMA)});var tamanho,temp;temp=window.location.href.split("?&");if(temp[1]){temp=temp[1].split("&");if(temp[0]&&temp[0]!=""&&temp.length==1){i3GEO.configura.sid=temp[0];if(i3GEO.configura.sid.split("#")[0]){i3GEO.configura.sid=i3GEO.configura.sid.split("#")[0]}}}else{i3GEO.configura.sid=""}if(i3GEO.configura.sid==='undefined'){i3GEO.configura.sid=""}i3GEO.mapa.aplicaPreferencias();if(!i3GEO.configura.locaplic||i3GEO.configura.locaplic===""){i3GEO.util.localizai3GEO()}temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.Interface.cria(parseInt(temp.style.width,10),parseInt(temp.style.height,10))}else{tamanho=i3GEO.calculaTamanho();i3GEO.Interface.cria(tamanho[0],tamanho[1])}},inicia:function(retorno){i3GEO.eventos.cliquePerm.ativoinicial=i3GEO.eventos.cliquePerm.ativo;var montaMapa,mashup,tamanho,temp;i3GEO.mapa.aplicaPreferencias();montaMapa=function(retorno){try{delete i3GEO.parametrosMapa2mashuppar;delete i3GEO.configMapa;delete i3GEO.init;var temp,nomecookie="i3geoOLUltimaExtensao",preferencias="";if(retorno.bloqueado){alert(retorno.bloqueado);return}if(retorno===""){alert("Ocorreu um erro no mapa - i3GEO.inicia.montaMapa");retorno={data:{erro:"erro"}}}if(retorno.data.erro){document.body.style.backgroundColor="white";document.body.innerHTML="<br>Para abrir o i3Geo utilize o link:<br><a href="+i3GEO.configura.locaplic+"/ms_criamapa.php >"+i3GEO.configura.locaplic+"/ms_criamapa.php</a>";return("linkquebrado")}else{if(retorno.data.variaveis){i3GEO.parametros=retorno.data.variaveis;i3GEO.parametros.mapscale=i3GEO.parametros.mapscale*1;i3GEO.parametros.mapres=i3GEO.parametros.mapres*1;i3GEO.parametros.pixelsize=i3GEO.parametros.pixelsize*1;i3GEO.parametros.w=i3GEO.parametros.w*1;i3GEO.parametros.h=i3GEO.parametros.h*1;if(retorno.data.customizacoesinit){preferencias=JSON.parse(retorno.data.customizacoesinit);temp=i3GEO.util.base64decode(preferencias.preferenciasbase64);i3GEO.mapa.aplicaPreferencias(temp)}if(i3GEO.configura.guardaExtensao===true){if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}temp=i3GEO.util.pegaCookie(nomecookie);if(temp&&temp!=""){temp=temp.replace(/[]/g," ");i3GEO.parametros.mapexten=temp}i3GEO.eventos.NAVEGAMAPA.push(function(){i3GEO.util.insereCookie(nomecookie,i3GEO.parametros.mapexten)})}if(i3GEO.parametros.logado==="nao"){i3GEO.login.anulaCookie()}i3GEO.arvoreDeCamadas.registaCamadas(retorno.data.temas);if(i3GEO.parametros.editor==="sim"){i3GEO.listaDeFerramentas=i3GEO.login.adicionaMenuSuspenso(i3GEO.listaDeFerramentas)}i3GEO.Interface.inicia();if(retorno.data.customizacoesinit){if(preferencias.geometriasbase64&&preferencias.geometriasbase64!=""){temp=i3GEO.util.base64decode(preferencias.geometriasbase64);i3GEO.mapa.desCompactaLayerGrafico(temp)}if(preferencias.graficosbase64&&preferencias.graficosbase64!=""){i3GEO.mapa.restauraGraficos(preferencias.graficosbase64)}if(preferencias.tabelasbase64&&preferencias.tabelasbase64!=""){i3GEO.mapa.restauraTabelas(preferencias.tabelasbase64)}}}else{alert("Erro. Impossivel criar o mapa "+retorno.data);return}}i3GEO.aposIniciar()}catch(e){}};if(!$i("i3geo")){document.body.id="i3geo"}temp=$i("i3geo");temp.className="yui-skin-sam";if(document.body.id==="i3geo"&&temp.style&&!temp.style.overflow&&i3GEO.Interface.ATUAL==="openlayers"){temp.style.overflow="hidden"}if(i3GEO.configura.sid===""){mashup=function(retorno){if(retorno.bloqueado){alert(retorno.bloqueado);return}i3GEO.configura.sid=retorno.data;i3GEO.inicia(retorno)};i3GEO.configura.mashuppar+="&interface="+i3GEO.Interface.ATUAL;if(i3GEO.mapa.TEMASINICIAIS.length>0){i3GEO.configura.mashuppar+="&temasa="+i3GEO.mapa.TEMASINICIAIS}if(i3GEO.mapa.TEMASINICIAISLIGADOS.length>0){i3GEO.configura.mashuppar+="&layers="+i3GEO.mapa.TEMASINICIAISLIGADOS}i3GEO.php.criamapa(mashup,i3GEO.configura.mashuppar)}else{if(i3GEO.parametros.w===""||i3GEO.parametros.h===""){tamanho=i3GEO.calculaTamanho();i3GEO.parametros.w=tamanho[0];i3GEO.parametros.h=tamanho[1]}i3GEO.php.inicia(montaMapa,i3GEO.parametros.w,i3GEO.parametros.h)}},aposIniciar:function(){if(jQuery.isFunction(i3GEO.finaliza)){i3GEO.finaliza.call()}else{if(i3GEO.finaliza!=""){eval(i3GEO.finaliza)}}i3GEO.guias.inicia();i3GEO.mapa.ativaAutoResize()},atualiza:function(retorno){var corpoMapa,erro,mapscale,temp;if(i3GEO.contadorAtualiza>1){i3GEO.contadorAtualiza--;return}if(i3GEO.contadorAtualiza>0){i3GEO.contadorAtualiza--}i3GEO.contadorAtualiza++;corpoMapa=function(){if($i("ajaxCorpoMapa")){return}i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem)};if(arguments.length===0){i3GEO.janela.fechaAguarde("ajaxCorpoMapa");corpoMapa.call();return}if(!retorno.data){alert("Ocorreu um erro ao carregar o mapa"+retorno);i3GEO.mapa.recupera.inicia();return}try{if(retorno.data==="erro"){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia();return}else if(retorno.data==="ok"||retorno.data===""){corpoMapa.call();return}}catch(e){}erro=function(){var c=confirm("Ocorreu um erro, quer tentar novamente?");if(c){corpoMapa.call()}else{i3GEO.janela.fechaAguarde()}return};if(arguments.length===0||retorno===""||retorno.data.variaveis===undefined){erro.call();return}else{if(arguments.length===0){return}i3GEO.mapa.verifica(retorno);mapscale=i3GEO.parametros.mapscale;i3GEO.atualizaParametros(retorno.data.variaveis);if(retorno.data.variaveis.erro!==""){alert(retorno.data.variaveis.erro)}temp=i3GEO.arvoreDeCamadas.converteChaveValor2normal(retorno.data.temas);try{i3GEO.arvoreDeCamadas.atualiza(temp);if(i3GEO.parametros.mapscale!==mapscale){i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale)}}catch(e){}i3GEO.arvoreDeCamadas.registaCamadas(temp);i3GEO.Interface.redesenha();if($i("mensagemt")){$i("mensagemt").value=i3GEO.parametros.mapexten}i3GEO.eventos.navegaMapa();temp=i3GEO.arvoreDeCamadas.verificaAplicaExtensao();if(temp!==""){i3GEO.tema.zoom(temp)}}},calculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=(antigoh-novoh);document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;i3GEO.parametros.w=w;i3GEO.parametros.h=h;return[w,h]},reCalculaTamanho:function(){var diminuix,diminuiy,menos,novow,novoh,w,h,temp,antigoh=i3GEO.parametros.h;temp=$i(i3GEO.Interface.IDCORPO);if(temp&&temp.style&&temp.style.width&&temp.style.height){i3GEO.parametros.w=parseInt(temp.style.width,10);i3GEO.parametros.h=parseInt(temp.style.height,10);i3GEO.eventos.resizeMapa();return[i3GEO.parametros.w,i3GEO.parametros.h]}menos=0;document.body.style.width="100%";temp=i3GEO.util.tamanhoBrowser();novow=temp[0];novoh=temp[1];temp=antigoh-novoh;document.body.style.height=novoh+"px";w=novow-menos+i3GEO.scrollerWidth;h=novoh;temp=$i(i3GEO.Interface.IDMAPA);if(temp){temp.style.height=h+"px";temp.style.width=w+"px"}i3GEO.parametros.w=w;i3GEO.parametros.h=h;temp=function(){switch(i3GEO.Interface.ATUAL){case"googlemaps":i3GEO.Interface.googlemaps.zoom2extent(i3GEO.parametros.mapexten);break;case"openlayers":i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.mapexten);i3geoOL.updateSize();if(i3GEO.Interface.openlayers.OLpanzoombar){i3GEO.Interface.openlayers.OLpanzoombar.div.style.top=i3GEO.Interface.BARRADEZOOMTOP+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=i3GEO.Interface.BARRADEZOOMLEFT+"px";i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=i3GEO.Interface.BARRADEZOOMRIGHT+"px";if(i3GEO.Interface.BARRADEZOOMLEFT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.left=null}if(i3GEO.Interface.BARRADEZOOMRIGHT===0){i3GEO.Interface.openlayers.OLpanzoombar.div.style.right=null}}break};i3GEO.guias.ALTURACORPOGUIAS=h;i3GEO.eventos.resizeMapa();return[w,h]};i3GEO.php.mudatamanho(temp,h,w)},atualizaParametros:function(variaveis){i3GEO.parametros.mapscale=variaveis.mapscale*1;i3GEO.parametros.mapres=variaveis.mapres*1;i3GEO.parametros.pixelsize=variaveis.pixelsize*1;i3GEO.parametros.mapexten=variaveis.mapexten;i3GEO.parametros.mapimagem=variaveis.mapimagem;i3GEO.parametros.w=variaveis.w*1;i3GEO.parametros.h=variaveis.h*1;i3GEO.parametros.mappath=variaveis.mappath;i3GEO.parametros.mapurl=variaveis.mapurl;if(i3GEO.login.verificaCookieLogin()){i3GEO.parametros.editor="sim"}else{i3GEO.parametros.editor="nao"}}};
210 210 //
211 211 //compactados/mustache.js
212 212 (function(global,factory){if(typeof exports==="object"&&exports){factory(exports)}else if(typeof define==="function"&&define.amd){define(['exports'],factory)}else{factory(global.Mustache={})}}(this,function(mustache){var Object_toString=Object.prototype.toString;var isArray=Array.isArray||function(object){return Object_toString.call(object)==='[object Array]'};function isFunction(object){return typeof object==='function'}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var RegExp_test=RegExp.prototype.test;function testRegExp(re,string){return RegExp_test.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':'&quot;',"'":'&#39;',"/":'&#x2F;'};function escapeHtml(string){return String(string).replace(/[&<>"'\/]/g,function(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tags){if(typeof tags==='string')tags=tags.split(spaceRe,2);if(!isArray(tags)||tags.length!==2)throw new Error('Invalid tags: '+tags);openingTagRe=new RegExp(escapeRegExp(tags[0])+'\\s*');closingTagRe=new RegExp('\\s*'+escapeRegExp(tags[1]));closingCurlyRe=new RegExp('\\s*'+escapeRegExp('}'+tags[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i<valueLength;++i){chr=value.charAt(i);if(isWhitespace(chr)){spaces.push(tokens.length)}else{nonSpace=true}tokens.push(['text',chr,start,start+1]);start+=1;if(chr==='\n')stripSpace()}}if(!scanner.scan(openingTagRe))break;hasTag=true;type=scanner.scan(tagRe)||'name';scanner.scan(whiteRe);if(type==='='){value=scanner.scanUntil(equalsRe);scanner.scan(equalsRe);scanner.scanUntil(closingTagRe)}else if(type==='{'){value=scanner.scanUntil(closingCurlyRe);scanner.scan(curlyRe);scanner.scanUntil(closingTagRe);type='&'}else{value=scanner.scanUntil(closingTagRe)}if(!scanner.scan(closingTagRe))throw new Error('Unclosed tag at '+scanner.pos);token=[type,value,start,scanner.pos];tokens.push(token);if(type==='#'||type==='^'){sections.push(token)}else if(type==='/'){openSection=sections.pop();if(!openSection)throw new Error('Unopened section "'+value+'" at '+start);if(openSection[1]!==value)throw new Error('Unclosed section "'+openSection[1]+'" at '+start)}else if(type==='name'||type==='{'||type==='&'){nonSpace=true}else if(type==='='){compileTags(value)}}openSection=sections.pop();if(openSection)throw new Error('Unclosed section "'+openSection[1]+'" at '+scanner.pos);return nestTokens(squashTokens(tokens))}function squashTokens(tokens){var squashedTokens=[];var token,lastToken;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];if(token){if(token[0]==='text'&&lastToken&&lastToken[0]==='text'){lastToken[1]+=token[1];lastToken[3]=token[3]}else{squashedTokens.push(token);lastToken=token}}}return squashedTokens}function nestTokens(tokens){var nestedTokens=[];var collector=nestedTokens;var sections=[];var token,section;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];switch(token[0]){case'#':case'^':collector.push(token);sections.push(token);collector=token[4]=[];break;case'/':section=sections.pop();section[5]=token[2];collector=sections.length>0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function(){return this.tail===""};Scanner.prototype.scan=function(re){var match=this.tail.match(re);if(!match||match.index!==0)return'';var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view==null?{}:view;this.cache={'.':this.view};this.parent=parentContext}Context.prototype.push=function(view){return new Context(view,this)};Context.prototype.lookup=function(name){var cache=this.cache;var value;if(name in cache){value=cache[name]}else{var context=this,names,index;while(context){if(name.indexOf('.')>0){value=context.view;names=name.split('.');index=0;while(value!=null&&index<names.length)value=value[names[index++]]}else{value=context.view[name]}if(value!=null)break;context=context.parent}cache[name]=value}if(isFunction(value))value=value.call(this.view);return value};function Writer(){this.cache={}}Writer.prototype.clearCache=function(){this.cache={}};Writer.prototype.parse=function(template,tags){var cache=this.cache;var tokens=cache[template];if(tokens==null)tokens=cache[template]=parseTemplate(template,tags);return tokens};Writer.prototype.render=function(template,view,partials){var tokens=this.parse(template);var context=(view instanceof Context)?view:new Context(view);return this.renderTokens(tokens,context,partials,template)};Writer.prototype.renderTokens=function(tokens,context,partials,originalTemplate){var buffer='';var self=this;function subRender(template){return self.render(template,context,partials)}var token,value;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];switch(token[0]){case'#':value=context.lookup(token[1]);if(!value)continue;if(isArray(value)){for(var j=0,valueLength=value.length;j<valueLength;++j){buffer+=this.renderTokens(token[4],context.push(value[j]),partials,originalTemplate)}}else if(typeof value==='object'||typeof value==='string'){buffer+=this.renderTokens(token[4],context.push(value),partials,originalTemplate)}else if(isFunction(value)){if(typeof originalTemplate!=='string')throw new Error('Cannot use higher-order sections without the original template');value=value.call(context.view,originalTemplate.slice(token[3],token[5]),subRender);if(value!=null)buffer+=value}else{buffer+=this.renderTokens(token[4],context,partials,originalTemplate)}break;case'^':value=context.lookup(token[1]);if(!value||(isArray(value)&&value.length===0))buffer+=this.renderTokens(token[4],context,partials,originalTemplate);break;case'>':if(!partials)continue;value=isFunction(partials)?partials(token[1]):partials[token[1]];if(value!=null)buffer+=this.renderTokens(this.parse(value),context,partials,value);break;case'&':value=context.lookup(token[1]);if(value!=null)buffer+=value;break;case'name':value=context.lookup(token[1]);if(value!=null)buffer+=mustache.escape(value);break;case'text':buffer+=token[1];break}}return buffer};mustache.name="mustache.js";mustache.version="0.8.1";mustache.tags=["{{","}}"];var defaultWriter=new Writer();mustache.clearCache=function(){return defaultWriter.clearCache()};mustache.parse=function(template,tags){return defaultWriter.parse(template,tags)};mustache.render=function(template,view,partials){return defaultWriter.render(template,view,partials)};mustache.to_html=function(template,view,partials,send){var result=mustache.render(template,view,partials);if(isFunction(send)){send(result)}else{return result}};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context;mustache.Writer=Writer}));
... ...
js/ini_i3geo.js
... ... @@ -412,6 +412,9 @@ var i3GEO = {
412 412 if(p.layers.off && p.layers.off.length > 0){
413 413 par.push("&desligar="+p.layers.off.join(","));
414 414 }
  415 + if(p.layers.metaestat && p.layers.metaestat.length > 0){
  416 + par.push("&metaestatids="+p.layers.metaestat.join(","));
  417 + }
415 418 }
416 419 if(p.hasOwnProperty("points") && p.points.coord.length > 0){
417 420 par.push("&nometemapontos="+p.points.title);
... ...
ms_criamapa.php
... ... @@ -256,6 +256,7 @@ if(empty($base) &amp;&amp; !empty($parurl[&quot;base&quot;])){
256 256 }
257 257  
258 258 ms_ResetErrorList();
  259 +$metaestatids = @$parurl["metaestatids"];
259 260 $temasa = @$parurl["temasa"];
260 261 $layers = @$parurl["layers"];
261 262 $desligar = @$parurl["desligar"];
... ... @@ -819,7 +820,7 @@ Inclui os temas definidos na vari&amp;aacute;vel $temasa
819 820 Os temas devem estar em i3geo/temas
820 821 */
821 822 function incluiTemasIniciais(){
822   - global $temasa,$mapn,$locaplic;
  823 + global $temasa,$mapn,$locaplic,$metaestatids,$layers;
823 824 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'){
824 825 $temasdir = $locaplic."\\temas";
825 826 }
... ... @@ -831,6 +832,53 @@ function incluiTemasIniciais(){
831 832 }
832 833 $temasa = str_replace(','," ",$temasa);
833 834 $alayers = explode(" ",$temasa);
  835 + if(isset($metaestatids)){
  836 + //localhost/i3geo/ms_criamapa.php?metaestatids=25,12&layers=25
  837 + include_once (dirname(__FILE__) . "/classesphp/classe_metaestatinfo.php");
  838 + $metaestatids = str_replace(','," ",$metaestatids);
  839 + $metaestatids = explode(" ",$metaestatids);
  840 + $metaestatidsligados = $layers;
  841 + $metaestatidsligados = str_replace(','," ",$metaestatidsligados);
  842 + $metaestatidsligados = explode(" ",$metaestatidsligados);
  843 + foreach($metaestatids as $metaestatid){
  844 + //$_pg["filtro"] = str_replace('"', "'", $_pg["filtro"]);
  845 + $m = new MetaestatInfo();
  846 +
  847 + $parametros = $m->listaParametro($metaestatid,"","",true,true);
  848 + //id_parametro_medida,coluna
  849 + $filtroPar = array();
  850 + foreach($parametros as $parametro){
  851 + $valoresparametro = $m->valorUnicoMedidaVariavel($metaestatid,$parametro["coluna"]);
  852 + $valormaior = $valoresparametro[count($valoresparametro) - 1];
  853 + $filtroPar[] = " ".$parametro["coluna"] . "::text = '" . $valormaior[$parametro["coluna"]] . "' ";
  854 + }
  855 + //var_dump($filtroPar);exit;
  856 + $mapfilemetaestat = $m->mapfileMedidaVariavel(
  857 + $metaestatid,
  858 + implode(" AND ",$filtroPar),
  859 + 0,
  860 + "polygon",
  861 + "",
  862 + "",
  863 + "",
  864 + "",
  865 + "",
  866 + false,
  867 + false
  868 + );
  869 + //array(3) { ["mapfile"]=> string(52) "/tmp/ms_tmp/AAAAc20ad4d76fe97759aa27a0c99bff6710.map" ["layer"]=> string(36) "AAAAc20ad4d76fe97759aa27a0c99bff6710" ["titulolayer"]=> string(0) "" }
  870 + //var_dump ($mapfilemetaestat);
  871 + //exit;
  872 + array_push($alayers,$mapfilemetaestat["mapfile"]);
  873 +
  874 + if(in_array($metaestatid,$metaestatidsligados)){
  875 + $maptemp = @ms_newMapObj($mapfilemetaestat["mapfile"]);
  876 + $maptemp->getlayerbyname($mapfilemetaestat["layer"])->set("status",MS_DEFAULT);
  877 + $maptemp->save($mapfilemetaestat["mapfile"]);
  878 + }
  879 + }
  880 + }
  881 +
834 882 $existeraster = false;
835 883 foreach ($alayers as $arqt) {
836 884 $arqtemp = "";
... ... @@ -854,7 +902,7 @@ function incluiTemasIniciais(){
854 902 $arqtemp = $temasdir."/".$arqt.$extensao;
855 903 }
856 904 if($arqtemp == ""){
857   - echo "<br>Imposs&iacute;vel acessar tema $arqtemp";
  905 + //echo "<br>Imposs&iacute;vel acessar tema $arqtemp";
858 906 }
859 907 else{
860 908 if ($extensao == ".map" && !@ms_newMapObj($arqtemp)){
... ...