if(!i3GEO||typeof(i3GEO)==='undefined'){var i3GEO={};i3GEO.Interface={};navn=false;navm=false;$i=function(id){return document.getElementById(id)};app=navigator.appName.substring(0,1);if(app==='N'){navn=true}else{navm=true}OpenLayers.ImgPath="../pacotes/openlayers/img/";OpenLayers.Lang.setCode("pt-BR")}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:2,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}),nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",e_oce:new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © ArcGIS'}),e_ims:new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © ArcGIS'}),e_wsm:new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false,attribution:'Tiles © ArcGIS'}),ol_mma:new OpenLayers.Layer.WMS("Base cartográfica","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",{layers:'baseraster',SRS:'EPSG:4618',FORMAT:'image/png'},{singleTile:false}),top_wms:new OpenLayers.Layer.WMS("Toponímia MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",{layers:"base",FORMAT:'image/png'}),est_wms:new OpenLayers.Layer.WMS("Estados do Brasil","http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",{layers:"estadosl",FORMAT:'image/png'}),osm:new OpenLayers.Layer.OSM("OSM","http://tile.openstreetmap.org/${z}/${x}/${y}.png",{isBaseLayer:true,visibility:false}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':true,'distancia':true,'area':true,'identifica':true,'linha':true,'ponto':true,'poligono':true,'texto':true,'edita':true,'listag':true,'corta':true,'apaga':true,'procura':true,'selecao':true,'selecaotudo':true,'salva':true,'ajuda':true,'propriedades':true,'fecha':false,'tools':true,'undo':false,'frente':false,'legenda':true,'rodadomouse':true,'novaaba':false},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.LayerSwitcher({'ascending':false}),new OpenLayers.Control.ScaleLine(),new OpenLayers.Control.MousePosition({'separator':' '}),new OpenLayers.Control.OverviewMap(),new OpenLayers.Control.KeyboardDefaults(),new OpenLayers.Control.Attribution()],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081),mapa:"",inicia:function(){var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n,temp;if(i3GEO.editorOL.ativalayerswitcher==="false"){i3GEO.editorOL.ativalayerswitcher=false}if(i3GEO.editorOL.ativalayerswitcher==="true"){i3GEO.editorOL.ativalayerswitcher=true}if(i3GEO.editorOL.ativarodadomouse==="false"){i3GEO.editorOL.ativarodadomouse=false}if(i3GEO.editorOL.ativarodadomouse==="true"){i3GEO.editorOL.ativarodadomouse=true}if(i3GEO.editorOL.legendahtml==="false"){i3GEO.editorOL.legendahtml=false}if(i3GEO.editorOL.legendahtml==="true"){i3GEO.editorOL.legendahtml=true}if(i3GEO.editorOL.incluilayergrafico==="false"){i3GEO.editorOL.incluilayergrafico=false}if(i3GEO.editorOL.incluilayergrafico==="true"){i3GEO.editorOL.incluilayergrafico=true}if(i3GEO.editorOL.incluilayergrafico===true){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}}else{i3GEO.desenho.layergrafico="";i3GEO.editorOL.botoes.linha=false;i3GEO.editorOL.botoes.ponto=false;i3GEO.editorOL.botoes.poligono=false;i3GEO.editorOL.botoes.texto=false;i3GEO.editorOL.botoes.edita=false;i3GEO.editorOL.botoes.listag=false;i3GEO.editorOL.botoes.corta=false;i3GEO.editorOL.botoes.apaga=false;i3GEO.editorOL.botoes.selecao=false;i3GEO.editorOL.botoes.selecaotudo=false;i3GEO.editorOL.botoes.salva=false;i3GEO.editorOL.botoes.propriedades=false;i3GEO.editorOL.botoes.fecha=false;i3GEO.editorOL.botoes.tools=false;i3GEO.editorOL.botoes.undo=false;i3GEO.editorOL.botoes.frente=false;i3GEO.editorOL.botoes.novaaba=false}if(i3GEO.editorOL.mapa===""){alert("O objeto i3GEO.editorOL.mapa nao existe. Precisa ser criado com new OpenLayers.Map()");return}for(i=0;i=0;i--){if(fundo[i]!=""){try{i3GEO.editorOL[fundo[i]].transitionEffect='resize';i3GEO.editorOL[fundo[i]].setVisibility(false);i3GEO.editorOL[fundo[i]].singleTile=false;alayers.push(i3GEO.editorOL[fundo[i]])}catch(e){if(alayers[0]){alayers[0].setVisibility(true)}}}}}i3GEO.editorOL.mapa.addLayers(alayers);if(i3GEO.editorOL.layersIniciais!==""){n=i3GEO.editorOL.layersIniciais.length;for(i=0;i0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"
Lat: "+d[1]}catch(e){}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="";ins="
"+$trad("a7")+":
"+combo;ins+="
"+$trad("x64")+":
";ins+="
"+$trad("t23")+":
";ins+="

