From 3575df8ef4ea34bcb14e9c719e0760a660528a95 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Fri, 29 Jul 2011 19:11:03 +0000 Subject: [PATCH] Inclusão de combo para escolha dos temas na ferramenta tabela --- admin/admin.db | Bin 74752 -> 0 bytes ferramentas/tabela/index.js.php | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- temas/postgis.map | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 temas/postgis.map diff --git a/admin/admin.db b/admin/admin.db index 03b8771..bcbc6a1 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/ferramentas/tabela/index.js.php b/ferramentas/tabela/index.js.php index 2bf2a6c..4da1f48 100644 --- a/ferramentas/tabela/index.js.php +++ b/ferramentas/tabela/index.js.php @@ -19,7 +19,7 @@ Licenca: GPL2 -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br @@ -103,6 +103,11 @@ i3GEOF.tabela = { iddiv {String} - id do div que receberá o conteudo HTML da ferramenta */ inicia: function(iddiv){ + if(i3GEO.temaAtivo === ""){ + i3GEOF.tabela.comboCabecalho(); + $i(iddiv).innerHTML = "Escolha um tema na lista mostrada no cabeçalho"; + return; + } try{ $i(iddiv).innerHTML += i3GEOF.tabela.html(); i3GEO.guias.mostraGuiaFerramenta("i3GEOtabelaguia1","i3GEOtabelaguia"); @@ -194,6 +199,7 @@ i3GEOF.tabela = { if (i3GEO.parametros.r.toLowerCase() !== "sim") {$i("i3GEOtabelaguia4obj").innerHTML = "Opção não disponível";} i3GEOF.tabela.pegaRegistros(); + i3GEOF.tabela.comboCabecalho(); } catch(erro){alert(erro);} }, @@ -312,7 +318,7 @@ i3GEOF.tabela = { i3GEO.janela.minimiza("i3GEOF.tabela"); }; //cria a janela flutuante - titulo = "
------
   Tabela    "; + titulo = "
------
   Tabela    "; janela = i3GEO.janela.cria( "500px", "400px", @@ -341,6 +347,8 @@ i3GEOF.tabela = { if(i3GEO.Interface.ATUAL === "googleearth"){ google.earth.removeEventListener(tabelaDragend); } + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.tabela.comboCabecalho()") > 0) + {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.tabela.comboCabecalho()");} }; YAHOO.util.Event.addListener(janela[0].close, "click", temp); }, @@ -350,13 +358,63 @@ i3GEOF.tabela = { Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado */ ativaFoco: function(){ - if(i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.tabela.tema) === "") + if(i3GEOF.tabela.tema !== "" && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.tabela.tema) === "") {alert("O tema ja nao existe mais no mapa");} var i = $i("i3GEOF.tabela_c").style; i3GEO.janela.ULTIMOZINDEX++; i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; }, /* + Function: comboCabecalho + + Cria o combo de seleção de temas localizado no cabeçalho da janela + */ + comboCabecalho: function(){ + var idDiv = "i3GEOFtabelaComboCabeca", + idCombo = "i3GEOFtabelaComboCabecaSel", + ferramenta = "tabela", + temp = $i(idDiv); + if(temp){ + temp.innerHTML = ""; + i3GEO.util.comboTemas( + temp.id+"Sel", + function(retorno){ + $i(idDiv).innerHTML = retorno.dados; + var c = $i(idCombo); + c.style.width = "150px"; + c.style.border = "solid #B4B4B4 1px"; + c.style.top = "1px"; + c.style.position = "relative"; + c.style.fontSize = "10px"; + c.style.color = "#B4B4B4"; + c.value = i3GEOF.tabela.tema; + if(c.value === ""){ + i3GEOF.tabela.tema = ""; + $i("i3GEOF."+ferramenta+"_corpo").innerHTML = ""; + } + c.onchange = function(){ + var valor = $i(idCombo).value; + if(valor !== ""){ + + i3GEO.mapa.ativaTema(valor); + i3GEOF.tabela.tema = valor; + + $i("i3GEOF."+ferramenta+"_corpo").innerHTML = ""; + eval("i3GEOF."+ferramenta+".inicia('i3GEOF."+ferramenta+"_corpo');"); + + } + }; + }, + temp.id, + "", + false, + "ligados" + ); + } + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.tabela.comboCabecalho()") < 0) + {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEOF.tabela.comboCabecalho()");} + }, + /* Function: ativaAutoAtualiza Ativa ou desativa a atualização automática da tabela quando o usuário navega no mapa diff --git a/temas/postgis.map b/temas/postgis.map new file mode 100644 index 0000000..5960166 --- /dev/null +++ b/temas/postgis.map @@ -0,0 +1,66 @@ +MAP + FONTSET "../symbols/fontes.txt" + SYMBOLSET "../symbols/simbolos.sym" + LAYER + CONNECTION "user=postgres dbname=dbspo host=localhost port=5432 password=postgres" + CONNECTIONTYPE POSTGIS + DATA "cg_regiao from (SELECT public.tb_regiao.cg_regiao, gid, info.qtd, info.co_ibge_central FROM public.tb_regiao, (SELECT dbacoes_saude.tb_samu_192.amb_habilit_usb AS qtd, dbacoes_saude.tb_samu_192.co_ibge_central FROM dbacoes_saude.tb_samu_192 INNER JOIN dbacoes_saude.tb_samu_cod ON dbacoes_saude.tb_samu_192.co_samu = dbacoes_saude.tb_samu_cod.co_samu WHERE dbacoes_saude.tb_samu_192.mes_inclusao_samu = 3 AND dbacoes_saude.tb_samu_192.ano_inclusao_samu = 2011 AND dbacoes_saude.tb_samu_cod.mes_samu = 3 AND dbacoes_saude.tb_samu_cod.ano_samu = 2011 GROUP BY dbacoes_saude.tb_samu_192.co_ibge_central, dbacoes_saude.tb_samu_192.amb_habilit_usb ) AS info WHERE info.co_ibge_central = tb_regiao.ibge) as aids using unique gid using srid=4291" + METADATA + "CLASSE" "SIM" + "itemcegonha" "7" + "permitekmz" "nao" + "grupocegonha" "samu_cb" + "permitedownload" "sim" + "permiteogc" "sim" + "permitekml" "sim" + "TEMA" "Centrais do SAMU - Unidades Básicas" + "IDENTIFICA" "SIM" + END + NAME "postgis" + STATUS DEFAULT + TYPE POLYGON + UNITS METERS + CLASS + NAME "Sem informação" + EXPRESSION ([qtd]=0) + STYLE + ANGLE 360 + COLOR 249 220 169 + SYMBOL 0 + WIDTH 1 + END + END + CLASS + NAME "Entre 1 e 2" + EXPRESSION ([qtd]>=1 and [qtd]<=2) + STYLE + ANGLE 360 + COLOR 225 220 109 + SYMBOL 0 + WIDTH 1 + END + END + CLASS + NAME "Entre 3 e 9" + EXPRESSION ([qtd]>=3 and [qtd]<=9) + STYLE + ANGLE 360 + COLOR 200 220 49 + SYMBOL 0 + WIDTH 1 + END + END + CLASS + NAME "Acima de 9" + EXPRESSION ([qtd]>9) + STYLE + ANGLE 360 + COLOR 155 211 0 + SYMBOL 0 + WIDTH 1 + END + END + END + +END + -- libgit2 0.21.2