From 0ec23f65328a4dcc34c8ae33160b35f4c8001c2f Mon Sep 17 00:00:00 2001
From: Edmar Moretti
Date: Mon, 11 May 2009 18:56:26 +0000
Subject: [PATCH] Correção na ferramenta de conexão com WMS
---
aplicmap/legenda3.htm | 1 +
classesjs/classe_arvoredecamadas.js | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
classesjs/compactados/classe_arvoredecamadas_compacto.js | 2 +-
classesjs/i3geo_tudo_compacto.js | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
classesjs/i3geo_tudo_compacto.js.php | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
classesphp/wmswfs.php | 43 ++++++++++++++++++++++---------------------
exemplos/camadas1.htm | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exemplos/camadas2.htm | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exemplos/camadas3.htm | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exemplos/camadas4.htm | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exemplos/index.html | 5 +++++
ferramentas/conectarwms/index.js | 2 ++
menutemas/admin.db | Bin 53248 -> 0 bytes
ogc.php | 14 +++++++++++++-
14 files changed, 958 insertions(+), 98 deletions(-)
create mode 100644 aplicmap/legenda3.htm
create mode 100644 exemplos/camadas1.htm
create mode 100644 exemplos/camadas2.htm
create mode 100644 exemplos/camadas3.htm
create mode 100644 exemplos/camadas4.htm
diff --git a/aplicmap/legenda3.htm b/aplicmap/legenda3.htm
new file mode 100644
index 0000000..78b3d51
--- /dev/null
+++ b/aplicmap/legenda3.htm
@@ -0,0 +1 @@
+[leg_layer_html opt_flag=1][if name=legendawms oper=isset ] |
[/if][/leg_layer_html][leg_class_html][if name=CLASSE oper=neq value=NAO]  | [leg_class_name] |
[/if][/leg_class_html]
\ No newline at end of file
diff --git a/classesjs/classe_arvoredecamadas.js b/classesjs/classe_arvoredecamadas.js
index fa43259..67645e8 100644
--- a/classesjs/classe_arvoredecamadas.js
+++ b/classesjs/classe_arvoredecamadas.js
@@ -41,6 +41,30 @@ Exemplos:
*/
i3GEO.arvoreDeCamadas = {
/*
+ Property: EXPANDIDA
+
+ Indica se a árvore será montada de forma expandida ou não. Se true, os nós do primeiro nível serão abertos na inicialização da árvore.
+
+ Default:
+ {false}
+
+ Type:
+ {Boolena}
+ */
+ EXPANDIDA: false,
+ /*
+ Property: LEGENDAEXPANDIDA
+
+ Indica se a legenda da árvore será montada de forma expandida ou não.
+
+ Default:
+ {false}
+
+ Type:
+ {Boolena}
+ */
+ LEGENDAEXPANDIDA: false,
+ /*
Property: ATIVATEMA
Nome da função que será incluída no evento onclick do elemento checkbox adicionado no início do nome de um tema.
@@ -50,6 +74,18 @@ i3GEO.arvoreDeCamadas = {
*/
ATIVATEMA: "",
/*
+ Property: OPCOESICONES
+
+ Inclui ou não os ícones de opções em cada tema (farol, zoom para o tema, etc)
+
+ Default:
+ {true}
+
+ Type:
+ {boolean}
+ */
+ OPCOESICONES: true,
+ /*
Property: OPCOESTEMAS
Inclui ou não o nó com as opções de manipulação de cada tema.
@@ -227,7 +263,7 @@ i3GEO.arvoreDeCamadas = {
for (var i=0, j=c; i i3GEO.parametros.mapscale*1){
- var farol = "maisvermelho.png";
- var mfarol = $trad("t10");
- }
- if (ltema.escala == 0){
- var farol = "maisamarelo.png";
- var mfarol = $trad("t11");
+ if(i3GEO.arvoreDeCamadas.OPCOESICONES == true){
+ var farol = "maisamarelo.png";
+ if (ltema.escala*1 < i3GEO.parametros.mapscale*1){
+ var farol = "maisverde.png";
+ var mfarol = $trad("t9");
+ }
+ if (ltema.escala*1 > i3GEO.parametros.mapscale*1){
+ var farol = "maisvermelho.png";
+ var mfarol = $trad("t10");
+ }
+ if (ltema.escala == 0){
+ var farol = "maisamarelo.png";
+ var mfarol = $trad("t11");
+ }
+ tnome = "
";
+ tnome += "
";
+ tnome += "
";
+ tnome += "
";
+ //a operação de zoom para o tema não funciona na interface flamingo
+ if( (ltema.zoomtema == "sim") && (!$i("flamingo")))
+ {tnome += "
";}
+ var d = {html:tnome};
+ var iconesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
+ iconesNode.isLeaf = true;
}
- tnome = "
";
- tnome += "
";
- tnome += "
";
- tnome += "
";
- //a operação de zoom para o tema não funciona na interface flamingo
- if( (ltema.zoomtema == "sim") && (!$i("flamingo")))
- {tnome += "
";}
- var d = {html:tnome};
- var iconesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
- iconesNode.isLeaf = true;
if(i3GEO.arvoreDeCamadas.OPCOESTEMAS == true){
var conteudo = $trad("t18a");
var d = {html:conteudo,idopcoes:ltema.name};
@@ -404,7 +442,7 @@ i3GEO.arvoreDeCamadas = {
if(i3GEO.arvoreDeCamadas.OPCOESLEGENDA == true){
var conteudo = $trad("p3");
var d = {html:conteudo,idlegenda:ltema.name};
- var opcoesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
+ var opcoesNode = new YAHOO.widget.HTMLNode(d, node, i3GEO.arvoreDeCamadas.LEGENDAEXPANDIDA,true);
opcoesNode.setDynamicLoad(i3GEO.arvoreDeCamadas.mostraLegenda, 1);
}
node.loadComplete();
@@ -486,7 +524,7 @@ i3GEO.arvoreDeCamadas = {
var idtema = node.data.idlegenda;
var ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);
var retorna = function(retorno){
- if (retorno.data.legenda){
+ if(retorno.data.legenda){
var original = retorno;
var retorno = retorno.data.legenda;
if (retorno[0]){
@@ -553,6 +591,9 @@ i3GEO.arvoreDeCamadas = {
}
}
};
+ if(i3GEO.configura.templateLegenda != "")
+ i3GEO.php.criaLegendaHTML(retorna,idtema,i3GEO.configura.templateLegenda);
+ else
i3GEO.php.criaLegendaHTML(retorna,idtema);
},
/*
diff --git a/classesjs/compactados/classe_arvoredecamadas_compacto.js b/classesjs/compactados/classe_arvoredecamadas_compacto.js
index 7375c77..25e52d5 100644
--- a/classesjs/compactados/classe_arvoredecamadas_compacto.js
+++ b/classesjs/compactados/classe_arvoredecamadas_compacto.js
@@ -1 +1 @@
-if(typeof(i3GEO)=='undefined'){i3GEO=new Array()}i3GEO.arvoreDeCamadas={ATIVATEMA:"",OPCOESTEMAS:true,OPCOESLEGENDA:true,CAMADAS:"",ARVORE:null,IDHTML:null,SID:null,LOCAPLIC:null,cria:function(onde,temas,g_sid,g_locaplic,funcaoTema){if(arguments.length==5){i3GEO.arvoreDeCamadas.ATIVATEMA=funcaoTema}this.SID=g_sid;this.LOCAPLIC=g_locaplic;if(onde!="")this.IDHTML=onde;if(this.IDHTML==""){return}this.atualiza(temas)},atualiza:function(temas){if(this.comparaTemas(temas,this.CAMADAS)){return}if(!document.getElementById(i3GEO.arvoreDeCamadas.IDHTML)){return}document.getElementById(i3GEO.arvoreDeCamadas.IDHTML).innerHTML="";this.CAMADAS=temas;var currentIconMode;YAHOO.example.treeExample=new function(){function changeIconMode(){var newVal=parseInt(this.value);if(newVal!=currentIconMode){currentIconMode=newVal}buildTree()}function buildTree(){i3GEO.arvoreDeCamadas.ARVORE=new YAHOO.widget.TreeView(i3GEO.arvoreDeCamadas.IDHTML);var root=i3GEO.arvoreDeCamadas.ARVORE.getRoot();var tempNode=new YAHOO.widget.TextNode('',root,false);tempNode.isLeaf=false}buildTree()}();var root=i3GEO.arvoreDeCamadas.ARVORE.getRoot();var titulo=""+$trad("a7")+" | +") |
";var d={html:titulo};var tempNode=new YAHOO.widget.HTMLNode(d,root,true,true);var c=temas.length;for(var i=0,j=c;i=0){do{var ltema=lista[i];if($i("arrastar_"+ltema.name)){new YAHOO.example.DDList("arrastar_"+ltema.name)}}while(i--)}}};YAHOO.example.DDList=function(id,sGroup,config){YAHOO.example.DDList.superclass.constructor.call(this,id,sGroup,config);this.logger=this.logger||YAHOO;var el=this.getDragEl();Dom.setStyle(el,"opacity",0.67);this.goingUp=false;this.lastY=0};YAHOO.extend(YAHOO.example.DDList,YAHOO.util.DDProxy,{startDrag:function(x,y){this.logger.log(this.id+" startDrag");var dragEl=this.getDragEl();var clickEl=this.getEl();Dom.setStyle(clickEl,"visibility","hidden");dragEl.innerHTML=clickEl.innerHTML;Dom.setStyle(dragEl,"color",Dom.getStyle(clickEl,"color"));Dom.setStyle(dragEl,"backgroundColor",Dom.getStyle(clickEl,"backgroundColor"));Dom.setStyle(dragEl,"border","4px solid gray");Dom.setStyle(dragEl,"z-index","5000")},endDrag:function(e){var srcEl=this.getEl();var proxy=this.getDragEl();Dom.setStyle(proxy,"visibility","");var a=new YAHOO.util.Motion(proxy,{points:{to:Dom.getXY(srcEl)}},0.2,YAHOO.util.Easing.easeOut);var proxyid=proxy.id;var thisid=this.id;a.onComplete.subscribe(function(){Dom.setStyle(proxyid,"visibility","hidden");Dom.setStyle(thisid,"visibility","")});a.animate();if($i("i3geo_lixeira")){$i("i3geo_lixeira").style.border="0px solid blue"}},onDragDrop:function(e,id){if(DDM.interactionInfo.drop.length===1){var pt=DDM.interactionInfo.point;var region=DDM.interactionInfo.sourceRegion;if(!region.intersect(pt)){DDM.refreshCache();if(DDM.getDDById(id).id=="i3geo_lixeira"){i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o1"));var tema=(this.getEl()).id.split("arrastar_")[1];i3GEO.php.excluitema(i3GEO.atualiza,tema);i3GEO.temaAtivo=""}else{i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));var destEl=Dom.get(id);var noid=id.split("arrastar_")[1];destEl.appendChild(this.getEl());var els=i3GEO.arvoreDeCamadas.listaLigadosDesligados();var lista=els[2].join(",");i3GEO.php.reordenatemas(i3GEO.atualiza,lista)}}}},onDrag:function(e){var y=Event.getPageY(e);if(ythis.lastY){this.goingUp=false}this.lastY=y},onDragOver:function(e,id){var srcEl=this.getEl();var destEl=Dom.get(id);if($i("i3geo_lixeira")&&id=="i3geo_lixeira"){$i("i3geo_lixeira").style.border="1px solid red"}else{destEl.style.textDecoration="underline"}},onDragOut:function(e,id){$i(id).style.textDecoration="none"}});Event.onDOMReady(YAHOO.example.DDApp.init,YAHOO.example.DDApp,true)},montaOpcoes:function(node){var idtema=node.data.id;var ltema=i3GEO.arvoreDeCamadas.pegaTema(idtema);var farol="maisamarelo.png";if(ltema.escala*1i3GEO.parametros.mapscale*1){var farol="maisvermelho.png";var mfarol=$trad("t10")}if(ltema.escala==0){var farol="maisamarelo.png";var mfarol=$trad("t11")}tnome="
";tnome+="
";tnome+="
";tnome+="
";if((ltema.zoomtema=="sim")&&(!$i("flamingo"))){tnome+="
"}var d={html:tnome};var iconesNode=new YAHOO.widget.HTMLNode(d,node,false,true);iconesNode.isLeaf=true;if(i3GEO.arvoreDeCamadas.OPCOESTEMAS==true){var conteudo=$trad("t18a");var d={html:conteudo,idopcoes:ltema.name};var opcoesNode=new YAHOO.widget.HTMLNode(d,node,false,true);opcoesNode.setDynamicLoad(i3GEO.arvoreDeCamadas.mostraOpcoes,1)}if(i3GEO.arvoreDeCamadas.OPCOESLEGENDA==true){var conteudo=$trad("p3");var d={html:conteudo,idlegenda:ltema.name};var opcoesNode=new YAHOO.widget.HTMLNode(d,node,false,true);opcoesNode.setDynamicLoad(i3GEO.arvoreDeCamadas.mostraLegenda,1)}node.loadComplete()},mostraOpcoes:function(node){var idtema=node.data.idopcoes;var ltema=i3GEO.arvoreDeCamadas.pegaTema(idtema);var tnome=""+$trad("t20")+" "+$inputText("","","tr"+ltema.name,"","3",ltema.transparency)+"
";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t21")+" "+$inputText("","","nn"+ltema.name,"","10","")+"
";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;if((ltema.type<3)&&(ltema.connectiontype!=7)){var tnome=""+$trad("t23")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t25")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t27")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t29")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t31")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;if(i3GEO.parametros.versaoms>4){var tnome=""+$trad("t37")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true}}if(ltema.type<4){var tnome=""+$trad("t33")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true}var tnome=""+$trad("t35")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;node.loadComplete()},mostraLegenda:function(node){var idtema=node.data.idlegenda;var ltema=i3GEO.arvoreDeCamadas.pegaTema(idtema);var retorna=function(retorno){if(retorno.data.legenda){var original=retorno;var retorno=retorno.data.legenda;if(retorno[0]){if((navn)&&(!retorno[0].imagem)){var tabela=retorno}else{var i=retorno[0].imagem;var re=new RegExp("tiff","g");var i=i.replace(re,'png');var tabela="
"}retorno=""}else{var linhas=retorno.split("#");if(linhas.length>1){var linhas=retorno.split("|");var tabela="";var linha=linhas.length-1;if(linha>=0){do{var colunas=linhas[linha].split("#");var id=colunas[0]+"-"+colunas[1];var re=new RegExp("'","g");var exp=colunas[3].replace(re,'"');tabela+=" | "+colunas[2]+" |
"}while(linha--)}tabela+="
"}else{tabela=retorno}}}else{var tabela="
"}var incluir=""+tabela+"
";var d={html:incluir};var nodeLeg=new YAHOO.widget.HTMLNode(d,node,false,false);node.loadComplete();var elementos=document.getElementById(idtema+"verdiv").getElementsByTagName("input");var nelementos=elementos.length;var inputs=new Array();var i=0;if(nelementos>0){do{if(elementos[i].type=="checkbox"){inputs.push(elementos[i])}i++}while(i0){do{inputs[desativar[i]].checked=false;i++}while(i";if(tema.contextoescala=="sim"){html+="
"}if(tema.sel=="sim"){html+="
"}if((tema.download=="sim")||(tema.download=="SIM")){html+="
"}html+=" "+tema.tema+"";html+="
";return(html)},atualizaFarol:function(mapscale){var farol="maisamarelo.png";var l=i3GEO.arvoreDeCamadas.CAMADAS.length-1;if(l>=0){do{var ltema=i3GEO.arvoreDeCamadas.CAMADAS[l];var escala=ltema.escala;if(escala*1mapscale*1){var farol="maisvermelho.png"}if(escala*1==0){var farol="maisamarelo.png"}if($i("farol"+ltema.name)){$i("farol"+ltema.name).src=g_locaplic+"/imagens/"+farol}}while(l--)}},aplicaTemas:function(){var t=i3GEO.arvoreDeCamadas.listaLigadosDesligados();var temp=function(){i3GEO.atualiza();i3GEO.janela.fechaAguarde("redesenha")};clearTimeout(tempoBotaoAplicar);tempoBotaoAplicar="";i3GEO.janela.abreAguarde("redesenha",$trad("o1"));i3GEO.php.ligatemas(temp,t[1].toString(),t[0].toString())},listaLigadosDesligados:function(){var nos=i3GEO.arvoreDeCamadas.ARVORE.getNodesByProperty("tipo","tema");var ligados=new Array();var desligados=new Array();var todos=new Array();var n=nos.length;var i=0;do{try{var no=nos[i].getEl();var cs=no.getElementsByTagName("input");var csn=cs.length;for(j=0;j+") | ";var d={html:titulo};var tempNode=new YAHOO.widget.HTMLNode(d,root,true,true);var c=temas.length;for(var i=0,j=c;i=0){do{var ltema=lista[i];if($i("arrastar_"+ltema.name)){new YAHOO.example.DDList("arrastar_"+ltema.name)}}while(i--)}}};YAHOO.example.DDList=function(id,sGroup,config){YAHOO.example.DDList.superclass.constructor.call(this,id,sGroup,config);this.logger=this.logger||YAHOO;var el=this.getDragEl();Dom.setStyle(el,"opacity",0.67);this.goingUp=false;this.lastY=0};YAHOO.extend(YAHOO.example.DDList,YAHOO.util.DDProxy,{startDrag:function(x,y){this.logger.log(this.id+" startDrag");var dragEl=this.getDragEl();var clickEl=this.getEl();Dom.setStyle(clickEl,"visibility","hidden");dragEl.innerHTML=clickEl.innerHTML;Dom.setStyle(dragEl,"color",Dom.getStyle(clickEl,"color"));Dom.setStyle(dragEl,"backgroundColor",Dom.getStyle(clickEl,"backgroundColor"));Dom.setStyle(dragEl,"border","4px solid gray");Dom.setStyle(dragEl,"z-index","5000")},endDrag:function(e){var srcEl=this.getEl();var proxy=this.getDragEl();Dom.setStyle(proxy,"visibility","");var a=new YAHOO.util.Motion(proxy,{points:{to:Dom.getXY(srcEl)}},0.2,YAHOO.util.Easing.easeOut);var proxyid=proxy.id;var thisid=this.id;a.onComplete.subscribe(function(){Dom.setStyle(proxyid,"visibility","hidden");Dom.setStyle(thisid,"visibility","")});a.animate();if($i("i3geo_lixeira")){$i("i3geo_lixeira").style.border="0px solid blue"}},onDragDrop:function(e,id){if(DDM.interactionInfo.drop.length===1){var pt=DDM.interactionInfo.point;var region=DDM.interactionInfo.sourceRegion;if(!region.intersect(pt)){DDM.refreshCache();if(DDM.getDDById(id).id=="i3geo_lixeira"){i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o1"));var tema=(this.getEl()).id.split("arrastar_")[1];i3GEO.php.excluitema(i3GEO.atualiza,tema);i3GEO.temaAtivo=""}else{i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));var destEl=Dom.get(id);var noid=id.split("arrastar_")[1];destEl.appendChild(this.getEl());var els=i3GEO.arvoreDeCamadas.listaLigadosDesligados();var lista=els[2].join(",");i3GEO.php.reordenatemas(i3GEO.atualiza,lista)}}}},onDrag:function(e){var y=Event.getPageY(e);if(ythis.lastY){this.goingUp=false}this.lastY=y},onDragOver:function(e,id){var srcEl=this.getEl();var destEl=Dom.get(id);if($i("i3geo_lixeira")&&id=="i3geo_lixeira"){$i("i3geo_lixeira").style.border="1px solid red"}else{destEl.style.textDecoration="underline"}},onDragOut:function(e,id){$i(id).style.textDecoration="none"}});Event.onDOMReady(YAHOO.example.DDApp.init,YAHOO.example.DDApp,true)},montaOpcoes:function(node){var idtema=node.data.id;var ltema=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(i3GEO.arvoreDeCamadas.OPCOESICONES==true){var farol="maisamarelo.png";if(ltema.escala*1i3GEO.parametros.mapscale*1){var farol="maisvermelho.png";var mfarol=$trad("t10")}if(ltema.escala==0){var farol="maisamarelo.png";var mfarol=$trad("t11")}tnome="
";tnome+="
";tnome+="
";tnome+="
";if((ltema.zoomtema=="sim")&&(!$i("flamingo"))){tnome+="
"}var d={html:tnome};var iconesNode=new YAHOO.widget.HTMLNode(d,node,false,true);iconesNode.isLeaf=true}if(i3GEO.arvoreDeCamadas.OPCOESTEMAS==true){var conteudo=$trad("t18a");var d={html:conteudo,idopcoes:ltema.name};var opcoesNode=new YAHOO.widget.HTMLNode(d,node,false,true);opcoesNode.setDynamicLoad(i3GEO.arvoreDeCamadas.mostraOpcoes,1)}if(i3GEO.arvoreDeCamadas.OPCOESLEGENDA==true){var conteudo=$trad("p3");var d={html:conteudo,idlegenda:ltema.name};var opcoesNode=new YAHOO.widget.HTMLNode(d,node,i3GEO.arvoreDeCamadas.LEGENDAEXPANDIDA,true);opcoesNode.setDynamicLoad(i3GEO.arvoreDeCamadas.mostraLegenda,1)}node.loadComplete()},mostraOpcoes:function(node){var idtema=node.data.idopcoes;var ltema=i3GEO.arvoreDeCamadas.pegaTema(idtema);var tnome=""+$trad("t20")+" "+$inputText("","","tr"+ltema.name,"","3",ltema.transparency)+"
";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t21")+" "+$inputText("","","nn"+ltema.name,"","10","")+"
";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;if((ltema.type<3)&&(ltema.connectiontype!=7)){var tnome=""+$trad("t23")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t25")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t27")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t29")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;var tnome=""+$trad("t31")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;if(i3GEO.parametros.versaoms>4){var tnome=""+$trad("t37")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true}}if(ltema.type<4){var tnome=""+$trad("t33")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true}var tnome=""+$trad("t35")+" ";var d={html:tnome};var n=new YAHOO.widget.HTMLNode(d,node,false,true);n.isLeaf=true;node.loadComplete()},mostraLegenda:function(node){var idtema=node.data.idlegenda;var ltema=i3GEO.arvoreDeCamadas.pegaTema(idtema);var retorna=function(retorno){if(retorno.data.legenda){var original=retorno;var retorno=retorno.data.legenda;if(retorno[0]){if((navn)&&(!retorno[0].imagem)){var tabela=retorno}else{var i=retorno[0].imagem;var re=new RegExp("tiff","g");var i=i.replace(re,'png');var tabela="
"}retorno=""}else{var linhas=retorno.split("#");if(linhas.length>1){var linhas=retorno.split("|");var tabela="";var linha=linhas.length-1;if(linha>=0){do{var colunas=linhas[linha].split("#");var id=colunas[0]+"-"+colunas[1];var re=new RegExp("'","g");var exp=colunas[3].replace(re,'"');tabela+=" | "+colunas[2]+" |
"}while(linha--)}tabela+="
"}else{tabela=retorno}}}else{var tabela="
"}var incluir=""+tabela+"
";var d={html:incluir};var nodeLeg=new YAHOO.widget.HTMLNode(d,node,false,false);node.loadComplete();var elementos=document.getElementById(idtema+"verdiv").getElementsByTagName("input");var nelementos=elementos.length;var inputs=new Array();var i=0;if(nelementos>0){do{if(elementos[i].type=="checkbox"){inputs.push(elementos[i])}i++}while(i0){do{inputs[desativar[i]].checked=false;i++}while(i";if(tema.contextoescala=="sim"){html+="
"}if(tema.sel=="sim"){html+="
"}if((tema.download=="sim")||(tema.download=="SIM")){html+="
"}html+=" "+tema.tema+"";html+="";return(html)},atualizaFarol:function(mapscale){var farol="maisamarelo.png";var l=i3GEO.arvoreDeCamadas.CAMADAS.length-1;if(l>=0){do{var ltema=i3GEO.arvoreDeCamadas.CAMADAS[l];var escala=ltema.escala;if(escala*1mapscale*1){var farol="maisvermelho.png"}if(escala*1==0){var farol="maisamarelo.png"}if($i("farol"+ltema.name)){$i("farol"+ltema.name).src=g_locaplic+"/imagens/"+farol}}while(l--)}},aplicaTemas:function(){var t=i3GEO.arvoreDeCamadas.listaLigadosDesligados();var temp=function(){i3GEO.atualiza();i3GEO.janela.fechaAguarde("redesenha")};clearTimeout(tempoBotaoAplicar);tempoBotaoAplicar="";i3GEO.janela.abreAguarde("redesenha",$trad("o1"));i3GEO.php.ligatemas(temp,t[1].toString(),t[0].toString())},listaLigadosDesligados:function(){var nos=i3GEO.arvoreDeCamadas.ARVORE.getNodesByProperty("tipo","tema");var ligados=new Array();var desligados=new Array();var todos=new Array();var n=nos.length;var i=0;do{try{var no=nos[i].getEl();var cs=no.getElementsByTagName("input");var csn=cs.length;for(j=0;j i3GEO.parametros.mapscale*1){
- var farol = "maisvermelho.png";
- var mfarol = $trad("t10");
- }
- if (ltema.escala == 0){
- var farol = "maisamarelo.png";
- var mfarol = $trad("t11");
+ if(i3GEO.arvoreDeCamadas.OPCOESICONES == true){
+ var farol = "maisamarelo.png";
+ if (ltema.escala*1 < i3GEO.parametros.mapscale*1){
+ var farol = "maisverde.png";
+ var mfarol = $trad("t9");
+ }
+ if (ltema.escala*1 > i3GEO.parametros.mapscale*1){
+ var farol = "maisvermelho.png";
+ var mfarol = $trad("t10");
+ }
+ if (ltema.escala == 0){
+ var farol = "maisamarelo.png";
+ var mfarol = $trad("t11");
+ }
+ tnome = "
";
+ tnome += "
";
+ tnome += "
";
+ tnome += "
";
+ //a operação de zoom para o tema não funciona na interface flamingo
+ if( (ltema.zoomtema == "sim") && (!$i("flamingo")))
+ {tnome += "
";}
+ var d = {html:tnome};
+ var iconesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
+ iconesNode.isLeaf = true;
}
- tnome = "
";
- tnome += "
";
- tnome += "
";
- tnome += "
";
- //a operação de zoom para o tema não funciona na interface flamingo
- if( (ltema.zoomtema == "sim") && (!$i("flamingo")))
- {tnome += "
";}
- var d = {html:tnome};
- var iconesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
- iconesNode.isLeaf = true;
if(i3GEO.arvoreDeCamadas.OPCOESTEMAS == true){
var conteudo = $trad("t18a");
var d = {html:conteudo,idopcoes:ltema.name};
@@ -14420,7 +14458,7 @@ i3GEO.arvoreDeCamadas = {
if(i3GEO.arvoreDeCamadas.OPCOESLEGENDA == true){
var conteudo = $trad("p3");
var d = {html:conteudo,idlegenda:ltema.name};
- var opcoesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
+ var opcoesNode = new YAHOO.widget.HTMLNode(d, node, i3GEO.arvoreDeCamadas.LEGENDAEXPANDIDA,true);
opcoesNode.setDynamicLoad(i3GEO.arvoreDeCamadas.mostraLegenda, 1);
}
node.loadComplete();
@@ -14502,7 +14540,7 @@ i3GEO.arvoreDeCamadas = {
var idtema = node.data.idlegenda;
var ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);
var retorna = function(retorno){
- if (retorno.data.legenda){
+ if(retorno.data.legenda){
var original = retorno;
var retorno = retorno.data.legenda;
if (retorno[0]){
@@ -14569,6 +14607,9 @@ i3GEO.arvoreDeCamadas = {
}
}
};
+ if(i3GEO.configura.templateLegenda != "")
+ i3GEO.php.criaLegendaHTML(retorna,idtema,i3GEO.configura.templateLegenda);
+ else
i3GEO.php.criaLegendaHTML(retorna,idtema);
},
/*
diff --git a/classesjs/i3geo_tudo_compacto.js.php b/classesjs/i3geo_tudo_compacto.js.php
index 7f11402..cb96ddb 100644
--- a/classesjs/i3geo_tudo_compacto.js.php
+++ b/classesjs/i3geo_tudo_compacto.js.php
@@ -14057,6 +14057,30 @@ Exemplos:
*/
i3GEO.arvoreDeCamadas = {
/*
+ Property: EXPANDIDA
+
+ Indica se a árvore será montada de forma expandida ou não. Se true, os nós do primeiro nível serão abertos na inicialização da árvore.
+
+ Default:
+ {false}
+
+ Type:
+ {Boolena}
+ */
+ EXPANDIDA: false,
+ /*
+ Property: LEGENDAEXPANDIDA
+
+ Indica se a legenda da árvore será montada de forma expandida ou não.
+
+ Default:
+ {false}
+
+ Type:
+ {Boolena}
+ */
+ LEGENDAEXPANDIDA: false,
+ /*
Property: ATIVATEMA
Nome da função que será incluída no evento onclick do elemento checkbox adicionado no início do nome de um tema.
@@ -14066,6 +14090,18 @@ i3GEO.arvoreDeCamadas = {
*/
ATIVATEMA: "",
/*
+ Property: OPCOESICONES
+
+ Inclui ou não os ícones de opções em cada tema (farol, zoom para o tema, etc)
+
+ Default:
+ {true}
+
+ Type:
+ {boolean}
+ */
+ OPCOESICONES: true,
+ /*
Property: OPCOESTEMAS
Inclui ou não o nó com as opções de manipulação de cada tema.
@@ -14243,7 +14279,7 @@ i3GEO.arvoreDeCamadas = {
for (var i=0, j=c; i i3GEO.parametros.mapscale*1){
- var farol = "maisvermelho.png";
- var mfarol = $trad("t10");
- }
- if (ltema.escala == 0){
- var farol = "maisamarelo.png";
- var mfarol = $trad("t11");
+ if(i3GEO.arvoreDeCamadas.OPCOESICONES == true){
+ var farol = "maisamarelo.png";
+ if (ltema.escala*1 < i3GEO.parametros.mapscale*1){
+ var farol = "maisverde.png";
+ var mfarol = $trad("t9");
+ }
+ if (ltema.escala*1 > i3GEO.parametros.mapscale*1){
+ var farol = "maisvermelho.png";
+ var mfarol = $trad("t10");
+ }
+ if (ltema.escala == 0){
+ var farol = "maisamarelo.png";
+ var mfarol = $trad("t11");
+ }
+ tnome = "
";
+ tnome += "
";
+ tnome += "
";
+ tnome += "
";
+ //a operação de zoom para o tema não funciona na interface flamingo
+ if( (ltema.zoomtema == "sim") && (!$i("flamingo")))
+ {tnome += "
";}
+ var d = {html:tnome};
+ var iconesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
+ iconesNode.isLeaf = true;
}
- tnome = "
";
- tnome += "
";
- tnome += "
";
- tnome += "
";
- //a operação de zoom para o tema não funciona na interface flamingo
- if( (ltema.zoomtema == "sim") && (!$i("flamingo")))
- {tnome += "
";}
- var d = {html:tnome};
- var iconesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
- iconesNode.isLeaf = true;
if(i3GEO.arvoreDeCamadas.OPCOESTEMAS == true){
var conteudo = $trad("t18a");
var d = {html:conteudo,idopcoes:ltema.name};
@@ -14420,7 +14458,7 @@ i3GEO.arvoreDeCamadas = {
if(i3GEO.arvoreDeCamadas.OPCOESLEGENDA == true){
var conteudo = $trad("p3");
var d = {html:conteudo,idlegenda:ltema.name};
- var opcoesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
+ var opcoesNode = new YAHOO.widget.HTMLNode(d, node, i3GEO.arvoreDeCamadas.LEGENDAEXPANDIDA,true);
opcoesNode.setDynamicLoad(i3GEO.arvoreDeCamadas.mostraLegenda, 1);
}
node.loadComplete();
@@ -14502,7 +14540,7 @@ i3GEO.arvoreDeCamadas = {
var idtema = node.data.idlegenda;
var ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);
var retorna = function(retorno){
- if (retorno.data.legenda){
+ if(retorno.data.legenda){
var original = retorno;
var retorno = retorno.data.legenda;
if (retorno[0]){
@@ -14569,6 +14607,9 @@ i3GEO.arvoreDeCamadas = {
}
}
};
+ if(i3GEO.configura.templateLegenda != "")
+ i3GEO.php.criaLegendaHTML(retorna,idtema,i3GEO.configura.templateLegenda);
+ else
i3GEO.php.criaLegendaHTML(retorna,idtema);
},
/*
diff --git a/classesphp/wmswfs.php b/classesphp/wmswfs.php
index 578fbb3..f20641c 100644
--- a/classesphp/wmswfs.php
+++ b/classesphp/wmswfs.php
@@ -49,23 +49,25 @@ function gravaCacheWMS($servico)
global $dir_tmp;
error_reporting(0);
try{
- $teste = explode("=",$servico);
- if ( count($teste) > 1 ){$servico = $servico."&";}
- $wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
- $nome = $dir_tmp."/wms".md5($servico).".xml";
- if(!file_exists($nome))
- {
- $wms_capabilities = file($wms_service_request);
- if( !$wms_capabilities )
- {return "erro";}
+ $teste = explode("=",$servico);
+ if ( count($teste) > 1 ){$servico = $servico."&";}
else
+ {$servico = $servico."?";}
+ $wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
+ $nome = $dir_tmp."/wms".md5($servico).".xml";
+ if(!file_exists($nome))
{
- $fp = fopen($nome, 'w');
- fwrite($fp, implode("",$wms_capabilities));
- fclose($fp);
+ $wms_capabilities = file($wms_service_request);
+ if( !$wms_capabilities )
+ {return "erro";}
+ else
+ {
+ $fp = fopen($nome, 'w');
+ fwrite($fp, implode("",$wms_capabilities));
+ fclose($fp);
+ }
}
- }
- return $nome;
+ return $nome;
}
catch(Exception $e){return "erro";}
}
@@ -271,9 +273,6 @@ function temaswms()
{
global $servico,$cp,$id_ws;
$wms_service_request = gravaCacheWMS($servico);
- //$teste = explode("=",$servico);
- //if ( count($teste) > 1 ){$servico = $servico."&";}
- //$wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
# -------------------------------------------------------------
# Test that the capabilites file has successfully downloaded.
#
@@ -292,12 +291,14 @@ function temaswms()
}
elseif(isset($id_ws))
{
- $handle = fopen ($wms_service_request, "r");
- $wms_capabilities = fread ($handle, filesize ($wms_service_request));
- fclose ($handle);
+ if($id_ws != "")
adicionaAcesso($id_ws,true);
}
- //$wms_capabilities = implode("",$wms_capabilities);
+
+ $handle = fopen ($wms_service_request, "r");
+ $wms_capabilities = fread($handle, filesize($wms_service_request));
+ fclose ($handle);
+
$dom = new DomDocument();
$dom->loadXML($wms_capabilities);
$layers = wms_layers($dom);
diff --git a/exemplos/camadas1.htm b/exemplos/camadas1.htm
new file mode 100644
index 0000000..2931f8c
--- /dev/null
+++ b/exemplos/camadas1.htm
@@ -0,0 +1,176 @@
+
+
+
+
+
+i3Geo - Mapa interativo
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ Temas
+ Adiciona
+ Legenda
+ Links
+
+ |
+
+
+ |
+
+
+
+
+
+ Aguarde... 
+
+
+ |
+
+
+ |
+
+
+
+
+
+ |
+
+
+ |
+
+
+ Aguarde...
+
+ |
+ |
+ |
+
+ | | |
+
+ |
+
+ |
+ |
+geoprocessamento@mma.gov.br |
+
+
+
+
+
+
+  |
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+
+
+
\ No newline at end of file
diff --git a/exemplos/camadas2.htm b/exemplos/camadas2.htm
new file mode 100644
index 0000000..18f383b
--- /dev/null
+++ b/exemplos/camadas2.htm
@@ -0,0 +1,177 @@
+
+
+
+
+
+i3Geo - Mapa interativo
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ Temas
+ Adiciona
+ Legenda
+ Links
+
+ |
+
+
+ |
+
+
+
+
+
+ Aguarde... 
+
+
+ |
+
+
+ |
+
+
+
+
+
+ |
+
+
+ |
+
+
+ Aguarde...
+
+ |
+ |
+ |
+
+ | | |
+
+ |
+
+ |
+ |
+geoprocessamento@mma.gov.br |
+
+
+
+
+
+
+  |
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+
+
+
\ No newline at end of file
diff --git a/exemplos/camadas3.htm b/exemplos/camadas3.htm
new file mode 100644
index 0000000..e93b029
--- /dev/null
+++ b/exemplos/camadas3.htm
@@ -0,0 +1,178 @@
+
+
+
+
+
+i3Geo - Mapa interativo
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ Temas
+ Adiciona
+ Legenda
+ Links
+
+ |
+
+
+ |
+
+
+
+
+
+ Aguarde... 
+
+
+ |
+
+
+ |
+
+
+
+
+
+ |
+
+
+ |
+
+
+ Aguarde...
+
+ |
+ |
+ |
+
+ | | |
+
+ |
+
+ |
+ |
+geoprocessamento@mma.gov.br |
+
+
+
+
+
+
+  |
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+
+
+
\ No newline at end of file
diff --git a/exemplos/camadas4.htm b/exemplos/camadas4.htm
new file mode 100644
index 0000000..229a55d
--- /dev/null
+++ b/exemplos/camadas4.htm
@@ -0,0 +1,185 @@
+
+
+
+
+
+i3Geo - Mapa interativo
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ Temas
+ Legenda
+ Links
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+
+ |
+
+
+ |
+
+
+ Aguarde...
+
+ |
+ |
+ |
+
+ | | |
+
+ |
+
+ |
+ |
+geoprocessamento@mma.gov.br |
+
+
+
+
+
+
+  |
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+
+
+
\ No newline at end of file
diff --git a/exemplos/index.html b/exemplos/index.html
index b830888..55e8ac2 100644
--- a/exemplos/index.html
+++ b/exemplos/index.html
@@ -24,4 +24,9 @@ body,td
Exemplo 3
Exemplo 4
Exemplo 5
+Exemplos de configuração da árvore de camadas
+Árvore expandida
+Legenda expandida
+Árvore simplificada
+Opção "mais temas" na guia de camadas