";ins+="
'"+$trad("result")+"':
";try{YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}}catch(e){}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",temp,combo="";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo);document.getElementById("i3GEOOLlistaTemasAtivos").onchange=function(){if(botaoIdentifica){botaoIdentifica.layers=[i3GEO.editorOL.layersLigados()[this.value]]}}},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo
")}else{YAHOO.temaativo.container.panel.setHeader($trad("tativo"))}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEOpanelEditor.deactivate();i3GEOpanelEditor.activate();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter="+item+"*"+palavra+"*";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,ins="",i,icone="",url,fers,f="",fer="";for(i=0;i

";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");var config={method:"GET",url:url,callback:f};OpenLayers.Request.issue(config)}else{ins+=layers[i].name+"

"}}}catch(e){}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader($trad("p3"));YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){YAHOO.legendaeditorOL.container.panel.destroy()})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(lonlat){var d=0.1,layers=[i3GEO.editorOL.layerAtivo()],xy=lonlat.split(","),u=layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS;if(i3GEO.Interface.openlayers.googleLike===true){u+="&SRS=EPSG:3857"}u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;var poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=Geometry"+poligono+"";document.body.style.cursor="wait";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="wait"}OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}var i,n,f,fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText);n=gml.length;for(i=0;i0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.salvaGeometrias.container.panel.setHeader($trad("u6"));YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}ins+="

"+n+" "+$trad("geosel")+"

";ins+="

"+$trad("listar")+"  ";if(i3GEO.editorOL.nomeFuncaoSalvar&&i3GEO.editorOL.nomeFuncaoSalvar!=""){ins+=""+$trad("sdados")+"  "}if(typeof i3geoOL!=="undefined"){ins+=""+$trad("incorpo")+"

";ins+="

"+$trad("ajudaEditorOlSalva")+"

"}YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{i3GEO.janela.tempoMsg($trad("selum"))}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="",i,a,w,g;for(i=0;i"+$trad("u6")+": "+i+"
"+i3GEO.editorOL.google2wgs(g.geometry)+"

";ins+=""+$trad("atrib")+": "+i+"
";a=g.attributes;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"
"}}if(g.attributes.registros){ins+=""+$trad("reg")+": "+i+"
";a=g.attributes.registros;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"
"}}}ins+="
"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,funcaoOK=function(){if(geos[0].geometry){var registros="",valorunico="",nometema=$i("editorOLcomboTemaEditavel").value,key="",tema,redesenha,p,g=i3GEO.editorOL.google2wgs(geos[0].geometry);if(nometema==""){return}tema=i3GEO.arvoreDeCamadas.pegaTema(nometema,"","name");if(geos[0].attributes.registros){registros=geos[0].attributes.registros;for(key in registros){if(registros[key]&&key==tema.colunaidunico){valorunico=registros[key]}}}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);i3GEO.Interface.atualizaTema("",nometema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto",$trad("adic")+"...");i3GEO.janela.AGUARDEMODAL=false;if(valorunico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g)}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g)}}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto=$trad("stema")+":


