diff --git a/admin/admin.db b/admin/admin.db
index 8fa50fc..6edcd1d 100644
Binary files a/admin/admin.db and b/admin/admin.db differ
diff --git a/classesjs/classe_plugini3geo.js b/classesjs/classe_plugini3geo.js
index 336b353..9d35545 100644
--- a/classesjs/classe_plugini3geo.js
+++ b/classesjs/classe_plugini3geo.js
@@ -1,25 +1,25 @@
/**
* Title: PluginI3Geo
- *
+ *
* i3GEO.pluginI3geo
- *
+ *
* Implementa os plugins do i3Geo que adicionam camadas especiais ao mapa, normalmente dados vetoriais processados no navegador Web.
- *
+ *
* Arquivo:
- *
+ *
* i3geo/classesjs/classe_plugini3geo.js
- *
+ *
* Licença:
- *
+ *
* GPL2
- *
+ *
* i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
- *
+ *
* Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
- *
+ *
* Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo sob os termos da Licença
* Pública Geral GNU conforme publicada pela Free Software Foundation;
- *
+ *
* Este programa é distribuído na expectativa de que seja útil, porém, SEM NENHUMA GARANTIA; nem mesmo a
* garantia implícita de COMERCIABILIDADE OU ADEQUACÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença
* Pública Geral do GNU para mais detalhes. Você deve ter recebido uma cópia da Licença Pública Geral do
@@ -34,7 +34,7 @@ i3GEO.pluginI3geo =
OBJETOS : {},
/**
* Lista de plugins
- *
+ *
* Utilizado no editor de mapfiles do sistema de administracao
*/
PLUGINS : [
@@ -51,11 +51,11 @@ i3GEO.pluginI3geo =
],
/**
* Inicia a execucao de um plugin
- *
+ *
* Camada e um objeto gerado pelo i3Geo quando uma camada e adicionada ao mapa O objeto i3GEO.arvoreDeCamadas.CAMADAS guarda todas
* as camadas adicionadas ao mapa Ao adicionar uma camada pelo catalogo, o i3Geo verifica se a camada possui plugin e direciona para
* ca Os plugins sao definidos como metadados em cada mapfile de cada tema
- *
+ *
* Veja em i3geo/classesphp/classe_mapa.php funcao parametrostemas
*/
inicia : function(camada) {
@@ -116,7 +116,7 @@ i3GEO.pluginI3geo =
},
/**
* Aplica as propriedades em um objeto do tipo tema
- *
+ *
* tema e fornecido por i3GEO.arvoreDeCamadas o ajuste das propriedades e necessario para que as propriedades aparecam de forma
* correta na arvore de camadas
*/
@@ -128,29 +128,29 @@ i3GEO.pluginI3geo =
},
/**
* Function: heatmap
- *
+ *
* Mapa de calor
- *
+ *
* Gera um layer do tipo mapa de calor e adiciona ao mapa
- *
+ *
* As dependências em javascript sao carregadas via script tag por meio de ferramentas/heatmap
- *
+ *
* Esse programa também obtém os dados necessários ao plugin
- *
+ *
* O layer existente no mapfile deve conter um metadata chamado PLUGINI3GEO
- *
+ *
* Esse matadado deve conter uma string que será transformada em um objeto javascript para uso no plugin
- *
+ *
* Exemplo:
- *
+ *
* "PLUGINI3GEO" '{"plugin":"heatmap","parametros":{"tipoGradiente": "default","coluna":"teste","max":"10","radius":"15"}}'
- *
+ *
* Coluna é a que contém os dados numéricos que definem a quantidade de uma medida em cada ponto e é
* usada para gerar a representação. Se for vazia, considera-se o valor como 1
- *
+ *
* As cores das classes existentes no LAYER serão utilizadas para calcular as cores do mapa de calor. Se tipoGradiente for
* igual a "default" será utilizado o gradiente padrĂ£o.
- *
+ *
*/
heatmap : {
linkAjuda : function() {
@@ -380,26 +380,26 @@ i3GEO.pluginI3geo =
},
/**
* Function: markercluster
- *
+ *
* Markercluster
- *
+ *
* Gera um layer que agrupa pontos conforme a distância entre eles e insere um contador adiciona ao mapa
- *
+ *
* As dependências em javascript sao carregadas via script tag por meio de ferramentas/markercluster
- *
+ *
* Esse programa também obtém os dados necessários ao plugin
- *
+ *
* O layer existente no mapfile deve conter um metadata chamado PLUGINI3GEO
- *
+ *
* Esse matadado deve conter uma string que será transformada em um objeto javascript para uso no plugin
- *
+ *
* Exemplo:
- *
+ *
* "PLUGINI3GEO" '{"plugin":"markercluster","parametros":{"coluna":"teste","gridSize":"50"}}'
- *
+ *
* Coluna é a que contém os dados numéricos que definem a quantidade de uma medida em cada ponto e é
* usada para gerar a representação. Se for vazia, considera-se o valor como 1
- *
+ *
*/
markercluster : {
linkAjuda : function() {
@@ -422,7 +422,8 @@ i3GEO.pluginI3geo =
+ "
Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile
" + + "Veja o exemplo utilizado no tema _lmapadecluster.map
"; return ins; }, @@ -454,8 +455,90 @@ i3GEO.pluginI3geo = marker = new google.maps.Marker({ 'position' : latLng, icon : { - url : i3GEO.configura.locaplic + "/imagens/google/symbol_blank.png", - scaledSize : new google.maps.Size(20, 20) + url : markercluster_config.ponto.url, + scaledSize : new google.maps.Size(markercluster_config.ponto.width, markercluster_config.ponto.height) + } + }); + marcas.push(marker); + } + markercluster = new MarkerClusterer(i3GeoMap, marcas, { + "gridSize" : parseInt(camada.plugini3geo.parametros.gridSize, 10), + "visible" : true, + "opacity" : camada.transparency, + "name" : camada.name, + "styles" : markercluster_config.estilos + }); + i3GEO.janela.fechaAguarde("aguardePlugin"); + i3GEO.eventos.cliquePerm.ativo = false; + + markercluster.ligaCamada = function() { + i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = true; + i3GEO.pluginI3geo.OBJETOS[camada.name].redraw(); + i3GEO.eventos.cliquePerm.ativo = false; + }; + markercluster.desLigaCamada = function() { + i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true); + i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = false; + i3GEO.eventos.cliquePerm.ativo = true; + }; + markercluster.removeCamada = function() { + i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers(); + i3GEO.eventos.cliquePerm.ativo = true; + }; + markercluster.atualizaCamada = function() { + i3GEO.pluginI3geo.OBJETOS[camada.name].ready_ = true; + i3GEO.pluginI3geo.OBJETOS[camada.name].redraw(); + i3GEO.eventos.cliquePerm.ativo = false; + }; + i3GEO.pluginI3geo.OBJETOS[camada.name] = markercluster; + markercluster_dados = null; + }; + //se o script nao existir carrega o codigo e os dados + //caso contrario, carrega apenas os dados no script + if (!$i(nomeScript)) { + carregaJs = "sim"; + } + else{ + nomeScript = ""; + } + p += + "?carregajs=" + carregaJs + "&layer=" + camada.name + "&coluna=" + camada.plugini3geo.parametros.coluna + + "&g_sid=" + i3GEO.configura.sid + + "&tipoEstilos=" + camada.plugini3geo.parametros.tipoEstilos + + "&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config"; + i3GEO.util.scriptTag(p, criaLayer, nomeScript); + } + }, + openlayers : { + aplicaPropriedades : function(camada) { + camada.sel = "nao"; + camada.download = "nao"; + camada.AGUARDALEGENDA = false; + camada.temporizador = ""; + camada.copia = false; + camada.procurar = false; + camada.toponimia = false; + camada.etiquetas = false; + camada.tabela = false; + camada.grafico = false; + camada.destacar = false; + camada.wms = false; + camada.classe = "NAO"; + return camada; + }, + inicia : function(camada) { + var nomeScript = "markercluster_script", p = i3GEO.configura.locaplic + "/ferramentas/markercluster/openlayers_js.php", carregaJs = "nao", criaLayer; + criaLayer = function() { + var markercluster, marcas, latLng, marker, n, i; + n = markercluster_dados.length; + marcas = []; + for (i = 0; i < n; i++) { + latLng = new google.maps.LatLng(markercluster_dados[i].lat, markercluster_dados[i].lng); + marker = new google.maps.Marker({ + 'position' : latLng, + icon : { + url : markercluster_config.ponto.url, + scaledSize : new google.maps.Size(markercluster_config.ponto.width, markercluster_config.ponto.height) } }); marcas.push(marker); diff --git a/ferramentas/markercluster/funcoes.php b/ferramentas/markercluster/funcoes.php index da79545..050e380 100644 --- a/ferramentas/markercluster/funcoes.php +++ b/ferramentas/markercluster/funcoes.php @@ -70,23 +70,25 @@ function markerclusterMapfile(){ } function markerclusterEstilos($map_file,$layer,$tipoEstilos){ if($tipoEstilos == "default"){ - $tipoEstilos = '{"estilos":[{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}]}'; + $tipoEstilos = '{"ponto":{url : i3GEO.configura.locaplic + "/imagens/google/symbol_blank.png",height : 20,width : 20},"estilos":[{url : i3GEO.configura.locaplic + "/imagens/google/m1.png",height : 53,width : 53},{url : i3GEO.configura.locaplic + "/imagens/google/m2.png",height : 56,width : 56},{url : i3GEO.configura.locaplic + "/imagens/google/m3.png",height : 66,width : 66},{url : i3GEO.configura.locaplic + "/imagens/google/m4.png",height : 78,width : 78},{url : i3GEO.configura.locaplic + "/imagens/google/m5.png",height : 90,width : 90}]}'; } else{ - $gradiente = array(); + $tipoEstilos = array(); $mapa = ms_newMapObj($map_file); $l = $mapa->getlayerbyname($layer); - $nc = $l->numclasses; - for ($c = 0;$c < $nc;$c++){ + $nc = $l->numclasses; + // a primeira classe e o ponto que nao entra no cluster + for ($c = 1;$c < $nc;$c++){ $classe = $l->getclass($c); $estilo = $classe->getstyle(0); - $nome = $classe->name; - $cor = $estilo->color; - $scor = "rgb(".$cor->red.",".$cor->green.",".$cor->blue.")"; - $gradiente[$nome] = $scor; - } - //echo $map_file;exit; - $gradiente = json_encode(array("gradient"=>$gradiente)); + $tipoEstilos[] = array("url"=>$estilo->symbol,"height"=>$estilo->size,"width"=>$estilo->size); + } + $classe = $l->getclass(0); + $estilo = $classe->getstyle(0); + $tipoEstilos = json_encode(array( + "ponto"=>array("url"=>$estilo->symbol,"height"=>$estilo->size,"width"=>$estilo->size), + "estilos"=>$tipoEstilos + )); } return $tipoEstilos; } diff --git a/ferramentas/markercluster/openlayers_js.php b/ferramentas/markercluster/openlayers_js.php index 024cc17..a0a1b65 100755 --- a/ferramentas/markercluster/openlayers_js.php +++ b/ferramentas/markercluster/openlayers_js.php @@ -48,8 +48,10 @@ if($map_file == ""){ } } $resultado = markerclusterDados($map_file); +$tipoEstilos = markerclusterEstilos($map_file,$layer,$tipoEstilos); echo $nomevariavel.' = ['.implode(",",$resultado).'];'; +echo $nomevariavelConfig.' = '.$tipoEstilos.';'; if($carregajs === "sim"){ include_once($dir."/../../pacotes/markercluster/openlayers/AnimatedCluster.js"); diff --git a/init/index.php b/init/index.php index 8ddb5c7..87a14ea 100755 --- a/init/index.php +++ b/init/index.php @@ -111,7 +111,6 @@ a { margin: 0px auto; text-decoration: none; } - @@ -130,28 +129,24 @@ a { ?> + +Tweets @i3Geo + | Tweets @i3Geo |