diff --git a/ferramentas/legenda/dicionario.js b/ferramentas/legenda/dicionario.js index b3dd863..5b3a35e 100644 --- a/ferramentas/legenda/dicionario.js +++ b/ferramentas/legenda/dicionario.js @@ -45,7 +45,7 @@ i3GEOF.legenda.dicionario = ], 'importaExportaSLD' : [ { - pt : "Importar/exportar SLD", + pt : "SLD", en : "", es : "" } @@ -793,5 +793,54 @@ i3GEOF.legenda.dicionario = en : "", es : "" } - ] + ], + "cluster" : [ + { + pt : "Cluster", + en : "", + es : "" + } + ], + "ClusterMaxdistance" : [ + { + pt : "Distância (pixels) máxima entre os pontos que será considerada para permitir o agrupamento", + en : "", + es : "" + } + ], + "ClusterBuffer" : [ + { + pt : "Distância em pixel, no entorno da extensão geográfica do mapa ou dos tiles, se for o caso, que extende a área de pesuisa dos pontos para formação do agrupamento", + en : "", + es : "" + } + ], + "ClusterFilter" : [ + { + pt : "Filtro que será aplicado para restringir os pontos que podem participar do agrupamento. A sintaxe do filtro é a mesma utilizada na definição das expressões que definem cada classe (ver o editor de classes)", + en : "", + es : "" + } + ], + "ClusterRegion" : [ + { + pt : "Tipo de forma que será utilizada na definição da região de busca dos pontos que formarão o agrupamento", + en : "", + es : "" + } + ], + "ClusterGroup" : [ + { + pt : "Item que será utilizado para separar os diferentes agrupamentos", + en : "", + es : "" + } + ], + "remover" : [ + { + pt : "Remover", + en : "", + es : "" + } + ] }; diff --git a/ferramentas/legenda/exec.php b/ferramentas/legenda/exec.php index 0e183c6..5230c0f 100644 --- a/ferramentas/legenda/exec.php +++ b/ferramentas/legenda/exec.php @@ -98,6 +98,25 @@ Acrescenta a contagem de elementos em cada classe. if (!$r){$r = "erro.Erro legenda nao disponivel";} $retorno = $r; break; + case "APLICARCLUSTER": + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); + $m = new Temas($map_file,$tema); + $l = $m->mapa->getlayerbyname($tema); + if($filter != ""){ + $filter = base64decode($filter); + } + $m->criaCluster($group,$filter,$maxdistance,$region,$buffer); + $m->salva(); + $retorno = "ok"; + break; + case "REMOVERCLUSTER": + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); + $m = new Temas($map_file,$tema); + $l = $m->mapa->getlayerbyname($tema); + $m->removeCluster(); + $m->salva(); + $retorno = "ok"; + break; } if (!connection_aborted()){ if(isset($map_file) && isset($postgis_mapa) && $map_file != "") diff --git a/ferramentas/legenda/index.js b/ferramentas/legenda/index.js index c83c573..96a98e3 100644 --- a/ferramentas/legenda/index.js +++ b/ferramentas/legenda/index.js @@ -135,6 +135,10 @@ i3GEOF.legenda = $i(iddiv).innerHTML += i3GEOF.legenda.html(); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); // eventos das guias + $i("i3GEOlegendaguia7").onclick = function() { + i3GEOF.legenda.ativaAplicar("none"); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia7", "i3GEOlegendaguia"); + }; $i("i3GEOlegendaguia6").onclick = function() { i3GEOF.legenda.ativaAplicar("none"); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia"); @@ -159,6 +163,21 @@ i3GEOF.legenda = i3GEOF.legenda.ativaAplicar("none"); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia"); }; + + var b = new YAHOO.widget.Button("i3GEOlegendabotaoAplicarCluster", { + onclick : { + fn : i3GEOF.legenda.aplicarCluster + } + }); + b.addClass("rodar"); + + var b = new YAHOO.widget.Button("i3GEOlegendabotaoRemoverCluster", { + onclick : { + fn : i3GEOF.legenda.removerCluster + } + }); + b.addClass("rodar"); + var b = new YAHOO.widget.Button("i3GEOlegendabotao1", { onclick : { fn : i3GEOF.legenda.mudaLegenda @@ -376,6 +395,9 @@ i3GEOF.legenda = if ($i("i3GEOlegendaitensValorClass")) { $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados; } + if ($i("i3GEOlegendaitensCluster")) { + $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados; + } if ($i("i3GEOlegendaitensValorQuartil")) { $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados; } @@ -2280,5 +2302,45 @@ i3GEOF.legenda = cp.set_response_type("JSON"); cp.call(p, "foo", temp); }); + }, + aplicarCluster : function(){ + var temp = function() { + // i3GEOF.legenda.mostralegenda(); + i3GEOF.legenda.aposAlterarLegenda(); + }, p, cp; + p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=aplicarCluster" + + "&maxdistance=" + + $i("i3GEOlegendaClusterMaxdistance").value + + "&buffer=" + + $i("i3GEOlegendaClusterBuffer").value + + "&filter=" + + i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value) + + "®ion=" + + $i("i3GEOlegendaClusterRegion").value + + "&group=" + + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value + + "&tema=" + + i3GEOF.legenda.tema; + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "foo", temp); + }, + removerCluster : function(){ + var temp = function() { + // i3GEOF.legenda.mostralegenda(); + i3GEOF.legenda.aposAlterarLegenda(); + }, p, cp; + p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=removerCluster" + + "&tema=" + + i3GEOF.legenda.tema; + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "foo", temp); } }; \ No newline at end of file diff --git a/ferramentas/legenda/template_mst.html b/ferramentas/legenda/template_mst.html index d53dbf9..7c418c4 100644 --- a/ferramentas/legenda/template_mst.html +++ b/ferramentas/legenda/template_mst.html @@ -43,9 +43,51 @@ +
{{{ClusterMaxdistance}}}:
+{{{ClusterBuffer}}}:
+{{{ClusterFilter}}}:
+{{{ClusterRegion}}}
+{{{ClusterGroup}}}
+ ++ +
++ +
+-- libgit2 0.21.2