Commit d4b1d361a94b9bc330f098348cedb3bc8343d505

Authored by Edmar Moretti
1 parent eb8ea972

Inclusao do calculo de heatmap na interface googlemaps

classesjs/classe_interface.js
@@ -47,152 +47,152 @@ if (typeof (i3GEO) === 'undefined') { @@ -47,152 +47,152 @@ if (typeof (i3GEO) === 'undefined') {
47 i3GEO.Interface = { 47 i3GEO.Interface = {
48 /* 48 /*
49 * Propriedade: TABLET 49 * Propriedade: TABLET
50 - * 50 + *
51 * Quando true, são aplicadas configurações especiais 51 * Quando true, são aplicadas configurações especiais
52 * para uso em tablets. 52 * para uso em tablets.
53 - * 53 + *
54 * Altera o posicionamento da barra de botões e comportamento das 54 * Altera o posicionamento da barra de botões e comportamento das
55 * guias. Veja o exemplo interface/openlayers_t.htm. 55 * guias. Veja o exemplo interface/openlayers_t.htm.
56 - * 56 + *
57 * Type: {boolean} 57 * Type: {boolean}
58 - * 58 + *
59 * Default: {false} 59 * Default: {false}
60 */ 60 */
61 TABLET : false, 61 TABLET : false,
62 /* 62 /*
63 * Propriedade: ALTTABLET 63 * Propriedade: ALTTABLET
64 - * 64 + *
65 * Nome do arquivo HTML com a interface alternativa utilizada quando o i3Geo 65 * Nome do arquivo HTML com a interface alternativa utilizada quando o i3Geo
66 * detecta o uso de um dispositivo móvel 66 * detecta o uso de um dispositivo móvel
67 - * 67 + *
68 * A detecção é aplicada automaticamente quando essa 68 * A detecção é aplicada automaticamente quando essa
69 * variável for definida 69 * variável for definida
70 - * 70 + *
71 * Para não aplicar a detecção, use 71 * Para não aplicar a detecção, use
72 * i3GEO.Interface.ALTTABLET = "" 72 * i3GEO.Interface.ALTTABLET = ""
73 - * 73 + *
74 * Type: {string} 74 * Type: {string}
75 - * 75 + *
76 * Default: {""} 76 * Default: {""}
77 */ 77 */
78 ALTTABLET : "", 78 ALTTABLET : "",
79 /* 79 /*
80 * Formato de geração da imagem. 80 * Formato de geração da imagem.
81 - * 81 + *
82 * Os formatos devem estar definidos no mapfile geral1windows.map e 82 * Os formatos devem estar definidos no mapfile geral1windows.map e
83 * geral1.map. A definição dessa variável não 83 * geral1.map. A definição dessa variável não
84 * afeta a interface padrão, que utiliza a definição 84 * afeta a interface padrão, que utiliza a definição
85 * que estiver ativa nos mapfiles de inicialização. 85 * que estiver ativa nos mapfiles de inicialização.
86 - * 86 + *
87 * Tipo: {MAPSERVER OUTPUTFORMAT} 87 * Tipo: {MAPSERVER OUTPUTFORMAT}
88 - * 88 + *
89 * Default: {"AGG_Q"} 89 * Default: {"AGG_Q"}
90 */ 90 */
91 OUTPUTFORMAT : "AGG_Q", 91 OUTPUTFORMAT : "AGG_Q",
92 /* 92 /*
93 * Propriedade: BARRABOTOESTOP 93 * Propriedade: BARRABOTOESTOP
94 - * 94 + *
95 * Distancia da barra de botões em relação ao topo do 95 * Distancia da barra de botões em relação ao topo do
96 * mapa. 96 * mapa.
97 - * 97 + *
98 * Tipo: {number} 98 * Tipo: {number}
99 - * 99 + *
100 * Default: {12} 100 * Default: {12}
101 */ 101 */
102 BARRABOTOESTOP : 12, 102 BARRABOTOESTOP : 12,
103 /* 103 /*
104 * Propriedade: BARRABOTOESLEFT 104 * Propriedade: BARRABOTOESLEFT
105 - * 105 + *
106 * Distancia da barra de botões em relação ao lado 106 * Distancia da barra de botões em relação ao lado
107 * esquerdo do mapa. 107 * esquerdo do mapa.
108 - * 108 + *
109 * Tipo: {number} 109 * Tipo: {number}
110 - * 110 + *
111 * Default: {3} 111 * Default: {3}
112 */ 112 */
113 BARRABOTOESLEFT : 3, 113 BARRABOTOESLEFT : 3,
114 /* 114 /*
115 * Propriedade: BARRADEZOOMTOP 115 * Propriedade: BARRADEZOOMTOP
116 - * 116 + *
117 * Distancia da barra de zoom em relação ao topo do mapa. 117 * Distancia da barra de zoom em relação ao topo do mapa.
118 - * 118 + *
119 * Tipo: {number} 119 * Tipo: {number}
120 - * 120 + *
121 * Default: {12} 121 * Default: {12}
122 */ 122 */
123 BARRADEZOOMTOP : 20, 123 BARRADEZOOMTOP : 20,
124 /* 124 /*
125 * Propriedade: BARRADEZOOMLEFT 125 * Propriedade: BARRADEZOOMLEFT
126 - * 126 + *
127 * Distancia da barra de zoom em relação ao lado esquerdo do 127 * Distancia da barra de zoom em relação ao lado esquerdo do
128 * mapa. 128 * mapa.
129 - * 129 + *
130 * Tipo: {number} 130 * Tipo: {number}
131 - * 131 + *
132 * Default: {3} 132 * Default: {3}
133 */ 133 */
134 BARRADEZOOMLEFT : 10, 134 BARRADEZOOMLEFT : 10,
135 /* 135 /*
136 * Propriedade: ATUAL 136 * Propriedade: ATUAL
137 - * 137 + *
138 * Interface utilizada na criação e controle do mapa. 138 * Interface utilizada na criação e controle do mapa.
139 - * 139 + *
140 * Veja como usar nos arquivos de apresentação do mapa 140 * Veja como usar nos arquivos de apresentação do mapa
141 * existentes no diretório i3geo/interface 141 * existentes no diretório i3geo/interface
142 - * 142 + *
143 * O i3Geo, além da interface própria, permite o uso de outras 143 * O i3Geo, além da interface própria, permite o uso de outras
144 * APIs para a construção do mapa, como Google Maps ou 144 * APIs para a construção do mapa, como Google Maps ou
145 * Openlayers. Essa propriedade define qual interface será usada. 145 * Openlayers. Essa propriedade define qual interface será usada.
146 * Não confundir com o nome do HTML que é utilizado para 146 * Não confundir com o nome do HTML que é utilizado para
147 * mostrar o mapa. 147 * mostrar o mapa.
148 - * 148 + *
149 * Para definir a interface, utilize 149 * Para definir a interface, utilize
150 - * 150 + *
151 * i3GEO.Interface.ATUAL = "<valor>" 151 * i3GEO.Interface.ATUAL = "<valor>"
152 - * 152 + *
153 * Tipo: {string} 153 * Tipo: {string}
154 - * 154 + *
155 * Valores: {openlayers|googlemaps|googleearth} 155 * Valores: {openlayers|googlemaps|googleearth}
156 - * 156 + *
157 * Default: {"openlayers"} 157 * Default: {"openlayers"}
158 */ 158 */
159 ATUAL : "openlayers", 159 ATUAL : "openlayers",
160 /* 160 /*
161 * Propriedade: IDCORPO 161 * Propriedade: IDCORPO
162 - * 162 + *
163 * ID do elemento HTML que receber&aacute; o corpo do mapa 163 * ID do elemento HTML que receber&aacute; o corpo do mapa
164 - * 164 + *
165 * Tipo: {string} 165 * Tipo: {string}
166 - * 166 + *
167 * Default: {"corpoMapa"} 167 * Default: {"corpoMapa"}
168 */ 168 */
169 IDCORPO : "corpoMapa", 169 IDCORPO : "corpoMapa",
170 /* 170 /*
171 * Indica se o menu de contexto deve ser ativado 171 * Indica se o menu de contexto deve ser ativado
172 - * 172 + *
173 * Tipo: {Boolean} 173 * Tipo: {Boolean}
174 - * 174 + *
175 * Default: {true} 175 * Default: {true}
176 */ 176 */
177 ATIVAMENUCONTEXTO : false, 177 ATIVAMENUCONTEXTO : false,
178 /* 178 /*
179 * Variavel: IDMAPA 179 * Variavel: IDMAPA
180 - * 180 + *
181 * ID do elemento HTML criado para conter o mapa 181 * ID do elemento HTML criado para conter o mapa
182 - * 182 + *
183 * Esse elemento normalmente &eacute; criado dentro de IDCORPO dependendo da 183 * Esse elemento normalmente &eacute; criado dentro de IDCORPO dependendo da
184 * interface 184 * interface
185 */ 185 */
186 IDMAPA : "", 186 IDMAPA : "",
187 /* 187 /*
188 * Indica o status atual do mapa. 188 * Indica o status atual do mapa.
189 - * 189 + *
190 * &Eacute; utilizado para verificar o status do mapa e bloquear ou 190 * &Eacute; utilizado para verificar o status do mapa e bloquear ou
191 * n&atilde;o determinadas fun&ccedil;&otilde;es. 191 * n&atilde;o determinadas fun&ccedil;&otilde;es.
192 - * 192 + *
193 * Por exemplo, na interface OpenLayers, identifica se as camadas 193 * Por exemplo, na interface OpenLayers, identifica se as camadas
194 * est&atilde;o sendo atualizadas 194 * est&atilde;o sendo atualizadas
195 - * 195 + *
196 * STATUS = { atualizando: new Array(), //guarda os c&oacute;digos dos 196 * STATUS = { atualizando: new Array(), //guarda os c&oacute;digos dos
197 * layers que est&atilde;o sendo redesenhados trocando: false //indica se o 197 * layers que est&atilde;o sendo redesenhados trocando: false //indica se o
198 * mapa est&aacute; na fase de troca de interface } 198 * mapa est&aacute; na fase de troca de interface }
@@ -282,7 +282,7 @@ i3GEO.Interface = { @@ -282,7 +282,7 @@ i3GEO.Interface = {
282 }, 282 },
283 /* 283 /*
284 * Function: redesenha 284 * Function: redesenha
285 - * 285 + *
286 * Aplica o m&eacute;todo redesenha da interface atual. Em alguns casos, a 286 * Aplica o m&eacute;todo redesenha da interface atual. Em alguns casos, a
287 * fun&ccedil;&atilde;o de redesenho aplica os mesmos processos da 287 * fun&ccedil;&atilde;o de redesenho aplica os mesmos processos da
288 * fun&ccedil;&atilde;o de atualizar o mapa. Isso ocorre pq em alguns casos 288 * fun&ccedil;&atilde;o de atualizar o mapa. Isso ocorre pq em alguns casos
@@ -296,13 +296,13 @@ i3GEO.Interface = { @@ -296,13 +296,13 @@ i3GEO.Interface = {
296 }, 296 },
297 /* 297 /*
298 * Function: aplicaOpacidade 298 * Function: aplicaOpacidade
299 - * 299 + *
300 * Aplica um fator de opacidade a todos os layers do mapa 300 * Aplica um fator de opacidade a todos os layers do mapa
301 - * 301 + *
302 * Parametro: 302 * Parametro:
303 - * 303 + *
304 * opacidade {numerico} - 0 a 1 304 * opacidade {numerico} - 0 a 1
305 - * 305 + *
306 * layer {string} - (opcional) se for vazio aplica ao mapa todo 306 * layer {string} - (opcional) se for vazio aplica ao mapa todo
307 */ 307 */
308 aplicaOpacidade : function(opacidade, layer) { 308 aplicaOpacidade : function(opacidade, layer) {
@@ -313,7 +313,7 @@ i3GEO.Interface = { @@ -313,7 +313,7 @@ i3GEO.Interface = {
313 }, 313 },
314 /* 314 /*
315 * Function: atualizaMapa 315 * Function: atualizaMapa
316 - * 316 + *
317 * Aplica o m&eacute;todo atualizaMapa da interface atual. Em alguns casos, 317 * Aplica o m&eacute;todo atualizaMapa da interface atual. Em alguns casos,
318 * a fun&ccedil;&atilde;o de redesenho aplica os mesmos processos da 318 * a fun&ccedil;&atilde;o de redesenho aplica os mesmos processos da
319 * fun&ccedil;&atilde;o de atualizar o mapa. Isso ocorre pq em alguns casos 319 * fun&ccedil;&atilde;o de atualizar o mapa. Isso ocorre pq em alguns casos
@@ -333,16 +333,16 @@ i3GEO.Interface = { @@ -333,16 +333,16 @@ i3GEO.Interface = {
333 }, 333 },
334 /* 334 /*
335 * Function: atualizaTema 335 * Function: atualizaTema
336 - * 336 + *
337 * Aplica o m&eacute;todo atualizaTema da interface atual 337 * Aplica o m&eacute;todo atualizaTema da interface atual
338 - * 338 + *
339 * Parametros: 339 * Parametros:
340 - * 340 + *
341 * retorno {JSON} - objeto JSON com os par�metros obtidos da 341 * retorno {JSON} - objeto JSON com os par�metros obtidos da
342 * fun&ccedil;&atilde;o PHP de redesenho do mapa. Quando igual a "", 342 * fun&ccedil;&atilde;o PHP de redesenho do mapa. Quando igual a "",
343 * &eacute; feita apenas a atualiza&ccedil;&atilde;o da camada, sem que a 343 * &eacute; feita apenas a atualiza&ccedil;&atilde;o da camada, sem que a
344 * &aacute;rvore de camadas seja atualizada. 344 * &aacute;rvore de camadas seja atualizada.
345 - * 345 + *
346 * tema {string} - c&oacute;digo do tema 346 * tema {string} - c&oacute;digo do tema
347 */ 347 */
348 atualizaTema : function(retorno, tema) { 348 atualizaTema : function(retorno, tema) {
@@ -352,11 +352,11 @@ i3GEO.Interface = { @@ -352,11 +352,11 @@ i3GEO.Interface = {
352 }, 352 },
353 /* 353 /*
354 * Function: ligaDesliga 354 * Function: ligaDesliga
355 - * 355 + *
356 * Liga/desliga um tema 356 * Liga/desliga um tema
357 - * 357 + *
358 * Parametros: 358 * Parametros:
359 - * 359 + *
360 * {object} objeto do tipo checkbox que foi acionado na arvore de camadas 360 * {object} objeto do tipo checkbox que foi acionado na arvore de camadas
361 */ 361 */
362 ligaDesliga : function(obj) { 362 ligaDesliga : function(obj) {
@@ -364,7 +364,7 @@ i3GEO.Interface = { @@ -364,7 +364,7 @@ i3GEO.Interface = {
364 }, 364 },
365 /* 365 /*
366 * Function: adicionaKml 366 * Function: adicionaKml
367 - * 367 + *
368 * Aplica o m&eacute;todo de adi&ccedil;&atilde;o de kml ao mapa conforme a 368 * Aplica o m&eacute;todo de adi&ccedil;&atilde;o de kml ao mapa conforme a
369 * interface atual 369 * interface atual
370 */ 370 */
@@ -383,14 +383,14 @@ i3GEO.Interface = { @@ -383,14 +383,14 @@ i3GEO.Interface = {
383 }, 383 },
384 /* 384 /*
385 * Cria ou altera os elementos HTML necess&aacute;rios para a interface 385 * Cria ou altera os elementos HTML necess&aacute;rios para a interface
386 - * 386 + *
387 * Essa fun&ccedil;&atilde;o &eacute; executada na 387 * Essa fun&ccedil;&atilde;o &eacute; executada na
388 * inicializa&ccedil;&atilde;o do i3geo 388 * inicializa&ccedil;&atilde;o do i3geo
389 - * 389 + *
390 * Parametros: 390 * Parametros:
391 - * 391 + *
392 * w {Integer} - largura do corpo do mapa em pixels 392 * w {Integer} - largura do corpo do mapa em pixels
393 - * 393 + *
394 * h {Integer} - altura do corpo do mapa em pixels 394 * h {Integer} - altura do corpo do mapa em pixels
395 */ 395 */
396 cria : function(w, h) { 396 cria : function(w, h) {
@@ -442,7 +442,7 @@ i3GEO.Interface = { @@ -442,7 +442,7 @@ i3GEO.Interface = {
442 }, 442 },
443 /* 443 /*
444 * Function: alteraLayers 444 * Function: alteraLayers
445 - * 445 + *
446 * Altera todos os layers do mapa modificando um determinado par�metro 446 * Altera todos os layers do mapa modificando um determinado par�metro
447 */ 447 */
448 alteraParametroLayers : function(parametro, valor) { 448 alteraParametroLayers : function(parametro, valor) {
@@ -469,27 +469,27 @@ i3GEO.Interface = { @@ -469,27 +469,27 @@ i3GEO.Interface = {
469 }, 469 },
470 /* 470 /*
471 * Classe: i3GEO.Interface.openlayers 471 * Classe: i3GEO.Interface.openlayers
472 - * 472 + *
473 * Interface com motor de navega&ccedil;&atilde;o baseado na API OpenLayers 473 * Interface com motor de navega&ccedil;&atilde;o baseado na API OpenLayers
474 - * 474 + *
475 * Utilizado quando 475 * Utilizado quando
476 - * 476 + *
477 * i3GEO.Interface.ATUAL = "openlayers" 477 * i3GEO.Interface.ATUAL = "openlayers"
478 - * 478 + *
479 * Cria o objeto i3geoOL que pode receber os m&eacute;todos da API do 479 * Cria o objeto i3geoOL que pode receber os m&eacute;todos da API do
480 * OpenLayers 480 * OpenLayers
481 - * 481 + *
482 * Para detalhes sobre a configura&ccedil;&atilde;o da interface, veja 482 * Para detalhes sobre a configura&ccedil;&atilde;o da interface, veja
483 * i3geo/aplicmap/openlayers.htm 483 * i3geo/aplicmap/openlayers.htm
484 */ 484 */
485 openlayers : { 485 openlayers : {
486 /* 486 /*
487 * Propriedade: parametrosMap 487 * Propriedade: parametrosMap
488 - * 488 + *
489 * Permite incluir parametros da API do OpenLayers nao previstos no 489 * Permite incluir parametros da API do OpenLayers nao previstos no
490 * i3Geo. Veja em 490 * i3Geo. Veja em
491 * http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Map-js.html 491 * http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Map-js.html
492 - * 492 + *
493 * Exemplo i3GEO.Interface.openlayers.parametrosMap.scales = [50000000, 493 * Exemplo i3GEO.Interface.openlayers.parametrosMap.scales = [50000000,
494 * 30000000, 10000000, 5000000]; 494 * 30000000, 10000000, 5000000];
495 */ 495 */
@@ -505,46 +505,46 @@ i3GEO.Interface = { @@ -505,46 +505,46 @@ i3GEO.Interface = {
505 }, 505 },
506 /* 506 /*
507 * Propriedade: FUNDOTEMA 507 * Propriedade: FUNDOTEMA
508 - * 508 + *
509 * Estilo "background" do nome do tema na &aacute;rvore de camadas 509 * Estilo "background" do nome do tema na &aacute;rvore de camadas
510 * enquanto o mesmo est&aacute; sendo carregado. 510 * enquanto o mesmo est&aacute; sendo carregado.
511 - * 511 + *
512 * Permite destacar o nome do tema que est&aacute; em processo de 512 * Permite destacar o nome do tema que est&aacute; em processo de
513 * carregamento 513 * carregamento
514 - * 514 + *
515 * Tipo: {background style} 515 * Tipo: {background style}
516 - * 516 + *
517 * Default: {yellow} 517 * Default: {yellow}
518 */ 518 */
519 FUNDOTEMA : "yellow", 519 FUNDOTEMA : "yellow",
520 /* 520 /*
521 * Propriedade: TILES 521 * Propriedade: TILES
522 - * 522 + *
523 * Indica se ser&aacute; utilizado o modo de navega&ccedil;&atilde;o em 523 * Indica se ser&aacute; utilizado o modo de navega&ccedil;&atilde;o em
524 * tiles 524 * tiles
525 - * 525 + *
526 * Tipo: {boolean} 526 * Tipo: {boolean}
527 - * 527 + *
528 * Default: {false} 528 * Default: {false}
529 */ 529 */
530 TILES : true, 530 TILES : true,
531 /* 531 /*
532 * N&uacute;mero de TILES na &aacute;rea n&atilde;o vis&iacute;vel do 532 * N&uacute;mero de TILES na &aacute;rea n&atilde;o vis&iacute;vel do
533 * mapa 533 * mapa
534 - * 534 + *
535 * Tipo: {integer} 535 * Tipo: {integer}
536 - * 536 + *
537 * Default: {0} 537 * Default: {0}
538 */ 538 */
539 BUFFER : 0, 539 BUFFER : 0,
540 /* 540 /*
541 * Propriedade: GADGETS 541 * Propriedade: GADGETS
542 - * 542 + *
543 * Lista dos controles espec&iacute;ficos da API do OpenLayers que 543 * Lista dos controles espec&iacute;ficos da API do OpenLayers que
544 * ser&atilde;o inseridos ou n&atilde;o no mapa 544 * ser&atilde;o inseridos ou n&atilde;o no mapa
545 - * 545 + *
546 * Tipo: {object} 546 * Tipo: {object}
547 - * 547 + *
548 * Default: 548 * Default:
549 * {PanZoomBar:true,LayerSwitcher:true,ScaleLine:true,OverviewMap:true} 549 * {PanZoomBar:true,LayerSwitcher:true,ScaleLine:true,OverviewMap:true}
550 */ 550 */
@@ -557,37 +557,37 @@ i3GEO.Interface = { @@ -557,37 +557,37 @@ i3GEO.Interface = {
557 }, 557 },
558 /* 558 /*
559 * Propriedade: MINEXTENT 559 * Propriedade: MINEXTENT
560 - * 560 + *
561 * Menor extens&atilde;o geogr&aacute;fica que pode ser mostrada no mapa 561 * Menor extens&atilde;o geogr&aacute;fica que pode ser mostrada no mapa
562 - * 562 + *
563 * Tipo: {array} 563 * Tipo: {array}
564 - * 564 + *
565 * Default: {-0.0003, -0.0003, 0.0003, 0.0003]} 565 * Default: {-0.0003, -0.0003, 0.0003, 0.0003]}
566 */ 566 */
567 MINEXTENT : [ -0.0003, -0.0003, 0.0003, 0.0003 ], 567 MINEXTENT : [ -0.0003, -0.0003, 0.0003, 0.0003 ],
568 /* 568 /*
569 * Propriedade: MAXEXTENT 569 * Propriedade: MAXEXTENT
570 - * 570 + *
571 * Maior extens&atilde;o geogr&aacute;fica que pode ser mostrada no mapa 571 * Maior extens&atilde;o geogr&aacute;fica que pode ser mostrada no mapa
572 - * 572 + *
573 * Tipo: {array} 573 * Tipo: {array}
574 - * 574 + *
575 * Default: {[-180, -90, 180, 90]} 575 * Default: {[-180, -90, 180, 90]}
576 */ 576 */
577 MAXEXTENT : [ -180, -90, 180, 90 ], 577 MAXEXTENT : [ -180, -90, 180, 90 ],
578 /* 578 /*
579 * Propriedades: LAYERSADICIONAIS 579 * Propriedades: LAYERSADICIONAIS
580 - * 580 + *
581 * Array com objetos do tipo LAYER que ser&atilde;o adicionados 581 * Array com objetos do tipo LAYER que ser&atilde;o adicionados
582 * ap&oacute;s a crioa&ccedil;&atilde;o de todos os layers default. 582 * ap&oacute;s a crioa&ccedil;&atilde;o de todos os layers default.
583 - * 583 + *
584 * Tipo: {array} 584 * Tipo: {array}
585 - * 585 + *
586 */ 586 */
587 LAYERSADICIONAIS : [], 587 LAYERSADICIONAIS : [],
588 /* 588 /*
589 * Propriedade: LAYERFUNDO 589 * Propriedade: LAYERFUNDO
590 - * 590 + *
591 * Nome do layer do tipo baselayer que sera ativado 591 * Nome do layer do tipo baselayer que sera ativado
592 */ 592 */
593 LAYERFUNDO : "", 593 LAYERFUNDO : "",
@@ -1628,13 +1628,13 @@ i3GEO.Interface = { @@ -1628,13 +1628,13 @@ i3GEO.Interface = {
1628 }, 1628 },
1629 /* 1629 /*
1630 * Classe: i3GEO.Interface.googlemaps 1630 * Classe: i3GEO.Interface.googlemaps
1631 - * 1631 + *
1632 * Interface com motor de navega&ccedil;&atilde;o baseado na API Google Maps 1632 * Interface com motor de navega&ccedil;&atilde;o baseado na API Google Maps
1633 - * 1633 + *
1634 * Utilizado quando 1634 * Utilizado quando
1635 - * 1635 + *
1636 * i3GEO.Interface.ATUAL = "googlemaps" 1636 * i3GEO.Interface.ATUAL = "googlemaps"
1637 - * 1637 + *
1638 * Cria o objeto i3GeoMap que pode receber os m&eacute;todos da API. Cria 1638 * Cria o objeto i3GeoMap que pode receber os m&eacute;todos da API. Cria
1639 * tamb&eacute;m o objeto i3GeoMapOverlay do tipo Overlay, utilizado para 1639 * tamb&eacute;m o objeto i3GeoMapOverlay do tipo Overlay, utilizado para
1640 * c&aacute;lculos ou para receber elementos gr&aacute;ficos. 1640 * c&aacute;lculos ou para receber elementos gr&aacute;ficos.
@@ -1642,14 +1642,14 @@ i3GEO.Interface = { @@ -1642,14 +1642,14 @@ i3GEO.Interface = {
1642 googlemaps : { 1642 googlemaps : {
1643 /* 1643 /*
1644 * Propriedade: ESTILOS 1644 * Propriedade: ESTILOS
1645 - * 1645 + *
1646 * Estilos que podem ser utilizados com o mapa 1646 * Estilos que podem ser utilizados com o mapa
1647 - *  
1648 - * 1647 + *
  1648 + *
1649 * Para novos estilos, acrescente seu codigo nesse objeto 1649 * Para novos estilos, acrescente seu codigo nesse objeto
1650 - * 1650 + *
1651 * Fonte http://maps-api-tt.appspot.com/apilite/styled/styled.html 1651 * Fonte http://maps-api-tt.appspot.com/apilite/styled/styled.html
1652 - * 1652 + *
1653 * Tipo: {objeto estilo do Google Maps} 1653 * Tipo: {objeto estilo do Google Maps}
1654 */ 1654 */
1655 ESTILOS : { 1655 ESTILOS : {
@@ -1791,30 +1791,30 @@ i3GEO.Interface = { @@ -1791,30 +1791,30 @@ i3GEO.Interface = {
1791 }, 1791 },
1792 /* 1792 /*
1793 * Propriedade: ESTILOPADRAO 1793 * Propriedade: ESTILOPADRAO
1794 - * 1794 + *
1795 * Nome do estilo definido em ESTILOS que sera usado como padrao para o 1795 * Nome do estilo definido em ESTILOS que sera usado como padrao para o
1796 * mapa. Se for "" sera usado o estilo normal do Google 1796 * mapa. Se for "" sera usado o estilo normal do Google
1797 - * 1797 + *
1798 * Estilos pre-definidos Red, Countries, Night, Blue, Greyscale, No 1798 * Estilos pre-definidos Red, Countries, Night, Blue, Greyscale, No
1799 * roads, Mixed, Chilled 1799 * roads, Mixed, Chilled
1800 - * 1800 + *
1801 * Tipo: {string} 1801 * Tipo: {string}
1802 - * 1802 + *
1803 * Default: "" 1803 * Default: ""
1804 */ 1804 */
1805 ESTILOPADRAO : "", 1805 ESTILOPADRAO : "",
1806 /* 1806 /*
1807 * Propriedade: MAPOPTIONS 1807 * Propriedade: MAPOPTIONS
1808 - * 1808 + *
1809 * Objeto contendo op&ccedil;&otilde;es que ser&atilde;o utilizadas no 1809 * Objeto contendo op&ccedil;&otilde;es que ser&atilde;o utilizadas no
1810 * construtor do mapa conforme a API do GoogleMaps 1810 * construtor do mapa conforme a API do GoogleMaps
1811 - * 1811 + *
1812 * Exemplo de uso 1812 * Exemplo de uso
1813 - * 1813 + *
1814 * i3GEO.Interface.googlemaps.MAPOPTIONS = {maxZoom:5}; 1814 * i3GEO.Interface.googlemaps.MAPOPTIONS = {maxZoom:5};
1815 - * 1815 + *
1816 * https://developers.google.com/maps/documentation/javascript/reference#MapOptions 1816 * https://developers.google.com/maps/documentation/javascript/reference#MapOptions
1817 - * 1817 + *
1818 * Tipo: {MapOptions} 1818 * Tipo: {MapOptions}
1819 */ 1819 */
1820 MAPOPTIONS : { 1820 MAPOPTIONS : {
@@ -1822,36 +1822,36 @@ i3GEO.Interface = { @@ -1822,36 +1822,36 @@ i3GEO.Interface = {
1822 }, 1822 },
1823 /* 1823 /*
1824 * Propriedade: OPACIDADE 1824 * Propriedade: OPACIDADE
1825 - * 1825 + *
1826 * Valor da opacidade das camadas i3geo do mapa 1826 * Valor da opacidade das camadas i3geo do mapa
1827 - * 1827 + *
1828 * Varia de 0 a 1 1828 * Varia de 0 a 1
1829 - * 1829 + *
1830 * Default: 0.8 1830 * Default: 0.8
1831 - * 1831 + *
1832 * Tipo: {Numeric} 1832 * Tipo: {Numeric}
1833 */ 1833 */
1834 OPACIDADE : 0.8, 1834 OPACIDADE : 0.8,
1835 /* 1835 /*
1836 * Propriedade: TIPOMAPA 1836 * Propriedade: TIPOMAPA
1837 - * 1837 + *
1838 * Tipo de mapa que ser&aacute; usado como default, conforme constantes 1838 * Tipo de mapa que ser&aacute; usado como default, conforme constantes
1839 * definidas na API do Google Maps. 1839 * definidas na API do Google Maps.
1840 - * 1840 + *
1841 * Default: "roadmap" 1841 * Default: "roadmap"
1842 - * 1842 + *
1843 * Tipo: {string - Google API constante 1843 * Tipo: {string - Google API constante
1844 * "satellite"|"roadmap"|"hybrid"|"terrain"} 1844 * "satellite"|"roadmap"|"hybrid"|"terrain"}
1845 */ 1845 */
1846 TIPOMAPA : "terrain", 1846 TIPOMAPA : "terrain",
1847 /* 1847 /*
1848 * Variable: ZOOMSCALE 1848 * Variable: ZOOMSCALE
1849 - * 1849 + *
1850 * Array com a lista de escalas em cada nivel de zoom utilizado pelo 1850 * Array com a lista de escalas em cada nivel de zoom utilizado pelo
1851 * Google 1851 * Google
1852 - * 1852 + *
1853 * Tipo: {array} 1853 * Tipo: {array}
1854 - * 1854 + *
1855 */ 1855 */
1856 ZOOMSCALE : [ 591657550, 295828775, 147914387, 73957193, 36978596, 1856 ZOOMSCALE : [ 591657550, 295828775, 147914387, 73957193, 36978596,
1857 18489298, 9244649, 4622324, 2311162, 1155581, 577790, 288895, 1857 18489298, 9244649, 4622324, 2311162, 1155581, 577790, 288895,
@@ -1859,14 +1859,14 @@ i3GEO.Interface = { @@ -1859,14 +1859,14 @@ i3GEO.Interface = {
1859 /* 1859 /*
1860 * Par�metros adicionais que s&atilde;o inseridos na URL que define cada 1860 * Par�metros adicionais que s&atilde;o inseridos na URL que define cada
1861 * layer 1861 * layer
1862 - * 1862 + *
1863 * Tipo: {string} 1863 * Tipo: {string}
1864 */ 1864 */
1865 PARAMETROSLAYER : "&TIPOIMAGEM=" + i3GEO.configura.tipoimagem, 1865 PARAMETROSLAYER : "&TIPOIMAGEM=" + i3GEO.configura.tipoimagem,
1866 /* 1866 /*
1867 * String acrescentada � url de cada tile para garantir a 1867 * String acrescentada � url de cada tile para garantir a
1868 * remo&ccedil;&atilde;o do cache local 1868 * remo&ccedil;&atilde;o do cache local
1869 - * 1869 + *
1870 * Type: {string} 1870 * Type: {string}
1871 */ 1871 */
1872 posfixo : 0, 1872 posfixo : 0,
@@ -2060,8 +2060,15 @@ i3GEO.Interface = { @@ -2060,8 +2060,15 @@ i3GEO.Interface = {
2060 if (!indice) { 2060 if (!indice) {
2061 // nao utilize !== aqui 2061 // nao utilize !== aqui
2062 if (camada.status != 0) { 2062 if (camada.status != 0) {
  2063 + // verifica se a camada contem um plugin do i3geo
  2064 + // caso tenha, direciona para a classe_i3geoplugin
  2065 + if (camada.plugini3geo != "") {
  2066 + i3GEO.pluginI3geo.inicia(camada);
  2067 + continue;
  2068 + } else {
2063 i3GEO.Interface.googlemaps.insereLayer(camada.name, 0, 2069 i3GEO.Interface.googlemaps.insereLayer(camada.name, 0,
2064 camada.cache); 2070 camada.cache);
  2071 + }
2065 } 2072 }
2066 } 2073 }
2067 } 2074 }
@@ -2172,7 +2179,7 @@ i3GEO.Interface = { @@ -2172,7 +2179,7 @@ i3GEO.Interface = {
2172 var i = false; 2179 var i = false;
2173 try { 2180 try {
2174 i3GeoMap.overlayMapTypes.forEach(function(elemento, number) { 2181 i3GeoMap.overlayMapTypes.forEach(function(elemento, number) {
2175 - // alert(nomeLayer+" "+elemento.name) 2182 + //alert(nomeLayer+" "+elemento.name)
2176 if (elemento.name === nomeLayer) { 2183 if (elemento.name === nomeLayer) {
2177 i = number; 2184 i = number;
2178 } 2185 }
@@ -2353,27 +2360,27 @@ i3GEO.Interface = { @@ -2353,27 +2360,27 @@ i3GEO.Interface = {
2353 }, 2360 },
2354 /* 2361 /*
2355 * Function: adicionaKml 2362 * Function: adicionaKml
2356 - * 2363 + *
2357 * Insere no mapa uma camada KML com base na API do Google Maps 2364 * Insere no mapa uma camada KML com base na API do Google Maps
2358 - * 2365 + *
2359 * As camadas adicionadas s&atilde;o acrescentadas na &aacute;rvore de 2366 * As camadas adicionadas s&atilde;o acrescentadas na &aacute;rvore de
2360 * camadas 2367 * camadas
2361 - * 2368 + *
2362 * A lista de nomes dos objetos geoXml criados &eacute; mantida em 2369 * A lista de nomes dos objetos geoXml criados &eacute; mantida em
2363 * i3GEO.mapas.GEOXML 2370 * i3GEO.mapas.GEOXML
2364 - * 2371 + *
2365 * Parametros: 2372 * Parametros:
2366 - * 2373 + *
2367 * pan {Boolean} - define se o mapa ser&aacute; deslocado para encaixar 2374 * pan {Boolean} - define se o mapa ser&aacute; deslocado para encaixar
2368 * o KML 2375 * o KML
2369 - * 2376 + *
2370 * url {String} - URL do arquivo KML. Se n&atilde;o for definido, a URL 2377 * url {String} - URL do arquivo KML. Se n&atilde;o for definido, a URL
2371 * ser&aacute; obtida do INPUT com id = i3geo_urlkml (veja 2378 * ser&aacute; obtida do INPUT com id = i3geo_urlkml (veja
2372 * i3GEO.gadgets.mostraInserirKml) 2379 * i3GEO.gadgets.mostraInserirKml)
2373 - * 2380 + *
2374 * titulo {string} - titulo que aparecer&aacute; na &aacute;rvore. Se 2381 * titulo {string} - titulo que aparecer&aacute; na &aacute;rvore. Se
2375 * n&atilde;o for definido, ser&aacute; calculado aleatoriamente. 2382 * n&atilde;o for definido, ser&aacute; calculado aleatoriamente.
2376 - * 2383 + *
2377 * ativo {boolean} - indica se a camada estar&aacute; ativa ou 2384 * ativo {boolean} - indica se a camada estar&aacute; ativa ou
2378 * n&atilde;o. Se n&atilde;o for definido, ser&aacute; considerado como 2385 * n&atilde;o. Se n&atilde;o for definido, ser&aacute; considerado como
2379 * true 2386 * true
@@ -2424,24 +2431,24 @@ i3GEO.Interface = { @@ -2424,24 +2431,24 @@ i3GEO.Interface = {
2424 }, 2431 },
2425 /* 2432 /*
2426 * Function: adicionaNoArvoreGoogle 2433 * Function: adicionaNoArvoreGoogle
2427 - * 2434 + *
2428 * Acrescenta na &aacute;rvore de camadas um novo tema no n&oacute; que 2435 * Acrescenta na &aacute;rvore de camadas um novo tema no n&oacute; que
2429 * mostra os arquivos KML inseridos no mapa 2436 * mostra os arquivos KML inseridos no mapa
2430 - * 2437 + *
2431 * Os temas s&atilde;o inclu&iacute;dos em um n&oacute; chamado "Google 2438 * Os temas s&atilde;o inclu&iacute;dos em um n&oacute; chamado "Google
2432 * Maps". 2439 * Maps".
2433 - * 2440 + *
2434 * Para obter esse n&oacute; utilize var node = 2441 * Para obter esse n&oacute; utilize var node =
2435 * i3GEO.arvoreDeCamadas.ARVORE.getNodeByProperty("idkml","raiz"); 2442 * i3GEO.arvoreDeCamadas.ARVORE.getNodeByProperty("idkml","raiz");
2436 - * 2443 + *
2437 * Parametros: 2444 * Parametros:
2438 - * 2445 + *
2439 * url {string} - url do arquivo KML 2446 * url {string} - url do arquivo KML
2440 - * 2447 + *
2441 * nomeOverlay {string} - t&iacute;tulo do tema 2448 * nomeOverlay {string} - t&iacute;tulo do tema
2442 - * 2449 + *
2443 * ativo {boolean} - indica o estado do checkbox 2450 * ativo {boolean} - indica o estado do checkbox
2444 - * 2451 + *
2445 * id {string} - nome do objeto GGeoXml 2452 * id {string} - nome do objeto GGeoXml
2446 */ 2453 */
2447 adicionaNoArvoreGoogle : function(url, nomeOverlay, ativo, id) { 2454 adicionaNoArvoreGoogle : function(url, nomeOverlay, ativo, id) {
@@ -2524,13 +2531,13 @@ i3GEO.Interface = { @@ -2524,13 +2531,13 @@ i3GEO.Interface = {
2524 }, 2531 },
2525 /* 2532 /*
2526 * Function: ativaDesativaCamadaKml 2533 * Function: ativaDesativaCamadaKml
2527 - * 2534 + *
2528 * Ativa ou desativa uma camada do n&oacute; de layers KML 2535 * Ativa ou desativa uma camada do n&oacute; de layers KML
2529 - * 2536 + *
2530 * Parametro: 2537 * Parametro:
2531 - * 2538 + *
2532 * obj {object} - objeto do tipo checkbox que foi ativado/desativado 2539 * obj {object} - objeto do tipo checkbox que foi ativado/desativado
2533 - * 2540 + *
2534 * url {string} - url do KML 2541 * url {string} - url do KML
2535 */ 2542 */
2536 ativaDesativaCamadaKml : function(obj, url) { 2543 ativaDesativaCamadaKml : function(obj, url) {
@@ -2553,42 +2560,42 @@ i3GEO.Interface = { @@ -2553,42 +2560,42 @@ i3GEO.Interface = {
2553 }, 2560 },
2554 /* 2561 /*
2555 * Classe: i3GEO.Interface.googleearth 2562 * Classe: i3GEO.Interface.googleearth
2556 - * 2563 + *
2557 * Interface com motor de navega&ccedil;&atilde;o baseado na API Google 2564 * Interface com motor de navega&ccedil;&atilde;o baseado na API Google
2558 * Earth 2565 * Earth
2559 - * 2566 + *
2560 * Utilizado quando 2567 * Utilizado quando
2561 - * 2568 + *
2562 * i3GEO.Interface.ATUAL = "googleearth" 2569 * i3GEO.Interface.ATUAL = "googleearth"
2563 - * 2570 + *
2564 * Cria o objeto i3GeoMap que pode receber os m&eacute;todos da API do 2571 * Cria o objeto i3GeoMap que pode receber os m&eacute;todos da API do
2565 * google Earth 2572 * google Earth
2566 */ 2573 */
2567 googleearth : { 2574 googleearth : {
2568 /* 2575 /*
2569 * Variable: PARAMETROSLAYER 2576 * Variable: PARAMETROSLAYER
2570 - * 2577 + *
2571 * Par�metros adicionais que s&atilde;o inseridos na URL que define cada 2578 * Par�metros adicionais que s&atilde;o inseridos na URL que define cada
2572 * layer 2579 * layer
2573 - * 2580 + *
2574 * Tipo: {string} 2581 * Tipo: {string}
2575 */ 2582 */
2576 PARAMETROSLAYER : "&TIPOIMAGEM=" + i3GEO.configura.tipoimagem, 2583 PARAMETROSLAYER : "&TIPOIMAGEM=" + i3GEO.configura.tipoimagem,
2577 /* 2584 /*
2578 * String acrescentada � url de cada tile para garantir a 2585 * String acrescentada � url de cada tile para garantir a
2579 * remo&ccedil;&atilde;o do cache local 2586 * remo&ccedil;&atilde;o do cache local
2580 - * 2587 + *
2581 * Type: {string} 2588 * Type: {string}
2582 */ 2589 */
2583 posfixo : "", 2590 posfixo : "",
2584 /* 2591 /*
2585 * Propriedade: GADGETS 2592 * Propriedade: GADGETS
2586 - * 2593 + *
2587 * Lista dos controles espec&iacute;ficos da API do Google Earth que 2594 * Lista dos controles espec&iacute;ficos da API do Google Earth que
2588 * ser&atilde;o inseridos ou n&atilde;o no mapa 2595 * ser&atilde;o inseridos ou n&atilde;o no mapa
2589 - * 2596 + *
2590 * Tipo: {object} 2597 * Tipo: {object}
2591 - * 2598 + *
2592 * Default: {} 2599 * Default: {}
2593 */ 2600 */
2594 GADGETS : { 2601 GADGETS : {
@@ -3060,27 +3067,27 @@ i3GEO.Interface = { @@ -3060,27 +3067,27 @@ i3GEO.Interface = {
3060 }, 3067 },
3061 /* 3068 /*
3062 * Function: adicionaKml 3069 * Function: adicionaKml
3063 - * 3070 + *
3064 * Insere no mapa uma camada KML com base na API do Google Earth 3071 * Insere no mapa uma camada KML com base na API do Google Earth
3065 - * 3072 + *
3066 * As camadas adicionadas s&atilde;o crescentadas na &aacute;rvore de 3073 * As camadas adicionadas s&atilde;o crescentadas na &aacute;rvore de
3067 * camadas 3074 * camadas
3068 - * 3075 + *
3069 * A lista de nomes dos objetos geoXml criados &eacute; mantida em 3076 * A lista de nomes dos objetos geoXml criados &eacute; mantida em
3070 * i3GEO.mapas.GEOXML 3077 * i3GEO.mapas.GEOXML
3071 - * 3078 + *
3072 * Parametros: 3079 * Parametros:
3073 - * 3080 + *
3074 * pan {Boolean} - define se o mapa ser&aacute; deslocado para encaixar 3081 * pan {Boolean} - define se o mapa ser&aacute; deslocado para encaixar
3075 * o KML 3082 * o KML
3076 - * 3083 + *
3077 * url {String} - URL do arquivo KML. Se n&atilde;o for definido, a URL 3084 * url {String} - URL do arquivo KML. Se n&atilde;o for definido, a URL
3078 * ser&aacute; obtida do INPUT com id = i3geo_urlkml (veja 3085 * ser&aacute; obtida do INPUT com id = i3geo_urlkml (veja
3079 * i3GEO.gadgets.mostraInserirKml) 3086 * i3GEO.gadgets.mostraInserirKml)
3080 - * 3087 + *
3081 * titulo {string} - titulo que aparecer&aacute; na &aacute;rvore. Se 3088 * titulo {string} - titulo que aparecer&aacute; na &aacute;rvore. Se
3082 * n&atilde;o for definido, ser&aacute; calculado aleatoriamente. 3089 * n&atilde;o for definido, ser&aacute; calculado aleatoriamente.
3083 - * 3090 + *
3084 * ativo {boolean} - indica se a camada estar&aacute; ativa ou 3091 * ativo {boolean} - indica se a camada estar&aacute; ativa ou
3085 * n&atilde;o. Se n&atilde;o for definido, ser&aacute; considerado como 3092 * n&atilde;o. Se n&atilde;o for definido, ser&aacute; considerado como
3086 * true 3093 * true
@@ -3141,24 +3148,24 @@ i3GEO.Interface = { @@ -3141,24 +3148,24 @@ i3GEO.Interface = {
3141 }, 3148 },
3142 /* 3149 /*
3143 * Function: adicionaNoArvoreGoogle 3150 * Function: adicionaNoArvoreGoogle
3144 - * 3151 + *
3145 * Acrescenta na &aacute;rvore de camadas um novo tema no n&oacute; que 3152 * Acrescenta na &aacute;rvore de camadas um novo tema no n&oacute; que
3146 * mostra os arquivos KML inseridos no mapa 3153 * mostra os arquivos KML inseridos no mapa
3147 - * 3154 + *
3148 * Os temas s&atilde;o inclu&iacute;dos em um n&oacute; chamado "Google 3155 * Os temas s&atilde;o inclu&iacute;dos em um n&oacute; chamado "Google
3149 * Earth". 3156 * Earth".
3150 - * 3157 + *
3151 * Para obter esse n&oacute; utilize var node = 3158 * Para obter esse n&oacute; utilize var node =
3152 * i3GEO.arvoreDeCamadas.ARVORE.getNodeByProperty("idkml","raiz"); 3159 * i3GEO.arvoreDeCamadas.ARVORE.getNodeByProperty("idkml","raiz");
3153 - * 3160 + *
3154 * Parametros: 3161 * Parametros:
3155 - * 3162 + *
3156 * url {string} - url do arquivo KML 3163 * url {string} - url do arquivo KML
3157 - * 3164 + *
3158 * nomeOverlay {string} - t&iacute;tulo do tema 3165 * nomeOverlay {string} - t&iacute;tulo do tema
3159 - * 3166 + *
3160 * ativo {boolean} - indica o estado do checkbox 3167 * ativo {boolean} - indica o estado do checkbox
3161 - * 3168 + *
3162 * id {string} - nome do objeto GGeoXml 3169 * id {string} - nome do objeto GGeoXml
3163 */ 3170 */
3164 adicionaNoArvoreGoogle : function(url, nomeOverlay, ativo, id) { 3171 adicionaNoArvoreGoogle : function(url, nomeOverlay, ativo, id) {
@@ -3254,11 +3261,11 @@ i3GEO.Interface = { @@ -3254,11 +3261,11 @@ i3GEO.Interface = {
3254 }, 3261 },
3255 /* 3262 /*
3256 * Function: ativaDesativaCamadaKml 3263 * Function: ativaDesativaCamadaKml
3257 - * 3264 + *
3258 * Ativa ou desativa uma camada do n&oacute; de layers KML 3265 * Ativa ou desativa uma camada do n&oacute; de layers KML
3259 - * 3266 + *
3260 * Parametro: 3267 * Parametro:
3261 - * 3268 + *
3262 * obj {object} - objeto do tipo checkbox que foi ativado/desativado 3269 * obj {object} - objeto do tipo checkbox que foi ativado/desativado
3263 */ 3270 */
3264 ativaDesativaCamadaKml : function(obj) { 3271 ativaDesativaCamadaKml : function(obj) {
classesjs/classe_plugini3geo.js
1 /** 1 /**
2 * Title: pluginI3geo 2 * Title: pluginI3geo
3 - * 3 + *
4 * i3GEO.pluginI3geo 4 * i3GEO.pluginI3geo
5 - * 5 + *
6 * Implementam os plugins do i3Geo que adicionam camadas especiais ao mapa, 6 * Implementam os plugins do i3Geo que adicionam camadas especiais ao mapa,
7 * normalmente dados vetoriais. 7 * normalmente dados vetoriais.
8 - * 8 + *
9 * Arquivo: 9 * Arquivo:
10 - * 10 + *
11 * i3geo/classesjs/classe_plugini3geo.js 11 * i3geo/classesjs/classe_plugini3geo.js
12 - * 12 + *
13 * Licen&ccedil;a: 13 * Licen&ccedil;a:
14 - * 14 + *
15 * GPL2 15 * GPL2
16 - * 16 + *
17 * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet 17 * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
18 - * 18 + *
19 * Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente 19 * Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente
20 * Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com 20 * Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
21 - * 21 + *
22 * Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo 22 * Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo
23 * e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral 23 * e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral
24 * GNU conforme publicada pela Free Software Foundation; 24 * GNU conforme publicada pela Free Software Foundation;
25 - * 25 + *
26 * Este programa &eacute; distribu&iacute;do na expectativa de que seja 26 * Este programa &eacute; distribu&iacute;do na expectativa de que seja
27 * &uacute;til, por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia 27 * &uacute;til, por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia
28 * impl&iacute;cita de COMERCIABILIDADE OU ADEQUAC&Atilde;O A UMA FINALIDADE 28 * impl&iacute;cita de COMERCIABILIDADE OU ADEQUAC&Atilde;O A UMA FINALIDADE
@@ -37,108 +37,150 @@ if (typeof (i3GEO) === &#39;undefined&#39;) { @@ -37,108 +37,150 @@ if (typeof (i3GEO) === &#39;undefined&#39;) {
37 var i3GEO = {}; 37 var i3GEO = {};
38 } 38 }
39 i3GEO.pluginI3geo = { 39 i3GEO.pluginI3geo = {
40 - /**  
41 - * Inicia a execucao de um plugin  
42 - *  
43 - * Camada e um objeto gerado pelo i3Geo quando uma camada e adicionada ao  
44 - * mapa O objeto i3GEO.arvoreDeCamadas.CAMADAS guarda todas as camadas  
45 - * adicionadas ao mapa Ao adicionar uma camada pelo catalogo, o i3Geo  
46 - * verifica se a camada possui plugin e direciona para ca Os plugins sao  
47 - * definidos como metadados em cada mapfile de cada tema  
48 - *  
49 - * Veja em i3geo/classesphp/classe_mapa.php funcao parametrostemas  
50 - */  
51 - inicia : function(camada) {  
52 - i3GEO.janela.AGUARDEMODAL = true;  
53 - i3GEO.janela.abreAguarde("aguardePlugin","Calculando...");  
54 - i3GEO.janela.AGUARDEMODAL = false;  
55 - // chama a funcao conforme o tipo de plugin e a interface atual  
56 - // para cada plugin deve haver um objeto com as funcoes especificas para  
57 - // cada interface  
58 - i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL]  
59 - .call(null, camada);  
60 - },  
61 - /**  
62 - * Function: heatmap  
63 - *  
64 - * Mapa de calor  
65 - *  
66 - * Gera um layer do tipo mapa de calor e adiciona ao mapa  
67 - *  
68 - * As depend&ecirc;ncias em javascript sao carregadas via script tag por  
69 - * meio de ferramentas/heatmap/openlayers_js.php  
70 - *  
71 - * Esse programa tamb&eacute;m obt&eacute;m os dados necess&aacute;rios ao  
72 - * plugin  
73 - *  
74 - * O layer existente no mapfile deve conter um metadata chamado PLUGINI3GEO  
75 - *  
76 - * Esse matadado deve conter uma string que ser&aacute; transformada em um  
77 - * objeto javascript para uso no plugin  
78 - *  
79 - * Exemplo:  
80 - *  
81 - * "PLUGINI3GEO" '{"plugin":"heatmap","parametros":{"coluna":"teste"}}'  
82 - *  
83 - * Coluna &eacute; a que cont&eacute;m os dados num&eacute;ricos que definem  
84 - * a quantidade de uma medida em cada ponto e &eacute; usada para gerar a  
85 - * representa&ccedil;&atilde;o. Se for vazia, considera-se o valor como 1  
86 - *  
87 - * As cores das classes existentes no LAYER ser&atilde;o utilizadas para  
88 - * calcular as cores do mapa de calor. Se n&atilde;o existirem classes,  
89 - * ser&aacute; usado o default.  
90 - *  
91 - */  
92 - heatmap : {  
93 - openlayers : function(camada) {  
94 - var p = i3GEO.configura.locaplic  
95 - + "/ferramentas/heatmap/openlayers_js.php", carregaJs = "nao", crialayer;  
96 - criaLayer = function() {  
97 - var heatmap, g, datalen = heatmap_dados.length, features = [];  
98 - if (i3GEO.Interface.openlayers.googleLike === true) {  
99 - var sphericalMercatorProj = new OpenLayers.Projection(  
100 - 'EPSG:900913'), geographicProj = new OpenLayers.Projection(  
101 - 'EPSG:4326'); 40 + /**
  41 + * Inicia a execucao de um plugin
  42 + *
  43 + * Camada e um objeto gerado pelo i3Geo quando uma camada e adicionada
  44 + * ao mapa O objeto i3GEO.arvoreDeCamadas.CAMADAS guarda todas as
  45 + * camadas adicionadas ao mapa Ao adicionar uma camada pelo catalogo, o
  46 + * i3Geo verifica se a camada possui plugin e direciona para ca Os
  47 + * plugins sao definidos como metadados em cada mapfile de cada tema
  48 + *
  49 + * Veja em i3geo/classesphp/classe_mapa.php funcao parametrostemas
  50 + */
  51 + inicia : function(camada) {
  52 + i3GEO.janela.AGUARDEMODAL = true;
  53 + i3GEO.janela.abreAguarde("aguardePlugin","Calculando...");
  54 + i3GEO.janela.AGUARDEMODAL = false;
  55 + // chama a funcao conforme o tipo de plugin e a interface atual
  56 + // para cada plugin deve haver um objeto com as funcoes especificas
  57 + // para
  58 + // cada interface
  59 + i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL]
  60 + .call(null, camada);
  61 + },
  62 + /**
  63 + * Function: heatmap
  64 + *
  65 + * Mapa de calor
  66 + *
  67 + * Gera um layer do tipo mapa de calor e adiciona ao mapa
  68 + *
  69 + * As depend&ecirc;ncias em javascript sao carregadas via script tag por
  70 + * meio de ferramentas/heatmap/openlayers_js.php
  71 + *
  72 + * Esse programa tamb&eacute;m obt&eacute;m os dados necess&aacute;rios
  73 + * ao plugin
  74 + *
  75 + * O layer existente no mapfile deve conter um metadata chamado
  76 + * PLUGINI3GEO
  77 + *
  78 + * Esse matadado deve conter uma string que ser&aacute; transformada em
  79 + * um objeto javascript para uso no plugin
  80 + *
  81 + * Exemplo:
  82 + *
  83 + * "PLUGINI3GEO" '{"plugin":"heatmap","parametros":{"coluna":"teste"}}'
  84 + *
  85 + * Coluna &eacute; a que cont&eacute;m os dados num&eacute;ricos que
  86 + * definem a quantidade de uma medida em cada ponto e &eacute; usada
  87 + * para gerar a representa&ccedil;&atilde;o. Se for vazia, considera-se
  88 + * o valor como 1
  89 + *
  90 + * As cores das classes existentes no LAYER ser&atilde;o utilizadas para
  91 + * calcular as cores do mapa de calor. Se n&atilde;o existirem classes,
  92 + * ser&aacute; usado o default.
  93 + *
  94 + */
  95 + heatmap : {
  96 + googlemaps: function(camada){
  97 + var p = i3GEO.configura.locaplic
  98 + + "/ferramentas/heatmap/googlemaps_js.php", carregaJs = "nao", crialayer;
  99 + criaLayer = function() {
  100 + var heatmap,pontos;
  101 + heatmap = new HeatmapOverlay(i3GeoMap, {
  102 + "radius":15,
  103 + "visible":true,
  104 + "opacity":60,
  105 + "gradient": { 0.45: "rgb(0,0,255)", 0.55: "rgb(0,255,255)", 0.65: "rgb(0,255,0)", 0.95: "yellow", 1.0: "rgb(255,0,0)" },
  106 + "legend": {
  107 + "title": camada.tema,
  108 + "position": "bl",
  109 + "offset": [5,50]
  110 + }
  111 + });
  112 + pontos={
  113 + max: 10,
  114 + data: heatmap_dados
  115 + };
  116 + i3GEO.janela.fechaAguarde("aguardePlugin");
  117 + heatmap.setDataSet(pontos);
  118 + heatmap_dados = null;
  119 + //i3GeoMap.setZoom(i3GeoMap.getZoom());
  120 + };
  121 + if (typeof (HeatmapOverlay) === 'undefined') {
  122 + carregaJs = "sim";
102 } 123 }
103 - while (datalen--) {  
104 - g = new OpenLayers.Geometry.Point(parseInt(  
105 - heatmap_dados[datalen].lng, 10), parseInt(  
106 - heatmap_dados[datalen].lat, 10));  
107 - if(geographicProj){  
108 - g.transform(geographicProj, sphericalMercatorProj); 124 + p += "?carregajs=" + carregaJs + "&layer=" + camada.name
  125 + + "&coluna=" + camada.plugini3geo.parametros.coluna
  126 + + "&g_sid=" + i3GEO.configura.sid
  127 + + "&nomevariavel=heatmap_dados";
  128 + i3GEO.util.scriptTag(p, criaLayer,
  129 + "i3GEO.pluginI3geo.heatmap_script");
  130 + },
  131 + openlayers : function(camada) {
  132 + var p = i3GEO.configura.locaplic
  133 + + "/ferramentas/heatmap/openlayers_js.php", carregaJs = "nao", crialayer;
  134 + criaLayer = function() {
  135 + var heatmap, transformedTestData = { max: 10 , data: [] },
  136 + data = heatmap_dados,
  137 + datalen = heatmap_dados.length,
  138 + nudata = [];
  139 + // in order to use the OpenLayers Heatmap Layer we have to transform our data into
  140 + // { max: <max>, data: [{lonlat: <OpenLayers.LonLat>, count: <count>},...]}
  141 + while(datalen--){
  142 + nudata.push({
  143 + lonlat: new OpenLayers.LonLat(data[datalen].lng, heatmap_dados[datalen].lat),
  144 + count: heatmap_dados[datalen].count
  145 + });
109 } 146 }
110 - features.push(new OpenLayers.Feature.Vector(g, {  
111 - count : parseInt(heatmap_dados[datalen].count, 10)  
112 - }));  
113 - } 147 + transformedTestData.data = nudata;
  148 + // create our heatmap layer
  149 + heatmap = new OpenLayers.Layer.Heatmap(
  150 + camada.name,
  151 + i3geoOL,
  152 + i3geoOL.baseLayer,
  153 + {
  154 + visible: true,
  155 + radius:10,
  156 + "gradient": { 0.45: "rgb(0,0,255)", 0.55: "rgb(0,255,255)", 0.65: "rgb(0,255,0)", 0.95: "yellow", 1.0: "rgb(255,0,0)" },
  157 + "legend": {
  158 + "title": camada.tema,
  159 + "position": "bl",
  160 + "offset": [5,50]
  161 + }
  162 + },
  163 + {
  164 + isBaseLayer: false,
  165 + opacity: 0.3,
  166 + projection: new OpenLayers.Projection("EPSG:4326")
  167 + }
  168 + );
  169 + i3geoOL.addLayer(heatmap);
  170 + heatmap.setDataSet(transformedTestData);
114 171
115 - // create our vectorial layer using heatmap renderer  
116 - heatmap = new OpenLayers.Layer.Vector(camada.name, {  
117 - opacity : 0.3,  
118 - renderers : [ 'Heatmap' ],  
119 - rendererOptions : {  
120 - weight : 'count',  
121 - heatmapConfig : {  
122 - radius : 10  
123 - }  
124 - }  
125 - });  
126 - heatmap.addFeatures(features);  
127 - i3geoOL.addLayer(heatmap);  
128 - heatmap_dados = null;  
129 - i3GEO.janela.fechaAguarde("aguardePlugin");  
130 - };  
131 - if (typeof (HeatmapOverlay) === 'undefined') {  
132 - carregaJs = "sim"; 172 + heatmap_dados = null;
  173 + i3GEO.janela.fechaAguarde("aguardePlugin");
  174 + };
  175 + if (typeof (HeatmapOverlay) === 'undefined') {
  176 + carregaJs = "sim";
  177 + }
  178 + p += "?carregajs=" + carregaJs + "&layer=" + camada.name
  179 + + "&coluna=" + camada.plugini3geo.parametros.coluna
  180 + + "&g_sid=" + i3GEO.configura.sid
  181 + + "&nomevariavel=heatmap_dados";
  182 + i3GEO.util.scriptTag(p, criaLayer,
  183 + "i3GEO.pluginI3geo.heatmap_script");
133 } 184 }
134 - p += "?carregajs=" + carregaJs + "&layer=" + camada.name  
135 - + "&coluna=" + camada.plugini3geo.parametros.coluna  
136 - + "&g_sid=" + i3GEO.configura.sid  
137 - + "&nomevariavel=heatmap_dados";  
138 -  
139 - i3GEO.util.scriptTag(p, criaLayer,  
140 - "i3GEO.pluginI3geo.heatmap_script");  
141 -  
142 } 185 }
143 - }  
144 } 186 }
145 \ No newline at end of file 187 \ No newline at end of file
classesphp/classe_atributos.php
@@ -564,17 +564,17 @@ class Atributos @@ -564,17 +564,17 @@ class Atributos
564 } 564 }
565 /* 565 /*
566 function: listaRegistrosXY 566 function: listaRegistrosXY
567 - 567 +
568 Pega o XY de cada registro e valores de itens especificos 568 Pega o XY de cada registro e valores de itens especificos
569 - 569 +
570 parameters: 570 parameters:
571 - 571 +
572 $items - lista de itens separado por "," 572 $items - lista de itens separado por ","
573 - 573 +
574 $tipo - Tipo de abrang&ecirc;ncia espacial (brasil ou mapa). 574 $tipo - Tipo de abrang&ecirc;ncia espacial (brasil ou mapa).
575 - 575 +
576 $tipolista - Indica se ser&atilde;o mostrados todos os registros ou apenas os selecionados (tudo|selecionados) 576 $tipolista - Indica se ser&atilde;o mostrados todos os registros ou apenas os selecionados (tudo|selecionados)
577 - 577 +
578 */ 578 */
579 function listaRegistrosXY($items,$tipo,$tipolista) 579 function listaRegistrosXY($items,$tipo,$tipolista)
580 { 580 {
ferramentas/heatmap/openlayers_js.php
@@ -47,7 +47,8 @@ if (!connection_aborted()){ @@ -47,7 +47,8 @@ if (!connection_aborted()){
47 echo $nomevariavel.' = ['.implode(",",$resultado).'];'; 47 echo $nomevariavel.' = ['.implode(",",$resultado).'];';
48 if($carregajs === "sim"){ 48 if($carregajs === "sim"){
49 include_once($dir."/../../pacotes/heatmap/src/heatmap.js"); 49 include_once($dir."/../../pacotes/heatmap/src/heatmap.js");
50 - include_once($dir."/../../pacotes/heatmap/src/heatmap-openlayers-renderer.js"); 50 + //include_once($dir."/../../pacotes/heatmap/src/heatmap-openlayers-renderer.js");
  51 + include_once($dir."/../../pacotes/heatmap/src/heatmap-openlayers.js");
51 } 52 }
52 53
53 ?> 54 ?>
54 \ No newline at end of file 55 \ No newline at end of file
pacotes/heatmap/src/heatmap-gmaps.js
1 -/* 1 +/*
2 * heatmap.js GMaps overlay 2 * heatmap.js GMaps overlay
3 * 3 *
4 * Copyright (c) 2011, Patrick Wied (http://www.patrick-wied.at) 4 * Copyright (c) 2011, Patrick Wied (http://www.patrick-wied.at)
5 * Dual-licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 5 * Dual-licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
6 * and the Beerware (http://en.wikipedia.org/wiki/Beerware) license. 6 * and the Beerware (http://en.wikipedia.org/wiki/Beerware) license.
7 - */  
8 - 7 + */
  8 +
  9 +//cria um layer idiota para poder calcular a projecao
  10 +//http://stackoverflow.com/questions/1538681/how-to-call-fromlatlngtodivpixel-in-google-maps-api-v3
  11 +heatmapFooOverlay.prototype = new google.maps.OverlayView();
  12 +heatmapFooOverlay.prototype.onAdd = function() { }
  13 +heatmapFooOverlay.prototype.onRemove = function() { }
  14 +heatmapFooOverlay.prototype.draw = function() { }
  15 +function heatmapFooOverlay() { this.setMap(i3GeoMap); }
  16 +var heatmapBarOverlay = new heatmapFooOverlay();
  17 +
  18 +
9 function HeatmapOverlay(map, cfg){ 19 function HeatmapOverlay(map, cfg){
10 var me = this; 20 var me = this;
11 21
@@ -14,21 +24,20 @@ function HeatmapOverlay(map, cfg){ @@ -14,21 +24,20 @@ function HeatmapOverlay(map, cfg){
14 me.latlngs = []; 24 me.latlngs = [];
15 me.bounds = null; 25 me.bounds = null;
16 me.setMap(map); 26 me.setMap(map);
17 -  
18 - google.maps.event.addListener(map, 'dragend', function() { me.draw() }); 27 + google.maps.event.addListener(map, 'bounds_changed', function() { me.draw() });
19 } 28 }
20 29
21 HeatmapOverlay.prototype = new google.maps.OverlayView(); 30 HeatmapOverlay.prototype = new google.maps.OverlayView();
22 31
23 HeatmapOverlay.prototype.onAdd = function(){ 32 HeatmapOverlay.prototype.onAdd = function(){
24 - 33 +
25 var panes = this.getPanes(), 34 var panes = this.getPanes(),
26 w = this.getMap().getDiv().clientWidth, 35 w = this.getMap().getDiv().clientWidth,
27 - h = this.getMap().getDiv().clientHeight, 36 + h = this.getMap().getDiv().clientHeight,
28 el = document.createElement("div"); 37 el = document.createElement("div");
29 - 38 +
30 el.style.cssText = "position:absolute;top:0;left:0;width:"+w+"px;height:"+h+"px;"; 39 el.style.cssText = "position:absolute;top:0;left:0;width:"+w+"px;height:"+h+"px;";
31 - 40 +
32 this.conf.element = el; 41 this.conf.element = el;
33 panes.overlayLayer.appendChild(el); 42 panes.overlayLayer.appendChild(el);
34 43
@@ -40,16 +49,16 @@ HeatmapOverlay.prototype.onRemove = function(){ @@ -40,16 +49,16 @@ HeatmapOverlay.prototype.onRemove = function(){
40 } 49 }
41 50
42 HeatmapOverlay.prototype.draw = function(){ 51 HeatmapOverlay.prototype.draw = function(){
43 - 52 +
44 var me = this, 53 var me = this,
45 - overlayProjection = me.getProjection(), 54 + overlayProjection = heatmapBarOverlay.getProjection(), //me.getProjection(),
46 currentBounds = me.map.getBounds(); 55 currentBounds = me.map.getBounds();
47 - 56 +
48 if (currentBounds.equals(me.bounds)) { 57 if (currentBounds.equals(me.bounds)) {
49 return; 58 return;
50 } 59 }
51 me.bounds = currentBounds; 60 me.bounds = currentBounds;
52 - 61 +
53 var ne = overlayProjection.fromLatLngToDivPixel(currentBounds.getNorthEast()), 62 var ne = overlayProjection.fromLatLngToDivPixel(currentBounds.getNorthEast()),
54 sw = overlayProjection.fromLatLngToDivPixel(currentBounds.getSouthWest()), 63 sw = overlayProjection.fromLatLngToDivPixel(currentBounds.getSouthWest()),
55 topY = ne.y, 64 topY = ne.y,
@@ -62,12 +71,12 @@ HeatmapOverlay.prototype.draw = function(){ @@ -62,12 +71,12 @@ HeatmapOverlay.prototype.draw = function(){
62 me.conf.element.style.width = w + 'px'; 71 me.conf.element.style.width = w + 'px';
63 me.conf.element.style.height = h + 'px'; 72 me.conf.element.style.height = h + 'px';
64 me.heatmap.store.get("heatmap").resize(); 73 me.heatmap.store.get("heatmap").resize();
65 - 74 +
66 if(this.latlngs.length > 0){ 75 if(this.latlngs.length > 0){
67 this.heatmap.clear(); 76 this.heatmap.clear();
68 - 77 +
69 var len = this.latlngs.length, 78 var len = this.latlngs.length,
70 - projection = this.getProjection(); 79 + projection = heatmapBarOverlay.getProjection(); //this.getProjection();
71 d = { 80 d = {
72 max: this.heatmap.store.max, 81 max: this.heatmap.store.max,
73 data: [] 82 data: []
@@ -76,7 +85,7 @@ HeatmapOverlay.prototype.draw = function(){ @@ -76,7 +85,7 @@ HeatmapOverlay.prototype.draw = function(){
76 while(len--){ 85 while(len--){
77 var latlng = this.latlngs[len].latlng; 86 var latlng = this.latlngs[len].latlng;
78 if(!currentBounds.contains(latlng)) { continue; } 87 if(!currentBounds.contains(latlng)) { continue; }
79 - 88 +
80 // DivPixel is pixel in overlay pixel coordinates... we need 89 // DivPixel is pixel in overlay pixel coordinates... we need
81 // to transform to screen coordinates so it'll match the canvas 90 // to transform to screen coordinates so it'll match the canvas
82 // which is continually repositioned to follow the screen. 91 // which is continually repositioned to follow the screen.
@@ -84,8 +93,8 @@ HeatmapOverlay.prototype.draw = function(){ @@ -84,8 +93,8 @@ HeatmapOverlay.prototype.draw = function(){
84 screenPixel = new google.maps.Point(divPixel.x - leftX, divPixel.y - topY); 93 screenPixel = new google.maps.Point(divPixel.x - leftX, divPixel.y - topY);
85 94
86 var roundedPoint = this.pixelTransform(screenPixel); 95 var roundedPoint = this.pixelTransform(screenPixel);
87 -  
88 - d.data.push({ 96 +
  97 + d.data.push({
89 x: roundedPoint.x, 98 x: roundedPoint.x,
90 y: roundedPoint.y, 99 y: roundedPoint.y,
91 count: this.latlngs[len].c 100 count: this.latlngs[len].c
@@ -96,17 +105,17 @@ HeatmapOverlay.prototype.draw = function(){ @@ -96,17 +105,17 @@ HeatmapOverlay.prototype.draw = function(){
96 } 105 }
97 106
98 HeatmapOverlay.prototype.pixelTransform = function(p){ 107 HeatmapOverlay.prototype.pixelTransform = function(p){
99 - var w = this.heatmap.get("width"),  
100 - h = this.heatmap.get("height"); 108 + var w = i3GEO.parametros.w,//this.heatmap.get("width"),
  109 + h = i3GEO.parametros.h; //this.heatmap.get("height");
101 110
102 while(p.x < 0){ 111 while(p.x < 0){
103 p.x+=w; 112 p.x+=w;
104 } 113 }
105 - 114 +
106 while(p.x > w){ 115 while(p.x > w){
107 p.x-=w; 116 p.x-=w;
108 } 117 }
109 - 118 +
110 while(p.y < 0){ 119 while(p.y < 0){
111 p.y+=h; 120 p.y+=h;
112 } 121 }
@@ -117,7 +126,7 @@ HeatmapOverlay.prototype.pixelTransform = function(p){ @@ -117,7 +126,7 @@ HeatmapOverlay.prototype.pixelTransform = function(p){
117 126
118 p.x = (p.x >> 0); 127 p.x = (p.x >> 0);
119 p.y = (p.y >> 0); 128 p.y = (p.y >> 0);
120 - 129 +
121 return p; 130 return p;
122 } 131 }
123 132
@@ -131,32 +140,34 @@ HeatmapOverlay.prototype.setDataSet = function(data){ @@ -131,32 +140,34 @@ HeatmapOverlay.prototype.setDataSet = function(data){
131 }, 140 },
132 d = data.data, 141 d = data.data,
133 dlen = d.length, 142 dlen = d.length,
134 - projection = me.getProjection(), 143 + projection = heatmapBarOverlay.getProjection(),//me.getProjection(),
135 latlng, point; 144 latlng, point;
136 145
137 me.latlngs = []; 146 me.latlngs = [];
138 -  
139 - while(dlen--){ 147 +
  148 + while(dlen--){
140 latlng = new google.maps.LatLng(d[dlen].lat, d[dlen].lng); 149 latlng = new google.maps.LatLng(d[dlen].lat, d[dlen].lng);
141 -  
142 - if(!currentBounds.contains(latlng)) {  
143 - continue; 150 +
  151 + if(!currentBounds.contains(latlng)) {
  152 + continue;
144 } 153 }
145 154
146 me.latlngs.push({latlng: latlng, c: d[dlen].count}); 155 me.latlngs.push({latlng: latlng, c: d[dlen].count});
147 point = me.pixelTransform(projection.fromLatLngToDivPixel(latlng)); 156 point = me.pixelTransform(projection.fromLatLngToDivPixel(latlng));
148 mapdata.data.push({x: point.x, y: point.y, count: d[dlen].count}); 157 mapdata.data.push({x: point.x, y: point.y, count: d[dlen].count});
149 } 158 }
150 - me.heatmap.clear();  
151 - me.heatmap.store.setDataSet(mapdata); 159 + if(me.heatmap){
  160 + me.heatmap.clear();
  161 + me.heatmap.store.setDataSet(mapdata);
  162 + }
152 } 163 }
153 164
154 HeatmapOverlay.prototype.addDataPoint = function(lat, lng, count){ 165 HeatmapOverlay.prototype.addDataPoint = function(lat, lng, count){
155 166
156 - var projection = this.getProjection(), 167 + var projection = heatmapBarOverlay.getProjection(),//this.getProjection(),
157 latlng = new google.maps.LatLng(lat, lng), 168 latlng = new google.maps.LatLng(lat, lng),
158 point = this.pixelTransform(projection.fromLatLngToDivPixel(latlng)); 169 point = this.pixelTransform(projection.fromLatLngToDivPixel(latlng));
159 - 170 +
160 this.heatmap.store.addDataPoint(point.x, point.y, count); 171 this.heatmap.store.addDataPoint(point.x, point.y, count);
161 this.latlngs.push({ latlng: latlng, c: count }); 172 this.latlngs.push({ latlng: latlng, c: count });
162 } 173 }
pacotes/heatmap/src/heatmap.js
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 53
54 // if count parameter is set increment by count otherwise by 1 54 // if count parameter is set increment by count otherwise by 1
55 data[x][y]+=(arguments.length<3)?1:arguments[2]; 55 data[x][y]+=(arguments.length<3)?1:arguments[2];
56 - 56 +
57 me.set("data", data); 57 me.set("data", data);
58 // do we have a new maximum? 58 // do we have a new maximum?
59 if(me.max < data[x][y]){ 59 if(me.max < data[x][y]){
@@ -75,7 +75,7 @@ @@ -75,7 +75,7 @@
75 this.max = obj.max; 75 this.max = obj.max;
76 // if a legend is set, update it 76 // if a legend is set, update it
77 heatmap.get("legend") && heatmap.get("legend").update(obj.max); 77 heatmap.get("legend") && heatmap.get("legend").update(obj.max);
78 - 78 +
79 if(internal != null && internal){ 79 if(internal != null && internal){
80 for(var one in d){ 80 for(var one in d){
81 // jump over undefined indexes 81 // jump over undefined indexes
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 if(two === undefined) 85 if(two === undefined)
86 continue; 86 continue;
87 // if both indexes are defined, push the values into the array 87 // if both indexes are defined, push the values into the array
88 - heatmap.drawAlpha(one, two, d[one][two], false); 88 + heatmap.drawAlpha(one, two, d[one][two], false);
89 } 89 }
90 } 90 }
91 }else{ 91 }else{
@@ -162,28 +162,28 @@ @@ -162,28 +162,28 @@
162 config = me.config, 162 config = me.config,
163 title = config.title || "Legend", 163 title = config.title || "Legend",
164 position = config.position, 164 position = config.position,
165 - offset = config.offset || 10, 165 + offset = config.offset || [10,10],
166 gconfig = config.gradient, 166 gconfig = config.gradient,
167 labelsEl = document.createElement("ul"), 167 labelsEl = document.createElement("ul"),
168 labelsHtml = "", 168 labelsHtml = "",
169 grad, element, gradient, positionCss = ""; 169 grad, element, gradient, positionCss = "";
170 - 170 +
171 me.processGradientObject(); 171 me.processGradientObject();
172 - 172 +
173 // Positioning 173 // Positioning
174 174
175 // top or bottom 175 // top or bottom
176 if(position.indexOf('t') > -1){ 176 if(position.indexOf('t') > -1){
177 - positionCss += 'top:'+offset+'px;'; 177 + positionCss += 'top:'+offset[1]+'px;';
178 }else{ 178 }else{
179 - positionCss += 'bottom:'+offset+'px;'; 179 + positionCss += 'bottom:'+offset[1]+'px;';
180 } 180 }
181 181
182 // left or right 182 // left or right
183 if(position.indexOf('l') > -1){ 183 if(position.indexOf('l') > -1){
184 - positionCss += 'left:'+offset+'px;'; 184 + positionCss += 'left:'+offset[0]+'px;';
185 }else{ 185 }else{
186 - positionCss += 'right:'+offset+'px;'; 186 + positionCss += 'right:'+offset[0]+'px;';
187 } 187 }
188 188
189 element = document.createElement("div"); 189 element = document.createElement("div");
@@ -191,7 +191,7 @@ @@ -191,7 +191,7 @@
191 element.innerHTML = "<h3 style='padding:0;margin:0;text-align:center;font-size:16px;'>"+title+"</h3>"; 191 element.innerHTML = "<h3 style='padding:0;margin:0;text-align:center;font-size:16px;'>"+title+"</h3>";
192 // create gradient in canvas 192 // create gradient in canvas
193 labelsEl.style.cssText = "position:relative;font-size:12px;display:block;list-style:none;list-style-type:none;margin:0;height:15px;"; 193 labelsEl.style.cssText = "position:relative;font-size:12px;display:block;list-style:none;list-style-type:none;margin:0;height:15px;";
194 - 194 +
195 195
196 // create gradient element 196 // create gradient element
197 gradient = document.createElement("div"); 197 gradient = document.createElement("div");
@@ -199,7 +199,7 @@ @@ -199,7 +199,7 @@
199 199
200 element.appendChild(labelsEl); 200 element.appendChild(labelsEl);
201 element.appendChild(gradient); 201 element.appendChild(gradient);
202 - 202 +
203 me.set("element", element); 203 me.set("element", element);
204 me.set("labelsEl", labelsEl); 204 me.set("labelsEl", labelsEl);
205 205
@@ -244,7 +244,7 @@ @@ -244,7 +244,7 @@
244 ctx.fillRect(0,5,256,10); 244 ctx.fillRect(0,5,256,10);
245 ctx.strokeStyle = "black"; 245 ctx.strokeStyle = "black";
246 ctx.beginPath(); 246 ctx.beginPath();
247 - 247 +
248 for(var i = 0; i < length; i++){ 248 for(var i = 0; i < length; i++){
249 ctx.moveTo(((1/(length-1)*i*256) >> 0)+.5, 0); 249 ctx.moveTo(((1/(length-1)*i*256) >> 0)+.5, 0);
250 ctx.lineTo(((1/(length-1)*i*256) >> 0)+.5, (i==0)?15:5); 250 ctx.lineTo(((1/(length-1)*i*256) >> 0)+.5, (i==0)?15:5);
@@ -253,7 +253,7 @@ @@ -253,7 +253,7 @@
253 ctx.lineTo(255.5, 15); 253 ctx.lineTo(255.5, 15);
254 ctx.moveTo(255.5, 4.5); 254 ctx.moveTo(255.5, 4.5);
255 ctx.lineTo(0, 4.5); 255 ctx.lineTo(0, 4.5);
256 - 256 +
257 ctx.stroke(); 257 ctx.stroke();
258 258
259 // we re-use the context for measuring the legends label widths 259 // we re-use the context for measuring the legends label widths
@@ -283,7 +283,7 @@ @@ -283,7 +283,7 @@
283 offset *= 2; 283 offset *= 2;
284 } 284 }
285 labelsHtml += '<li style="position:absolute;left:'+(((((1/(gradient.length-1)*i*256) || 0)) >> 0)-offset+.5)+'px">'+labelText+'</li>'; 285 labelsHtml += '<li style="position:absolute;left:'+(((((1/(gradient.length-1)*i*256) || 0)) >> 0)-offset+.5)+'px">'+labelText+'</li>';
286 - } 286 + }
287 labels.innerHTML = labelsHtml; 287 labels.innerHTML = labelsHtml;
288 } 288 }
289 }; 289 };
@@ -351,7 +351,7 @@ @@ -351,7 +351,7 @@
351 legendCfg.gradient = me.get("gradient"); 351 legendCfg.gradient = me.get("gradient");
352 me.set("legend", new legend(legendCfg)); 352 me.set("legend", new legend(legendCfg));
353 } 353 }
354 - 354 +
355 }, 355 },
356 resize: function () { 356 resize: function () {
357 var me = this, 357 var me = this,
@@ -372,7 +372,7 @@ @@ -372,7 +372,7 @@
372 actx = acanvas.getContext("2d"), 372 actx = acanvas.getContext("2d"),
373 element = me.get("element"); 373 element = me.get("element");
374 374
375 - 375 +
376 me.initColorPalette(); 376 me.initColorPalette();
377 377
378 me.set("canvas", canvas); 378 me.set("canvas", canvas);
@@ -382,7 +382,7 @@ @@ -382,7 +382,7 @@
382 382
383 me.resize(); 383 me.resize();
384 canvas.style.cssText = acanvas.style.cssText = "position:absolute;top:0;left:0;z-index:10000000;"; 384 canvas.style.cssText = acanvas.style.cssText = "position:absolute;top:0;left:0;z-index:10000000;";
385 - 385 +
386 if(!me.get("visible")) 386 if(!me.get("visible"))
387 canvas.style.display = "none"; 387 canvas.style.display = "none";
388 388
@@ -390,14 +390,14 @@ @@ -390,14 +390,14 @@
390 if(me.get("legend")){ 390 if(me.get("legend")){
391 element.appendChild(me.get("legend").getElement()); 391 element.appendChild(me.get("legend").getElement());
392 } 392 }
393 - 393 +
394 // debugging purposes only 394 // debugging purposes only
395 if(me.get("debug")) 395 if(me.get("debug"))
396 document.body.appendChild(acanvas); 396 document.body.appendChild(acanvas);
397 -  
398 - actx.shadowOffsetX = 15000;  
399 - actx.shadowOffsetY = 15000;  
400 - actx.shadowBlur = 15; 397 +
  398 + actx.shadowOffsetX = 15000;
  399 + actx.shadowOffsetY = 15000;
  400 + actx.shadowBlur = 15;
401 }, 401 },
402 initColorPalette: function(){ 402 initColorPalette: function(){
403 403
@@ -420,7 +420,7 @@ @@ -420,7 +420,7 @@
420 ctx.putImageData(testData, 0, 0); 420 ctx.putImageData(testData, 0, 0);
421 testData = ctx.getImageData(0,0,1,1); 421 testData = ctx.getImageData(0,0,1,1);
422 me.set("premultiplyAlpha", (testData.data[0] < 60 || testData.data[0] > 70)); 422 me.set("premultiplyAlpha", (testData.data[0] < 60 || testData.data[0] > 70));
423 - 423 +
424 for(var x in gradient){ 424 for(var x in gradient){
425 grad.addColorStop(x, gradient[x]); 425 grad.addColorStop(x, gradient[x]);
426 } 426 }
@@ -465,9 +465,9 @@ @@ -465,9 +465,9 @@
465 palette = me.get("gradient"), 465 palette = me.get("gradient"),
466 opacity = me.get("opacity"), 466 opacity = me.get("opacity"),
467 bounds = me.get("bounds"), 467 bounds = me.get("bounds"),
468 - left, top, bottom, right, 468 + left, top, bottom, right,
469 image, imageData, length, alpha, offset, finalAlpha; 469 image, imageData, length, alpha, offset, finalAlpha;
470 - 470 +
471 if(x != null && y != null){ 471 if(x != null && y != null){
472 if(x+x2>width){ 472 if(x+x2>width){
473 x=width-x2; 473 x=width-x2;
@@ -506,7 +506,7 @@ @@ -506,7 +506,7 @@
506 bottom = height; 506 bottom = height;
507 }else{ 507 }else{
508 bottom = bounds['b']; 508 bottom = bounds['b'];
509 - } 509 + }
510 } 510 }
511 511
512 image = actx.getImageData(left, top, right-left, bottom-top); 512 image = actx.getImageData(left, top, right-left, bottom-top);
@@ -528,7 +528,7 @@ @@ -528,7 +528,7 @@
528 imageData[i-3]=palette[offset]; 528 imageData[i-3]=palette[offset];
529 imageData[i-2]=palette[offset+1]; 529 imageData[i-2]=palette[offset+1];
530 imageData[i-1]=palette[offset+2]; 530 imageData[i-1]=palette[offset+2];
531 - 531 +
532 if (premultiplyAlpha) { 532 if (premultiplyAlpha) {
533 // To fix browsers that premultiply incorrectly, we'll pass in a value scaled 533 // To fix browsers that premultiply incorrectly, we'll pass in a value scaled
534 // appropriately so when the multiplication happens the correct value will result. 534 // appropriately so when the multiplication happens the correct value will result.
@@ -536,7 +536,7 @@ @@ -536,7 +536,7 @@
536 imageData[i-2] /= 255/finalAlpha; 536 imageData[i-2] /= 255/finalAlpha;
537 imageData[i-1] /= 255/finalAlpha; 537 imageData[i-1] /= 255/finalAlpha;
538 } 538 }
539 - 539 +
540 // we want the heatmap to have a gradient from transparent to the colors 540 // we want the heatmap to have a gradient from transparent to the colors
541 // as long as alpha is lower than the defined opacity (maximum), we'll use the alpha value 541 // as long as alpha is lower than the defined opacity (maximum), we'll use the alpha value
542 imageData[i] = finalAlpha; 542 imageData[i] = finalAlpha;
@@ -558,9 +558,9 @@ @@ -558,9 +558,9 @@
558 558
559 ctx.shadowColor = ('rgba(0,0,0,'+((count)?(count/me.store.max):'0.1')+')'); 559 ctx.shadowColor = ('rgba(0,0,0,'+((count)?(count/me.store.max):'0.1')+')');
560 560
561 - ctx.shadowOffsetX = 15000;  
562 - ctx.shadowOffsetY = 15000;  
563 - ctx.shadowBlur = 15; 561 + ctx.shadowOffsetX = 15000;
  562 + ctx.shadowOffsetY = 15000;
  563 + ctx.shadowBlur = 15;
564 564
565 ctx.beginPath(); 565 ctx.beginPath();
566 ctx.arc(x - 15000, y - 15000, radius, 0, Math.PI * 2, true); 566 ctx.arc(x - 15000, y - 15000, radius, 0, Math.PI * 2, true);
@@ -621,7 +621,7 @@ @@ -621,7 +621,7 @@
621 return { 621 return {
622 create: function(config){ 622 create: function(config){
623 return new heatmap(config); 623 return new heatmap(config);
624 - }, 624 + },
625 util: { 625 util: {
626 mousePosition: function(ev){ 626 mousePosition: function(ev){
627 // this doesn't work right 627 // this doesn't work right