Commit 9b97d72e7ec7fd31b65a759f9e569779a980aa4c
1 parent
39e9e0f9
Exists in
master
and in
7 other branches
exemplo de painel baseado em um mapa salvo
Showing
2 changed files
with
45 additions
and
19 deletions
Show diff stats
exemplos/index.html
| @@ -36,7 +36,7 @@ body,td { | @@ -36,7 +36,7 @@ body,td { | ||
| 36 | <a href="vinde.htm" target="_blank">Navegador de WMS cadastrados na INDE Brasileira</a> | 36 | <a href="vinde.htm" target="_blank">Navegador de WMS cadastrados na INDE Brasileira</a> |
| 37 | </p> | 37 | </p> |
| 38 | <p> | 38 | <p> |
| 39 | - <a href="guiamovel1.htm" target="_blank">Ícones inseridas no puxador lateral da guia móvel</a> | 39 | + <a href="guiamovel1.htm" target="_blank">Ícones inseridos no puxador lateral da guia móvel</a> |
| 40 | </p> | 40 | </p> |
| 41 | <p> | 41 | <p> |
| 42 | <a href="guiamovel2.htm" target="_blank">Puxador lateral da guia móvel sem ícones</a> | 42 | <a href="guiamovel2.htm" target="_blank">Puxador lateral da guia móvel sem ícones</a> |
| @@ -44,6 +44,9 @@ body,td { | @@ -44,6 +44,9 @@ body,td { | ||
| 44 | <p> | 44 | <p> |
| 45 | <a href="guiaesquerda.htm" target="_blank">Guias laterais posicionados à esquerda do mapa</a> | 45 | <a href="guiaesquerda.htm" target="_blank">Guias laterais posicionados à esquerda do mapa</a> |
| 46 | </p> | 46 | </p> |
| 47 | + <p> | ||
| 48 | + <a href="../ms_criamapa.php?mapext=&perfil=&temasa=&layers=&restauramapa=8&interface=exemplos/painel1.htm" target="_blank">Painel que abre um mapa e gráficos. O mapa é restaurado de um mapa salvo anteriormente e que contém dois gráficos</a> | ||
| 49 | + </p> | ||
| 47 | </fieldset> | 50 | </fieldset> |
| 48 | <h2>Mashups</h2> | 51 | <h2>Mashups</h2> |
| 49 | <fieldset> | 52 | <fieldset> |
ferramentas/graficointerativo1/index.js
| @@ -211,14 +211,17 @@ i3GEOF.graficointerativo1 = | @@ -211,14 +211,17 @@ i3GEOF.graficointerativo1 = | ||
| 211 | n = nomesIds.length; | 211 | n = nomesIds.length; |
| 212 | for (j = 0; j < n; j++) { | 212 | for (j = 0; j < n; j++) { |
| 213 | i = nomesIds[j]; | 213 | i = nomesIds[j]; |
| 214 | - o = $i(i); | ||
| 215 | - //if(o && o.style) | ||
| 216 | - //o.style.color = "red" | ||
| 217 | - if (o && o.type) { | ||
| 218 | - if (o.type.toLowerCase() === "radio" || o.type.toLowerCase() === "checkbox") { | ||
| 219 | - o.checked = config[i]; | ||
| 220 | - } else { | ||
| 221 | - o.value = config[i]; | 214 | + if(config[i]){ |
| 215 | + o = $i(i); | ||
| 216 | + //if(o && o.style) | ||
| 217 | + //o.style.color = "red" | ||
| 218 | + if (o && o.type) { | ||
| 219 | + if (o.type.toLowerCase() === "radio" || o.type.toLowerCase() === "checkbox") { | ||
| 220 | + o.checked = config[i]; | ||
| 221 | + } else { | ||
| 222 | + //alert(idjanela+" - "+config[i]) | ||
| 223 | + o.value = config[i]; | ||
| 224 | + } | ||
| 222 | } | 225 | } |
| 223 | } | 226 | } |
| 224 | } | 227 | } |
| @@ -231,6 +234,7 @@ i3GEOF.graficointerativo1 = | @@ -231,6 +234,7 @@ i3GEOF.graficointerativo1 = | ||
| 231 | i3GEOF.graficointerativo1.comboTemas(idjanela); | 234 | i3GEOF.graficointerativo1.comboTemas(idjanela); |
| 232 | // cria as entradas de parametros para o eixo y | 235 | // cria as entradas de parametros para o eixo y |
| 233 | // quando o grafico esta sendo restaurado do mapa | 236 | // quando o grafico esta sendo restaurado do mapa |
| 237 | + | ||
| 234 | if (config.valoresCombosItens && config.valoresCombosItens.selects.length > 0) { | 238 | if (config.valoresCombosItens && config.valoresCombosItens.selects.length > 0) { |
| 235 | n = config.valoresCombosItens.selects.length; | 239 | n = config.valoresCombosItens.selects.length; |
| 236 | 240 | ||
| @@ -238,6 +242,7 @@ i3GEOF.graficointerativo1 = | @@ -238,6 +242,7 @@ i3GEOF.graficointerativo1 = | ||
| 238 | var i, c, objs; | 242 | var i, c, objs; |
| 239 | atualizaConfigGr(); | 243 | atualizaConfigGr(); |
| 240 | //cria as demais entradas de Y | 244 | //cria as demais entradas de Y |
| 245 | + | ||
| 241 | for (i = 0; i < n; i++) { | 246 | for (i = 0; i < n; i++) { |
| 242 | // cria o combo, para cada combo sao adicionados um input para o nome e um input para a cor | 247 | // cria o combo, para cada combo sao adicionados um input para o nome e um input para a cor |
| 243 | $i(idjanela + "i3GEOgraficointerativo1ComboYid").onchange.call(); | 248 | $i(idjanela + "i3GEOgraficointerativo1ComboYid").onchange.call(); |
| @@ -247,20 +252,25 @@ i3GEOF.graficointerativo1 = | @@ -247,20 +252,25 @@ i3GEOF.graficointerativo1 = | ||
| 247 | // | 252 | // |
| 248 | c = $i(idjanela + "i3GEOgraficointerativo1ComboYlinha"); | 253 | c = $i(idjanela + "i3GEOgraficointerativo1ComboYlinha"); |
| 249 | objs = c.getElementsByTagName("select"); | 254 | objs = c.getElementsByTagName("select"); |
| 255 | + | ||
| 250 | for (i = 0; i < n; i++) { | 256 | for (i = 0; i < n; i++) { |
| 251 | objs[i].value = config.valoresCombosItens.selects[i]; | 257 | objs[i].value = config.valoresCombosItens.selects[i]; |
| 252 | } | 258 | } |
| 259 | + | ||
| 253 | objs = c.getElementsByTagName("input"); | 260 | objs = c.getElementsByTagName("input"); |
| 254 | n = config.valoresCombosItens.inputs.length; | 261 | n = config.valoresCombosItens.inputs.length; |
| 255 | for (i = 0; i < n; i++) { | 262 | for (i = 0; i < n; i++) { |
| 256 | objs[i].value = config.valoresCombosItens.inputs[i]; | 263 | objs[i].value = config.valoresCombosItens.inputs[i]; |
| 257 | } | 264 | } |
| 258 | atualizaConfigGr(); | 265 | atualizaConfigGr(); |
| 266 | + | ||
| 259 | if (i3GEOF.graficointerativo1.propJanelas[idjanela].dados == "") { | 267 | if (i3GEOF.graficointerativo1.propJanelas[idjanela].dados == "") { |
| 260 | i3GEOF.graficointerativo1.obterDados(idjanela); | 268 | i3GEOF.graficointerativo1.obterDados(idjanela); |
| 261 | } | 269 | } |
| 270 | + | ||
| 262 | }; | 271 | }; |
| 263 | //cria o combo para X e um combo para Y | 272 | //cria o combo para X e um combo para Y |
| 273 | + | ||
| 264 | i3GEOF.graficointerativo1.comboItensSel(idjanela,f); | 274 | i3GEOF.graficointerativo1.comboItensSel(idjanela,f); |
| 265 | } | 275 | } |
| 266 | else{ | 276 | else{ |
| @@ -475,6 +485,7 @@ i3GEOF.graficointerativo1 = | @@ -475,6 +485,7 @@ i3GEOF.graficointerativo1 = | ||
| 475 | } else { | 485 | } else { |
| 476 | i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOgraficointerativo1guia1", idjanela + "i3GEOgraficointerativo1guia"); | 486 | i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOgraficointerativo1guia1", idjanela + "i3GEOgraficointerativo1guia"); |
| 477 | } | 487 | } |
| 488 | + | ||
| 478 | // | 489 | // |
| 479 | // Apos todos os elementos HTML da ferramenta terem sido renderizados | 490 | // Apos todos os elementos HTML da ferramenta terem sido renderizados |
| 480 | // aplicam-se os parametros armazenados nas propriedades da janela atual | 491 | // aplicam-se os parametros armazenados nas propriedades da janela atual |
| @@ -532,7 +543,7 @@ i3GEOF.graficointerativo1 = | @@ -532,7 +543,7 @@ i3GEOF.graficointerativo1 = | ||
| 532 | // se existir um elemento HTML com o mesmo ID da janela, a renderizacao ocorrera | 543 | // se existir um elemento HTML com o mesmo ID da janela, a renderizacao ocorrera |
| 533 | // nesse elemento, caso contrario, sera criada uma janela flutuante | 544 | // nesse elemento, caso contrario, sera criada uma janela flutuante |
| 534 | // | 545 | // |
| 535 | - if (!$i(idjanela)) { | 546 | + if (!$i(idjanela) && !$i(idjanela+"_corpo")) { |
| 536 | // cria a janela flutuante | 547 | // cria a janela flutuante |
| 537 | cabecalho = function() { | 548 | cabecalho = function() { |
| 538 | i3GEOF.graficointerativo1.ativaFoco(idjanela); | 549 | i3GEOF.graficointerativo1.ativaFoco(idjanela); |
| @@ -599,14 +610,23 @@ i3GEOF.graficointerativo1 = | @@ -599,14 +610,23 @@ i3GEOF.graficointerativo1 = | ||
| 599 | 610 | ||
| 600 | } else { | 611 | } else { |
| 601 | // o grafico sera renderizado em $i(idjanela) | 612 | // o grafico sera renderizado em $i(idjanela) |
| 602 | - divid = idjanela; | 613 | + temp = 'i3GEOF.graficointerativo1.propJanelas["' + idjanela + '"].atualiza = this.checked'; |
| 614 | + $i(idjanela+"_corpo").innerHTML = "<img src='../imagens/aguarde2.gif' style='visibility: hidden;' class='i3GeoAguardeJanela' id='"+idjanela+"_imagemCabecalho'>" | ||
| 615 | + + "<div style=background-color:#F2F2F2; >" | ||
| 616 | + + "<input class='inputsb' checked style='cursor:pointer;position:relative;top:2px;' onclick='" | ||
| 617 | + + temp | ||
| 618 | + + "' type=checkbox /> " | ||
| 619 | + + $trad("atualizaNavegacao", i3GEOF.graficointerativo1.dicionario) + " (" + idjanela + ")</div>"; | ||
| 620 | + | ||
| 621 | + divid = idjanela+"_corpo"; | ||
| 622 | + } | ||
| 623 | + if($i(idjanela + "_imagemCabecalho")){ | ||
| 624 | + i3GEOF.graficointerativo1.aguarde = $i(idjanela + "_imagemCabecalho").style; | ||
| 625 | + i3GEOF.graficointerativo1.propJanelas[idjanela].aguarde = $i(idjanela + "_imagemCabecalho").style; | ||
| 626 | + i3GEOF.graficointerativo1.propJanelas[idjanela].atualiza = true; | ||
| 603 | } | 627 | } |
| 604 | - i3GEOF.graficointerativo1.aguarde = $i(idjanela + "_imagemCabecalho").style; | ||
| 605 | - i3GEOF.graficointerativo1.propJanelas[idjanela].aguarde = $i(idjanela + "_imagemCabecalho").style; | ||
| 606 | - i3GEOF.graficointerativo1.propJanelas[idjanela].atualiza = true; | ||
| 607 | 628 | ||
| 608 | i3GEOF.graficointerativo1.inicia(divid, idjanela); | 629 | i3GEOF.graficointerativo1.inicia(divid, idjanela); |
| 609 | - | ||
| 610 | // eventos que ocorrem no mapa e afetam os graficos | 630 | // eventos que ocorrem no mapa e afetam os graficos |
| 611 | if (i3GEO.Interface) { | 631 | if (i3GEO.Interface) { |
| 612 | i3GEO.janela.tempoMsg($trad('dadosRegiaoMostrada', i3GEOF.graficointerativo1.dicionario)); | 632 | i3GEO.janela.tempoMsg($trad('dadosRegiaoMostrada', i3GEOF.graficointerativo1.dicionario)); |
| @@ -636,9 +656,12 @@ i3GEOF.graficointerativo1 = | @@ -636,9 +656,12 @@ i3GEOF.graficointerativo1 = | ||
| 636 | if (i3GEO.Interface) { | 656 | if (i3GEO.Interface) { |
| 637 | i3GEO.barraDeBotoes.ativaIcone("graficointerativo1"); | 657 | i3GEO.barraDeBotoes.ativaIcone("graficointerativo1"); |
| 638 | } | 658 | } |
| 639 | - var i = $i(idjanela + "_c").style; | ||
| 640 | - i3GEO.janela.ULTIMOZINDEX++; | ||
| 641 | - i.zIndex = i3GEO.janela.ULTIMOZINDEX; | 659 | + var i = $i(idjanela + "_c"); |
| 660 | + if(i){ | ||
| 661 | + i = i.style; | ||
| 662 | + i3GEO.janela.ULTIMOZINDEX++; | ||
| 663 | + i.zIndex = i3GEO.janela.ULTIMOZINDEX; | ||
| 664 | + } | ||
| 642 | }, | 665 | }, |
| 643 | novaJanela : function(idjanela) { | 666 | novaJanela : function(idjanela) { |
| 644 | var janela = "", divid, g, v, cabecalho, id, minimiza, titulo; | 667 | var janela = "", divid, g, v, cabecalho, id, minimiza, titulo; |
| @@ -664,7 +687,7 @@ i3GEOF.graficointerativo1 = | @@ -664,7 +687,7 @@ i3GEOF.graficointerativo1 = | ||
| 664 | * Monta o combo para escolha do tema que será utilizado no gráfico | 687 | * Monta o combo para escolha do tema que será utilizado no gráfico |
| 665 | */ | 688 | */ |
| 666 | comboTemas : function(idjanela) { | 689 | comboTemas : function(idjanela) { |
| 667 | - if (!i3GEO.Interface) { | 690 | + if (!i3GEO.Interface || !$i(idjanela + "i3GEOgraficointerativo1ComboTemas")) { |
| 668 | return; | 691 | return; |
| 669 | } | 692 | } |
| 670 | i3GEO.util.comboTemas(idjanela + "i3GEOgraficointerativo1ComboTemasId", function(retorno) { | 693 | i3GEO.util.comboTemas(idjanela + "i3GEOgraficointerativo1ComboTemasId", function(retorno) { |