Commit 212edb6b33ea036f946b8d9b1212109cf760b9fa

Authored by Edmar Moretti
1 parent 0db9cf86

Desenvolvimento do heatmap.

admin/admin.db
No preview for this file type
classesjs/classe_interface.js
@@ -1405,6 +1405,11 @@ i3GEO.Interface = { @@ -1405,6 +1405,11 @@ i3GEO.Interface = {
1405 layers[0].setVisibility(obj.checked); 1405 layers[0].setVisibility(obj.checked);
1406 if(obj.checked === true){ 1406 if(obj.checked === true){
1407 layers[0].div.style.display = "block"; 1407 layers[0].div.style.display = "block";
  1408 + i3GEO.pluginI3geo.ligaCamada(obj.value);
  1409 + }
  1410 + else{
  1411 + layers[0].div.style.display = "none";
  1412 + i3GEO.pluginI3geo.desLigaCamada(obj.value);
1408 } 1413 }
1409 } 1414 }
1410 if (obj.checked) { 1415 if (obj.checked) {
classesjs/classe_plugini3geo.js
@@ -36,6 +36,7 @@ if (typeof (i3GEO) === 'undefined') { @@ -36,6 +36,7 @@ if (typeof (i3GEO) === 'undefined') {
36 var i3GEO = {}; 36 var i3GEO = {};
37 } 37 }
38 i3GEO.pluginI3geo = { 38 i3GEO.pluginI3geo = {
  39 + OBJETOS: {},
39 /** 40 /**
40 * Inicia a execucao de um plugin 41 * Inicia a execucao de um plugin
41 * 42 *
@@ -57,6 +58,16 @@ i3GEO.pluginI3geo = { @@ -57,6 +58,16 @@ i3GEO.pluginI3geo = {
57 // cada interface 58 // cada interface
58 i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada); 59 i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada);
59 }, 60 },
  61 + ligaCamada : function(nomecamada) {
  62 + if(i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada){
  63 + i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada();
  64 + }
  65 + },
  66 + desLigaCamada : function(nomecamada) {
  67 + if(i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada){
  68 + i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada();
  69 + }
  70 + },
60 /** 71 /**
61 * Aplica as propriedades em um objeto do tipo tema 72 * Aplica as propriedades em um objeto do tipo tema
62 * 73 *
@@ -106,6 +117,19 @@ i3GEO.pluginI3geo = { @@ -106,6 +117,19 @@ i3GEO.pluginI3geo = {
106 heatmap : { 117 heatmap : {
107 googlemaps: { 118 googlemaps: {
108 aplicaPropriedades: function(camada){ 119 aplicaPropriedades: function(camada){
  120 + camada.sel = "nao";
  121 + camada.download = "nao";
  122 + camada.AGUARDALEGENDA = false;
  123 + camada.temporizador = "";
  124 + camada.copia = false;
  125 + camada.procurar = false;
  126 + camada.toponimia = false;
  127 + camada.etiquetas = false;
  128 + camada.tabela = false;
  129 + camada.grafico = false;
  130 + camada.destacar = false;
  131 + camada.wms = false;
  132 + camada.classe = "NAO";
109 return camada; 133 return camada;
110 }, 134 },
111 inicia: function(camada){ 135 inicia: function(camada){
@@ -145,6 +169,11 @@ i3GEO.pluginI3geo = { @@ -145,6 +169,11 @@ i3GEO.pluginI3geo = {
145 "i3GEO.pluginI3geo.heatmap_script"); 169 "i3GEO.pluginI3geo.heatmap_script");
146 } 170 }
147 }, 171 },
  172 + //
  173 + //O script que adiciona a camada
  174 + //define os eventos visibilitychanged, moveend e removed
  175 + //A camada e adicionada como um objeto layer, permitindo que as funcoes do i3Geo operem normalmente, sem muitas modificacoes
  176 + //
148 openlayers : { 177 openlayers : {
149 aplicaPropriedades: function(camada){ 178 aplicaPropriedades: function(camada){
150 camada.sel = "nao"; 179 camada.sel = "nao";
@@ -204,6 +233,15 @@ i3GEO.pluginI3geo = { @@ -204,6 +233,15 @@ i3GEO.pluginI3geo = {
204 projection: new OpenLayers.Projection("EPSG:4326") 233 projection: new OpenLayers.Projection("EPSG:4326")
205 } 234 }
206 ); 235 );
  236 + heatmap.ligaCamada = function(){
  237 + this.toggle();
  238 + this.updateLayer();
  239 + };
  240 + heatmap.desLigaCamada = function(){
  241 + this.toggle();
  242 + this.updateLayer();
  243 + };
  244 + i3GEO.pluginI3geo.OBJETOS[camada.name] = heatmap;
207 i3geoOL.addLayer(heatmap); 245 i3geoOL.addLayer(heatmap);
208 heatmap.setDataSet(transformedTestData); 246 heatmap.setDataSet(transformedTestData);
209 heatmap_dados = null; 247 heatmap_dados = null;
pacotes/heatmap/src/heatmap-openlayers.js
@@ -49,7 +49,7 @@ OpenLayers.Layer.Heatmap = OpenLayers.Class(OpenLayers.Layer, { @@ -49,7 +49,7 @@ OpenLayers.Layer.Heatmap = OpenLayers.Class(OpenLayers.Layer, {
49 // on zoomend and moveend we have to move the canvas element and redraw the datapoints with new positions 49 // on zoomend and moveend we have to move the canvas element and redraw the datapoints with new positions
50 //map.events.register("zoomend", this, handler); 50 //map.events.register("zoomend", this, handler);
51 map.events.register("moveend", this, handler); 51 map.events.register("moveend", this, handler);
52 - this.events.register("visibilitychanged", this,handler1); 52 + //this.events.register("visibilitychanged", this,handler1);
53 map.events.register( 53 map.events.register(
54 "removed", 54 "removed",
55 this, 55 this,