Commit cd3701713022dee843dc6050bad92a52f49dbd90

Authored by Edmar Moretti
1 parent 8f0cef26

#281

Showing 1 changed file with 30 additions and 0 deletions   Show diff stats
ferramentas/graficointerativo/index.js.php
... ... @@ -183,6 +183,7 @@ i3GEOF.graficointerativo = {
183 183 ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoAcumula /> Utiliza valores acumulados</p>' +
184 184 ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoRelativa /> Utiliza valores relativos (%)</p>' +
185 185 ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoDadosPuros /> Não processa os valores ao obter os dados (mantém os dados como estão na tabela de atributos) - essa opção é útil nos gráficos de distribuição de pontos</p>' +
  186 + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox onclick="i3GEOF.graficointerativo.ativaNavegacao(this)" /> Atualiza o gráfico ao navegar pelo mapa</p>' +
186 187 '</div>'+
187 188 '<div class=guiaobj id="i3GEOgraficointerativoguia4obj" style="left:1px;display:none;top:-5px">' +
188 189 ' <div id="i3GEOgraficointerativoGrafico"></div>' +
... ... @@ -646,7 +647,36 @@ i3GEOF.graficointerativo = {
646 647 tabela.innerHTML = ins;
647 648 }
648 649 catch(e){}
  650 + },
  651 + /*
  652 + Function: ativaNavegacao
  653 +
  654 + Ativa ou desativa a atualização automática ao navegar no mapa
  655 + */
  656 + ativaNavegacao: function(obj){
  657 + if(obj.checked){
  658 + if(i3GEO.Interface.ATUAL === "padrao"){
  659 + i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo.obterDados()");
  660 + }
  661 + if(i3GEO.Interface.ATUAL === "googlemaps"){
  662 + graficointerativoDragend = GEvent.addListener(i3GeoMap, "dragend", function() {i3GEOF.graficointerativo.obterDados();});
  663 + graficointerativoZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {i3GEOF.graficointerativo.obterDados();});
  664 + }
  665 + if(i3GEO.Interface.ATUAL === "openlayers"){
  666 + i3geoOL.events.register("moveend",i3geoOL,function(e){i3GEOF.graficointerativo.obterDados();});
  667 + }
  668 + }
  669 + else{
  670 + if(i3GEO.Interface.ATUAL === "padrao"){
  671 + i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo.obterDados()");
  672 + }
  673 + if(i3GEO.Interface.ATUAL === "googlemaps"){
  674 + GEvent.removeListener(graficointerativoDragend);
  675 + GEvent.removeListener(graficointerativoZoomend);
  676 + }
  677 + }
649 678 }
  679 +
650 680 };
651 681 //pacotes/openflahchart/json2.js
652 682 if (!this.JSON1) {
... ...