";if(n!=1){i3GEO.janela.tempoMsg($trad("seluma"))}else{i3GEO.janela.confirma(texto,300,$trad("salva"),$trad("canc"),funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},criaBotoes:function(botoes){var sketchSymbolizers={"Point":{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#666666",strokeDashstyle:"dash"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}},style=new OpenLayers.Style(),styleMap=new OpenLayers.StyleMap({"default":style,"vertex":{strokeOpacity:1,strokeWidth:1,fillColor:"white",fillOpacity:0.45,pointRadius:3}},{extendDefault:false}),adiciona=false,button,controles=[];style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);i3GEOpanelEditor=new OpenLayers.Control.Panel({displayClass:"olControlEditingToolbar1 noprint",saveState:false,activateControl:function(c){this.deactivate();this.activate();try{i3GEO.editorOL.ModifyFeature.deactivate();if(i3GEO&&i3GEO.barraDeBotoes){i3GEO.barraDeBotoes.ativaPadrao()}}catch(e){}if(!c.trigger){c.activate()}else{c.trigger.call()}}});if(botoes.novaaba===true){button=new OpenLayers.Control.Button({displayClass:"editorOLnovaaba",trigger:function(){window.open(window.location,'_blank')},title:$trad("novaaba"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.procura===true){button=new OpenLayers.Control.Button({displayClass:"editorOLprocura",trigger:function(){YAHOO.procura.container.panel.show()},title:$trad("t23"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.pan===true){controles.push(new OpenLayers.Control.Navigation({title:"pan",displayClass:"editorOLpan",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoombox===true){controles.push(new OpenLayers.Control.ZoomBox({title:"zoombox",displayClass:"editorOLzoombox",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoomtot===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomtot",trigger:function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.editorOL.mapa.zoomToExtent(i3GEO.editorOL.mapext)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}},title:$trad("d2t"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomin===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomin",trigger:function(){i3GEO.editorOL.mapa.zoomIn()},title:$trad("d5t"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomout===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomout",trigger:function(){i3GEO.editorOL.mapa.zoomOut()},title:$trad("d6t"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.legenda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlegenda",trigger:function(){i3GEO.editorOL.mostraLegenda()},title:$trad("p3"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.distancia===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLdistancia",title:$trad("d21t"),type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units,measure=event.measure;alert($trad("d21t")+": "+measure.toFixed(3)+" "+units)}});controles.push(button);adiciona=true}if(botoes.area===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLarea",title:$trad("d21at"),type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units;var measure=event.measure;alert($trad("d21at")+": "+measure.toFixed(3)+" "+units+"2")}});controles.push(button);adiciona=true}if(botoes.identifica===true){botaoIdentifica=new OpenLayers.Control.WMSGetFeatureInfo({maxFeatures:1,infoFormat:'text/plain',layers:[i3GEO.editorOL.layerAtivo()],queryVisible:true,title:$trad("d7t"),type:OpenLayers.Control.TYPE_TOOL,displayClass:"editorOLidentifica",eventListeners:{getfeatureinfo:function(event){var lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),lonlattexto="
",formata;if(botoes.linha===true||botoes.ponto===true||botoes.poligono===true||botoes.edita===true){lonlattexto+="
edita geometria

"}formata=function(texto){var temp,temp1,n,i,f=[],textoN=texto.split(":");try{if(textoN.length>1){temp=textoN[2].replace(/\n\r/g,"");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.replace(/=/g,":");temp=temp.split("|");n=temp.length;for(i=0;i
")}}catch(e){}return texto};i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("chicken",i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),null,"
"+lonlattexto+"
"+formata(event.text)+"
",null,true));i3GEO.editorOL.removeClone()},beforegetfeatureinfo:function(event){var ativo=[i3GEO.editorOL.layerAtivo()];if(ativo[0].serviceVersion==="&tms="||ativo[0].CLASS_NAME=="OpenLayers.Layer.TMS"||ativo[0].CLASS_NAME=="OpenLayers.Layer.OSM"){ativo=[i3GEO.editorOL.layertms2wms(ativo[0])]}ativo[0].projection=new OpenLayers.Projection("EPSG:4326");event.object.layers=ativo;botaoIdentifica.layers=ativo;botaoIdentifica.url=ativo[0].url},activate:function(){i3GEO.editorOL.criaJanelaAtivaTema()}}});controles.push(botaoIdentifica);adiciona=true}if(botoes.linha===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Path,{displayClass:"editorOLlinha",title:$trad("dlinha"),type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.ponto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLponto",title:$trad("dponto"),type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f,style_mark;if(i3GEO.editorOL.simbologia.externalGraphic!=""){style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=i3GEO.editorOL.simbologia.externalGraphic;style_mark.graphicWidth=i3GEO.editorOL.simbologia.graphicWidth;style_mark.graphicHeight=i3GEO.editorOL.simbologia.graphicHeight;style_mark.fillOpacity=i3GEO.editorOL.simbologia.opacidade;f=new OpenLayers.Feature.Vector(feature,null,style_mark)}else{f=new OpenLayers.Feature.Vector(feature)}f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,externalGraphic:i3GEO.editorOL.simbologia.externalGraphic,graphicHeight:i3GEO.editorOL.simbologia.graphicHeight,graphicWidth:i3GEO.editorOL.simbologia.graphicWidth};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.poligono===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLpoligono",title:$trad("dpol"),type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.texto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLtexto",title:$trad("dtexto"),type:OpenLayers.Control.TYPE_TOOL,persist:true,callbacks:{done:function(feature){var texto=window.prompt("Texto",""),label=new OpenLayers.Feature.Vector(feature);label["attributes"]={opacidade:0.1,fillColor:"white",strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,texto:texto,pointRadius:2,graphicName:"square",strokeColor:"black",fontColor:i3GEO.editorOL.simbologia.fontColor,fontSize:i3GEO.editorOL.simbologia.fontSize,fontFamily:"Arial",fontWeight:"bold",labelAlign:"rt"};if(texto&&texto!==""){i3GEO.desenho.layergrafico.addFeatures([label])}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEO.editorOL.CortaFeature=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLcorta",title:$trad("cortaf"),type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length!=1){alert("Selecione primeiro um elemento para ser cortado");i3GEO.editorOL.CortaFeature.deactivate()}else{i3GEO.editorOL.CortaFeature.activate()}},callbacks:{done:function(feature){var temp,sel=i3GEO.desenho.layergrafico.selectedFeatures[0].geometry,corta=feature;temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,sel+"|"+corta,"difference")}}});controles.push(i3GEO.editorOL.CortaFeature);adiciona=true}if(botoes.edita===true){i3GEO.editorOL.ModifyFeature=new OpenLayers.Control.ModifyFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLedita",title:$trad("modf"),type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,mode:OpenLayers.Control.ModifyFeature.RESHAPE,standalone:false,createVertices:true,styleMap:"default",vertexRenderIntent:"vertex"});controles.push(i3GEO.editorOL.ModifyFeature);adiciona=true}if(botoes.edita===true&&botoes.listag===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlistag",trigger:function(){i3GEO.editorOL.listaGeometrias()},title:$trad("listag"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.frente===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfrente",trigger:function(){i3GEO.editorOL.trazParaFrente();if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},title:$trad("frente"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.tools===true&&i3GEO.php){button=new OpenLayers.Control.Button({displayClass:"editorOLtools",trigger:function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}},title:$trad("u15a"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.selecao===true){i3GEO.editorOL.selbutton=new OpenLayers.Control.SelectFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLselecao",title:$trad("d24t"),type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,multiple:false,hover:false,toggleKey:"ctrlKey",multipleKey:"shiftKey",box:false});controles.push(i3GEO.editorOL.selbutton);adiciona=true}if(botoes.selecaotudo===true){button=new OpenLayers.Control.Button({displayClass:"editorOLselecaoTudo",trigger:function(){var fs=i3GEO.desenho.layergrafico.features,n=fs.length,i;for(i=0;i0){var x=window.confirm($trad("excsel")+"?");if(x){i3GEO.editorOL.guardaBackup();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}if(typeof i3geoOL!=="undefined"){i3GEO.janela.tempoMsg($trad("meneditor1"))}}}else{i3GEO.janela.tempoMsg($trad("seluma"))}},title:$trad("excsel"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.propriedades===true){button=new OpenLayers.Control.Button({displayClass:"editorOLpropriedades",trigger:function(){i3GEO.editorOL.propriedades()},title:$trad("p13"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.salva===true){button=new OpenLayers.Control.Button({displayClass:"editorOLsalva",trigger:function(){i3GEO.editorOL.salvaGeometrias()},title:$trad("salva"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.ajuda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLajuda",trigger:function(){try{window.open(i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php")}catch(e){window.open("openlayers_ajuda.php")}},title:$trad("s1"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.fecha===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfecha",trigger:function(){var temp=window.confirm($trad("x94"));if(i3GEO.eventos){i3GEO.eventos.cliquePerm.ativa()}i3GEOpanelEditor.destroy();try{YAHOO.temaativo.container.panel.destroy()}catch(e){}try{YAHOO.procura.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.listaGeometrias.panel.destroy()}catch(e){}try{YAHOO.editorOL.ferramentas.panel.destroy()}catch(e){}try{YAHOO.legendaeditorOL.container.panel.destroy()}catch(e){}try{YAHOO.salvaGeometrias.container.panel.destroy()}catch(e){}if(temp===true){try{if(i3GEO.desenho.layergrafico){i3GEO.editorOL.mapa.removeLayer(i3GEO.desenho.layergrafico);delete(i3GEO.desenho.layergrafico)}if(i3GEO.editorOL.backup){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.backup);delete(i3GEO.editorOL.backup)}}catch(e){}}},title:$trad("x74"),type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}i3GEOOLsnap=new OpenLayers.Control.Snapping({layer:i3GEO.desenho.layergrafico});i3GEOOLsplit=new OpenLayers.Control.Split({layer:i3GEO.desenho.layergrafico,source:i3GEO.desenho.layergrafico,tolerance:0.0001,eventListeners:{beforesplit:function(event){i3GEO.editorOL.guardaBackup()},aftersplit:function(event){i3GEO.editorOL.flashFeatures(event.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}}});if(adiciona===true){i3GEOpanelEditor.addControls(controles);i3GEO.editorOL.mapa.addControl(i3GEOpanelEditor)}},mudaSimbolo:function(estilo,id){var valor=$i(id).value,geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,i;i3GEO.editorOL.simbologia[estilo]=valor;for(i=0;iEstilos (utilize a cor no formato r,g,b):

'+''+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
Cor do contorno';if(i3GEO.configura){ins+='aquarela.gif'}ins+=""+'
Cor do preenchimento';if(i3GEO.configura){ins+='aquarela.gif'}ins+=""+'
Cor da fonte';if(i3GEO.configura){ins+='aquarela.gif'}ins+=""+'
Tamanho da fonte
Opacidade (de 0 a 1)
Largura da linha/contorno
Url de uma figura
Largura e altura 
'+'
'+'

Ajusta nó em edição para o(a):

'+''+' '+' '+' '+' '+' '+' '+' '+' '+'
vérticeborda
'+'
'+'

Divide intersecção ao digitalizar

'+''+' '+' '+' '+'
borda
'+'
'+'

Operação ativada pelo botão de modificação da figura

'+''+' '+' '+' '+' '+' '+' '+' '+' '+'
altera figuraaltera tamanho
rotacionadesloca
';YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades
")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});temp=$i("panelpropriedadesEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelpropriedadesEditor")}}}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{zIndex:20000,iframe:true,width:"320px",visible:false,draggable:true,close:true});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader($trad("u6")+"
")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader($trad("u6"))}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()});temp=$i("panellistagEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panellistagEditor")}}}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var g,temp,geos=i3GEO.desenho.layergrafico.features,n=geos.length,ins="";ins+="";while(n>0){n-=1;g=geos[n].geometry;ins+=""}ins+="
"+$trad("u6")+""+$trad("opcoes")+"
"+g.CLASS_NAME+"selecionalimpabrilha
";if(geos.length===0){ins=$trad("meneditor2")}YAHOO.editorOL.listaGeometrias.panel.show();if(i3GEO.configura){temp=$i("panellistagEditor").getElementsByTagName("div")[2]}else{temp=$i("panellistagEditor").getElementsByTagName("div")[1]}temp.style.overflow="auto";temp.style.height="100px";temp.innerHTML=ins},ferramentas:function(){if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true});var ins=""+'

'+$trad("opsel")+':

'+''+'

Apaga tudo';YAHOO.editorOL.ferramentas.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas
")}else{YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas")}YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){});temp=$i("panelferramentasEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelferramentasEditor")}}}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i0){polis=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point");temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.merge(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}return}else{i3GEO.janela.tempoMsg("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i;w.read(geoms[0].toString());if(n>1){for(i=1;i1){uniao=(fwkt.read(geoms[0]).geometry).toString();uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=(fwkt.read(geoms[i]).geometry).toString();uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.read(uniao)]}else{return false}},retornaGeometriasTipo:function(features,tipo){var n=features.length,lista=[],i,temp;for(i=0;i0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(wkt){i3GEO.editorOL.guardaBackup();try{var f,fwkt=new OpenLayers.Format.WKT();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);f=fwkt.read(wkt);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}catch(e){i3GEO.editorOL.restauraBackup()}},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(index){i3GEO.editorOL.selbutton.select(i3GEO.desenho.layergrafico.features[index])},unselFeature:function(index){i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[index])},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var features=i3GEO.desenho.layergrafico.selectedFeatures;if(features.length>0){i3GEO.editorOL.backup=new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false});i3GEO.editorOL.backup.addFeatures(features);i3GEO.editorOL.unselTodosBackup();i3GEO.desenho.layergrafico.removeFeatures(features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}else{i3GEO.janela.tempoMsg("Selecione pelo menos um elemento")}},pegaControle:function(classe){var n=i3GEO.editorOL.controles.length,i;for(i=0;i