Commit 3575df8ef4ea34bcb14e9c719e0760a660528a95
1 parent
54464476
Exists in
master
and in
7 other branches
Inclusão de combo para escolha dos temas na ferramenta tabela
Showing
3 changed files
with
127 additions
and
3 deletions
Show diff stats
admin/admin.db
No preview for this file type
ferramentas/tabela/index.js.php
| @@ -19,7 +19,7 @@ Licenca: | @@ -19,7 +19,7 @@ Licenca: | ||
| 19 | 19 | ||
| 20 | GPL2 | 20 | GPL2 |
| 21 | 21 | ||
| 22 | -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | 22 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet |
| 23 | 23 | ||
| 24 | Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | 24 | Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil |
| 25 | Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | 25 | Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br |
| @@ -103,6 +103,11 @@ i3GEOF.tabela = { | @@ -103,6 +103,11 @@ i3GEOF.tabela = { | ||
| 103 | iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | 103 | iddiv {String} - id do div que receberá o conteudo HTML da ferramenta |
| 104 | */ | 104 | */ |
| 105 | inicia: function(iddiv){ | 105 | inicia: function(iddiv){ |
| 106 | + if(i3GEO.temaAtivo === ""){ | ||
| 107 | + i3GEOF.tabela.comboCabecalho(); | ||
| 108 | + $i(iddiv).innerHTML = "Escolha um tema na lista mostrada no cabeçalho"; | ||
| 109 | + return; | ||
| 110 | + } | ||
| 106 | try{ | 111 | try{ |
| 107 | $i(iddiv).innerHTML += i3GEOF.tabela.html(); | 112 | $i(iddiv).innerHTML += i3GEOF.tabela.html(); |
| 108 | i3GEO.guias.mostraGuiaFerramenta("i3GEOtabelaguia1","i3GEOtabelaguia"); | 113 | i3GEO.guias.mostraGuiaFerramenta("i3GEOtabelaguia1","i3GEOtabelaguia"); |
| @@ -194,6 +199,7 @@ i3GEOF.tabela = { | @@ -194,6 +199,7 @@ i3GEOF.tabela = { | ||
| 194 | if (i3GEO.parametros.r.toLowerCase() !== "sim") | 199 | if (i3GEO.parametros.r.toLowerCase() !== "sim") |
| 195 | {$i("i3GEOtabelaguia4obj").innerHTML = "Opção não disponível";} | 200 | {$i("i3GEOtabelaguia4obj").innerHTML = "Opção não disponível";} |
| 196 | i3GEOF.tabela.pegaRegistros(); | 201 | i3GEOF.tabela.pegaRegistros(); |
| 202 | + i3GEOF.tabela.comboCabecalho(); | ||
| 197 | } | 203 | } |
| 198 | catch(erro){alert(erro);} | 204 | catch(erro){alert(erro);} |
| 199 | }, | 205 | }, |
| @@ -312,7 +318,7 @@ i3GEOF.tabela = { | @@ -312,7 +318,7 @@ i3GEOF.tabela = { | ||
| 312 | i3GEO.janela.minimiza("i3GEOF.tabela"); | 318 | i3GEO.janela.minimiza("i3GEOF.tabela"); |
| 313 | }; | 319 | }; |
| 314 | //cria a janela flutuante | 320 | //cria a janela flutuante |
| 315 | - titulo = "<div style='position:absolute' id='i3GEOFtabelaComboCabeca' >------</div> Tabela <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=5&idajuda=39' > </a>"; | 321 | + titulo = "<div style='z-index:1;position:absolute' id='i3GEOFtabelaComboCabeca' >------</div> Tabela <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=5&idajuda=39' > </a>"; |
| 316 | janela = i3GEO.janela.cria( | 322 | janela = i3GEO.janela.cria( |
| 317 | "500px", | 323 | "500px", |
| 318 | "400px", | 324 | "400px", |
| @@ -341,6 +347,8 @@ i3GEOF.tabela = { | @@ -341,6 +347,8 @@ i3GEOF.tabela = { | ||
| 341 | if(i3GEO.Interface.ATUAL === "googleearth"){ | 347 | if(i3GEO.Interface.ATUAL === "googleearth"){ |
| 342 | google.earth.removeEventListener(tabelaDragend); | 348 | google.earth.removeEventListener(tabelaDragend); |
| 343 | } | 349 | } |
| 350 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.tabela.comboCabecalho()") > 0) | ||
| 351 | + {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.tabela.comboCabecalho()");} | ||
| 344 | }; | 352 | }; |
| 345 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); | 353 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); |
| 346 | }, | 354 | }, |
| @@ -350,13 +358,63 @@ i3GEOF.tabela = { | @@ -350,13 +358,63 @@ i3GEOF.tabela = { | ||
| 350 | Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado | 358 | Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado |
| 351 | */ | 359 | */ |
| 352 | ativaFoco: function(){ | 360 | ativaFoco: function(){ |
| 353 | - if(i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.tabela.tema) === "") | 361 | + if(i3GEOF.tabela.tema !== "" && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.tabela.tema) === "") |
| 354 | {alert("O tema ja nao existe mais no mapa");} | 362 | {alert("O tema ja nao existe mais no mapa");} |
| 355 | var i = $i("i3GEOF.tabela_c").style; | 363 | var i = $i("i3GEOF.tabela_c").style; |
| 356 | i3GEO.janela.ULTIMOZINDEX++; | 364 | i3GEO.janela.ULTIMOZINDEX++; |
| 357 | i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 365 | i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; |
| 358 | }, | 366 | }, |
| 359 | /* | 367 | /* |
| 368 | + Function: comboCabecalho | ||
| 369 | + | ||
| 370 | + Cria o combo de seleção de temas localizado no cabeçalho da janela | ||
| 371 | + */ | ||
| 372 | + comboCabecalho: function(){ | ||
| 373 | + var idDiv = "i3GEOFtabelaComboCabeca", | ||
| 374 | + idCombo = "i3GEOFtabelaComboCabecaSel", | ||
| 375 | + ferramenta = "tabela", | ||
| 376 | + temp = $i(idDiv); | ||
| 377 | + if(temp){ | ||
| 378 | + temp.innerHTML = ""; | ||
| 379 | + i3GEO.util.comboTemas( | ||
| 380 | + temp.id+"Sel", | ||
| 381 | + function(retorno){ | ||
| 382 | + $i(idDiv).innerHTML = retorno.dados; | ||
| 383 | + var c = $i(idCombo); | ||
| 384 | + c.style.width = "150px"; | ||
| 385 | + c.style.border = "solid #B4B4B4 1px"; | ||
| 386 | + c.style.top = "1px"; | ||
| 387 | + c.style.position = "relative"; | ||
| 388 | + c.style.fontSize = "10px"; | ||
| 389 | + c.style.color = "#B4B4B4"; | ||
| 390 | + c.value = i3GEOF.tabela.tema; | ||
| 391 | + if(c.value === ""){ | ||
| 392 | + i3GEOF.tabela.tema = ""; | ||
| 393 | + $i("i3GEOF."+ferramenta+"_corpo").innerHTML = ""; | ||
| 394 | + } | ||
| 395 | + c.onchange = function(){ | ||
| 396 | + var valor = $i(idCombo).value; | ||
| 397 | + if(valor !== ""){ | ||
| 398 | + | ||
| 399 | + i3GEO.mapa.ativaTema(valor); | ||
| 400 | + i3GEOF.tabela.tema = valor; | ||
| 401 | + | ||
| 402 | + $i("i3GEOF."+ferramenta+"_corpo").innerHTML = ""; | ||
| 403 | + eval("i3GEOF."+ferramenta+".inicia('i3GEOF."+ferramenta+"_corpo');"); | ||
| 404 | + | ||
| 405 | + } | ||
| 406 | + }; | ||
| 407 | + }, | ||
| 408 | + temp.id, | ||
| 409 | + "", | ||
| 410 | + false, | ||
| 411 | + "ligados" | ||
| 412 | + ); | ||
| 413 | + } | ||
| 414 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.tabela.comboCabecalho()") < 0) | ||
| 415 | + {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEOF.tabela.comboCabecalho()");} | ||
| 416 | + }, | ||
| 417 | + /* | ||
| 360 | Function: ativaAutoAtualiza | 418 | Function: ativaAutoAtualiza |
| 361 | 419 | ||
| 362 | Ativa ou desativa a atualização automática da tabela quando o usuário navega no mapa | 420 | Ativa ou desativa a atualização automática da tabela quando o usuário navega no mapa |
| @@ -0,0 +1,66 @@ | @@ -0,0 +1,66 @@ | ||
| 1 | +MAP | ||
| 2 | + FONTSET "../symbols/fontes.txt" | ||
| 3 | + SYMBOLSET "../symbols/simbolos.sym" | ||
| 4 | + LAYER | ||
| 5 | + CONNECTION "user=postgres dbname=dbspo host=localhost port=5432 password=postgres" | ||
| 6 | + CONNECTIONTYPE POSTGIS | ||
| 7 | + 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" | ||
| 8 | + METADATA | ||
| 9 | + "CLASSE" "SIM" | ||
| 10 | + "itemcegonha" "7" | ||
| 11 | + "permitekmz" "nao" | ||
| 12 | + "grupocegonha" "samu_cb" | ||
| 13 | + "permitedownload" "sim" | ||
| 14 | + "permiteogc" "sim" | ||
| 15 | + "permitekml" "sim" | ||
| 16 | + "TEMA" "Centrais do SAMU - Unidades Básicas" | ||
| 17 | + "IDENTIFICA" "SIM" | ||
| 18 | + END | ||
| 19 | + NAME "postgis" | ||
| 20 | + STATUS DEFAULT | ||
| 21 | + TYPE POLYGON | ||
| 22 | + UNITS METERS | ||
| 23 | + CLASS | ||
| 24 | + NAME "Sem informação" | ||
| 25 | + EXPRESSION ([qtd]=0) | ||
| 26 | + STYLE | ||
| 27 | + ANGLE 360 | ||
| 28 | + COLOR 249 220 169 | ||
| 29 | + SYMBOL 0 | ||
| 30 | + WIDTH 1 | ||
| 31 | + END | ||
| 32 | + END | ||
| 33 | + CLASS | ||
| 34 | + NAME "Entre 1 e 2" | ||
| 35 | + EXPRESSION ([qtd]>=1 and [qtd]<=2) | ||
| 36 | + STYLE | ||
| 37 | + ANGLE 360 | ||
| 38 | + COLOR 225 220 109 | ||
| 39 | + SYMBOL 0 | ||
| 40 | + WIDTH 1 | ||
| 41 | + END | ||
| 42 | + END | ||
| 43 | + CLASS | ||
| 44 | + NAME "Entre 3 e 9" | ||
| 45 | + EXPRESSION ([qtd]>=3 and [qtd]<=9) | ||
| 46 | + STYLE | ||
| 47 | + ANGLE 360 | ||
| 48 | + COLOR 200 220 49 | ||
| 49 | + SYMBOL 0 | ||
| 50 | + WIDTH 1 | ||
| 51 | + END | ||
| 52 | + END | ||
| 53 | + CLASS | ||
| 54 | + NAME "Acima de 9" | ||
| 55 | + EXPRESSION ([qtd]>9) | ||
| 56 | + STYLE | ||
| 57 | + ANGLE 360 | ||
| 58 | + COLOR 155 211 0 | ||
| 59 | + SYMBOL 0 | ||
| 60 | + WIDTH 1 | ||
| 61 | + END | ||
| 62 | + END | ||
| 63 | + END | ||
| 64 | + | ||
| 65 | +END | ||
| 66 | + |