Commit 51930acd4601977be5070f589894e47a8cc6fe49
1 parent
d80ca755
Exists in
master
and in
7 other branches
Inclusao de cluster na ferramenta legenda
Showing
4 changed files
with
174 additions
and
2 deletions
Show diff stats
ferramentas/legenda/dicionario.js
| @@ -45,7 +45,7 @@ i3GEOF.legenda.dicionario = | @@ -45,7 +45,7 @@ i3GEOF.legenda.dicionario = | ||
| 45 | ], | 45 | ], |
| 46 | 'importaExportaSLD' : [ | 46 | 'importaExportaSLD' : [ |
| 47 | { | 47 | { |
| 48 | - pt : "Importar/exportar SLD", | 48 | + pt : "SLD", |
| 49 | en : "", | 49 | en : "", |
| 50 | es : "" | 50 | es : "" |
| 51 | } | 51 | } |
| @@ -793,5 +793,54 @@ i3GEOF.legenda.dicionario = | @@ -793,5 +793,54 @@ i3GEOF.legenda.dicionario = | ||
| 793 | en : "", | 793 | en : "", |
| 794 | es : "" | 794 | es : "" |
| 795 | } | 795 | } |
| 796 | - ] | 796 | + ], |
| 797 | + "cluster" : [ | ||
| 798 | + { | ||
| 799 | + pt : "Cluster", | ||
| 800 | + en : "", | ||
| 801 | + es : "" | ||
| 802 | + } | ||
| 803 | + ], | ||
| 804 | + "ClusterMaxdistance" : [ | ||
| 805 | + { | ||
| 806 | + pt : "Distância (pixels) máxima entre os pontos que será considerada para permitir o agrupamento", | ||
| 807 | + en : "", | ||
| 808 | + es : "" | ||
| 809 | + } | ||
| 810 | + ], | ||
| 811 | + "ClusterBuffer" : [ | ||
| 812 | + { | ||
| 813 | + 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", | ||
| 814 | + en : "", | ||
| 815 | + es : "" | ||
| 816 | + } | ||
| 817 | + ], | ||
| 818 | + "ClusterFilter" : [ | ||
| 819 | + { | ||
| 820 | + 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)", | ||
| 821 | + en : "", | ||
| 822 | + es : "" | ||
| 823 | + } | ||
| 824 | + ], | ||
| 825 | + "ClusterRegion" : [ | ||
| 826 | + { | ||
| 827 | + pt : "Tipo de forma que será utilizada na definição da região de busca dos pontos que formarão o agrupamento", | ||
| 828 | + en : "", | ||
| 829 | + es : "" | ||
| 830 | + } | ||
| 831 | + ], | ||
| 832 | + "ClusterGroup" : [ | ||
| 833 | + { | ||
| 834 | + pt : "Item que será utilizado para separar os diferentes agrupamentos", | ||
| 835 | + en : "", | ||
| 836 | + es : "" | ||
| 837 | + } | ||
| 838 | + ], | ||
| 839 | + "remover" : [ | ||
| 840 | + { | ||
| 841 | + pt : "Remover", | ||
| 842 | + en : "", | ||
| 843 | + es : "" | ||
| 844 | + } | ||
| 845 | + ] | ||
| 797 | }; | 846 | }; |
ferramentas/legenda/exec.php
| @@ -98,6 +98,25 @@ Acrescenta a contagem de elementos em cada classe. | @@ -98,6 +98,25 @@ Acrescenta a contagem de elementos em cada classe. | ||
| 98 | if (!$r){$r = "erro.Erro legenda nao disponivel";} | 98 | if (!$r){$r = "erro.Erro legenda nao disponivel";} |
| 99 | $retorno = $r; | 99 | $retorno = $r; |
| 100 | break; | 100 | break; |
| 101 | + case "APLICARCLUSTER": | ||
| 102 | + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); | ||
| 103 | + $m = new Temas($map_file,$tema); | ||
| 104 | + $l = $m->mapa->getlayerbyname($tema); | ||
| 105 | + if($filter != ""){ | ||
| 106 | + $filter = base64decode($filter); | ||
| 107 | + } | ||
| 108 | + $m->criaCluster($group,$filter,$maxdistance,$region,$buffer); | ||
| 109 | + $m->salva(); | ||
| 110 | + $retorno = "ok"; | ||
| 111 | + break; | ||
| 112 | + case "REMOVERCLUSTER": | ||
| 113 | + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); | ||
| 114 | + $m = new Temas($map_file,$tema); | ||
| 115 | + $l = $m->mapa->getlayerbyname($tema); | ||
| 116 | + $m->removeCluster(); | ||
| 117 | + $m->salva(); | ||
| 118 | + $retorno = "ok"; | ||
| 119 | + break; | ||
| 101 | } | 120 | } |
| 102 | if (!connection_aborted()){ | 121 | if (!connection_aborted()){ |
| 103 | if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | 122 | if(isset($map_file) && isset($postgis_mapa) && $map_file != "") |
ferramentas/legenda/index.js
| @@ -135,6 +135,10 @@ i3GEOF.legenda = | @@ -135,6 +135,10 @@ i3GEOF.legenda = | ||
| 135 | $i(iddiv).innerHTML += i3GEOF.legenda.html(); | 135 | $i(iddiv).innerHTML += i3GEOF.legenda.html(); |
| 136 | i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); | 136 | i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); |
| 137 | // eventos das guias | 137 | // eventos das guias |
| 138 | + $i("i3GEOlegendaguia7").onclick = function() { | ||
| 139 | + i3GEOF.legenda.ativaAplicar("none"); | ||
| 140 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia7", "i3GEOlegendaguia"); | ||
| 141 | + }; | ||
| 138 | $i("i3GEOlegendaguia6").onclick = function() { | 142 | $i("i3GEOlegendaguia6").onclick = function() { |
| 139 | i3GEOF.legenda.ativaAplicar("none"); | 143 | i3GEOF.legenda.ativaAplicar("none"); |
| 140 | i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia"); | 144 | i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia"); |
| @@ -159,6 +163,21 @@ i3GEOF.legenda = | @@ -159,6 +163,21 @@ i3GEOF.legenda = | ||
| 159 | i3GEOF.legenda.ativaAplicar("none"); | 163 | i3GEOF.legenda.ativaAplicar("none"); |
| 160 | i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia"); | 164 | i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia"); |
| 161 | }; | 165 | }; |
| 166 | + | ||
| 167 | + var b = new YAHOO.widget.Button("i3GEOlegendabotaoAplicarCluster", { | ||
| 168 | + onclick : { | ||
| 169 | + fn : i3GEOF.legenda.aplicarCluster | ||
| 170 | + } | ||
| 171 | + }); | ||
| 172 | + b.addClass("rodar"); | ||
| 173 | + | ||
| 174 | + var b = new YAHOO.widget.Button("i3GEOlegendabotaoRemoverCluster", { | ||
| 175 | + onclick : { | ||
| 176 | + fn : i3GEOF.legenda.removerCluster | ||
| 177 | + } | ||
| 178 | + }); | ||
| 179 | + b.addClass("rodar"); | ||
| 180 | + | ||
| 162 | var b = new YAHOO.widget.Button("i3GEOlegendabotao1", { | 181 | var b = new YAHOO.widget.Button("i3GEOlegendabotao1", { |
| 163 | onclick : { | 182 | onclick : { |
| 164 | fn : i3GEOF.legenda.mudaLegenda | 183 | fn : i3GEOF.legenda.mudaLegenda |
| @@ -376,6 +395,9 @@ i3GEOF.legenda = | @@ -376,6 +395,9 @@ i3GEOF.legenda = | ||
| 376 | if ($i("i3GEOlegendaitensValorClass")) { | 395 | if ($i("i3GEOlegendaitensValorClass")) { |
| 377 | $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados; | 396 | $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados; |
| 378 | } | 397 | } |
| 398 | + if ($i("i3GEOlegendaitensCluster")) { | ||
| 399 | + $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados; | ||
| 400 | + } | ||
| 379 | if ($i("i3GEOlegendaitensValorQuartil")) { | 401 | if ($i("i3GEOlegendaitensValorQuartil")) { |
| 380 | $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados; | 402 | $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados; |
| 381 | } | 403 | } |
| @@ -2280,5 +2302,45 @@ i3GEOF.legenda = | @@ -2280,5 +2302,45 @@ i3GEOF.legenda = | ||
| 2280 | cp.set_response_type("JSON"); | 2302 | cp.set_response_type("JSON"); |
| 2281 | cp.call(p, "foo", temp); | 2303 | cp.call(p, "foo", temp); |
| 2282 | }); | 2304 | }); |
| 2305 | + }, | ||
| 2306 | + aplicarCluster : function(){ | ||
| 2307 | + var temp = function() { | ||
| 2308 | + // i3GEOF.legenda.mostralegenda(); | ||
| 2309 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
| 2310 | + }, p, cp; | ||
| 2311 | + p = | ||
| 2312 | + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" | ||
| 2313 | + + i3GEO.configura.sid | ||
| 2314 | + + "&funcao=aplicarCluster" | ||
| 2315 | + + "&maxdistance=" | ||
| 2316 | + + $i("i3GEOlegendaClusterMaxdistance").value | ||
| 2317 | + + "&buffer=" | ||
| 2318 | + + $i("i3GEOlegendaClusterBuffer").value | ||
| 2319 | + + "&filter=" | ||
| 2320 | + + i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value) | ||
| 2321 | + + "®ion=" | ||
| 2322 | + + $i("i3GEOlegendaClusterRegion").value | ||
| 2323 | + + "&group=" | ||
| 2324 | + + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value | ||
| 2325 | + + "&tema=" | ||
| 2326 | + + i3GEOF.legenda.tema; | ||
| 2327 | + cp = new cpaint(); | ||
| 2328 | + cp.set_response_type("JSON"); | ||
| 2329 | + cp.call(p, "foo", temp); | ||
| 2330 | + }, | ||
| 2331 | + removerCluster : function(){ | ||
| 2332 | + var temp = function() { | ||
| 2333 | + // i3GEOF.legenda.mostralegenda(); | ||
| 2334 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
| 2335 | + }, p, cp; | ||
| 2336 | + p = | ||
| 2337 | + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" | ||
| 2338 | + + i3GEO.configura.sid | ||
| 2339 | + + "&funcao=removerCluster" | ||
| 2340 | + + "&tema=" | ||
| 2341 | + + i3GEOF.legenda.tema; | ||
| 2342 | + cp = new cpaint(); | ||
| 2343 | + cp.set_response_type("JSON"); | ||
| 2344 | + cp.call(p, "foo", temp); | ||
| 2283 | } | 2345 | } |
| 2284 | }; | 2346 | }; |
| 2285 | \ No newline at end of file | 2347 | \ No newline at end of file |
ferramentas/legenda/template_mst.html
| @@ -43,9 +43,51 @@ | @@ -43,9 +43,51 @@ | ||
| 43 | </a> | 43 | </a> |
| 44 | </div> | 44 | </div> |
| 45 | </li> | 45 | </li> |
| 46 | + <li> | ||
| 47 | + <div id='i3GEOlegendaguia7' style='text-align: center; left: 0px;'> | ||
| 48 | + <a> | ||
| 49 | + <em>{{{cluster}}}</em> | ||
| 50 | + </a> | ||
| 51 | + </div> | ||
| 52 | + </li> | ||
| 46 | </ul> | 53 | </ul> |
| 47 | </div> | 54 | </div> |
| 48 | <br> | 55 | <br> |
| 56 | +<div id='i3GEOlegendaguia7obj' style='width: 99%; text-align: left;'> | ||
| 57 | + <p class='paragrafo'>{{{ClusterMaxdistance}}}:</p> | ||
| 58 | + <div class='i3geoForm i3geoFormIconeNumero'> | ||
| 59 | + <input type='number' id='i3GEOlegendaClusterMaxdistance' value='5' /> | ||
| 60 | + </div> | ||
| 61 | + <br> | ||
| 62 | + <p class='paragrafo'>{{{ClusterBuffer}}}:</p> | ||
| 63 | + <div class='i3geoForm i3geoFormIconeNumero'> | ||
| 64 | + <input type='number' id='i3GEOlegendaClusterBuffer' value='0' /> | ||
| 65 | + </div> | ||
| 66 | + <br> | ||
| 67 | + <p class='paragrafo'>{{{ClusterFilter}}}:</p> | ||
| 68 | + <div class='i3geoForm i3geoFormIconeNumero'> | ||
| 69 | + <input type='text' id='i3GEOlegendaClusterFilter' value='' /> | ||
| 70 | + </div> | ||
| 71 | + <br> | ||
| 72 | + <p class='paragrafo'>{{{ClusterRegion}}}</p> | ||
| 73 | + <div class='styled-select'> | ||
| 74 | + <select id='i3GEOlegendaClusterRegion'> | ||
| 75 | + <option value='rectangle'>rectangle</option> | ||
| 76 | + <option value='ellipse'>ellipse</option> | ||
| 77 | + </select> | ||
| 78 | + </div> | ||
| 79 | + <br> | ||
| 80 | + <p class='paragrafo'>{{{ClusterGroup}}}</p> | ||
| 81 | + <div id='i3GEOlegendaitensCluster' class='styled-select'></div> | ||
| 82 | + <br> | ||
| 83 | + <p class='paragrafo'> | ||
| 84 | + <input id='i3GEOlegendabotaoAplicarCluster' size='35' type='button' value='{{{aplicar}}}'> | ||
| 85 | + </p> | ||
| 86 | + <br> | ||
| 87 | + <p class='paragrafo'> | ||
| 88 | + <input id='i3GEOlegendabotaoRemoverCluster' size='35' type='button' value='{{{remover}}}'> | ||
| 89 | + </p> | ||
| 90 | +</div> | ||
| 49 | <div id='i3GEOlegendaguia6obj' style='width: 99%; text-align: left;'> | 91 | <div id='i3GEOlegendaguia6obj' style='width: 99%; text-align: left;'> |
| 50 | <p class='paragrafo'> | 92 | <p class='paragrafo'> |
| 51 | | 93 | |