Commit 208ad84ab1e59df4901d07f903836c18bd721c16
1 parent
82f6a647
Exists in
master
and in
7 other branches
Conclusão da reformulação da ferramenta graficos interativos
Showing
1 changed file
with
15 additions
and
30 deletions
Show diff stats
ferramentas/graficointerativo1/index.js
| ... | ... | @@ -98,17 +98,6 @@ i3GEOF.graficointerativo1 = |
| 98 | 98 | */ |
| 99 | 99 | dadospuros : false, |
| 100 | 100 | /** |
| 101 | - * Propriedade: navegacao | |
| 102 | - * | |
| 103 | - * Ativa ou não a navegação dinâmica do mapa | |
| 104 | - * | |
| 105 | - * Type: {boolean} | |
| 106 | - * | |
| 107 | - * Default: {false} | |
| 108 | - */ | |
| 109 | - navegacao : false, | |
| 110 | - | |
| 111 | - /** | |
| 112 | 101 | * Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário |
| 113 | 102 | */ |
| 114 | 103 | criaJanelaFlutuante : function(dados) { |
| ... | ... | @@ -129,8 +118,8 @@ i3GEOF.graficointerativo1 = |
| 129 | 118 | i3GEOF.graficointerativo1.dados = dados; |
| 130 | 119 | } |
| 131 | 120 | var temp = function() { |
| 132 | - i3GEOF.graficointerativo1.ativaNavegacao(); | |
| 133 | 121 | i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados); |
| 122 | + i3GEOF.graficointerativo1.ativaEventosNavegacao(); | |
| 134 | 123 | }; |
| 135 | 124 | if (typeof (i3GEOF.graficointerativo1.dicionario) === 'undefined') { |
| 136 | 125 | i3GEO.util.scriptTag( |
| ... | ... | @@ -444,8 +433,9 @@ i3GEOF.graficointerativo1 = |
| 444 | 433 | i3GEOF.graficointerativo1.janelas.push(idjanela); |
| 445 | 434 | i3GEOF.graficointerativo1.propJanelas[idjanela] = {}; |
| 446 | 435 | i3GEOF.graficointerativo1.propJanelas[idjanela].tema = i3GEO.temaAtivo; |
| 447 | - i3GEOF.graficointerativo1.propJanelas[idjanela].atualiza = false; | |
| 436 | + i3GEOF.graficointerativo1.propJanelas[idjanela].atualiza = true; | |
| 448 | 437 | i3GEOF.graficointerativo1.propJanelas[idjanela].dados = dados; |
| 438 | + | |
| 449 | 439 | // guarda para esse grafico alguns valores default obtidos dos |
| 450 | 440 | // parametros gerais da ferramenta |
| 451 | 441 | i3GEOF.graficointerativo1.propJanelas[idjanela].acumula = i3GEOF.graficointerativo1.acumula; |
| ... | ... | @@ -502,32 +492,28 @@ i3GEOF.graficointerativo1 = |
| 502 | 492 | // indica se a janela sera atualizada na navegacao |
| 503 | 493 | temp = 'i3GEOF.graficointerativo1.propJanelas["' + idjanela + '"].atualiza = this.checked'; |
| 504 | 494 | janela[0] |
| 505 | - .setFooter("<div style=background-color:#F2F2F2; ><input class='inputsb' style='cursor:pointer;position:relative;top:2px;' onclick='" | |
| 495 | + .setFooter("<div style=background-color:#F2F2F2; ><input class='inputsb' checked style='cursor:pointer;position:relative;top:2px;' onclick='" | |
| 506 | 496 | + temp + "' type=checkbox /> " + $trad(53, i3GEOF.graficointerativo1.dicionario) + " (" + idjanela + ")</div>"); |
| 507 | 497 | |
| 508 | 498 | i3GEOF.graficointerativo1.inicia(divid, idjanela); |
| 509 | 499 | if (i3GEO.Interface) { |
| 510 | - temp = | |
| 511 | - function() { | |
| 512 | - if (i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth") { | |
| 513 | - i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.obterDados()"); | |
| 500 | + temp = function() { | |
| 501 | + i3GEOF.graficointerativo1.janelas.remove(idjanela); | |
| 502 | + i3GEOF.graficointerativo1.propJanelas[idjanela] = null; | |
| 503 | + if (i3GEOF.graficointerativo1.janelas.length === 0) { | |
| 504 | + if (i3GEO.Interface.ATUAL === "openlayers") { | |
| 505 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.atualizaListaDeRegistros()"); | |
| 514 | 506 | } |
| 515 | - if (i3GEO.Interface.ATUAL == "googlemaps") { | |
| 507 | + if (i3GEO.Interface.ATUAL === "googlemaps") { | |
| 516 | 508 | google.maps.event.removeListener(graficointerativo1Dragend); |
| 517 | 509 | google.maps.event.removeListener(graficointerativo1Zoomend); |
| 518 | 510 | } |
| 519 | 511 | if (i3GEO.Interface.ATUAL === "googleearth") { |
| 520 | 512 | google.earth.removeEventListener(graficointerativo1Dragend); |
| 521 | 513 | } |
| 522 | - if (i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search( | |
| 523 | - "i3GEOF.graficointerativo1.comboTemas('" + idjanela + "')") > 0) { | |
| 524 | - i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.graficointerativo1.comboTemas('" + idjanela + "')"); | |
| 525 | - } | |
| 526 | - }; | |
| 514 | + } | |
| 515 | + }; | |
| 527 | 516 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); |
| 528 | - if (i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.graficointerativo1.comboTemas('" + idjanela + "')") < 0) { | |
| 529 | - i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEOF.graficointerativo1.comboTemas('" + idjanela + "')"); | |
| 530 | - } | |
| 531 | 517 | } |
| 532 | 518 | janela[0].bringToTop(); |
| 533 | 519 | }, |
| ... | ... | @@ -720,7 +706,6 @@ i3GEOF.graficointerativo1 = |
| 720 | 706 | * <GRAFICOSELECAO> |
| 721 | 707 | */ |
| 722 | 708 | obterDados : function(idjanela) { |
| 723 | - // TODO | |
| 724 | 709 | if (!i3GEO.Interface) { |
| 725 | 710 | return; |
| 726 | 711 | } |
| ... | ... | @@ -1111,12 +1096,12 @@ i3GEOF.graficointerativo1 = |
| 1111 | 1096 | * |
| 1112 | 1097 | * Ativa a atualização automática ao navegar no mapa |
| 1113 | 1098 | */ |
| 1114 | - ativaNavegacao : function() { | |
| 1099 | + ativaEventosNavegacao : function() { | |
| 1115 | 1100 | if (!i3GEO.Interface) { |
| 1116 | 1101 | return; |
| 1117 | 1102 | } |
| 1118 | 1103 | i3GEO.janela.tempoMsg($trad(37, i3GEOF.graficointerativo1.dicionario)); |
| 1119 | - if (i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth") { | |
| 1104 | + if (i3GEO.Interface.ATUAL === "openlayers") { | |
| 1120 | 1105 | i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo1.atualizaListaDeRegistros()"); |
| 1121 | 1106 | } |
| 1122 | 1107 | if (i3GEO.Interface.ATUAL === "googlemaps") { | ... | ... |