Commit 64bf4fedfc7db638d7791f34d8d129780d70bdd4
1 parent
7b224389
Exists in
master
and in
7 other branches
Inclusão de opção para processamento em lote na ferramenta "filtro" da árvore de camadas
Showing
4 changed files
with
38 additions
and
16 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesjs/classe_arvoredetemas.js
... | ... | @@ -1654,6 +1654,12 @@ i3GEO.arvoreDeTemas = { |
1654 | 1654 | // |
1655 | 1655 | //se forem encontrados temas ativos na árvore de menus, o mapa é redesenhado com a adição de novos temas |
1656 | 1656 | // |
1657 | + //verifica se o tema já existe no mapa | |
1658 | + // | |
1659 | + if(tsl.length === 1 && i3GEO.arvoreDeCamadas.pegaTema(tsl[0]) !== ""){ | |
1660 | + temp = window.confirm("O tema já existe no mapa. Adiciona novamente?"); | |
1661 | + if(!temp){return;} | |
1662 | + } | |
1657 | 1663 | if(tsl.length > 0){ |
1658 | 1664 | i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); |
1659 | 1665 | temp = function(retorno){ | ... | ... |
classesjs/classe_php.js
... | ... | @@ -140,18 +140,21 @@ i3GEO.php = { |
140 | 140 | |
141 | 141 | <EXCLUITEMA> |
142 | 142 | */ |
143 | - excluitema: function(funcao,tema){ | |
144 | - var layer,retorno,p; | |
143 | + excluitema: function(funcao,temas){ | |
144 | + var layer,retorno,p,n,i; | |
145 | 145 | i3GEO.php.verifica(); |
146 | 146 | retorno = function(retorno){ |
147 | 147 | if(i3GEO.Interface.ATUAL === "openlayers"){ |
148 | - layers = i3geoOL.getLayersByName(tema); | |
149 | - if(layers.length > 0) | |
150 | - {i3geoOL.removeLayer(layers[0]);} | |
148 | + n = temas.length; | |
149 | + for(i=0;i<n;i++){ | |
150 | + layer = i3geoOL.getLayersByName(temas[i]); | |
151 | + if(layer.length > 0) | |
152 | + {i3geoOL.removeLayer(layer[0]);} | |
153 | + } | |
151 | 154 | } |
152 | 155 | funcao.call(retorno); |
153 | 156 | }; |
154 | - p = i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=excluitema&temas="+tema+"&g_sid="+i3GEO.arvoreDeCamadas.SID; | |
157 | + p = i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=excluitema&temas="+temas+"&g_sid="+i3GEO.arvoreDeCamadas.SID; | |
155 | 158 | cpJSON.call(p,"excluitema",retorno); |
156 | 159 | }, |
157 | 160 | /* | ... | ... |
ferramentas/filtroarvore/index.js.php
... | ... | @@ -74,15 +74,22 @@ i3GEOF.filtroarvore = { |
74 | 74 | */ |
75 | 75 | html:function(){ |
76 | 76 | var ins = '<p class=paragrafo >Escolha o tipo de filtro ou "nenhum" para não filtrar<br><br>' + |
77 | - '<select onchange="i3GEO.arvoreDeCamadas.ARVORE = null;i3GEO.arvoreDeCamadas.FILTRO = this.value;i3GEO.arvoreDeCamadas.atualiza(i3GEO.arvoreDeCamadas.CAMADAS,true)"><option value="">Nenhum</option>' + | |
77 | + '<select onchange="i3GEO.arvoreDeCamadas.ARVORE = null;i3GEO.arvoreDeCamadas.FILTRO = this.value;i3GEO.arvoreDeCamadas.atualiza(i3GEO.arvoreDeCamadas.CAMADAS,true)">' + | |
78 | + '<option value="">Nenhum</option>' + | |
78 | 79 | '<option value="ligados">ligados</option>' + |
79 | 80 | '<option value="desligados">desligados</option>' + |
80 | 81 | '<option value="selecionados">com seleção</option>' + |
81 | 82 | '<option value="download">permitem download</option>' + |
82 | 83 | '<option value="wms">são do tipo WMS</option>' + |
83 | 84 | '<option value="raster">são do tipo raster</option>' + |
84 | - '<option value="toponimia">contem apenas texto</option>'; | |
85 | - return ins+"</select>"; | |
85 | + '<option value="toponimia">contem apenas texto</option>' + | |
86 | + '</select><br><br>' + | |
87 | + 'Operação<br><br>' + | |
88 | + '<select onchange="i3GEOF.filtroarvore.lote(this)" >' + | |
89 | + '<option value="">---</option>' + | |
90 | + '<option value="excluir">excluir</option>' + | |
91 | + '</select>'; | |
92 | + return ins; | |
86 | 93 | }, |
87 | 94 | /* |
88 | 95 | Function: criaJanelaFlutuante |
... | ... | @@ -99,7 +106,7 @@ i3GEOF.filtroarvore = { |
99 | 106 | titulo = "Filtro <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=1&idajuda=4' > </a>"; |
100 | 107 | janela = i3GEO.janela.cria( |
101 | 108 | "220px", |
102 | - "90px", | |
109 | + "140px", | |
103 | 110 | "", |
104 | 111 | "", |
105 | 112 | "", |
... | ... | @@ -117,15 +124,21 @@ i3GEOF.filtroarvore = { |
117 | 124 | i3GEOF.filtroarvore.inicia(divid); |
118 | 125 | }, |
119 | 126 | /* |
120 | - Function: executa | |
127 | + Function: lote | |
121 | 128 | |
122 | - Altera o tamanho do mapa | |
129 | + Executa uma operação em lote sobre as camadas mostradas no mapa | |
123 | 130 | |
124 | - Veja: | |
125 | - | |
126 | - <MUDATAMANHO> | |
127 | 131 | */ |
128 | - executa: function(){ | |
132 | + lote: function(objeto){ | |
133 | + var operacao = objeto.value, | |
134 | + lista = i3GEO.arvoreDeCamadas.listaLigadosDesligados(), | |
135 | + temp; | |
136 | + if(operacao === "excluir"){ | |
137 | + if(window.confirm("Remove todos do mapa?")){ | |
138 | + i3GEO.php.excluitema(i3GEO.atualiza,lista[2]); | |
139 | + } | |
140 | + } | |
141 | + objeto.value = ""; | |
129 | 142 | } |
130 | 143 | }; |
131 | 144 | <?php error_reporting(0);if(extension_loaded('zlib')){ob_end_flush();}?> |
132 | 145 | \ No newline at end of file | ... | ... |