Commit 463e27a07a79ee11c7c3a99b3f59fb8c6cf75ae3
1 parent
e4613ed9
Exists in
master
and in
7 other branches
-
Showing
17 changed files
with
554 additions
and
556 deletions
Show diff stats
admin/js/editormapfile_conexao.js
| ... | ... | @@ -135,7 +135,7 @@ function montaEditorDados(dados) |
| 135 | 135 | $i("connectiontype").onchange = function(){ |
| 136 | 136 | core_desativaforms(idsForms); |
| 137 | 137 | var valor = $i("connectiontype").value, |
| 138 | - d = []; | |
| 138 | + d; | |
| 139 | 139 | //["connection","data","tileitem","tileindex"] |
| 140 | 140 | if(valor == 0 || valor == 10) |
| 141 | 141 | {d = [];} |
| ... | ... | @@ -154,7 +154,7 @@ function montaEditorDados(dados) |
| 154 | 154 | $i("metaestat").onchange = function(){ |
| 155 | 155 | core_desativaforms(idsMetaestat); |
| 156 | 156 | var valor = $i("metaestat").value, |
| 157 | - d = []; | |
| 157 | + d; | |
| 158 | 158 | if(valor === "SIM"){ |
| 159 | 159 | d = ["metaestat_id_medida_variavel"]; |
| 160 | 160 | } | ... | ... |
classesjs/classe_plugini3geo.js
| 1 | 1 | /** |
| 2 | 2 | * Title: PluginI3Geo |
| 3 | - * | |
| 3 | + * | |
| 4 | 4 | * i3GEO.pluginI3geo |
| 5 | - * | |
| 6 | - * Implementa os plugins do i3Geo que adicionam camadas especiais ao mapa, | |
| 7 | - * normalmente dados vetoriais processados no navegador Web. | |
| 8 | - * | |
| 5 | + * | |
| 6 | + * Implementa os plugins do i3Geo que adicionam camadas especiais ao mapa, normalmente dados vetoriais processados no navegador Web. | |
| 7 | + * | |
| 9 | 8 | * Arquivo: |
| 10 | - * | |
| 9 | + * | |
| 11 | 10 | * i3geo/classesjs/classe_plugini3geo.js |
| 12 | - * | |
| 11 | + * | |
| 13 | 12 | * Licença: |
| 14 | - * | |
| 13 | + * | |
| 15 | 14 | * GPL2 |
| 16 | - * | |
| 15 | + * | |
| 17 | 16 | * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet |
| 18 | - * | |
| 19 | - * Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente | |
| 20 | - * Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | |
| 21 | - * | |
| 22 | - * Este programa é software livre; você pode redistribuí-lo | |
| 23 | - * e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 24 | - * GNU conforme publicada pela Free Software Foundation; | |
| 25 | - * | |
| 26 | - * Este programa é distribuído na expectativa de que seja | |
| 27 | - * útil, porém, SEM NENHUMA GARANTIA; nem mesmo a garantia | |
| 28 | - * implícita de COMERCIABILIDADE OU ADEQUACÃO A UMA FINALIDADE | |
| 29 | - * ESPECÍFICA. Consulte a Licença Pública Geral do GNU para | |
| 30 | - * mais detalhes. Você deve ter recebido uma cópia da | |
| 31 | - * Licença Pública Geral do GNU junto com este programa; se | |
| 32 | - * não, escreva para a Free Software Foundation, Inc., no endereço | |
| 33 | - * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 17 | + * | |
| 18 | + * Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | |
| 19 | + * | |
| 20 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo sob os termos da Licença | |
| 21 | + * Pública Geral GNU conforme publicada pela Free Software Foundation; | |
| 22 | + * | |
| 23 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM NENHUMA GARANTIA; nem mesmo a | |
| 24 | + * garantia implícita de COMERCIABILIDADE OU ADEQUACÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença | |
| 25 | + * Pública Geral do GNU para mais detalhes. Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 26 | + * GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite | |
| 27 | + * 330, Boston, MA 02111-1307 USA. | |
| 34 | 28 | */ |
| 35 | 29 | if (typeof (i3GEO) === 'undefined') { |
| 36 | 30 | var i3GEO = {}; |
| 37 | 31 | } |
| 38 | -i3GEO.pluginI3geo = { | |
| 39 | - OBJETOS : {}, | |
| 40 | - /** | |
| 41 | - * Lista de plugins | |
| 42 | - * | |
| 43 | - * Utilizado no editor de mapfiles do sistema de administracao | |
| 44 | - */ | |
| 45 | - PLUGINS : [ | |
| 32 | +i3GEO.pluginI3geo = | |
| 33 | + { | |
| 34 | + OBJETOS : {}, | |
| 35 | + /** | |
| 36 | + * Lista de plugins | |
| 37 | + * | |
| 38 | + * Utilizado no editor de mapfiles do sistema de administracao | |
| 39 | + */ | |
| 40 | + PLUGINS : [ | |
| 46 | 41 | { |
| 47 | 42 | "classe" : "heatmap", |
| 48 | 43 | "nome" : "Mapa de calor", |
| 49 | 44 | "editor" : true |
| 50 | - }, { | |
| 45 | + }, | |
| 46 | + { | |
| 51 | 47 | "classe" : "markercluster", |
| 52 | 48 | "nome" : "Agrupamento de pontos (cluster)", |
| 53 | 49 | "editor" : true |
| 54 | 50 | } |
| 55 | - ], | |
| 56 | - /** | |
| 57 | - * Inicia a execucao de um plugin | |
| 58 | - * | |
| 59 | - * Camada e um objeto gerado pelo i3Geo quando uma camada e adicionada ao | |
| 60 | - * mapa O objeto i3GEO.arvoreDeCamadas.CAMADAS guarda todas as camadas | |
| 61 | - * adicionadas ao mapa Ao adicionar uma camada pelo catalogo, o i3Geo | |
| 62 | - * verifica se a camada possui plugin e direciona para ca Os plugins sao | |
| 63 | - * definidos como metadados em cada mapfile de cada tema | |
| 64 | - * | |
| 65 | - * Veja em i3geo/classesphp/classe_mapa.php funcao parametrostemas | |
| 66 | - */ | |
| 67 | - inicia : function(camada) { | |
| 68 | - if (i3GEO.janela) { | |
| 69 | - i3GEO.janela.AGUARDEMODAL = true; | |
| 70 | - i3GEO.janela.abreAguarde( | |
| 71 | - "aguardePlugin", | |
| 72 | - "Calculando..."); | |
| 73 | - i3GEO.janela.AGUARDEMODAL = false; | |
| 74 | - } | |
| 75 | - // chama a funcao conforme o tipo de plugin e a interface atual | |
| 76 | - // para cada plugin deve haver um objeto com as funcoes especificas | |
| 77 | - // para | |
| 78 | - // cada interface | |
| 79 | - i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada); | |
| 80 | - }, | |
| 81 | - /** | |
| 82 | - * Retorna o HTML com o formulario para editar os parametros do plugin | |
| 83 | - */ | |
| 84 | - formAdmin : function(plugin, configString) { | |
| 85 | - return i3GEO.pluginI3geo[plugin].formAdmin(configString); | |
| 86 | - }, | |
| 87 | - linkAjuda : function(plugin) { | |
| 88 | - return i3GEO.pluginI3geo[plugin].linkAjuda(); | |
| 89 | - }, | |
| 90 | - ligaCamada : function(nomecamada) { | |
| 91 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 92 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada) { | |
| 93 | - i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada(); | |
| 94 | - return true; | |
| 95 | - } | |
| 96 | - return false; | |
| 97 | - }, | |
| 98 | - desligaCamada : function(nomecamada) { | |
| 99 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 100 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada) { | |
| 101 | - i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada(); | |
| 102 | - return true; | |
| 103 | - } | |
| 104 | - return false; | |
| 105 | - }, | |
| 106 | - removeCamada : function(nomecamada) { | |
| 107 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 108 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada) { | |
| 109 | - i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada(); | |
| 110 | - delete (i3GEO.pluginI3geo.OBJETOS[nomecamada]); | |
| 111 | - return true; | |
| 112 | - } | |
| 113 | - return false; | |
| 114 | - }, | |
| 115 | - atualizaCamada : function(nomecamada) { | |
| 116 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 117 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada) { | |
| 118 | - i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada(); | |
| 119 | - return true; | |
| 120 | - } | |
| 121 | - return false; | |
| 122 | - }, | |
| 123 | - existeObjeto : function(nomecamada) { | |
| 124 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 125 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada) { | |
| 126 | - return true; | |
| 127 | - } | |
| 128 | - return false; | |
| 129 | - }, | |
| 130 | - /** | |
| 131 | - * Aplica as propriedades em um objeto do tipo tema | |
| 132 | - * | |
| 133 | - * tema e fornecido por i3GEO.arvoreDeCamadas o ajuste das propriedades e | |
| 134 | - * necessario para que as propriedades aparecam de forma correta na arvore | |
| 135 | - * de camadas | |
| 136 | - */ | |
| 137 | - aplicaPropriedades : function(camada) { | |
| 138 | - if (camada.plugini3geo | |
| 139 | - && camada.plugini3geo != "") { | |
| 140 | - camada = i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada); | |
| 141 | - } | |
| 142 | - return camada; | |
| 143 | - }, | |
| 144 | - /** | |
| 145 | - * Function: heatmap | |
| 146 | - * | |
| 147 | - * Mapa de calor | |
| 148 | - * | |
| 149 | - * Gera um layer do tipo mapa de calor e adiciona ao mapa | |
| 150 | - * | |
| 151 | - * As dependências em javascript sao carregadas via script tag por | |
| 152 | - * meio de ferramentas/heatmap | |
| 153 | - * | |
| 154 | - * Esse programa também obtém os dados necessários ao | |
| 155 | - * plugin | |
| 156 | - * | |
| 157 | - * O layer existente no mapfile deve conter um metadata chamado PLUGINI3GEO | |
| 158 | - * | |
| 159 | - * Esse matadado deve conter uma string que será transformada em um | |
| 160 | - * objeto javascript para uso no plugin | |
| 161 | - * | |
| 162 | - * Exemplo: | |
| 163 | - * | |
| 164 | - * "PLUGINI3GEO" | |
| 165 | - * '{"plugin":"heatmap","parametros":{"tipoGradiente": "default","coluna":"teste","max":"10","radius":"15"}}' | |
| 166 | - * | |
| 167 | - * Coluna é a que contém os dados numéricos que definem | |
| 168 | - * a quantidade de uma medida em cada ponto e é usada para gerar a | |
| 169 | - * representação. Se for vazia, considera-se o valor como 1 | |
| 170 | - * | |
| 171 | - * As cores das classes existentes no LAYER serão utilizadas para | |
| 172 | - * calcular as cores do mapa de calor. Se tipoGradiente for igual a "default" será utilizado | |
| 173 | - * o gradiente padrão. | |
| 174 | - * | |
| 175 | - */ | |
| 176 | - heatmap : { | |
| 177 | - linkAjuda : function() { | |
| 178 | - return i3GEO.configura.locaplic | |
| 179 | - + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 51 | + ], | |
| 52 | + /** | |
| 53 | + * Inicia a execucao de um plugin | |
| 54 | + * | |
| 55 | + * Camada e um objeto gerado pelo i3Geo quando uma camada e adicionada ao mapa O objeto i3GEO.arvoreDeCamadas.CAMADAS guarda todas | |
| 56 | + * as camadas adicionadas ao mapa Ao adicionar uma camada pelo catalogo, o i3Geo verifica se a camada possui plugin e direciona para | |
| 57 | + * ca Os plugins sao definidos como metadados em cada mapfile de cada tema | |
| 58 | + * | |
| 59 | + * Veja em i3geo/classesphp/classe_mapa.php funcao parametrostemas | |
| 60 | + */ | |
| 61 | + inicia : function(camada) { | |
| 62 | + if (i3GEO.janela) { | |
| 63 | + i3GEO.janela.AGUARDEMODAL = true; | |
| 64 | + i3GEO.janela.abreAguarde("aguardePlugin", "Calculando..."); | |
| 65 | + i3GEO.janela.AGUARDEMODAL = false; | |
| 66 | + } | |
| 67 | + // chama a funcao conforme o tipo de plugin e a interface atual | |
| 68 | + // para cada plugin deve haver um objeto com as funcoes especificas | |
| 69 | + // para | |
| 70 | + // cada interface | |
| 71 | + i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada); | |
| 72 | + }, | |
| 73 | + /** | |
| 74 | + * Retorna o HTML com o formulario para editar os parametros do plugin | |
| 75 | + */ | |
| 76 | + formAdmin : function(plugin, configString) { | |
| 77 | + return i3GEO.pluginI3geo[plugin].formAdmin(configString); | |
| 78 | + }, | |
| 79 | + linkAjuda : function(plugin) { | |
| 80 | + return i3GEO.pluginI3geo[plugin].linkAjuda(); | |
| 81 | + }, | |
| 82 | + ligaCamada : function(nomecamada) { | |
| 83 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada) { | |
| 84 | + i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada(); | |
| 85 | + return true; | |
| 86 | + } | |
| 87 | + return false; | |
| 88 | + }, | |
| 89 | + desligaCamada : function(nomecamada) { | |
| 90 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada) { | |
| 91 | + i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada(); | |
| 92 | + return true; | |
| 93 | + } | |
| 94 | + return false; | |
| 95 | + }, | |
| 96 | + removeCamada : function(nomecamada) { | |
| 97 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada) { | |
| 98 | + i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada(); | |
| 99 | + delete (i3GEO.pluginI3geo.OBJETOS[nomecamada]); | |
| 100 | + return true; | |
| 101 | + } | |
| 102 | + return false; | |
| 180 | 103 | }, |
| 181 | - formAdmin : function(config) { | |
| 182 | - // {"plugin":"heatmap","parametros":{"coluna":"","radius":15,"max":10}} | |
| 183 | - var parametros, ins = "", configDefault = '{"plugin":"heatmap","parametros":{"tipoGradiente": "default","coluna":"1","radius":15,"max":10}}'; | |
| 184 | - if (config === "") { | |
| 185 | - config = configDefault; | |
| 104 | + atualizaCamada : function(nomecamada) { | |
| 105 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada) { | |
| 106 | + i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada(); | |
| 107 | + return true; | |
| 186 | 108 | } |
| 187 | - config = YAHOO.lang.JSON.parse(config); | |
| 188 | - if (config.plugin != "heatmap") { | |
| 189 | - config = YAHOO.lang.JSON.parse(configDefault); | |
| 109 | + return false; | |
| 110 | + }, | |
| 111 | + existeObjeto : function(nomecamada) { | |
| 112 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada) { | |
| 113 | + return true; | |
| 190 | 114 | } |
| 191 | - parametros = config.parametros; | |
| 192 | - ins += "" | |
| 193 | - + "<p>Coluna que contém os dados ou valor numérico para cada ponto:" | |
| 194 | - + "<br><input name='coluna' type='text' value='" | |
| 195 | - + parametros.coluna | |
| 196 | - + "' size='30'></p>" | |
| 197 | - + "<p>Raio de cada ponto em pixels:" | |
| 198 | - + "<br><input name='radius' type='text' value='" | |
| 199 | - + parametros.radius | |
| 200 | - + "' size='30'></p>" | |
| 201 | - + "<p>Valor máximo em cada ponto:" | |
| 202 | - + "<br><input name='max' type='text' value='" | |
| 203 | - + parametros.max | |
| 204 | - + "' size='30'></p>" | |
| 205 | - + "<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):" | |
| 206 | - + "<br><input name='tipoGradiente' type='text' value='" | |
| 207 | - + parametros.tipoGradiente | |
| 208 | - + "' size='30'></p>" | |
| 209 | - + "<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1." | |
| 210 | - + " As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor." | |
| 211 | - + " Veja o exemplo utilizado no tema _lmapadecalor.map</p>"; | |
| 212 | - return ins; | |
| 115 | + return false; | |
| 213 | 116 | }, |
| 214 | - googlemaps : { | |
| 215 | - aplicaPropriedades : function(camada) { | |
| 216 | - camada.sel = "nao"; | |
| 217 | - camada.download = "nao"; | |
| 218 | - camada.AGUARDALEGENDA = false; | |
| 219 | - camada.temporizador = ""; | |
| 220 | - camada.copia = false; | |
| 221 | - camada.procurar = false; | |
| 222 | - camada.toponimia = false; | |
| 223 | - camada.etiquetas = false; | |
| 224 | - camada.tabela = false; | |
| 225 | - camada.grafico = false; | |
| 226 | - camada.destacar = false; | |
| 227 | - camada.wms = false; | |
| 228 | - camada.classe = "NAO"; | |
| 229 | - return camada; | |
| 117 | + /** | |
| 118 | + * Aplica as propriedades em um objeto do tipo tema | |
| 119 | + * | |
| 120 | + * tema e fornecido por i3GEO.arvoreDeCamadas o ajuste das propriedades e necessario para que as propriedades aparecam de forma | |
| 121 | + * correta na arvore de camadas | |
| 122 | + */ | |
| 123 | + aplicaPropriedades : function(camada) { | |
| 124 | + if (camada.plugini3geo && camada.plugini3geo != "") { | |
| 125 | + camada = i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada); | |
| 126 | + } | |
| 127 | + return camada; | |
| 128 | + }, | |
| 129 | + /** | |
| 130 | + * Function: heatmap | |
| 131 | + * | |
| 132 | + * Mapa de calor | |
| 133 | + * | |
| 134 | + * Gera um layer do tipo mapa de calor e adiciona ao mapa | |
| 135 | + * | |
| 136 | + * As dependências em javascript sao carregadas via script tag por meio de ferramentas/heatmap | |
| 137 | + * | |
| 138 | + * Esse programa também obtém os dados necessários ao plugin | |
| 139 | + * | |
| 140 | + * O layer existente no mapfile deve conter um metadata chamado PLUGINI3GEO | |
| 141 | + * | |
| 142 | + * Esse matadado deve conter uma string que será transformada em um objeto javascript para uso no plugin | |
| 143 | + * | |
| 144 | + * Exemplo: | |
| 145 | + * | |
| 146 | + * "PLUGINI3GEO" '{"plugin":"heatmap","parametros":{"tipoGradiente": "default","coluna":"teste","max":"10","radius":"15"}}' | |
| 147 | + * | |
| 148 | + * Coluna é a que contém os dados numéricos que definem a quantidade de uma medida em cada ponto e é | |
| 149 | + * usada para gerar a representação. Se for vazia, considera-se o valor como 1 | |
| 150 | + * | |
| 151 | + * As cores das classes existentes no LAYER serão utilizadas para calcular as cores do mapa de calor. Se tipoGradiente for | |
| 152 | + * igual a "default" será utilizado o gradiente padrão. | |
| 153 | + * | |
| 154 | + */ | |
| 155 | + heatmap : { | |
| 156 | + linkAjuda : function() { | |
| 157 | + return i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 230 | 158 | }, |
| 231 | - inicia : function(camada) { | |
| 232 | - var p = i3GEO.configura.locaplic | |
| 233 | - + "/ferramentas/heatmap/googlemaps_js.php", carregaJs = "nao", criaLayer; | |
| 234 | - criaLayer = function() { | |
| 235 | - var heatmap, pontos; | |
| 159 | + formAdmin : function(config) { | |
| 160 | + // {"plugin":"heatmap","parametros":{"coluna":"","radius":15,"max":10}} | |
| 161 | + var parametros, ins = "", configDefault = | |
| 162 | + '{"plugin":"heatmap","parametros":{"tipoGradiente": "default","coluna":"1","radius":15,"max":10}}'; | |
| 163 | + if (config === "") { | |
| 164 | + config = configDefault; | |
| 165 | + } | |
| 166 | + config = YAHOO.lang.JSON.parse(config); | |
| 167 | + if (config.plugin != "heatmap") { | |
| 168 | + config = YAHOO.lang.JSON.parse(configDefault); | |
| 169 | + } | |
| 170 | + parametros = config.parametros; | |
| 171 | + ins += | |
| 172 | + "" | |
| 173 | + + "<p>Coluna que contém os dados ou valor numérico para cada ponto:" | |
| 174 | + + "<br><input name='coluna' type='text' value='" | |
| 175 | + + parametros.coluna | |
| 176 | + + "' size='30'></p>" | |
| 177 | + + "<p>Raio de cada ponto em pixels:" | |
| 178 | + + "<br><input name='radius' type='text' value='" | |
| 179 | + + parametros.radius | |
| 180 | + + "' size='30'></p>" | |
| 181 | + + "<p>Valor máximo em cada ponto:" | |
| 182 | + + "<br><input name='max' type='text' value='" | |
| 183 | + + parametros.max | |
| 184 | + + "' size='30'></p>" | |
| 185 | + + "<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):" | |
| 186 | + + "<br><input name='tipoGradiente' type='text' value='" | |
| 187 | + + parametros.tipoGradiente | |
| 188 | + + "' size='30'></p>" | |
| 189 | + + "<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1." | |
| 190 | + + " As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor." | |
| 191 | + + " Veja o exemplo utilizado no tema _lmapadecalor.map</p>"; | |
| 192 | + return ins; | |
| 193 | + }, | |
| 194 | + googlemaps : { | |
| 195 | + aplicaPropriedades : function(camada) { | |
| 196 | + camada.sel = "nao"; | |
| 197 | + camada.download = "nao"; | |
| 198 | + camada.AGUARDALEGENDA = false; | |
| 199 | + camada.temporizador = ""; | |
| 200 | + camada.copia = false; | |
| 201 | + camada.procurar = false; | |
| 202 | + camada.toponimia = false; | |
| 203 | + camada.etiquetas = false; | |
| 204 | + camada.tabela = false; | |
| 205 | + camada.grafico = false; | |
| 206 | + camada.destacar = false; | |
| 207 | + camada.wms = false; | |
| 208 | + camada.classe = "NAO"; | |
| 209 | + return camada; | |
| 210 | + }, | |
| 211 | + inicia : function(camada) { | |
| 212 | + var p = i3GEO.configura.locaplic + "/ferramentas/heatmap/googlemaps_js.php", carregaJs = "nao", criaLayer; | |
| 213 | + criaLayer = function() { | |
| 214 | + var heatmap, pontos; | |
| 236 | 215 | |
| 237 | - heatmap = new HeatmapOverlay(i3GeoMap, camada.name, { | |
| 238 | - "radius" : camada.plugini3geo.parametros.radius, | |
| 239 | - "visible" : true, | |
| 240 | - "opacity" : camada.transparency, | |
| 241 | - "gradient" : heatmap_config.gradient, | |
| 242 | - "legend" : { | |
| 243 | - "title" : camada.tema, | |
| 244 | - "position" : "bl", | |
| 245 | - "offset" : [ | |
| 246 | - 5, 50 | |
| 247 | - ] | |
| 248 | - } | |
| 249 | - }); | |
| 250 | - // i3GeoMap.overlayMapTypes.insertAt(0, heatmap); | |
| 251 | - pontos = { | |
| 252 | - max : camada.plugini3geo.parametros.max, | |
| 253 | - data : heatmap_dados | |
| 254 | - }; | |
| 255 | - i3GEO.janela.fechaAguarde("aguardePlugin"); | |
| 256 | - heatmap.setDataSet(pontos); | |
| 257 | - heatmap.ligaCamada = function() { | |
| 258 | - this.liga(); | |
| 259 | - }; | |
| 260 | - heatmap.desLigaCamada = function() { | |
| 261 | - this.desliga(); | |
| 262 | - }; | |
| 263 | - heatmap.removeCamada = function() { | |
| 264 | - this.destroy(); | |
| 265 | - }; | |
| 266 | - heatmap.atualizaCamada = function() { | |
| 267 | - this.draw(); | |
| 216 | + heatmap = new HeatmapOverlay(i3GeoMap, camada.name, { | |
| 217 | + "radius" : camada.plugini3geo.parametros.radius, | |
| 218 | + "visible" : true, | |
| 219 | + "opacity" : camada.transparency, | |
| 220 | + "gradient" : heatmap_config.gradient, | |
| 221 | + "legend" : { | |
| 222 | + "title" : camada.tema, | |
| 223 | + "position" : "bl", | |
| 224 | + "offset" : [ | |
| 225 | + 5, | |
| 226 | + 50 | |
| 227 | + ] | |
| 228 | + } | |
| 229 | + }); | |
| 230 | + // i3GeoMap.overlayMapTypes.insertAt(0, heatmap); | |
| 231 | + pontos = { | |
| 232 | + max : camada.plugini3geo.parametros.max, | |
| 233 | + data : heatmap_dados | |
| 234 | + }; | |
| 235 | + i3GEO.janela.fechaAguarde("aguardePlugin"); | |
| 236 | + heatmap.setDataSet(pontos); | |
| 237 | + heatmap.ligaCamada = function() { | |
| 238 | + this.liga(); | |
| 239 | + }; | |
| 240 | + heatmap.desLigaCamada = function() { | |
| 241 | + this.desliga(); | |
| 242 | + }; | |
| 243 | + heatmap.removeCamada = function() { | |
| 244 | + this.destroy(); | |
| 245 | + }; | |
| 246 | + heatmap.atualizaCamada = function() { | |
| 247 | + this.draw(); | |
| 248 | + }; | |
| 249 | + i3GEO.pluginI3geo.OBJETOS[camada.name] = heatmap; | |
| 250 | + heatmap_dados = null; | |
| 268 | 251 | }; |
| 269 | - i3GEO.pluginI3geo.OBJETOS[camada.name] = heatmap; | |
| 270 | - heatmap_dados = null; | |
| 271 | - }; | |
| 272 | - if (typeof (HeatmapOverlay) === 'undefined') { | |
| 273 | - carregaJs = "sim"; | |
| 252 | + if (typeof (HeatmapOverlay) === 'undefined') { | |
| 253 | + carregaJs = "sim"; | |
| 254 | + } | |
| 255 | + p += | |
| 256 | + "?carregajs=" + carregaJs + "&layer=" + camada.name + "&coluna=" + camada.plugini3geo.parametros.coluna | |
| 257 | + + "&tipoGradiente=" + camada.plugini3geo.parametros.tipoGradiente + "&g_sid=" + i3GEO.configura.sid | |
| 258 | + + "&nomevariavel=heatmap_dados", +"&nomevariavelConfig=heatmap_config"; | |
| 259 | + i3GEO.util.scriptTag(p, criaLayer, "i3GEO.pluginI3geo.heatmap_script"); | |
| 274 | 260 | } |
| 275 | - p += "?carregajs=" | |
| 276 | - + carregaJs | |
| 277 | - + "&layer=" | |
| 278 | - + camada.name | |
| 279 | - + "&coluna=" | |
| 280 | - + camada.plugini3geo.parametros.coluna | |
| 281 | - + "&tipoGradiente=" | |
| 282 | - + camada.plugini3geo.parametros.tipoGradiente | |
| 283 | - + "&g_sid=" | |
| 284 | - + i3GEO.configura.sid | |
| 285 | - + "&nomevariavel=heatmap_dados", | |
| 286 | - + "&nomevariavelConfig=heatmap_config"; | |
| 287 | - i3GEO.util.scriptTag( | |
| 288 | - p, | |
| 289 | - criaLayer, | |
| 290 | - "i3GEO.pluginI3geo.heatmap_script"); | |
| 291 | - } | |
| 292 | - }, | |
| 293 | - // | |
| 294 | - // O script que adiciona a camada | |
| 295 | - // define os eventos visibilitychanged, moveend e removed | |
| 296 | - // A camada e adicionada como um objeto layer, permitindo que as funcoes | |
| 297 | - // do i3Geo operem normalmente, sem muitas modificacoes | |
| 298 | - // | |
| 299 | - openlayers : { | |
| 300 | - aplicaPropriedades : function(camada) { | |
| 301 | - camada.sel = "nao"; | |
| 302 | - camada.download = "nao"; | |
| 303 | - camada.AGUARDALEGENDA = false; | |
| 304 | - camada.temporizador = ""; | |
| 305 | - camada.copia = false; | |
| 306 | - camada.procurar = false; | |
| 307 | - camada.toponimia = false; | |
| 308 | - camada.etiquetas = false; | |
| 309 | - camada.tabela = false; | |
| 310 | - camada.grafico = false; | |
| 311 | - camada.destacar = false; | |
| 312 | - camada.wms = false; | |
| 313 | - camada.classe = "NAO"; | |
| 314 | - return camada; | |
| 315 | 261 | }, |
| 316 | - inicia : function(camada, objMapa) { | |
| 317 | - var p = i3GEO.configura.locaplic | |
| 318 | - + "/ferramentas/heatmap/openlayers_js.php", carregaJs = "nao", criaLayer; | |
| 319 | - criaLayer = function() { | |
| 320 | - var heatmap, transformedTestData = { | |
| 321 | - max : camada.plugini3geo.parametros.max, | |
| 322 | - data : [] | |
| 323 | - }, data = heatmap_dados, datalen = heatmap_dados.length, nudata = []; | |
| 262 | + // | |
| 263 | + // O script que adiciona a camada | |
| 264 | + // define os eventos visibilitychanged, moveend e removed | |
| 265 | + // A camada e adicionada como um objeto layer, permitindo que as funcoes | |
| 266 | + // do i3Geo operem normalmente, sem muitas modificacoes | |
| 267 | + // | |
| 268 | + openlayers : { | |
| 269 | + aplicaPropriedades : function(camada) { | |
| 270 | + camada.sel = "nao"; | |
| 271 | + camada.download = "nao"; | |
| 272 | + camada.AGUARDALEGENDA = false; | |
| 273 | + camada.temporizador = ""; | |
| 274 | + camada.copia = false; | |
| 275 | + camada.procurar = false; | |
| 276 | + camada.toponimia = false; | |
| 277 | + camada.etiquetas = false; | |
| 278 | + camada.tabela = false; | |
| 279 | + camada.grafico = false; | |
| 280 | + camada.destacar = false; | |
| 281 | + camada.wms = false; | |
| 282 | + camada.classe = "NAO"; | |
| 283 | + return camada; | |
| 284 | + }, | |
| 285 | + inicia : function(camada, objMapa) { | |
| 286 | + var p = i3GEO.configura.locaplic + "/ferramentas/heatmap/openlayers_js.php", carregaJs = "nao", criaLayer; | |
| 287 | + criaLayer = function() { | |
| 288 | + var heatmap, transformedTestData = { | |
| 289 | + max : camada.plugini3geo.parametros.max, | |
| 290 | + data : [] | |
| 291 | + }, data = heatmap_dados, datalen = heatmap_dados.length, nudata = []; | |
| 324 | 292 | |
| 325 | - // para uso com o mashup | |
| 326 | - if (!objMapa) { | |
| 327 | - objMapa = i3geoOL; | |
| 328 | - } | |
| 329 | - // in order to use the OpenLayers Heatmap Layer we have | |
| 330 | - // to | |
| 331 | - // transform our data into | |
| 332 | - // { max: <max>, data: [{lonlat: <OpenLayers.LonLat>, | |
| 333 | - // count: | |
| 334 | - // <count>},...]} | |
| 335 | - while (datalen--) { | |
| 336 | - nudata.push({ | |
| 337 | - lonlat : new OpenLayers.LonLat(data[datalen].lng, heatmap_dados[datalen].lat), | |
| 338 | - count : heatmap_dados[datalen].count | |
| 293 | + // para uso com o mashup | |
| 294 | + if (!objMapa) { | |
| 295 | + objMapa = i3geoOL; | |
| 296 | + } | |
| 297 | + // in order to use the OpenLayers Heatmap Layer we have | |
| 298 | + // to | |
| 299 | + // transform our data into | |
| 300 | + // { max: <max>, data: [{lonlat: <OpenLayers.LonLat>, | |
| 301 | + // count: | |
| 302 | + // <count>},...]} | |
| 303 | + while (datalen--) { | |
| 304 | + nudata.push({ | |
| 305 | + lonlat : new OpenLayers.LonLat(data[datalen].lng, heatmap_dados[datalen].lat), | |
| 306 | + count : heatmap_dados[datalen].count | |
| 307 | + }); | |
| 308 | + } | |
| 309 | + transformedTestData.data = nudata; | |
| 310 | + // create our heatmap layer | |
| 311 | + heatmap = new OpenLayers.Layer.Heatmap(camada.name, objMapa, objMapa.baseLayer, { | |
| 312 | + "visible" : true, | |
| 313 | + "opacity" : camada.transparency, | |
| 314 | + "radius" : camada.plugini3geo.parametros.radius, | |
| 315 | + "gradient" : heatmap_config.gradient, | |
| 316 | + "legend" : { | |
| 317 | + "title" : camada.tema, | |
| 318 | + "position" : "bl", | |
| 319 | + "offset" : [ | |
| 320 | + 5, | |
| 321 | + 50 | |
| 322 | + ] | |
| 323 | + } | |
| 324 | + }, { | |
| 325 | + isBaseLayer : false, | |
| 326 | + projection : new OpenLayers.Projection("EPSG:4326"), | |
| 327 | + displayInLayerSwitcher : true | |
| 339 | 328 | }); |
| 340 | - } | |
| 341 | - transformedTestData.data = nudata; | |
| 342 | - // create our heatmap layer | |
| 343 | - heatmap = new OpenLayers.Layer.Heatmap(camada.name, objMapa, objMapa.baseLayer, { | |
| 344 | - "visible" : true, | |
| 345 | - "opacity" : camada.transparency, | |
| 346 | - "radius" : camada.plugini3geo.parametros.radius, | |
| 347 | - "gradient" : heatmap_config.gradient, | |
| 348 | - "legend" : { | |
| 349 | - "title" : camada.tema, | |
| 350 | - "position" : "bl", | |
| 351 | - "offset" : [ | |
| 352 | - 5, 50 | |
| 353 | - ] | |
| 329 | + heatmap.ligaCamada = function() { | |
| 330 | + this.toggle(); | |
| 331 | + this.updateLayer(); | |
| 332 | + }; | |
| 333 | + heatmap.desLigaCamada = function() { | |
| 334 | + this.toggle(); | |
| 335 | + this.updateLayer(); | |
| 336 | + }; | |
| 337 | + heatmap.removeCamada = function() { | |
| 338 | + this.destroy(); | |
| 339 | + }; | |
| 340 | + heatmap.atualizaCamada = function() { | |
| 341 | + this.updateLayer(); | |
| 342 | + }; | |
| 343 | + | |
| 344 | + i3GEO.pluginI3geo.OBJETOS[camada.name] = heatmap; | |
| 345 | + objMapa.addLayer(heatmap); | |
| 346 | + heatmap.setDataSet(transformedTestData); | |
| 347 | + heatmap_dados = null; | |
| 348 | + if (i3GEO.janela) { | |
| 349 | + i3GEO.janela.fechaAguarde("aguardePlugin"); | |
| 354 | 350 | } |
| 355 | - }, { | |
| 356 | - isBaseLayer : false, | |
| 357 | - projection : new OpenLayers.Projection("EPSG:4326"), | |
| 358 | - displayInLayerSwitcher : true | |
| 359 | - }); | |
| 360 | - heatmap.ligaCamada = function() { | |
| 361 | - this.toggle(); | |
| 362 | - this.updateLayer(); | |
| 363 | - }; | |
| 364 | - heatmap.desLigaCamada = function() { | |
| 365 | - this.toggle(); | |
| 366 | - this.updateLayer(); | |
| 367 | - }; | |
| 368 | - heatmap.removeCamada = function() { | |
| 369 | - this.destroy(); | |
| 370 | 351 | }; |
| 371 | - heatmap.atualizaCamada = function() { | |
| 372 | - this.updateLayer(); | |
| 373 | - }; | |
| 374 | - | |
| 375 | - i3GEO.pluginI3geo.OBJETOS[camada.name] = heatmap; | |
| 376 | - objMapa.addLayer(heatmap); | |
| 377 | - heatmap.setDataSet(transformedTestData); | |
| 378 | - heatmap_dados = null; | |
| 379 | - if (i3GEO.janela) { | |
| 380 | - i3GEO.janela.fechaAguarde("aguardePlugin"); | |
| 352 | + if (typeof (HeatmapOverlay) === 'undefined') { | |
| 353 | + carregaJs = "sim"; | |
| 354 | + } | |
| 355 | + if (!i3GEO.configura || !i3GEO.configura.sid) { | |
| 356 | + i3GEO.configura.sid = ""; | |
| 381 | 357 | } |
| 382 | - }; | |
| 383 | - if (typeof (HeatmapOverlay) === 'undefined') { | |
| 384 | - carregaJs = "sim"; | |
| 358 | + p += | |
| 359 | + "?carregajs=" + carregaJs + "&layer=" + camada.name + "&coluna=" + camada.plugini3geo.parametros.coluna | |
| 360 | + + "&tipoGradiente=" + camada.plugini3geo.parametros.tipoGradiente + "&g_sid=" + i3GEO.configura.sid | |
| 361 | + + "&nomevariavel=heatmap_dados" + "&nomevariavelConfig=heatmap_config"; | |
| 362 | + i3GEO.util.scriptTag(p, criaLayer, "i3GEO.pluginI3geo.heatmap_script"); | |
| 385 | 363 | } |
| 386 | - if (!i3GEO.configura | |
| 387 | - || !i3GEO.configura.sid) { | |
| 388 | - i3GEO.configura.sid = ""; | |
| 364 | + }, | |
| 365 | + googleearth : { | |
| 366 | + inicia : function() { | |
| 367 | + alert("Plugin nao disponivel"); | |
| 389 | 368 | } |
| 390 | - p += "?carregajs=" | |
| 391 | - + carregaJs | |
| 392 | - + "&layer=" | |
| 393 | - + camada.name | |
| 394 | - + "&coluna=" | |
| 395 | - + camada.plugini3geo.parametros.coluna | |
| 396 | - + "&tipoGradiente=" | |
| 397 | - + camada.plugini3geo.parametros.tipoGradiente | |
| 398 | - + "&g_sid=" | |
| 399 | - + i3GEO.configura.sid | |
| 400 | - + "&nomevariavel=heatmap_dados" | |
| 401 | - + "&nomevariavelConfig=heatmap_config"; | |
| 402 | - i3GEO.util.scriptTag( | |
| 403 | - p, | |
| 404 | - criaLayer, | |
| 405 | - "i3GEO.pluginI3geo.heatmap_script"); | |
| 406 | - } | |
| 407 | - }, | |
| 408 | - googleearth : { | |
| 409 | - inicia : function() { | |
| 410 | - alert("Plugin nao disponivel"); | |
| 411 | 369 | } |
| 412 | - } | |
| 413 | - }, | |
| 414 | - /** | |
| 415 | - * Function: markercluster | |
| 416 | - * | |
| 417 | - * Markercluster | |
| 418 | - * | |
| 419 | - * Gera um layer que agrupa pontos conforme a distância entre eles e | |
| 420 | - * insere um contador adiciona ao mapa | |
| 421 | - * | |
| 422 | - * As dependências em javascript sao carregadas via script tag por | |
| 423 | - * meio de ferramentas/markercluster | |
| 424 | - * | |
| 425 | - * Esse programa também obtém os dados necessários ao | |
| 426 | - * plugin | |
| 427 | - * | |
| 428 | - * O layer existente no mapfile deve conter um metadata chamado PLUGINI3GEO | |
| 429 | - * | |
| 430 | - * Esse matadado deve conter uma string que será transformada em um | |
| 431 | - * objeto javascript para uso no plugin | |
| 432 | - * | |
| 433 | - * Exemplo: | |
| 434 | - * | |
| 435 | - * "PLUGINI3GEO" | |
| 436 | - * '{"plugin":"markercluster","parametros":{"coluna":"teste","gridSize":"50"}}' | |
| 437 | - * | |
| 438 | - * Coluna é a que contém os dados numéricos que definem | |
| 439 | - * a quantidade de uma medida em cada ponto e é usada para gerar a | |
| 440 | - * representação. Se for vazia, considera-se o valor como 1 | |
| 441 | - * | |
| 442 | - */ | |
| 443 | - markercluster : { | |
| 444 | - linkAjuda : function() { | |
| 445 | - return i3GEO.configura.locaplic | |
| 446 | - + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 447 | 370 | }, |
| 448 | - formAdmin : function(config) { | |
| 449 | - var parametros, ins = "", configDefault = '{"plugin":"markercluster","parametros":{"gridSize":50}}'; | |
| 450 | - if (config === "") { | |
| 451 | - config = configDefault; | |
| 452 | - } | |
| 453 | - config = YAHOO.lang.JSON.parse(config); | |
| 454 | - if (config.plugin != "markercluster") { | |
| 455 | - config = YAHOO.lang.JSON.parse(configDefault); | |
| 456 | - } | |
| 457 | - parametros = config.parametros; | |
| 458 | - ins += "" | |
| 459 | - + "<p>Distância máxima entre ponto em pixels:" | |
| 460 | - + "<br><input name='gridSize' type='text' value='" | |
| 461 | - + parametros.gridSize | |
| 462 | - + "' size='30'></p>"; | |
| 463 | - return ins; | |
| 464 | - }, | |
| 465 | - googlemaps : { | |
| 466 | - aplicaPropriedades : function(camada) { | |
| 467 | - camada.sel = "nao"; | |
| 468 | - camada.download = "nao"; | |
| 469 | - camada.AGUARDALEGENDA = false; | |
| 470 | - camada.temporizador = ""; | |
| 471 | - camada.copia = false; | |
| 472 | - camada.procurar = false; | |
| 473 | - camada.toponimia = false; | |
| 474 | - camada.etiquetas = false; | |
| 475 | - camada.tabela = false; | |
| 476 | - camada.grafico = false; | |
| 477 | - camada.destacar = false; | |
| 478 | - camada.wms = false; | |
| 479 | - camada.classe = "NAO"; | |
| 480 | - return camada; | |
| 371 | + /** | |
| 372 | + * Function: markercluster | |
| 373 | + * | |
| 374 | + * Markercluster | |
| 375 | + * | |
| 376 | + * Gera um layer que agrupa pontos conforme a distância entre eles e insere um contador adiciona ao mapa | |
| 377 | + * | |
| 378 | + * As dependências em javascript sao carregadas via script tag por meio de ferramentas/markercluster | |
| 379 | + * | |
| 380 | + * Esse programa também obtém os dados necessários ao plugin | |
| 381 | + * | |
| 382 | + * O layer existente no mapfile deve conter um metadata chamado PLUGINI3GEO | |
| 383 | + * | |
| 384 | + * Esse matadado deve conter uma string que será transformada em um objeto javascript para uso no plugin | |
| 385 | + * | |
| 386 | + * Exemplo: | |
| 387 | + * | |
| 388 | + * "PLUGINI3GEO" '{"plugin":"markercluster","parametros":{"coluna":"teste","gridSize":"50"}}' | |
| 389 | + * | |
| 390 | + * Coluna é a que contém os dados numéricos que definem a quantidade de uma medida em cada ponto e é | |
| 391 | + * usada para gerar a representação. Se for vazia, considera-se o valor como 1 | |
| 392 | + * | |
| 393 | + */ | |
| 394 | + markercluster : { | |
| 395 | + linkAjuda : function() { | |
| 396 | + return i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 481 | 397 | }, |
| 482 | - inicia : function(camada) { | |
| 483 | - var p = i3GEO.configura.locaplic | |
| 484 | - + "/ferramentas/markercluster/googlemaps_js.php", carregaJs = "nao", criaLayer; | |
| 485 | - criaLayer = function() { | |
| 486 | - var markercluster, marcas, latLng, marker, n, i; | |
| 487 | - n = markercluster_dados.length; | |
| 488 | - marcas = []; | |
| 489 | - for (i = 0; i < n; i++) { | |
| 490 | - latLng = new google.maps.LatLng(markercluster_dados[i].lat, markercluster_dados[i].lng); | |
| 491 | - marker = new google.maps.Marker({ | |
| 492 | - 'position' : latLng | |
| 493 | - }); | |
| 494 | - marcas.push(marker); | |
| 495 | - } | |
| 496 | - markercluster = new MarkerClusterer(i3GeoMap, marcas, { | |
| 497 | - "gridSize" : parseInt(camada.plugini3geo.parametros.gridSize,10), | |
| 498 | - "visible" : true, | |
| 499 | - "opacity" : camada.transparency, | |
| 500 | - "name" : camada.name | |
| 501 | - }); | |
| 502 | - i3GEO.janela.fechaAguarde("aguardePlugin"); | |
| 398 | + formAdmin : function(config) { | |
| 399 | + var parametros, ins = "", configDefault = '{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}'; | |
| 400 | + if (config === "") { | |
| 401 | + config = configDefault; | |
| 402 | + } | |
| 403 | + config = YAHOO.lang.JSON.parse(config); | |
| 404 | + if (config.plugin != "markercluster") { | |
| 405 | + config = YAHOO.lang.JSON.parse(configDefault); | |
| 406 | + } | |
| 407 | + parametros = config.parametros; | |
| 408 | + ins += | |
| 409 | + "" + "<p>Distância máxima entre ponto em pixels:" + "<br><input name='gridSize' type='text' value='" | |
| 410 | + + parametros.gridSize + "' size='30'></p>" | |
| 411 | + + "<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):" | |
| 412 | + + "<br><input name='tipoEstilos' type='text' value='" | |
| 413 | + + parametros.tipoEstilos | |
| 414 | + + "' size='30'></p>" | |
| 415 | + + "<p></p>"; | |
| 503 | 416 | |
| 504 | - markercluster.ligaCamada = function() { | |
| 505 | - i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = true; | |
| 506 | - i3GEO.pluginI3geo.OBJETOS[camada.name].redraw(); | |
| 507 | - }; | |
| 508 | - markercluster.desLigaCamada = function() { | |
| 509 | - i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true); | |
| 510 | - i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = false; | |
| 511 | - }; | |
| 512 | - markercluster.removeCamada = function() { | |
| 513 | - i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers(); | |
| 417 | + return ins; | |
| 418 | + }, | |
| 419 | + googlemaps : { | |
| 420 | + aplicaPropriedades : function(camada) { | |
| 421 | + camada.sel = "nao"; | |
| 422 | + camada.download = "nao"; | |
| 423 | + camada.AGUARDALEGENDA = false; | |
| 424 | + camada.temporizador = ""; | |
| 425 | + camada.copia = false; | |
| 426 | + camada.procurar = false; | |
| 427 | + camada.toponimia = false; | |
| 428 | + camada.etiquetas = false; | |
| 429 | + camada.tabela = false; | |
| 430 | + camada.grafico = false; | |
| 431 | + camada.destacar = false; | |
| 432 | + camada.wms = false; | |
| 433 | + camada.classe = "NAO"; | |
| 434 | + return camada; | |
| 435 | + }, | |
| 436 | + inicia : function(camada) { | |
| 437 | + var p = i3GEO.configura.locaplic + "/ferramentas/markercluster/googlemaps_js.php", carregaJs = "nao", criaLayer; | |
| 438 | + criaLayer = function() { | |
| 439 | + var markercluster, marcas, latLng, marker, n, i; | |
| 440 | + n = markercluster_dados.length; | |
| 441 | + marcas = []; | |
| 442 | + for (i = 0; i < n; i++) { | |
| 443 | + latLng = new google.maps.LatLng(markercluster_dados[i].lat, markercluster_dados[i].lng); | |
| 444 | + marker = new google.maps.Marker({ | |
| 445 | + 'position' : latLng, | |
| 446 | + icon : { | |
| 447 | + url : i3GEO.configura.locaplic + "/imagens/google/symbol_blank.png", | |
| 448 | + scaledSize : new google.maps.Size(20, 20) | |
| 449 | + } | |
| 450 | + }); | |
| 451 | + marcas.push(marker); | |
| 452 | + } | |
| 453 | + markercluster = new MarkerClusterer(i3GeoMap, marcas, { | |
| 454 | + "gridSize" : parseInt(camada.plugini3geo.parametros.gridSize, 10), | |
| 455 | + "visible" : true, | |
| 456 | + "opacity" : camada.transparency, | |
| 457 | + "name" : camada.name, | |
| 458 | + "styles" : [ | |
| 459 | + { | |
| 460 | + url : i3GEO.configura.locaplic + "/imagens/google/m1", | |
| 461 | + height : 53, | |
| 462 | + width : 53 | |
| 463 | + }, | |
| 464 | + { | |
| 465 | + url : i3GEO.configura.locaplic + "/imagens/google/m2", | |
| 466 | + height : 56, | |
| 467 | + width : 56 | |
| 468 | + }, | |
| 469 | + { | |
| 470 | + url : i3GEO.configura.locaplic + "/imagens/google/m3", | |
| 471 | + height : 66, | |
| 472 | + width : 66 | |
| 473 | + }, | |
| 474 | + { | |
| 475 | + url : i3GEO.configura.locaplic + "/imagens/google/m4", | |
| 476 | + height : 78, | |
| 477 | + width : 78 | |
| 478 | + }, | |
| 479 | + { | |
| 480 | + url : i3GEO.configura.locaplic + "/imagens/google/m5", | |
| 481 | + height : 90, | |
| 482 | + width : 90 | |
| 483 | + } | |
| 484 | + ] | |
| 485 | + }); | |
| 486 | + i3GEO.janela.fechaAguarde("aguardePlugin"); | |
| 487 | + i3GEO.eventos.cliquePerm.ativo = false; | |
| 514 | 488 | |
| 489 | + markercluster.ligaCamada = function() { | |
| 490 | + i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = true; | |
| 491 | + i3GEO.pluginI3geo.OBJETOS[camada.name].redraw(); | |
| 492 | + i3GEO.eventos.cliquePerm.ativo = false; | |
| 493 | + }; | |
| 494 | + markercluster.desLigaCamada = function() { | |
| 495 | + i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true); | |
| 496 | + i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = false; | |
| 497 | + i3GEO.eventos.cliquePerm.ativo = true; | |
| 498 | + }; | |
| 499 | + markercluster.removeCamada = function() { | |
| 500 | + i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers(); | |
| 501 | + i3GEO.eventos.cliquePerm.ativo = true; | |
| 502 | + }; | |
| 503 | + markercluster.atualizaCamada = function() { | |
| 504 | + i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = true; | |
| 505 | + i3GEO.pluginI3geo.OBJETOS[camada.name].redraw(); | |
| 506 | + i3GEO.eventos.cliquePerm.ativo = false; | |
| 507 | + }; | |
| 508 | + i3GEO.pluginI3geo.OBJETOS[camada.name] = markercluster; | |
| 509 | + markercluster_dados = null; | |
| 515 | 510 | }; |
| 516 | - markercluster.atualizaCamada = function() { | |
| 517 | - i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = true; | |
| 518 | - i3GEO.pluginI3geo.OBJETOS[camada.name].redraw(); | |
| 519 | - }; | |
| 520 | - i3GEO.pluginI3geo.OBJETOS[camada.name] = markercluster; | |
| 521 | - markercluster_dados = null; | |
| 522 | - }; | |
| 523 | - if (typeof (MarkerClusterer) === 'undefined') { | |
| 524 | - carregaJs = "sim"; | |
| 511 | + if (typeof (MarkerClusterer) === 'undefined') { | |
| 512 | + carregaJs = "sim"; | |
| 513 | + } | |
| 514 | + p += | |
| 515 | + "?carregajs=" + carregaJs + "&layer=" + camada.name + "&coluna=" + camada.plugini3geo.parametros.coluna | |
| 516 | + + "&g_sid=" + i3GEO.configura.sid | |
| 517 | + + "&tipoEstilos=" + camada.plugini3geo.parametros.tipoEstilos | |
| 518 | + + "&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config"; | |
| 519 | + i3GEO.util.scriptTag(p, criaLayer, "i3GEO.pluginI3geo.markercluster_script"); | |
| 525 | 520 | } |
| 526 | - p += "?carregajs=" | |
| 527 | - + carregaJs | |
| 528 | - + "&layer=" | |
| 529 | - + camada.name | |
| 530 | - + "&coluna=" | |
| 531 | - + camada.plugini3geo.parametros.coluna | |
| 532 | - + "&g_sid=" | |
| 533 | - + i3GEO.configura.sid | |
| 534 | - + "&nomevariavel=markercluster_dados"; | |
| 535 | - i3GEO.util.scriptTag( | |
| 536 | - p, | |
| 537 | - criaLayer, | |
| 538 | - "i3GEO.pluginI3geo.markercluster_script"); | |
| 539 | 521 | } |
| 540 | 522 | } |
| 541 | - } | |
| 542 | -}; | |
| 543 | 523 | \ No newline at end of file |
| 524 | + }; | |
| 544 | 525 | \ No newline at end of file | ... | ... |
exemplos/atlas/i3geo.js
| 1 | -function atlasInicia() | |
| 2 | -{ | |
| 3 | - if ($i("guia6")) | |
| 4 | - { | |
| 5 | - $i("guia6").onclick = function() | |
| 6 | - { | |
| 1 | +function atlasInicia() { | |
| 2 | + if ($i("guia6")) { | |
| 3 | + $i("guia6").onclick = function() { | |
| 7 | 4 | g_guiaativa = "guia6"; |
| 8 | 5 | mostraguiaf(6); |
| 9 | - } | |
| 6 | + }; | |
| 10 | 7 | } |
| 11 | 8 | objmapa = new Mapa(); |
| 12 | 9 | objmapa.inicializa(); |
| 13 | - | |
| 14 | - //corrige a altura da guia 6 | |
| 10 | + | |
| 11 | + // corrige a altura da guia 6 | |
| 15 | 12 | $i("guia6obj").style.height = objmapa.h; |
| 16 | 13 | } |
| 17 | -function atlasMapa(mapa,temas) | |
| 18 | -{ | |
| 19 | - if ($i(mapa)) | |
| 20 | - {$i("atlasTexto").innerHTML = $i(mapa).innerHTML} | |
| 21 | - else | |
| 22 | - {$i("atlasTexto").innerHTML = ""} | |
| 23 | - if ($i("guia1obj")) | |
| 24 | - { | |
| 25 | - //desliga todos | |
| 14 | +function atlasMapa(mapa, temas) { | |
| 15 | + if ($i(mapa)) { | |
| 16 | + $i("atlasTexto").innerHTML = $i(mapa).innerHTML; | |
| 17 | + } else { | |
| 18 | + $i("atlasTexto").innerHTML = ""; | |
| 19 | + } | |
| 20 | + if ($i("guia1obj")) { | |
| 21 | + // desliga todos | |
| 26 | 22 | var iguias = $i("guia1obj").getElementsByTagName("input"); |
| 27 | - for (i=0;i<iguias.length; i++) | |
| 28 | - { | |
| 29 | - if (iguias[i].type == "checkbox") | |
| 30 | - {iguias[i].checked = false} | |
| 23 | + for (var i = 0; i < iguias.length; i++) { | |
| 24 | + if (iguias[i].type == "checkbox") { | |
| 25 | + iguias[i].checked = false; | |
| 26 | + } | |
| 31 | 27 | } |
| 32 | - //liga o que interessa | |
| 33 | - var temas = temas.split(",") | |
| 34 | - for (i=0;i<temas.length; i++) | |
| 35 | - { | |
| 36 | - for (j=0;j<iguias.length; j++) | |
| 37 | - { | |
| 38 | - if (iguias[j].type == "checkbox") | |
| 39 | - { | |
| 40 | - if (iguias[j].value == temas[i]) | |
| 41 | - {iguias[j].checked = true} | |
| 28 | + // liga o que interessa | |
| 29 | + temas = temas.split(","); | |
| 30 | + for (var i = 0; i < temas.length; i++) { | |
| 31 | + for (var j = 0; j < iguias.length; j++) { | |
| 32 | + if (iguias[j].type == "checkbox") { | |
| 33 | + if (iguias[j].value == temas[i]) { | |
| 34 | + iguias[j].checked = true; | |
| 35 | + } | |
| 42 | 36 | } |
| 43 | 37 | } |
| 44 | 38 | } |
| 45 | - //sempre ligados | |
| 46 | - var temas = new Array("estadosl","zee","mundo","brasil","estados") | |
| 47 | - for (i=0;i<temas.length; i++) | |
| 48 | - { | |
| 49 | - for (j=0;j<iguias.length; j++) | |
| 50 | - { | |
| 51 | - if (iguias[j].type == "checkbox") | |
| 52 | - { | |
| 53 | - if (iguias[j].value == temas[i]) | |
| 54 | - {iguias[j].checked = true} | |
| 39 | + // sempre ligados | |
| 40 | + temas = new Array("estadosl", "zee", "mundo", "brasil", "estados"); | |
| 41 | + for (i = 0; i < temas.length; i++) { | |
| 42 | + for (j = 0; j < iguias.length; j++) { | |
| 43 | + if (iguias[j].type == "checkbox") { | |
| 44 | + if (iguias[j].value == temas[i]) { | |
| 45 | + iguias[j].checked = true; | |
| 46 | + } | |
| 55 | 47 | } |
| 56 | 48 | } |
| 57 | - } | |
| 49 | + } | |
| 58 | 50 | } |
| 59 | - remapaf() | |
| 51 | + remapaf(); | |
| 60 | 52 | } | ... | ... |
exemplos/atlas/mapa.htm
| ... | ... | @@ -33,10 +33,10 @@ |
| 33 | 33 | <tr><td style="border-bottom:1px solid rgb(230,230,230)"> |
| 34 | 34 | <!-- Guias principais, não mude o ID, apenas o nome se for desejado --> |
| 35 | 35 | <div class=verdeescuro style="top:0px;cursor:pointer"> |
| 36 | - <div id=guia1 class=guia value="Mostra os temas atualmente inseridos no mapa e que podem estar visíveis ou não." > Temas </div> | |
| 37 | - <div id=guia2 class=guia value="Mostra a lista de temas disponíveis no servidor de dados, possibilitando que novos temas sejam adicionados ao mapa."> Adiciona </div> | |
| 38 | - <div id=guia4 class=guia value="Mostra a legnda do mapa atual." > Legenda </div> | |
| 39 | - <div id=guia6 class=guia value="Atlas SRH"> Atlas </div> | |
| 36 | + <div id=guia1 class=guia > Temas </div> | |
| 37 | + <div id=guia2 class=guia > Adiciona </div> | |
| 38 | + <div id=guia4 class=guia > Legenda </div> | |
| 39 | + <div id=guia6 class=guia > Atlas </div> | |
| 40 | 40 | </div> |
| 41 | 41 | </td></tr> |
| 42 | 42 | </table> |
| ... | ... | @@ -98,7 +98,7 @@ |
| 98 | 98 | <td class=verdeclaro ><div id=escala ></div></td> |
| 99 | 99 | <!-- Localizador de coordenadas --> |
| 100 | 100 | <td class=verdeclaro ><div id=localizarxy >Aguarde...</div></td> |
| 101 | - </td></tr> | |
| 101 | + </tr> | |
| 102 | 102 | </table> |
| 103 | 103 | </td> |
| 104 | 104 | </tr> | ... | ... |
ferramentas/markercluster/funcoes.php
| ... | ... | @@ -68,4 +68,26 @@ function markerclusterMapfile(){ |
| 68 | 68 | } |
| 69 | 69 | return $map_file; |
| 70 | 70 | } |
| 71 | +function markerclusterEstilos($map_file,$layer,$tipoEstilos){ | |
| 72 | + if($tipoEstilos == "default"){ | |
| 73 | + $tipoEstilos = '[{url : i3GEO.configura.locaplic + "/imagens/google/m1",height : 53,width : 53},{url : i3GEO.configura.locaplic + "/imagens/google/m2",height : 56,width : 56},{url : i3GEO.configura.locaplic + "/imagens/google/m3",height : 66,width : 66},{url : i3GEO.configura.locaplic + "/imagens/google/m4",height : 78,width : 78},{url : i3GEO.configura.locaplic + "/imagens/google/m5",height : 90,width : 90}]'; | |
| 74 | + } | |
| 75 | + else{ | |
| 76 | + $gradiente = array(); | |
| 77 | + $mapa = ms_newMapObj($map_file); | |
| 78 | + $l = $mapa->getlayerbyname($layer); | |
| 79 | + $nc = $l->numclasses; | |
| 80 | + for ($c = 0;$c < $nc;$c++){ | |
| 81 | + $classe = $l->getclass($c); | |
| 82 | + $estilo = $classe->getstyle(0); | |
| 83 | + $nome = $classe->name; | |
| 84 | + $cor = $estilo->color; | |
| 85 | + $scor = "rgb(".$cor->red.",".$cor->green.",".$cor->blue.")"; | |
| 86 | + $gradiente[$nome] = $scor; | |
| 87 | + } | |
| 88 | + //echo $map_file;exit; | |
| 89 | + $gradiente = json_encode(array("gradient"=>$gradiente)); | |
| 90 | + } | |
| 91 | + return $tipoEstilos; | |
| 92 | +} | |
| 71 | 93 | ?> |
| 72 | 94 | \ No newline at end of file | ... | ... |
ferramentas/markercluster/googlemaps_js.php
| ... | ... | @@ -22,9 +22,12 @@ include_once($dir."/../inicia.php"); |
| 22 | 22 | include_once($dir."/funcoes.php"); |
| 23 | 23 | |
| 24 | 24 | $map_file = markerclusterMapfile(); |
| 25 | -$resultado = markerclusterDados($map_file); | |
| 25 | +$resultado = markerclusterDados($map_file); | |
| 26 | +$tipoEstilos = markerclusterEstilos($map_file,$layer,$tipoEstilos); | |
| 26 | 27 | |
| 27 | 28 | echo $nomevariavel.' = ['.implode(",",$resultado).'];'; |
| 29 | +echo $nomevariavelConfig.' = '.$tipoEstilos.';'; | |
| 30 | + | |
| 28 | 31 | if($carregajs === "sim"){ |
| 29 | 32 | include_once($dir."/../../pacotes/markercluster/google/markerclusterer.js"); |
| 30 | 33 | } | ... | ... |
ferramentas/minhaferramenta/index.htm
ferramentas/sibea/pesquisa.htm
| ... | ... | @@ -63,7 +63,7 @@ height: 35px; |
| 63 | 63 | </STYLE> |
| 64 | 64 | |
| 65 | 65 | <SCRIPT src="../../pacotes/cpaint/cpaint2.inc.compressed.js" ></script> |
| 66 | -<body name="ancora" class="yui-skin-sam"> | |
| 66 | +<body class="yui-skin-sam"> | |
| 67 | 67 | <FONT face=Arial color=#808000 size=4>SIBEA - Educadores ambientais</FONT><br> |
| 68 | 68 | <FONT face=Arial color=#808000 size=2> |
| 69 | 69 | Educadores cadastrados no SIBEA. <a href="http://sibea.mma.gov.br/dcsibea/" target=blank >Mais info...</a> |
| ... | ... | @@ -99,7 +99,7 @@ Title: SIBEA-MMA (JavaScript) |
| 99 | 99 | |
| 100 | 100 | Acessa os web services do MMA para recuperar dados sobre educadores ambientais. |
| 101 | 101 | |
| 102 | -Por ser executado dentro do I3Geo, boa parte dos parâmetros são obtidos da variável de seção. | |
| 102 | +Por ser executado dentro do I3Geo, boa parte dos par�metros são obtidos da variável de seção. | |
| 103 | 103 | |
| 104 | 104 | Arquivos: |
| 105 | 105 | ... | ... |
ferramentas/tabela/template_mst.html
| 1 | -<div id='{{{idjanela}}}' guiasYUI class='yui-navset' style='top: 0px; cursor: pointer; left: 0px;'> | |
| 1 | +<div id='{{{idjanela}}}' class='yui-navset' style='top: 0px; cursor: pointer; left: 0px;'> | |
| 2 | 2 | <ul class='yui-nav' style='border-width: 0pt 0pt 0px; border-color: rgb(240, 240, 240); border-bottom-color: white;'> |
| 3 | 3 | <li><div id='{{{idjanela}}}i3GEOtabelaguia6' style='text-align: center; left: 0px;'> |
| 4 | 4 | <a><em><img class='ticPropriedades2' style='height: 14px' title='{{{propriedades}}}' src='{{{locaplic}}}/imagens/visual/default/branco.gif'></em></a> | ... | ... |
2.93 KB
3.18 KB
3.86 KB
5.57 KB
6.68 KB
490 Bytes
pacotes/markercluster/google/markerclusterer.js
| ... | ... | @@ -1082,8 +1082,8 @@ ClusterIcon.prototype.onAdd = function() { |
| 1082 | 1082 | panes.overlayMouseTarget.appendChild(this.div_); |
| 1083 | 1083 | |
| 1084 | 1084 | var that = this; |
| 1085 | - google.maps.event.addDomListener(this.div_, 'click', function() { | |
| 1086 | - that.triggerClusterClick(); | |
| 1085 | + google.maps.event.addDomListener(this.div_, 'click', function(evt) { | |
| 1086 | + that.triggerClusterClick(); | |
| 1087 | 1087 | }); |
| 1088 | 1088 | }; |
| 1089 | 1089 | ... | ... |
temas/_lmapadecluster.map
| ... | ... | @@ -27,7 +27,7 @@ MAP |
| 27 | 27 | "ltempoitemicone" "" |
| 28 | 28 | "permitecomentario" "" |
| 29 | 29 | "metaestat" "" |
| 30 | - "PLUGINI3GEO" '{"plugin":"markercluster","parametros":{"gridSize":"50"}}' | |
| 30 | + "PLUGINI3GEO" '{"plugin":"markercluster","parametros":{"tipoEstilos":"default","coluna":"","gridSize":"50"}}' | |
| 31 | 31 | "itembuscarapida" "" |
| 32 | 32 | "arquivokmz" "" |
| 33 | 33 | "arquivodownload" "" | ... | ... |