Commit 8e305beec0d1409564ddcb551a61891b07046ef9
1 parent
9d17e12e
Exists in
master
and in
7 other branches
Inclusão de minscale e maxscale no editor de legenda
Showing
5 changed files
with
1931 additions
and
1524 deletions
Show diff stats
classesphp/classe_alteraclasse.php
@@ -173,8 +173,12 @@ $nomes - lista com os novos nomes | @@ -173,8 +173,12 @@ $nomes - lista com os novos nomes | ||
173 | $exps - lista com as novas expressões | 173 | $exps - lista com as novas expressões |
174 | 174 | ||
175 | $base64 sim|nao indica se as strings estao codificadas em base64 | 175 | $base64 sim|nao indica se as strings estao codificadas em base64 |
176 | + | ||
177 | +$minScales - lista com valores para minscaledenom | ||
178 | + | ||
179 | +$maxScales - lista com valores para maxscaledenom | ||
176 | */ | 180 | */ |
177 | - function alteraclasses($ids,$nomes,$exps,$base64="nao") | 181 | + function alteraclasses($ids,$nomes,$exps,$base64="nao",$minScales="",$maxScales="") |
178 | { | 182 | { |
179 | if($base64 == "sim"){ | 183 | if($base64 == "sim"){ |
180 | $ids = base64_decode($ids); | 184 | $ids = base64_decode($ids); |
@@ -183,6 +187,8 @@ $base64 sim|nao indica se as strings estao codificadas em base64 | @@ -183,6 +187,8 @@ $base64 sim|nao indica se as strings estao codificadas em base64 | ||
183 | } | 187 | } |
184 | //prepara os arrays com os valores | 188 | //prepara os arrays com os valores |
185 | $ids = explode(";",$ids); | 189 | $ids = explode(";",$ids); |
190 | + $minScales = explode(";",$minScales); | ||
191 | + $maxScales = explode(";",$maxScales); | ||
186 | //$nomes = mb_convert_encoding($nomes,"ISO-8859-1","UTF-8"); | 192 | //$nomes = mb_convert_encoding($nomes,"ISO-8859-1","UTF-8"); |
187 | $nomes = explode(";",$nomes); | 193 | $nomes = explode(";",$nomes); |
188 | //$exps = mb_convert_encoding($exps,"ISO-8859-1","UTF-8"); | 194 | //$exps = mb_convert_encoding($exps,"ISO-8859-1","UTF-8"); |
@@ -196,8 +202,7 @@ $base64 sim|nao indica se as strings estao codificadas em base64 | @@ -196,8 +202,7 @@ $base64 sim|nao indica se as strings estao codificadas em base64 | ||
196 | //elimina nomes de layers duplicados | 202 | //elimina nomes de layers duplicados |
197 | $t = array_unique($t); | 203 | $t = array_unique($t); |
198 | //elimina as classes existentes atualmente em cada layer | 204 | //elimina as classes existentes atualmente em cada layer |
199 | - foreach ($t as $tema) | ||
200 | - { | 205 | + foreach ($t as $tema){ |
201 | $layer = $this->mapa->getlayerbyname($tema); | 206 | $layer = $this->mapa->getlayerbyname($tema); |
202 | $layer->setMetaData("cache",""); | 207 | $layer->setMetaData("cache",""); |
203 | $nc = $layer->numclasses; | 208 | $nc = $layer->numclasses; |
@@ -209,14 +214,12 @@ $base64 sim|nao indica se as strings estao codificadas em base64 | @@ -209,14 +214,12 @@ $base64 sim|nao indica se as strings estao codificadas em base64 | ||
209 | } | 214 | } |
210 | //acrescenta as classes definidas | 215 | //acrescenta as classes definidas |
211 | $c = count($ids); | 216 | $c = count($ids); |
212 | - for ($i=0; $i < $c; ++$i) | ||
213 | - { | 217 | + for ($i=0; $i < $c; ++$i){ |
214 | $layerc = explode("-",$ids[$i]); //nome do layer é o indice 0 do array | 218 | $layerc = explode("-",$ids[$i]); //nome do layer é o indice 0 do array |
215 | $layer = $this->mapa->getlayerbyname($layerc[0]); | 219 | $layer = $this->mapa->getlayerbyname($layerc[0]); |
216 | $layer->setMetaData("cache",""); | 220 | $layer->setMetaData("cache",""); |
217 | $ncl = $layer->numclasses; | 221 | $ncl = $layer->numclasses; |
218 | - if ($layerc[1] < $ncl) | ||
219 | - { | 222 | + if ($layerc[1] < $ncl){ |
220 | $classe = $layer->getclass($layerc[1]); | 223 | $classe = $layer->getclass($layerc[1]); |
221 | $classe->set("status",MS_DEFAULT); | 224 | $classe->set("status",MS_DEFAULT); |
222 | $classe->set("name",$nomes[$i]); | 225 | $classe->set("name",$nomes[$i]); |
@@ -226,6 +229,18 @@ $base64 sim|nao indica se as strings estao codificadas em base64 | @@ -226,6 +229,18 @@ $base64 sim|nao indica se as strings estao codificadas em base64 | ||
226 | $e = str_replace("''","'",$e); | 229 | $e = str_replace("''","'",$e); |
227 | $e = str_replace("##","'",$e); | 230 | $e = str_replace("##","'",$e); |
228 | $classe->setexpression($e); | 231 | $classe->setexpression($e); |
232 | + if($minScales[$i]){ | ||
233 | + if($minScales[$i] == 0 || $minScales[$i] == ""){ | ||
234 | + $minScales[$i] = -1; | ||
235 | + } | ||
236 | + $classe->set("minscaledenom",$minScales[$i]); | ||
237 | + } | ||
238 | + if($maxScales[$i]){ | ||
239 | + if($maxScales[$i] == 0 || $maxScales[$i] == ""){ | ||
240 | + $maxScales[$i] = -1; | ||
241 | + } | ||
242 | + $classe->set("maxscaledenom",$maxScales[$i]); | ||
243 | + } | ||
229 | } | 244 | } |
230 | } | 245 | } |
231 | } | 246 | } |
classesphp/classe_legenda.php
@@ -342,7 +342,7 @@ array | @@ -342,7 +342,7 @@ array | ||
342 | } | 342 | } |
343 | else | 343 | else |
344 | {$imgLeg = $im;} | 344 | {$imgLeg = $im;} |
345 | - $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","expressao"=>"","imagem"=>$imgLeg); | 345 | + $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","expressao"=>"","imagem"=>$imgLeg,"minScale"=>0,"maxScale"=>0); |
346 | } | 346 | } |
347 | else | 347 | else |
348 | { | 348 | { |
@@ -360,7 +360,7 @@ array | @@ -360,7 +360,7 @@ array | ||
360 | $nomeexp = $classe->getExpressionString(); | 360 | $nomeexp = $classe->getExpressionString(); |
361 | if (function_exists("mb_convert_encoding")) | 361 | if (function_exists("mb_convert_encoding")) |
362 | {$nomeexp = mb_convert_encoding($nomeexp,"UTF-8","ISO-8859-1");} | 362 | {$nomeexp = mb_convert_encoding($nomeexp,"UTF-8","ISO-8859-1");} |
363 | - $linhas[] = array("tema"=>$l,"idclasse"=>$c,"nomeclasse"=>$nomeclasse,"expressao"=>$nomeexp,"imagem"=>$i,"proc"=>""); | 363 | + $linhas[] = array("tema"=>$l,"idclasse"=>$c,"nomeclasse"=>$nomeclasse,"expressao"=>$nomeexp,"imagem"=>$i,"proc"=>"","minScale"=>$classe->minscaledenom,"maxScale"=>$classe->maxscaledenom); |
364 | } | 364 | } |
365 | if (($totaliza=="sim") && ($nc > 1)){ | 365 | if (($totaliza=="sim") && ($nc > 1)){ |
366 | $layer->set("template","none.htm"); | 366 | $layer->set("template","none.htm"); |
@@ -422,7 +422,7 @@ array | @@ -422,7 +422,7 @@ array | ||
422 | if($layer->type == MS_LAYER_RASTER && $proc == ""){ | 422 | if($layer->type == MS_LAYER_RASTER && $proc == ""){ |
423 | $proc = array("RESAMPLE=NEAREST"); | 423 | $proc = array("RESAMPLE=NEAREST"); |
424 | } | 424 | } |
425 | - $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","imagem"=>"","proc"=>$proc); | 425 | + $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","imagem"=>"","proc"=>$proc,"minScale"=>0,"maxScale"=>0); |
426 | } | 426 | } |
427 | } | 427 | } |
428 | } | 428 | } |
classesphp/mapa_controle.php
@@ -1159,7 +1159,7 @@ Altera uma classe de um tema, aplicando uma nova classifica&ccedil;&atilde;o ou | @@ -1159,7 +1159,7 @@ Altera uma classe de um tema, aplicando uma nova classifica&ccedil;&atilde;o ou | ||
1159 | if ($opcao == "alteraclasses"){ | 1159 | if ($opcao == "alteraclasses"){ |
1160 | //esta operação é chamada com POST via cpaint | 1160 | //esta operação é chamada com POST via cpaint |
1161 | //error_reporting(0); | 1161 | //error_reporting(0); |
1162 | - alteraclassesPost($ids,$nomes,$exps,$base64); | 1162 | + alteraclassesPost($ids,$nomes,$exps,$base64,$minScales,$maxScales); |
1163 | restauraCon($map_file,$postgis_mapa); | 1163 | restauraCon($map_file,$postgis_mapa); |
1164 | cpjson(""); | 1164 | cpjson(""); |
1165 | } | 1165 | } |
@@ -2242,10 +2242,10 @@ Altera as classes de um tema aplicando novos par&acirc;metros como nome e expres | @@ -2242,10 +2242,10 @@ Altera as classes de um tema aplicando novos par&acirc;metros como nome e expres | ||
2242 | Include: | 2242 | Include: |
2243 | <classe_alteraclasse.php> | 2243 | <classe_alteraclasse.php> |
2244 | */ | 2244 | */ |
2245 | -function alteraclassesPost($ids,$nomes,$exps,$base64="nao"){ | 2245 | +function alteraclassesPost($ids,$nomes,$exps,$base64="nao",$minScales="",$maxScales=""){ |
2246 | global $map_file,$tema; | 2246 | global $map_file,$tema; |
2247 | $m = new Alteraclasse($map_file,$tema); | 2247 | $m = new Alteraclasse($map_file,$tema); |
2248 | - $m->alteraclasses($ids,$nomes,$exps,$base64); | 2248 | + $m->alteraclasses($ids,$nomes,$exps,$base64,$minScales,$maxScales); |
2249 | $m->salva(); | 2249 | $m->salva(); |
2250 | $_SESSION["contadorsalva"]++; | 2250 | $_SESSION["contadorsalva"]++; |
2251 | } | 2251 | } |
ferramentas/legenda/dicionario.js
@@ -569,5 +569,17 @@ i3GEOF.legenda.dicionario = { | @@ -569,5 +569,17 @@ i3GEOF.legenda.dicionario = { | ||
569 | en:"", | 569 | en:"", |
570 | es:"", | 570 | es:"", |
571 | it:"" | 571 | it:"" |
572 | + }], | ||
573 | + 'minScale': [{ | ||
574 | + pt:"Não desenha se escala for menor que", | ||
575 | + en:"", | ||
576 | + es:"", | ||
577 | + it:"" | ||
578 | + }], | ||
579 | + 'maxScale': [{ | ||
580 | + pt:"Não desenha se escala for maior que", | ||
581 | + en:"", | ||
582 | + es:"", | ||
583 | + it:"" | ||
572 | }] | 584 | }] |
573 | }; | 585 | }; |
574 | \ No newline at end of file | 586 | \ No newline at end of file |
ferramentas/legenda/index.js
1 | - | ||
2 | -/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ | ||
3 | /* | 1 | /* |
4 | -Title: Editor de legenda | 2 | + Title: Editor de legenda |
5 | 3 | ||
6 | -Define a forma de representação de um tema, modificando o tipo de classificação e os símbolos utilizados em cada classe | 4 | + Define a forma de representação de um tema, modificando o tipo de classificação e os símbolos utilizados em cada classe |
7 | 5 | ||
8 | -Veja: | 6 | + Veja: |
9 | 7 | ||
10 | -<i3GEO.tema.dialogo.editaLegenda> | 8 | + <i3GEO.tema.dialogo.editaLegenda> |
11 | 9 | ||
12 | -Arquivo: | 10 | + Arquivo: |
13 | 11 | ||
14 | -i3geo/ferramentas/legenda/index.js.php | 12 | + i3geo/ferramentas/legenda/index.js.php |
15 | 13 | ||
16 | -Licenca: | 14 | + Licenca: |
17 | 15 | ||
18 | -GPL2 | 16 | + GPL2 |
19 | 17 | ||
20 | -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | 18 | + i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet |
21 | 19 | ||
22 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
23 | -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | 20 | + Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil |
21 | + Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
24 | 22 | ||
25 | -Este programa é software livre; você pode redistribuí-lo | ||
26 | -e/ou modificá-lo sob os termos da Licença Pública Geral | ||
27 | -GNU conforme publicada pela Free Software Foundation; | 23 | + Este programa é software livre; você pode redistribuí-lo |
24 | + e/ou modificá-lo sob os termos da Licença Pública Geral | ||
25 | + GNU conforme publicada pela Free Software Foundation; | ||
28 | 26 | ||
29 | -Este programa é distribuído na expectativa de que seja útil, | ||
30 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
31 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
32 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
33 | -Você deve ter recebido uma cópia da Licença Pública Geral do | ||
34 | -GNU junto com este programa; se não, escreva para a | ||
35 | -Free Software Foundation, Inc., no endereço | ||
36 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
37 | -*/ | 27 | + Este programa é distribuído na expectativa de que seja útil, |
28 | + porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
29 | + de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
30 | + Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
31 | + Você deve ter recebido uma cópia da Licença Pública Geral do | ||
32 | + GNU junto com este programa; se não, escreva para a | ||
33 | + Free Software Foundation, Inc., no endereço | ||
34 | + 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
35 | + */ | ||
38 | 36 | ||
39 | -if(typeof(i3GEOF) === 'undefined'){ | 37 | +if (typeof (i3GEOF) === 'undefined') { |
40 | var i3GEOF = {}; | 38 | var i3GEOF = {}; |
41 | } | 39 | } |
42 | /* | 40 | /* |
43 | -Classe: i3GEOF.legenda | ||
44 | -*/ | ||
45 | -i3GEOF.legenda = { | ||
46 | - /* | ||
47 | - Variavel: parDefault | ||
48 | - | ||
49 | - Parametros padrão utilizados para formatar os labels | ||
50 | - */ | ||
51 | - parDefault: "&position=MS_UR&partials=1&offsetx=0&offsety=0&minfeaturesize=auto&mindistance=auto&force=0&shadowsizex=1&shadowsizey=1&cor=0 0 0&sombray=1&sombrax=1&angulo=0&tamanho=8&fonte=bitmap&fundo=off&sombra=off&outlinecolor=off&shadowcolor=off&wrap=", | ||
52 | - /* | ||
53 | - Variavel: aviso | ||
54 | - | ||
55 | - Indica que uma alteração ainda não foi salva | ||
56 | - | ||
57 | - Type: | ||
58 | - {boolean} | ||
59 | - */ | ||
60 | - aviso: false, | ||
61 | - /* | ||
62 | - Variavel: tema | ||
63 | - | ||
64 | - Tema que será utilizado | ||
65 | - | ||
66 | - Type: | ||
67 | - {string} | ||
68 | - */ | ||
69 | - tema: i3GEO.temaAtivo, | ||
70 | - /* | ||
71 | - Variavel: dadosGrafico | ||
72 | - | ||
73 | - Dados utilizados no gráfico no formato da ferramenta graficointerativo | ||
74 | - */ | ||
75 | - dadosGrafico: "", | ||
76 | - /* | ||
77 | - Variavel: aguarde | ||
78 | - | ||
79 | - Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. | ||
80 | - */ | ||
81 | - aguarde: "", | ||
82 | - /* | ||
83 | - Variavel: estilos | ||
84 | - | ||
85 | - Estilos existentes em um símbolo de uma classe | ||
86 | - */ | ||
87 | - estilos: "", | ||
88 | - /* | ||
89 | - Variavel: estilo | ||
90 | - | ||
91 | - Ultimo estilo selecionado | ||
92 | - */ | ||
93 | - estilo: "", | ||
94 | - /* | ||
95 | - Variavel: classe | ||
96 | - | ||
97 | - Ultima classe selecionado | ||
98 | - */ | ||
99 | - classe: "", | ||
100 | - /* | ||
101 | - Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | ||
102 | - */ | ||
103 | - criaJanelaFlutuante: function(){ | ||
104 | - i3GEOF.legenda.iniciaDicionario(); | ||
105 | - }, | ||
106 | - /* | ||
107 | - Function: iniciaDicionario | ||
108 | - | ||
109 | - Carrega o dicionário e chama a função que inicia a ferramenta | ||
110 | - | ||
111 | - O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | ||
112 | - */ | ||
113 | - iniciaDicionario: function(){ | ||
114 | - if(typeof(i3GEOF.legenda.dicionario) === 'undefined'){ | ||
115 | - i3GEO.util.scriptTag( | ||
116 | - i3GEO.configura.locaplic+"/ferramentas/legenda/dicionario.js", | ||
117 | - "i3GEOF.legenda.iniciaJanelaFlutuante()", | ||
118 | - "i3GEOF.legenda.dicionario_script" | ||
119 | - ); | ||
120 | - } | ||
121 | - else{ | ||
122 | - i3GEOF.legenda.iniciaJanelaFlutuante(); | ||
123 | - } | ||
124 | - }, | ||
125 | - /* | ||
126 | - Function: inicia | ||
127 | - | ||
128 | - Inicia a ferramenta. É chamado por criaJanelaFlutuante | ||
129 | - | ||
130 | - Parametro: | ||
131 | - | ||
132 | - iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | ||
133 | - */ | ||
134 | - inicia: function(iddiv){ | ||
135 | - i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados"); | ||
136 | - if(i3GEO.temaAtivo === ""){ | ||
137 | - $i(iddiv).innerHTML = "";//'<p style="position: relative; top: 0px; font-size: 15px; text-align: left;">'+$trad("x33")+'</p>'; | ||
138 | - return; | ||
139 | - } | ||
140 | - try{ | ||
141 | - $i(iddiv).innerHTML += i3GEOF.legenda.html(); | ||
142 | - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1","i3GEOlegendaguia"); | ||
143 | - //eventos das guias | ||
144 | - $i("i3GEOlegendaguia6").onclick = function() | ||
145 | - {i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6","i3GEOlegendaguia");}; | ||
146 | - $i("i3GEOlegendaguia1").onclick = function(){ | ||
147 | - i3GEOF.legenda.mostralegenda(); | ||
148 | - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1","i3GEOlegendaguia"); | ||
149 | - }; | ||
150 | - $i("i3GEOlegendaguia2").onclick = function() | ||
151 | - {i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia2","i3GEOlegendaguia");}; | ||
152 | - $i("i3GEOlegendaguia3").onclick = function(){ | ||
153 | - i3GEO.janela.tempoMsg($trad('ajuda',i3GEOF.legenda.dicionario)); | ||
154 | - }; | ||
155 | - $i("i3GEOlegendaguia4").onclick = function(){ | ||
156 | - i3GEOF.legenda.mostraGrafico(); | ||
157 | - }; | ||
158 | - $i("i3GEOlegendaguia5").onclick = function(){ | ||
159 | - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5","i3GEOlegendaguia"); | ||
160 | - }; | ||
161 | - new YAHOO.widget.Button( | ||
162 | - "i3GEOlegendabotao1", | ||
163 | - {onclick:{fn: i3GEOF.legenda.mudaLegenda}} | ||
164 | - ); | ||
165 | - if(navm) | ||
166 | - {$i("i3GEOlegendabotao1-button").style.width = "0px";} | ||
167 | - new YAHOO.widget.Button( | ||
168 | - "i3GEOlegendabotao2", | ||
169 | - {onclick:{fn: i3GEOF.legenda.adicionaClasse}} | ||
170 | - ); | ||
171 | - //if(navm) | ||
172 | - //{$i("i3GEOlegendabotao2-button").style.width = "0px";} | ||
173 | - | ||
174 | - new YAHOO.widget.Button( | ||
175 | - "i3GEOlegendabotao3", | ||
176 | - {onclick:{fn: i3GEOF.legenda.adicionaConta},width:"100px"} | ||
177 | - ); | ||
178 | - $i("i3GEOlegendabotao3-button").style.width = "200px"; | ||
179 | - new YAHOO.widget.Button( | ||
180 | - "i3GEOlegendabotao15", | ||
181 | - {onclick:{fn: i3GEOF.legenda.adicionaOpacidade}} | ||
182 | - ); | ||
183 | - $i("i3GEOlegendabotao15-button").style.width = "200px"; | ||
184 | - new YAHOO.widget.Button( | ||
185 | - "i3GEOlegendabotaoRamp", | ||
186 | - {onclick:{fn: function(){ | ||
187 | - var tabela = $i("i3GEOlegendalegenda"); | ||
188 | - var trs = tabela.getElementsByTagName("tr"); | ||
189 | - var ncores = trs.length - 1; | ||
190 | - i3GEO.util.abreColourRamp("","listaColourRamp",ncores); | ||
191 | - }}} | ||
192 | - ); | ||
193 | - $i("i3GEOlegendabotaoRamp-button").style.width = "200px"; | ||
194 | - new YAHOO.widget.Button( | ||
195 | - "i3GEOlegendabotao4", | ||
196 | - {onclick:{fn: i3GEOF.legenda.paleta}} | ||
197 | - ); | ||
198 | - new YAHOO.widget.Button( | ||
199 | - "i3GEOlegendabotao5", | ||
200 | - {onclick:{fn: i3GEOF.legenda.simbU}} | ||
201 | - ); | ||
202 | - $i("i3GEOlegendabotao5-button").style.width = "200px"; | ||
203 | - new YAHOO.widget.Button( | ||
204 | - "i3GEOlegendabotao6", | ||
205 | - {onclick:{fn: i3GEOF.legenda.valorU}} | ||
206 | - ); | ||
207 | - $i("i3GEOlegendabotao6-button").style.width = "200px"; | ||
208 | - new YAHOO.widget.Button( | ||
209 | - "i3GEOlegendabotao7", | ||
210 | - {onclick:{fn: i3GEOF.legenda.representacao}} | ||
211 | - ); | ||
212 | - $i("i3GEOlegendabotao7-button").style.width = "200px"; | ||
213 | - | ||
214 | - new YAHOO.widget.Button( | ||
215 | - "i3GEOlegendabotao8", | ||
216 | - {onclick:{fn: i3GEOF.legenda.valorC}} | ||
217 | - ); | ||
218 | - $i("i3GEOlegendabotao8-button").style.width = "120px"; | ||
219 | - | ||
220 | - new YAHOO.widget.Button( | ||
221 | - "i3GEOlegendabotao9", | ||
222 | - {onclick:{fn: i3GEOF.legenda.valorQ}} | ||
223 | - ); | ||
224 | - $i("i3GEOlegendabotao9-button").style.width = "120px"; | ||
225 | - | ||
226 | - new YAHOO.widget.Button( | ||
227 | - "i3GEOlegendabotaoQuantil", | ||
228 | - {onclick:{fn: i3GEOF.legenda.valorQu}} | ||
229 | - ); | ||
230 | - $i("i3GEOlegendabotaoQuantil-button").style.width = "120px"; | ||
231 | - | ||
232 | - new YAHOO.widget.Button( | ||
233 | - "i3GEOlegendabotaoQN", | ||
234 | - {onclick:{fn: i3GEOF.legenda.valorQN}} | ||
235 | - ); | ||
236 | - $i("i3GEOlegendabotaoQN-button").style.width = "120px"; | ||
237 | - | ||
238 | - new YAHOO.widget.Button( | ||
239 | - "i3GEOlegendabotao10", | ||
240 | - {onclick:{fn: i3GEOF.legenda.aplicaEstilo}} | ||
241 | - ); | ||
242 | - $i("i3GEOlegendabotao10-button").style.width = "220px"; | ||
243 | - | ||
244 | - new YAHOO.widget.Button( | ||
245 | - "i3GEOlegendabotao17", | ||
246 | - {onclick:{fn: i3GEOF.legenda.alteraGeometriaTema}} | ||
247 | - ); | ||
248 | - $i("i3GEOlegendabotao17-button").style.width = "200px"; | ||
249 | - new YAHOO.widget.Button( | ||
250 | - "i3GEOlegendabotaoSLDe", | ||
251 | - {onclick:{fn: function(){window.open(i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?funcao=tema2sld&tema="+i3GEOF.legenda.tema+"&g_sid="+i3GEO.configura.sid);}}} | ||
252 | - ); | ||
253 | - $i("i3GEOlegendabotaoSLDe-button").style.width = "200px"; | ||
254 | - new YAHOO.widget.Button( | ||
255 | - "i3GEOlegendabotaoSLDi", | ||
256 | - {onclick:{fn: function(){i3GEO.tema.dialogo.aplicarsld(i3GEOF.legenda.tema);}}} | ||
257 | - ); | ||
258 | - $i("i3GEOlegendabotaoSLDi-button").style.width = "200px"; | ||
259 | - new YAHOO.widget.Button( | ||
260 | - "i3GEOlegendabotaoIncluirLabel", | ||
261 | - {onclick:{fn: function(){ | ||
262 | - var par,p,temp,cp; | ||
263 | - try{ | ||
264 | - par = i3GEOF.proplabel.pegaPar(); | ||
265 | - i3GEOF.legenda.parDefault = par; | 41 | + * Classe: i3GEOF.legenda |
42 | + */ | ||
43 | +i3GEOF.legenda = | ||
44 | + { | ||
45 | + /* | ||
46 | + * Variavel: parDefault | ||
47 | + * | ||
48 | + * Parametros padrão utilizados para formatar os labels | ||
49 | + */ | ||
50 | + parDefault : "&position=MS_UR&partials=1&offsetx=0&offsety=0&minfeaturesize=auto&mindistance=auto&force=0&shadowsizex=1&shadowsizey=1&cor=0 0 0&sombray=1&sombrax=1&angulo=0&tamanho=8&fonte=bitmap&fundo=off&sombra=off&outlinecolor=off&shadowcolor=off&wrap=", | ||
51 | + /* | ||
52 | + * Variavel: aviso | ||
53 | + * | ||
54 | + * Indica que uma alteração ainda não foi salva | ||
55 | + * | ||
56 | + * Type: {boolean} | ||
57 | + */ | ||
58 | + aviso : false, | ||
59 | + /* | ||
60 | + * Variavel: tema | ||
61 | + * | ||
62 | + * Tema que será utilizado | ||
63 | + * | ||
64 | + * Type: {string} | ||
65 | + */ | ||
66 | + tema : i3GEO.temaAtivo, | ||
67 | + /* | ||
68 | + * Variavel: dadosGrafico | ||
69 | + * | ||
70 | + * Dados utilizados no gráfico no formato da ferramenta graficointerativo | ||
71 | + */ | ||
72 | + dadosGrafico : "", | ||
73 | + /* | ||
74 | + * Variavel: aguarde | ||
75 | + * | ||
76 | + * Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. | ||
77 | + */ | ||
78 | + aguarde : "", | ||
79 | + /* | ||
80 | + * Variavel: estilos | ||
81 | + * | ||
82 | + * Estilos existentes em um símbolo de uma classe | ||
83 | + */ | ||
84 | + estilos : "", | ||
85 | + /* | ||
86 | + * Variavel: estilo | ||
87 | + * | ||
88 | + * Ultimo estilo selecionado | ||
89 | + */ | ||
90 | + estilo : "", | ||
91 | + /* | ||
92 | + * Variavel: classe | ||
93 | + * | ||
94 | + * Ultima classe selecionado | ||
95 | + */ | ||
96 | + classe : "", | ||
97 | + /* | ||
98 | + * Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | ||
99 | + */ | ||
100 | + criaJanelaFlutuante : function() { | ||
101 | + i3GEOF.legenda.iniciaDicionario(); | ||
102 | + }, | ||
103 | + /* | ||
104 | + * Function: iniciaDicionario | ||
105 | + * | ||
106 | + * Carrega o dicionário e chama a função que inicia a ferramenta | ||
107 | + * | ||
108 | + * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | ||
109 | + */ | ||
110 | + iniciaDicionario : function() { | ||
111 | + if (typeof (i3GEOF.legenda.dicionario) === 'undefined') { | ||
112 | + i3GEO.util.scriptTag( | ||
113 | + i3GEO.configura.locaplic + "/ferramentas/legenda/dicionario.js", | ||
114 | + "i3GEOF.legenda.iniciaJanelaFlutuante()", | ||
115 | + "i3GEOF.legenda.dicionario_script"); | ||
116 | + } else { | ||
117 | + i3GEOF.legenda.iniciaJanelaFlutuante(); | ||
118 | + } | ||
119 | + }, | ||
120 | + /* | ||
121 | + * Function: inicia | ||
122 | + * | ||
123 | + * Inicia a ferramenta. É chamado por criaJanelaFlutuante | ||
124 | + * | ||
125 | + * Parametro: | ||
126 | + * | ||
127 | + * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | ||
128 | + */ | ||
129 | + inicia : function(iddiv) { | ||
130 | + i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca", "i3GEOFlegendaComboCabecaSel", "legenda", "ligados"); | ||
131 | + if (i3GEO.temaAtivo === "") { | ||
132 | + $i(iddiv).innerHTML = "";// '<p style="position: relative; top: 0px; font-size: 15px; text-align: | ||
133 | + // left;">'+$trad("x33")+'</p>'; | ||
134 | + return; | ||
135 | + } | ||
136 | + try { | ||
137 | + $i(iddiv).innerHTML += i3GEOF.legenda.html(); | ||
138 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); | ||
139 | + // eventos das guias | ||
140 | + $i("i3GEOlegendaguia6").onclick = function() { | ||
141 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia"); | ||
142 | + }; | ||
143 | + $i("i3GEOlegendaguia1").onclick = function() { | ||
144 | + i3GEOF.legenda.mostralegenda(); | ||
145 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); | ||
146 | + }; | ||
147 | + $i("i3GEOlegendaguia2").onclick = function() { | ||
148 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia2", "i3GEOlegendaguia"); | ||
149 | + }; | ||
150 | + $i("i3GEOlegendaguia3").onclick = function() { | ||
151 | + i3GEO.janela.tempoMsg($trad('ajuda', i3GEOF.legenda.dicionario)); | ||
152 | + }; | ||
153 | + $i("i3GEOlegendaguia4").onclick = function() { | ||
154 | + i3GEOF.legenda.mostraGrafico(); | ||
155 | + }; | ||
156 | + $i("i3GEOlegendaguia5").onclick = function() { | ||
157 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia"); | ||
158 | + }; | ||
159 | + new YAHOO.widget.Button("i3GEOlegendabotao1", { | ||
160 | + onclick : { | ||
161 | + fn : i3GEOF.legenda.mudaLegenda | ||
266 | } | 162 | } |
267 | - catch(e){ | ||
268 | - par = i3GEOF.legenda.parDefault; | 163 | + }); |
164 | + if (navm) { | ||
165 | + $i("i3GEOlegendabotao1-button").style.width = "0px"; | ||
166 | + } | ||
167 | + new YAHOO.widget.Button("i3GEOlegendabotao2", { | ||
168 | + onclick : { | ||
169 | + fn : i3GEOF.legenda.adicionaClasse | ||
269 | } | 170 | } |
270 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
271 | - temp = function(){ | ||
272 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
273 | - i3GEOF.legenda.aposAlterarLegenda(); | ||
274 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
275 | - }; | ||
276 | - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionaLabelClasse&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+par; | ||
277 | - p += "&item="+$i("i3GEOlegendaSelItemLabel").value; | ||
278 | - cp = new cpaint(); | ||
279 | - cp.set_response_type("JSON"); | ||
280 | - cp.call(p,"foo",temp); | ||
281 | - }}} | ||
282 | - ); | ||
283 | - new YAHOO.widget.Button( | ||
284 | - "i3GEOlegendabotaoExcluirLabel", | ||
285 | - {onclick:{fn: function(){ | ||
286 | - var p,temp,cp; | ||
287 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
288 | - temp = function(){ | ||
289 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
290 | - i3GEOF.legenda.aposAlterarLegenda(); | ||
291 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
292 | - }; | ||
293 | - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=removeLabelClasse&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe; | ||
294 | - cp = new cpaint(); | ||
295 | - cp.set_response_type("JSON"); | ||
296 | - cp.call(p,"foo",temp); | ||
297 | - }}} | ||
298 | - ); | ||
299 | - new YAHOO.widget.Button( | ||
300 | - "i3GEOlegendabotaoPropriedadeLabel", | ||
301 | - {onclick:{fn: function(){ | ||
302 | - i3GEO.util.scriptTag( | ||
303 | - i3GEO.configura.locaplic+"/ferramentas/opcoes_label/index.js", | ||
304 | - "i3GEOF.proplabel.criaJanelaFlutuante(false)", | ||
305 | - "i3GEOFproplabel", | ||
306 | - false | ||
307 | - ); | ||
308 | - }}} | ||
309 | - ); | ||
310 | - i3GEOF.legenda.ativaFoco(); | ||
311 | - i3GEOF.legenda.mostralegenda(); | ||
312 | - i3GEO.util.comboItens( | ||
313 | - "i3GEOlegendaSelItem", | ||
314 | - i3GEOF.legenda.tema, | ||
315 | - function(retorno){ | ||
316 | - if($i("i3GEOlegendaitens")) | ||
317 | - {$i("i3GEOlegendaitens").innerHTML = retorno.dados;} | ||
318 | - }, | ||
319 | - "i3GEOlegendaitens" | ||
320 | - ); | ||
321 | - if(i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema).classe && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema).classe.toLowerCase() == "nao") | ||
322 | - {$i("i3GEOFlegendamostra").checked = false;} | ||
323 | - $i("i3GEOFlegendamostra").onclick = function(){i3GEO.tema.invertestatuslegenda(i3GEOF.legenda.tema);}; | ||
324 | - } | ||
325 | - catch(erro){i3GEO.janela.tempoMsg(erro);} | ||
326 | - }, | ||
327 | - /* | ||
328 | - Function: html | ||
329 | - | ||
330 | - Gera o código html para apresentação das opções da ferramenta | ||
331 | - | ||
332 | - Retorno: | ||
333 | - | ||
334 | - String com o código html | ||
335 | - */ | ||
336 | - html:function(){ | ||
337 | - var ins = '' + | ||
338 | - '<div id=guiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;">'+ | ||
339 | - ' <ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">'+ | ||
340 | - ' <li><a ><em><div id="i3GEOlegendaguia6" style="text-align:center;left:0px;" ><img class="ticPropriedades2" style="height:14px" title="'+$trad('propriedades',i3GEOF.legenda.dicionario)+'" src="'+i3GEO.configura.locaplic+'/imagens/visual/default/branco.gif"></div></em></a></li>'+ | ||
341 | - ' <li><a ><em><div id="i3GEOlegendaguia1" style="text-align:center;left:0px;" >'+$trad('legenda',i3GEOF.legenda.dicionario)+'</div></em></a></li>'+ | ||
342 | - ' <li><a ><em><div id="i3GEOlegendaguia2" style="text-align:center;left:0px;" >'+$trad('classes',i3GEOF.legenda.dicionario)+'</div></em></a></li>'+ | ||
343 | - ' <li><a ><em><div id="i3GEOlegendaguia3" style="text-align:center;left:0px;" >'+$trad('editor',i3GEOF.legenda.dicionario)+'</div></em></a></li>'+ | ||
344 | - ' <li><a ><em><div id="i3GEOlegendaguia4" style="text-align:center;left:0px;" >'+$trad('graficos',i3GEOF.legenda.dicionario)+'</div></em></a></li>'+ | ||
345 | - ' <li><a ><em><div id="i3GEOlegendaguia5" style="text-align:center;left:0px;" >'+$trad('importaExportaSLD',i3GEOF.legenda.dicionario)+'</div></em></a></li>'+ | ||
346 | - ' </ul>'+ | ||
347 | - '</div><br>'+ | ||
348 | - '<div id=i3GEOlegendaguia6obj style="width:99%;text-align:left;">'+ | ||
349 | - ' <p class=paragrafo > <input type=checkbox onclick="" checked id=i3GEOFlegendamostra style="cursor:pointer;border:0px solid white;" /> <span style="cursor:pointer;position:relative;top:-2px;">'+$trad('mostraClassesLegenda',i3GEOF.legenda.dicionario)+'</span></p>' + | ||
350 | - ' <p class=paragrafo ><input id=i3GEOlegendabotao3 type="button" value="'+$trad('incluiNumeroOcorrencia',i3GEOF.legenda.dicionario)+'" title="'+$trad('incluiNumeroOcorrencia2',i3GEOF.legenda.dicionario)+'"></p>' + | ||
351 | - ' <p class=paragrafo ><input id=i3GEOlegendabotao15 type="button" value="'+$trad('aplicaOpacidadeVariavel',i3GEOF.legenda.dicionario)+'" title="'+$trad('aplicaOpacidade',i3GEOF.legenda.dicionario)+'"></p>' + | ||
352 | - ' <p class=paragrafo ><input id=i3GEOlegendabotaoRamp type="button" size=15 value="'+$trad('escolhePaletaCores',i3GEOF.legenda.dicionario)+'" title="'+$trad('variaCoresExtremos',i3GEOF.legenda.dicionario)+'"></p>' + | ||
353 | - ' <div style=margin-left:5px; >' + | ||
354 | - ' <p class=paragrafo >'+$trad('geraCores',i3GEOF.legenda.dicionario)+'</p>' + | ||
355 | - ' <table summary="" class=lista6 >' + | ||
356 | - ' <tr>' + | ||
357 | - ' <td>'+$trad('ate',i3GEOF.legenda.dicionario)+':</td>' + | ||
358 | - ' <td>' + | ||
359 | - ' <div class=styled-select style="width:120px" >' + | ||
360 | - ' <input type=text id="i3GEOlegendaacori" value="0,0,0" />' + | ||
361 | - ' </div>' + | ||
362 | - ' </td>' + | ||
363 | - ' <td><img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.legenda.corj(\'i3GEOlegendaacori\')" /> ' + | ||
364 | - ' </td>' + | ||
365 | - ' <td>'+$trad('de',i3GEOF.legenda.dicionario)+':</td>' + | ||
366 | - ' <td>'+ | ||
367 | - ' <div class=styled-select style="width:120px" >' + | ||
368 | - ' <input type=text id="i3GEOlegendaacorf" value="255,255,255" />' + | ||
369 | - ' </div>' + | ||
370 | - ' </td>' + | ||
371 | - ' <td><img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.legenda.corj(\'i3GEOlegendaacorf\')" /> ' + | ||
372 | - ' </td>' + | ||
373 | - ' <td><input id=i3GEOlegendabotao4 type="button" size=15 value="'+$trad('aplica',i3GEOF.legenda.dicionario)+'" title="'+$trad('aplicaVariaCores',i3GEOF.legenda.dicionario)+'"></td>' + | ||
374 | - ' </tr>' + | ||
375 | - ' </table>' + | ||
376 | - '</div>' + | ||
377 | - '</div>' + | ||
378 | - '<div id=i3GEOlegendaguia1obj style="width:99%;text-align:left;">'+ | ||
379 | - ' <div style=margin-left:5px; >' + | ||
380 | - ' <table summary="" class=lista5 ><tr>' + | ||
381 | - ' <td><input id=i3GEOlegendabotao1 size="22" type="button" value="'+$trad('aplicaAlteracao',i3GEOF.legenda.dicionario)+'" ></td>'+ | ||
382 | - ' <td><input id=i3GEOlegendabotao2 size="22" type="button" value="'+$trad('adicionaClasse',i3GEOF.legenda.dicionario)+'" title="'+$trad('adicionaNovaClasse',i3GEOF.legenda.dicionario)+'" ></td>' + | ||
383 | - ' </tr></table><br>' + | ||
384 | - ' <p class=paragrafo >'+$trad('clicaSimbolo',i3GEOF.legenda.dicionario)+'</p>' + | ||
385 | - ' <div id="i3GEOlegendaresultado" style="text-align:left;width:100%;display:block;left:0px">' + | ||
386 | - ' </div>'+ | ||
387 | - '</div>'+ | ||
388 | - '</div>' + | ||
389 | - '<div id=i3GEOlegendaguia2obj style="width:99%;text-align:left;">'+ | ||
390 | - ' <div style=margin-left:5px; >' + | ||
391 | - ' <div id=i3GEOFlegendaClassesOpcionais >' + | ||
392 | - ' <p class=paragrafo > <input type=checkbox onclick="" checked id=i3GEOFlegendaaplicaextent style="cursor:pointer;border:0px solid white;" /> <span style="cursor:pointer;position:relative;top:-2px;">'+$trad('consideraElementosVisisveis',i3GEOF.legenda.dicionario)+'</span></p>' + | ||
393 | - ' <p class=paragrafo >'+$trad('ignoraValores',i3GEOF.legenda.dicionario)+':'+ | ||
394 | - ' <div class=styled-select >' + | ||
395 | - ' <input type=text id="i3GEOlegendaignorar" value="" />' + | ||
396 | - ' </div>' + | ||
397 | - ' <hr><p class=paragrafo >'+$trad('transformaGeom',i3GEOF.legenda.dicionario)+'</p>'+ | ||
398 | - ' <div class=styled-select >' + | ||
399 | - ' <select id=i3GEOlegentaTipoGeo >'+ | ||
400 | - ' <option value="">'+$trad('semTransformacao',i3GEOF.legenda.dicionario)+'</option>'+ | ||
401 | - ' <option value="centroid">'+$trad('centroide',i3GEOF.legenda.dicionario)+'</option>'+ | ||
402 | - ' <option value="bbox">box</option>'+ | ||
403 | - ' <option value="vertices">'+$trad('vertices',i3GEOF.legenda.dicionario)+'</option>'+ | ||
404 | - ' <option value="start">'+$trad('verticeInicial',i3GEOF.legenda.dicionario)+'</option>'+ | ||
405 | - ' <option value="end">'+$trad('verticeFinal',i3GEOF.legenda.dicionario)+'</option>'+ | ||
406 | - ' </select>'+ | ||
407 | - ' </div>' + | ||
408 | - ' <br><p class=paragrafo >' + | ||
409 | - ' <input id=i3GEOlegendabotao17 size="35" type="button" value="'+$trad('alteraGeom',i3GEOF.legenda.dicionario)+'"></p>'+ | ||
410 | - ' <hr><p class=paragrafo >'+$trad('alteraTipoGeom',i3GEOF.legenda.dicionario)+'</p>'+ | ||
411 | - ' <p class=paragrafo ><input id=i3GEOlegendabotao7 size="25" type="button" value="'+$trad('alteraTipo',i3GEOF.legenda.dicionario)+'"></p>'+ | ||
412 | - ' </div>' + | ||
413 | - ' <hr><p class=paragrafo >'+$trad('todosElementosUnicoSimbolo',i3GEOF.legenda.dicionario)+'</p>'+ | ||
414 | - ' <p class=paragrafo ><input id=i3GEOlegendabotao5 size="25" type="button" value="'+$trad('simboloUnico',i3GEOF.legenda.dicionario)+'"></p>'+ | ||
415 | - ' <hr><p class=paragrafo >'+$trad('cadaOcorrenciaUnicoSimbolo',i3GEOF.legenda.dicionario)+'</p>'+ | ||
416 | - ' <div id="i3GEOlegendaitens" class=styled-select ></div><br>'+ | ||
417 | - ' <p class=paragrafo ><input id=i3GEOlegendabotao6 size="25" type="button" value="'+$trad('valorUnico',i3GEOF.legenda.dicionario)+'"></p>'+ | ||
418 | - ' <hr><p class=paragrafo >'+$trad('criaClassesItemNumerico',i3GEOF.legenda.dicionario)+'</p>'+ | ||
419 | - ' <p class=paragrafo >'+$trad('numeroClasses',i3GEOF.legenda.dicionario)+':'+ | ||
420 | - ' <div class=styled-select >' + | ||
421 | - ' <input type=text id="i3GEOlegendanclasses" value="5" />' + | ||
422 | - ' </div>' + | ||
423 | - ' <br><p class=paragrafo ><input id=i3GEOlegendabotao8 size="25" type="button" value="'+$trad('intervalosIguais',i3GEOF.legenda.dicionario)+'">'+ | ||
424 | - ' <input id=i3GEOlegendabotaoQN size="25" type="button" value="'+$trad('quebrasNaturais',i3GEOF.legenda.dicionario)+'">'+ | ||
425 | - ' <input id=i3GEOlegendabotaoQuantil size="25" type="button" value="Quantil">'+ | ||
426 | - ' <hr><p class=paragrafo >'+$trad('criaQuartis',i3GEOF.legenda.dicionario)+'</p>'+ | ||
427 | - ' <p class=paragrafo ><input id=i3GEOlegendabotao9 size="25" type="button" value="Quartis">'+ | ||
428 | - ' <p class=paragrafo >'+$trad('estiloNomeClasses',i3GEOF.legenda.dicionario)+': ' + | ||
429 | - ' <div class=styled-select >' + | ||
430 | - ' <select id=estiloClassesQuartis >' + | ||
431 | - ' <option value=minimo select >'+$trad('soValores',i3GEOF.legenda.dicionario)+'</option>' + | ||
432 | - ' <option value=simples select >'+$trad('quartilValores',i3GEOF.legenda.dicionario)+'</option>' + | ||
433 | - ' <option value=completo select >'+$trad('expressaoCompleta',i3GEOF.legenda.dicionario)+'</option>' + | ||
434 | - ' </select></div><br>' + | ||
435 | - '</div>'+ | ||
436 | - '</div>'+ | ||
437 | - '<div id=i3GEOlegendaguia3obj style="width:99%;text-align:left;">'+ | ||
438 | - ' <fieldset style="padding:5px;margin:2px;">'+ | ||
439 | - ' <legend>'+$trad('etiquetasClasse',i3GEOF.legenda.dicionario)+'</legend>'+ | ||
440 | - ' <p class=paragrafo >'+$trad('itemComTexto',i3GEOF.legenda.dicionario)+': <div class=styled-select id=i3GEOlegendaitensLabel ></div></p>' + | ||
441 | - ' <br><p class=paragrafo style="font-size:10px;">'+ | ||
442 | - ' <input id=i3GEOlegendabotaoExcluirLabel size=10 type=buttom value="'+$trad('exclui',i3GEOF.legenda.dicionario)+'" />' + | ||
443 | - ' <input id=i3GEOlegendabotaoIncluirLabel size=10 type=buttom value="'+$trad('adiciona',i3GEOF.legenda.dicionario)+'" />' + | ||
444 | - ' <input id=i3GEOlegendabotaoPropriedadeLabel size=10 type=buttom value="'+$trad('propriedades2',i3GEOF.legenda.dicionario)+'" />' + | ||
445 | - ' </p>' + | ||
446 | - ' </fieldset><br>'+ | ||
447 | - ' <fieldset style="padding:5px;margin:2px;">'+ | ||
448 | - ' <legend>'+$trad('estilos',i3GEOF.legenda.dicionario)+'</legend>'+ | ||
449 | - ' <p class=paragrafo style="font-size:10px;">'+$trad('ajudaEstilo',i3GEOF.legenda.dicionario)+''+ | ||
450 | - ' <div id="i3GEOlegendacomboestilos" >'+ | ||
451 | - ' </div>'+ | ||
452 | - " <br><input id=i3GEOlegendabotao11 class=executar size=10 type=button value='"+$trad('exclui',i3GEOF.legenda.dicionario)+"' />" + | ||
453 | - " <input id=i3GEOlegendabotao12 class=executar size=14 type=button value='"+$trad('adiciona',i3GEOF.legenda.dicionario)+"' />" + | ||
454 | - " <input id=i3GEOlegendabotao13 class=executar size=8 type=button value='"+$trad('sobe',i3GEOF.legenda.dicionario)+"' />" + | ||
455 | - " <input id=i3GEOlegendabotao14 class=executar size=8 type=button value='"+$trad('desce',i3GEOF.legenda.dicionario)+"' />" + | ||
456 | - ' <div id="i3GEOlegendaParametrosEstilos" style="position:relative;top:10px;left:0px;text-align:left">'+ | ||
457 | - ' </div>'+ | ||
458 | - ' <br><br><p class=paragrafo style="font-size:10px" ><input id=i3GEOlegendabotao10 size="35" type="button" value="'+$trad('aplicaAlteracoes',i3GEOF.legenda.dicionario)+'"></p>'+ | ||
459 | - ' <div style="position:relative;top:0px;left:0px;text-align:left;" id="i3GEOlegendamostraEstilo">'+ | ||
460 | - ' </div>'+ | ||
461 | - ' <div style="position:relative;top:0px;left:0px;text-align:left;" id="i3GEOlegendasimbolos">'+ | ||
462 | - ' </div>'+ | ||
463 | - ' </fieldset>'+ | ||
464 | - '</div>'+ | ||
465 | - '<div id=i3GEOlegendaguia4obj style="width:99%;text-align:left;">'+ | ||
466 | - '</div>'+ | ||
467 | - '<div id=i3GEOlegendaguia5obj style="width:99%;text-align:left;">'+ | ||
468 | - ' <p class=paragrafo >'+$trad('geraSLD',i3GEOF.legenda.dicionario)+' <a href="http://mapserver.org/ogc/sld.html#sld" target=_blank >Mapserver SLD</a> '+$trad('ajudaSLD',i3GEOF.legenda.dicionario)+ | ||
469 | - ' <p class=paragrafo ><input id=i3GEOlegendabotaoSLDe size="25" type="button" value="'+$trad('exportaSLD',i3GEOF.legenda.dicionario)+'"></p>'+ | ||
470 | - ' <p class=paragrafo >'+$trad('msgAplicaSLD',i3GEOF.legenda.dicionario)+ | ||
471 | - ' <p class=paragrafo ><input id=i3GEOlegendabotaoSLDi size="25" type="button" value="'+$trad('aplicaSLD',i3GEOF.legenda.dicionario)+'"></p>'+ | ||
472 | - '</div>' + | ||
473 | - '<input type=hidden value="" id="listaColourRamp" onchange="javascript:i3GEOF.legenda.aplicaColourRamp()" />'; //utilizado pelo seletor de colourramp | ||
474 | - return ins; | ||
475 | - }, | ||
476 | - /* | ||
477 | - Function: iniciaJanelaFlutuante | ||
478 | - | ||
479 | - Cria a janela flutuante para controle da ferramenta. | ||
480 | - */ | ||
481 | - iniciaJanelaFlutuante: function(){ | ||
482 | - var minimiza,cabecalho,janela,divid,temp,titulo; | ||
483 | - if($i("i3GEOF.legenda")){ | ||
484 | - i3GEOF.legenda.tema = i3GEO.temaAtivo; | ||
485 | - i3GEOF.legenda.inicia("i3GEOF.legenda_corpo"); | ||
486 | - return; | ||
487 | - } | ||
488 | - cabecalho = function(){ | ||
489 | - i3GEOF.legenda.ativaFoco(); | ||
490 | - }; | ||
491 | - minimiza = function(){ | ||
492 | - i3GEO.janela.minimiza("i3GEOF.legenda"); | ||
493 | - }; | ||
494 | - //cria a janela flutuante | ||
495 | - titulo = "<div id='i3GEOFlegendaComboCabeca' class='comboTemasCabecalho'> ------</div> "+$trad("t33")+" <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=5&idajuda=41' > </a>"; | ||
496 | - janela = i3GEO.janela.cria( | ||
497 | - "490px", | ||
498 | - "340px", | ||
499 | - "", | ||
500 | - "", | ||
501 | - "", | ||
502 | - titulo, | ||
503 | - "i3GEOF.legenda", | ||
504 | - false, | ||
505 | - "hd", | ||
506 | - cabecalho, | ||
507 | - minimiza, | ||
508 | - "", | ||
509 | - true, | ||
510 | - i3GEO.configura.locaplic+"/imagens/oxygen/16x16/format-list-unordered.png" | ||
511 | - ); | ||
512 | - divid = janela[2].id; | ||
513 | - i3GEOF.legenda.aguarde = $i("i3GEOF.legenda_imagemCabecalho").style; | ||
514 | - $i("i3GEOF.legenda_corpo").style.backgroundColor = "white"; | ||
515 | - i3GEOF.legenda.inicia(divid); | ||
516 | - temp = function(){ | ||
517 | - if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search('i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados")') > 0) | ||
518 | - {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove('i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados")');} | ||
519 | - }; | ||
520 | - YAHOO.util.Event.addListener(janela[0].close, "click", temp); | ||
521 | - }, | ||
522 | - /* | ||
523 | - Function: ativaFoco | ||
524 | - | ||
525 | - Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado | ||
526 | - */ | ||
527 | - ativaFoco: function(){ | ||
528 | - if(i3GEOF.legenda.tema !== "" && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema) === "") | ||
529 | - {i3GEO.janela.tempoMsg($trad('temaInexistente',i3GEOF.legenda.dicionario));} | ||
530 | - var i = $i("i3GEOF.legenda_c").style; | ||
531 | - i.zIndex = i3GEO.janela.ULTIMOZINDEX; | ||
532 | - i3GEO.janela.ULTIMOZINDEX++; | ||
533 | - }, | ||
534 | - /* | ||
535 | - Function: aposAlterarLegenda | ||
536 | - | ||
537 | - Função executada após ocorrer alguma alteração efetiva da legenda do mapa | ||
538 | - */ | ||
539 | - aposAlterarLegenda: function(){ | ||
540 | - i3GEO.atualiza(); | ||
541 | - i3GEO.Interface.atualizaTema("",i3GEOF.legenda.tema); | ||
542 | - i3GEO.arvoreDeCamadas.atualizaLegenda(i3GEOF.legenda.tema); | ||
543 | - i3GEO.mapa.legendaHTML.atualiza(); | ||
544 | - }, | ||
545 | - /* | ||
546 | - Function: mostralegenda | 171 | + }); |
172 | + // if(navm) | ||
173 | + // {$i("i3GEOlegendabotao2-button").style.width = "0px";} | ||
174 | + | ||
175 | + new YAHOO.widget.Button("i3GEOlegendabotao3", { | ||
176 | + onclick : { | ||
177 | + fn : i3GEOF.legenda.adicionaConta | ||
178 | + }, | ||
179 | + width : "100px" | ||
180 | + }); | ||
181 | + $i("i3GEOlegendabotao3-button").style.width = "200px"; | ||
182 | + new YAHOO.widget.Button("i3GEOlegendabotao15", { | ||
183 | + onclick : { | ||
184 | + fn : i3GEOF.legenda.adicionaOpacidade | ||
185 | + } | ||
186 | + }); | ||
187 | + $i("i3GEOlegendabotao15-button").style.width = "200px"; | ||
188 | + new YAHOO.widget.Button("i3GEOlegendabotaoRamp", { | ||
189 | + onclick : { | ||
190 | + fn : function() { | ||
191 | + var tabela = $i("i3GEOlegendalegenda"); | ||
192 | + var trs = tabela.getElementsByTagName("tr"); | ||
193 | + var ncores = trs.length - 1; | ||
194 | + i3GEO.util.abreColourRamp("", "listaColourRamp", ncores); | ||
195 | + } | ||
196 | + } | ||
197 | + }); | ||
198 | + $i("i3GEOlegendabotaoRamp-button").style.width = "200px"; | ||
199 | + new YAHOO.widget.Button("i3GEOlegendabotao4", { | ||
200 | + onclick : { | ||
201 | + fn : i3GEOF.legenda.paleta | ||
202 | + } | ||
203 | + }); | ||
204 | + new YAHOO.widget.Button("i3GEOlegendabotao5", { | ||
205 | + onclick : { | ||
206 | + fn : i3GEOF.legenda.simbU | ||
207 | + } | ||
208 | + }); | ||
209 | + $i("i3GEOlegendabotao5-button").style.width = "200px"; | ||
210 | + new YAHOO.widget.Button("i3GEOlegendabotao6", { | ||
211 | + onclick : { | ||
212 | + fn : i3GEOF.legenda.valorU | ||
213 | + } | ||
214 | + }); | ||
215 | + $i("i3GEOlegendabotao6-button").style.width = "200px"; | ||
216 | + new YAHOO.widget.Button("i3GEOlegendabotao7", { | ||
217 | + onclick : { | ||
218 | + fn : i3GEOF.legenda.representacao | ||
219 | + } | ||
220 | + }); | ||
221 | + $i("i3GEOlegendabotao7-button").style.width = "200px"; | ||
547 | 222 | ||
548 | - Pega os dados da legenda do mapa atual e mostra na tela | 223 | + new YAHOO.widget.Button("i3GEOlegendabotao8", { |
224 | + onclick : { | ||
225 | + fn : i3GEOF.legenda.valorC | ||
226 | + } | ||
227 | + }); | ||
228 | + $i("i3GEOlegendabotao8-button").style.width = "120px"; | ||
549 | 229 | ||
550 | - Veja: | 230 | + new YAHOO.widget.Button("i3GEOlegendabotao9", { |
231 | + onclick : { | ||
232 | + fn : i3GEOF.legenda.valorQ | ||
233 | + } | ||
234 | + }); | ||
235 | + $i("i3GEOlegendabotao9-button").style.width = "120px"; | ||
551 | 236 | ||
552 | - <EDITALEGENDA> | ||
553 | - */ | ||
554 | - mostralegenda: function(){ | ||
555 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
556 | - {return;} | ||
557 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
558 | - var p,cp; | ||
559 | - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=editalegenda&opcao=edita&tema="+i3GEOF.legenda.tema; | ||
560 | - cp = new cpaint(); | ||
561 | - cp.set_response_type("JSON"); | ||
562 | - cp.call(p,"tabelaLegenda",i3GEOF.legenda.montaLegenda); | ||
563 | - }, | ||
564 | - /* | ||
565 | - Function: montaLegenda | 237 | + new YAHOO.widget.Button("i3GEOlegendabotaoQuantil", { |
238 | + onclick : { | ||
239 | + fn : i3GEOF.legenda.valorQu | ||
240 | + } | ||
241 | + }); | ||
242 | + $i("i3GEOlegendabotaoQuantil-button").style.width = "120px"; | ||
566 | 243 | ||
567 | - Formata a tabela de edição da legenda | 244 | + new YAHOO.widget.Button("i3GEOlegendabotaoQN", { |
245 | + onclick : { | ||
246 | + fn : i3GEOF.legenda.valorQN | ||
247 | + } | ||
248 | + }); | ||
249 | + $i("i3GEOlegendabotaoQN-button").style.width = "120px"; | ||
568 | 250 | ||
569 | - Parametro: | 251 | + new YAHOO.widget.Button("i3GEOlegendabotao10", { |
252 | + onclick : { | ||
253 | + fn : i3GEOF.legenda.aplicaEstilo | ||
254 | + } | ||
255 | + }); | ||
256 | + $i("i3GEOlegendabotao10-button").style.width = "220px"; | ||
570 | 257 | ||
571 | - retorno - objeto contendo os dados para formatação da legenda | ||
572 | - */ | ||
573 | - montaLegenda: function(retorno){ | ||
574 | - i3GEOF.legenda.aviso = false; | ||
575 | - try{ | ||
576 | - if (retorno.data != undefined){ | ||
577 | - var ins, | ||
578 | - i, | ||
579 | - ajuda, | ||
580 | - id, | ||
581 | - re, | ||
582 | - exp, | ||
583 | - n; | ||
584 | - if (retorno.data[0].proc === ""){ | ||
585 | - ins = ["<table class=lista4 id=i3GEOlegendalegenda ><tr><td><img src='"+i3GEO.configura.locaplic+"/imagens/inverter.png' title='Inverter cores' onclick='i3GEOF.legenda.inverteCores()' style=cursor:pointer /></td><td style=background-color:white ><img src='"+i3GEO.configura.locaplic+"/imagens/tamanho.png' title='Calcula tamanho' onclick='i3GEOF.legenda.calculaTamanho()' style=cursor:pointer /></td><td style=background-color:yellow ></td><td style=background-color:yellow >nome</td><td style=background-color:yellow >expressão</td></tr>"]; | ||
586 | - n = retorno.data.length; | ||
587 | - for (i=0;i<n;i++){ | ||
588 | - id = retorno.data[i].tema+"-"+retorno.data[i].idclasse; //layer+indice da classe | ||
589 | - re = new RegExp("'", "g"); | ||
590 | - exp = (retorno.data[i].expressao).replace(re,'"'); | ||
591 | - ins.push("<tr><td><img style='cursor:pointer' title='"+$trad('cliqueExclui',i3GEOF.legenda.dicionario)+"' onclick='i3GEOF.legenda.excluilinhaf(this)' src='" + i3GEO.configura.locaplic + "/imagens/x.gif' title='excluir' /></td><td><img width='30px' height='15px' style='cursor:pointer' title='"+$trad('cliqueAltera',i3GEOF.legenda.dicionario)+"' src='"+retorno.data[i].imagem+"' onclick=i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_"+id+"') /></td>"); | ||
592 | - ins.push("<td><img onclick=i3GEOF.legenda.modificaCor('"+retorno.data[i].idclasse+"') title='alterar a cor' style='cursor:pointer' src='" + i3GEO.configura.locaplic + "/imagens/aquarela.gif' /></td>"); | ||
593 | - ins.push("<td>"); | ||
594 | - ins.push($inputText("","","i3GEOlegendaid_"+id,$trad('digitaNovoNome',i3GEOF.legenda.dicionario),20,retorno.data[i].nomeclasse,"nome","javascript:i3GEOF.legenda.aviso()")); | ||
595 | - ins.push("</td><td>"); | ||
596 | - ins.push($inputText("","","i3GEOlegendaid_"+id,$trad('digitaNovaExpressao',i3GEOF.legenda.dicionario),25,exp,"expressao","javascript:i3GEOF.legenda.aviso()")); | ||
597 | - ins.push("</td>"); | ||
598 | - if(n>1){ | ||
599 | - ins.push("<td><img src='"+i3GEO.configura.locaplic+"/imagens/sobe1.png' style=cursor:pointer title='"+$trad('sobe',i3GEOF.legenda.dicionario)+"' onclick=i3GEOF.legenda.sobelinhaf('"+retorno.data[i].idclasse+"') /></td>"); | ||
600 | - ins.push("<td><img src='"+i3GEO.configura.locaplic+"/imagens/desce1.png' style=cursor:pointer title='"+$trad('desce',i3GEOF.legenda.dicionario)+"' onclick=i3GEOF.legenda.descelinhaf('"+retorno.data[i].idclasse+"') /></td>"); | 258 | + new YAHOO.widget.Button("i3GEOlegendabotao17", { |
259 | + onclick : { | ||
260 | + fn : i3GEOF.legenda.alteraGeometriaTema | ||
261 | + } | ||
262 | + }); | ||
263 | + $i("i3GEOlegendabotao17-button").style.width = "200px"; | ||
264 | + new YAHOO.widget.Button("i3GEOlegendabotaoSLDe", { | ||
265 | + onclick : { | ||
266 | + fn : function() { | ||
267 | + window.open(i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?funcao=tema2sld&tema=" | ||
268 | + + i3GEOF.legenda.tema + "&g_sid=" + i3GEO.configura.sid); | ||
601 | } | 269 | } |
602 | - ins.push("</tr>"); | ||
603 | } | 270 | } |
604 | - ins.push("</table><br>"); | ||
605 | - $i("i3GEOlegendaresultado").innerHTML = ins.join(""); | ||
606 | - } | ||
607 | - else{ | ||
608 | - ajuda = "<br><p class=paragrafo >"+$trad('ajudaEscalaCores',i3GEOF.legenda.dicionario) + | ||
609 | - "<p class=paragrafo >"+$trad('msgEscalaCoresAuto',i3GEOF.legenda.dicionario) + | ||
610 | - "<p class=paragrafo >"+$trad('msgEscalaCoresIndividual',i3GEOF.legenda.dicionario) + | ||
611 | - "<p class=paragrafo >"+$trad('msgBandas',i3GEOF.legenda.dicionario) + | ||
612 | - "<p class=paragrafo >"+$trad('msgReamostragem',i3GEOF.legenda.dicionario) ; | ||
613 | - ins = "<p class=paragrafo >"+$trad('adicionaProcesso',i3GEOF.legenda.dicionario)+":" + | ||
614 | - "<select onchange=i3GEOF.legenda.adicionaProcesso(this) >" + | ||
615 | - "<option value='' >"+$trad('selecionaProcesso',i3GEOF.legenda.dicionario)+"</option>" + | ||
616 | - "<option value='SCALE=' >"+$trad('escalaCores',i3GEOF.legenda.dicionario)+"</option>" + | ||
617 | - "<option value='RESAMPLE=' >"+$trad('reamostragem',i3GEOF.legenda.dicionario)+"</option>" + | ||
618 | - "<option value='BANDS=' >"+$trad('bandas',i3GEOF.legenda.dicionario)+"</option>" + | ||
619 | - "<option value='COLOR_MATCH_THRESHOLD=' >Threshold</option>" + | ||
620 | - "<option value='NODATA=' >Nodata</option>" + | ||
621 | - "</select><br>" + | ||
622 | - '<p class=paragrafo ><input id=i3GEOlegendabotao16 class="executar" size="22" type="buttom" value="'+$trad('aplicaProcesso',i3GEOF.legenda.dicionario)+'">'; | ||
623 | - if(retorno.data[0].proc == "") | ||
624 | - {ins += "<div style=width:80% id=i3GEOlegendaprocessos ></div>";} | ||
625 | - else{ | ||
626 | - ins += "<div style='width:80%;text-align:left;' id=i3GEOlegendaprocessos >"; | ||
627 | - for (i=0;i<retorno.data[0].proc.length;i++){ | ||
628 | - ins += "<br>"+$inputText("","","","",50,retorno.data[0].proc[i]); | 271 | + }); |
272 | + $i("i3GEOlegendabotaoSLDe-button").style.width = "200px"; | ||
273 | + new YAHOO.widget.Button("i3GEOlegendabotaoSLDi", { | ||
274 | + onclick : { | ||
275 | + fn : function() { | ||
276 | + i3GEO.tema.dialogo.aplicarsld(i3GEOF.legenda.tema); | ||
629 | } | 277 | } |
630 | - ins += "</div>"; | ||
631 | } | 278 | } |
632 | - $i("i3GEOlegendaresultado").innerHTML = ins+ajuda; | ||
633 | - new YAHOO.widget.Button( | ||
634 | - "i3GEOlegendabotao16", | ||
635 | - {onclick:{fn: i3GEOF.legenda.aplicaProcessos}} | ||
636 | - ); | 279 | + }); |
280 | + $i("i3GEOlegendabotaoSLDi-button").style.width = "200px"; | ||
281 | + new YAHOO.widget.Button("i3GEOlegendabotaoIncluirLabel", { | ||
282 | + onclick : { | ||
283 | + fn : function() { | ||
284 | + var par, p, temp, cp; | ||
285 | + try { | ||
286 | + par = i3GEOF.proplabel.pegaPar(); | ||
287 | + i3GEOF.legenda.parDefault = par; | ||
288 | + } catch (e) { | ||
289 | + par = i3GEOF.legenda.parDefault; | ||
290 | + } | ||
291 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
292 | + temp = function() { | ||
293 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
294 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
295 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
296 | + }; | ||
297 | + p = | ||
298 | + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + i3GEO.configura.sid | ||
299 | + + "&funcao=adicionaLabelClasse&tema=" + i3GEOF.legenda.tema + "&classe=" + i3GEOF.legenda.classe + par; | ||
300 | + p += "&item=" + $i("i3GEOlegendaSelItemLabel").value; | ||
301 | + cp = new cpaint(); | ||
302 | + cp.set_response_type("JSON"); | ||
303 | + cp.call(p, "foo", temp); | ||
304 | + } | ||
305 | + } | ||
306 | + }); | ||
307 | + new YAHOO.widget.Button("i3GEOlegendabotaoExcluirLabel", { | ||
308 | + onclick : { | ||
309 | + fn : function() { | ||
310 | + var p, temp, cp; | ||
311 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
312 | + temp = function() { | ||
313 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
314 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
315 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
316 | + }; | ||
317 | + p = | ||
318 | + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + i3GEO.configura.sid | ||
319 | + + "&funcao=removeLabelClasse&tema=" + i3GEOF.legenda.tema + "&classe=" + i3GEOF.legenda.classe; | ||
320 | + cp = new cpaint(); | ||
321 | + cp.set_response_type("JSON"); | ||
322 | + cp.call(p, "foo", temp); | ||
323 | + } | ||
324 | + } | ||
325 | + }); | ||
326 | + new YAHOO.widget.Button("i3GEOlegendabotaoPropriedadeLabel", { | ||
327 | + onclick : { | ||
328 | + fn : function() { | ||
329 | + i3GEO.util.scriptTag( | ||
330 | + i3GEO.configura.locaplic + "/ferramentas/opcoes_label/index.js", | ||
331 | + "i3GEOF.proplabel.criaJanelaFlutuante(false)", | ||
332 | + "i3GEOFproplabel", | ||
333 | + false); | ||
334 | + } | ||
335 | + } | ||
336 | + }); | ||
337 | + i3GEOF.legenda.ativaFoco(); | ||
338 | + i3GEOF.legenda.mostralegenda(); | ||
339 | + i3GEO.util.comboItens("i3GEOlegendaSelItem", i3GEOF.legenda.tema, function(retorno) { | ||
340 | + if ($i("i3GEOlegendaitens")) { | ||
341 | + $i("i3GEOlegendaitens").innerHTML = retorno.dados; | ||
342 | + } | ||
343 | + }, "i3GEOlegendaitens"); | ||
344 | + if (i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema).classe | ||
345 | + && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema).classe.toLowerCase() == "nao") { | ||
346 | + $i("i3GEOFlegendamostra").checked = false; | ||
637 | } | 347 | } |
348 | + $i("i3GEOFlegendamostra").onclick = function() { | ||
349 | + i3GEO.tema.invertestatuslegenda(i3GEOF.legenda.tema); | ||
350 | + }; | ||
351 | + } catch (erro) { | ||
352 | + i3GEO.janela.tempoMsg(erro); | ||
353 | + } | ||
354 | + }, | ||
355 | + /* | ||
356 | + * Function: html | ||
357 | + * | ||
358 | + * Gera o código html para apresentação das opções da ferramenta | ||
359 | + * | ||
360 | + * Retorno: | ||
361 | + * | ||
362 | + * String com o código html | ||
363 | + */ | ||
364 | + html : function() { | ||
365 | + var ins = | ||
366 | + '' | ||
367 | + + '<div id=guiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;">' | ||
368 | + + ' <ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">' | ||
369 | + + ' <li><a ><em><div id="i3GEOlegendaguia6" style="text-align:center;left:0px;" ><img class="ticPropriedades2" style="height:14px" title="' | ||
370 | + + $trad('propriedades', i3GEOF.legenda.dicionario) | ||
371 | + + '" src="' | ||
372 | + + i3GEO.configura.locaplic | ||
373 | + + '/imagens/visual/default/branco.gif"></div></em></a></li>' | ||
374 | + + ' <li><a ><em><div id="i3GEOlegendaguia1" style="text-align:center;left:0px;" >' | ||
375 | + + $trad('legenda', i3GEOF.legenda.dicionario) | ||
376 | + + '</div></em></a></li>' | ||
377 | + + ' <li><a ><em><div id="i3GEOlegendaguia2" style="text-align:center;left:0px;" >' | ||
378 | + + $trad('classes', i3GEOF.legenda.dicionario) | ||
379 | + + '</div></em></a></li>' | ||
380 | + + ' <li><a ><em><div id="i3GEOlegendaguia3" style="text-align:center;left:0px;" >' | ||
381 | + + $trad('editor', i3GEOF.legenda.dicionario) | ||
382 | + + '</div></em></a></li>' | ||
383 | + + ' <li><a ><em><div id="i3GEOlegendaguia4" style="text-align:center;left:0px;" >' | ||
384 | + + $trad('graficos', i3GEOF.legenda.dicionario) | ||
385 | + + '</div></em></a></li>' | ||
386 | + + ' <li><a ><em><div id="i3GEOlegendaguia5" style="text-align:center;left:0px;" >' | ||
387 | + + $trad('importaExportaSLD', i3GEOF.legenda.dicionario) | ||
388 | + + '</div></em></a></li>' | ||
389 | + + ' </ul>' | ||
390 | + + '</div><br>' | ||
391 | + + '<div id=i3GEOlegendaguia6obj style="width:99%;text-align:left;">' | ||
392 | + + ' <p class=paragrafo > <input type=checkbox onclick="" checked id=i3GEOFlegendamostra style="cursor:pointer;border:0px solid white;" /> <span style="cursor:pointer;position:relative;top:-2px;">' | ||
393 | + + $trad('mostraClassesLegenda', i3GEOF.legenda.dicionario) | ||
394 | + + '</span></p>' | ||
395 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotao3 type="button" value="' | ||
396 | + + $trad('incluiNumeroOcorrencia', i3GEOF.legenda.dicionario) | ||
397 | + + '" title="' | ||
398 | + + $trad('incluiNumeroOcorrencia2', i3GEOF.legenda.dicionario) | ||
399 | + + '"></p>' | ||
400 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotao15 type="button" value="' | ||
401 | + + $trad('aplicaOpacidadeVariavel', i3GEOF.legenda.dicionario) | ||
402 | + + '" title="' | ||
403 | + + $trad('aplicaOpacidade', i3GEOF.legenda.dicionario) | ||
404 | + + '"></p>' | ||
405 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotaoRamp type="button" size=15 value="' | ||
406 | + + $trad('escolhePaletaCores', i3GEOF.legenda.dicionario) | ||
407 | + + '" title="' | ||
408 | + + $trad('variaCoresExtremos', i3GEOF.legenda.dicionario) | ||
409 | + + '"></p>' | ||
410 | + + ' <div style=margin-left:5px; >' | ||
411 | + + ' <p class=paragrafo >' | ||
412 | + + $trad('geraCores', i3GEOF.legenda.dicionario) | ||
413 | + + '</p>' | ||
414 | + + ' <table summary="" class=lista6 >' | ||
415 | + + ' <tr>' | ||
416 | + + ' <td>' | ||
417 | + + $trad('ate', i3GEOF.legenda.dicionario) | ||
418 | + + ':</td>' | ||
419 | + + ' <td>' | ||
420 | + + ' <div class=styled-select style="width:120px" >' | ||
421 | + + ' <input type=text id="i3GEOlegendaacori" value="0,0,0" />' | ||
422 | + + ' </div>' | ||
423 | + + ' </td>' | ||
424 | + + ' <td><img alt="aquarela.gif" style=cursor:pointer src="' | ||
425 | + + i3GEO.configura.locaplic | ||
426 | + + '/imagens/aquarela.gif" onclick="i3GEOF.legenda.corj(\'i3GEOlegendaacori\')" /> ' | ||
427 | + + ' </td>' | ||
428 | + + ' <td>' | ||
429 | + + $trad('de', i3GEOF.legenda.dicionario) | ||
430 | + + ':</td>' | ||
431 | + + ' <td>' | ||
432 | + + ' <div class=styled-select style="width:120px" >' | ||
433 | + + ' <input type=text id="i3GEOlegendaacorf" value="255,255,255" />' | ||
434 | + + ' </div>' | ||
435 | + + ' </td>' | ||
436 | + + ' <td><img alt="aquarela.gif" style=cursor:pointer src="' | ||
437 | + + i3GEO.configura.locaplic | ||
438 | + + '/imagens/aquarela.gif" onclick="i3GEOF.legenda.corj(\'i3GEOlegendaacorf\')" /> ' | ||
439 | + + ' </td>' | ||
440 | + + ' <td><input id=i3GEOlegendabotao4 type="button" size=15 value="' | ||
441 | + + $trad('aplica', i3GEOF.legenda.dicionario) | ||
442 | + + '" title="' | ||
443 | + + $trad('aplicaVariaCores', i3GEOF.legenda.dicionario) | ||
444 | + + '"></td>' | ||
445 | + + ' </tr>' | ||
446 | + + ' </table>' | ||
447 | + + '</div>' | ||
448 | + + '</div>' | ||
449 | + + '<div id=i3GEOlegendaguia1obj style="width:99%;text-align:left;">' | ||
450 | + + ' <div style=margin-left:5px; >' | ||
451 | + + ' <table summary="" class=lista5 ><tr>' | ||
452 | + + ' <td><input id=i3GEOlegendabotao1 size="22" type="button" value="' | ||
453 | + + $trad('aplicaAlteracao', i3GEOF.legenda.dicionario) | ||
454 | + + '" ></td>' | ||
455 | + + ' <td><input id=i3GEOlegendabotao2 size="22" type="button" value="' | ||
456 | + + $trad('adicionaClasse', i3GEOF.legenda.dicionario) | ||
457 | + + '" title="' | ||
458 | + + $trad('adicionaNovaClasse', i3GEOF.legenda.dicionario) | ||
459 | + + '" ></td>' | ||
460 | + + ' </tr></table><br>' | ||
461 | + + ' <p class=paragrafo >' | ||
462 | + + $trad('clicaSimbolo', i3GEOF.legenda.dicionario) | ||
463 | + + '</p>' | ||
464 | + + ' <div id="i3GEOlegendaresultado" style="text-align:left;width:100%;display:block;left:0px">' | ||
465 | + + ' </div>' | ||
466 | + + '</div>' | ||
467 | + + '</div>' | ||
468 | + + '<div id=i3GEOlegendaguia2obj style="width:99%;text-align:left;">' | ||
469 | + + ' <div style=margin-left:5px; >' | ||
470 | + + ' <div id=i3GEOFlegendaClassesOpcionais >' | ||
471 | + + ' <p class=paragrafo > <input type=checkbox onclick="" checked id=i3GEOFlegendaaplicaextent style="cursor:pointer;border:0px solid white;" /> <span style="cursor:pointer;position:relative;top:-2px;">' | ||
472 | + + $trad('consideraElementosVisisveis', i3GEOF.legenda.dicionario) | ||
473 | + + '</span></p>' | ||
474 | + + ' <p class=paragrafo >' | ||
475 | + + $trad('ignoraValores', i3GEOF.legenda.dicionario) | ||
476 | + + ':' | ||
477 | + + ' <div class=styled-select >' | ||
478 | + + ' <input type=text id="i3GEOlegendaignorar" value="" />' | ||
479 | + + ' </div>' | ||
480 | + + ' <hr><p class=paragrafo >' | ||
481 | + + $trad('transformaGeom', i3GEOF.legenda.dicionario) | ||
482 | + + '</p>' | ||
483 | + + ' <div class=styled-select >' | ||
484 | + + ' <select id=i3GEOlegentaTipoGeo >' | ||
485 | + + ' <option value="">' | ||
486 | + + $trad('semTransformacao', i3GEOF.legenda.dicionario) | ||
487 | + + '</option>' | ||
488 | + + ' <option value="centroid">' | ||
489 | + + $trad('centroide', i3GEOF.legenda.dicionario) | ||
490 | + + '</option>' | ||
491 | + + ' <option value="bbox">box</option>' | ||
492 | + + ' <option value="vertices">' | ||
493 | + + $trad('vertices', i3GEOF.legenda.dicionario) | ||
494 | + + '</option>' | ||
495 | + + ' <option value="start">' | ||
496 | + + $trad('verticeInicial', i3GEOF.legenda.dicionario) | ||
497 | + + '</option>' | ||
498 | + + ' <option value="end">' | ||
499 | + + $trad('verticeFinal', i3GEOF.legenda.dicionario) | ||
500 | + + '</option>' | ||
501 | + + ' </select>' | ||
502 | + + ' </div>' | ||
503 | + + ' <br><p class=paragrafo >' | ||
504 | + + ' <input id=i3GEOlegendabotao17 size="35" type="button" value="' | ||
505 | + + $trad('alteraGeom', i3GEOF.legenda.dicionario) | ||
506 | + + '"></p>' | ||
507 | + + ' <hr><p class=paragrafo >' | ||
508 | + + $trad('alteraTipoGeom', i3GEOF.legenda.dicionario) | ||
509 | + + '</p>' | ||
510 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotao7 size="25" type="button" value="' | ||
511 | + + $trad('alteraTipo', i3GEOF.legenda.dicionario) | ||
512 | + + '"></p>' | ||
513 | + + ' </div>' | ||
514 | + + ' <hr><p class=paragrafo >' | ||
515 | + + $trad('todosElementosUnicoSimbolo', i3GEOF.legenda.dicionario) | ||
516 | + + '</p>' | ||
517 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotao5 size="25" type="button" value="' | ||
518 | + + $trad('simboloUnico', i3GEOF.legenda.dicionario) | ||
519 | + + '"></p>' | ||
520 | + + ' <hr><p class=paragrafo >' | ||
521 | + + $trad('cadaOcorrenciaUnicoSimbolo', i3GEOF.legenda.dicionario) | ||
522 | + + '</p>' | ||
523 | + + ' <div id="i3GEOlegendaitens" class=styled-select ></div><br>' | ||
524 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotao6 size="25" type="button" value="' | ||
525 | + + $trad('valorUnico', i3GEOF.legenda.dicionario) | ||
526 | + + '"></p>' | ||
527 | + + ' <hr><p class=paragrafo >' | ||
528 | + + $trad('criaClassesItemNumerico', i3GEOF.legenda.dicionario) | ||
529 | + + '</p>' | ||
530 | + + ' <p class=paragrafo >' | ||
531 | + + $trad('numeroClasses', i3GEOF.legenda.dicionario) | ||
532 | + + ':' | ||
533 | + + ' <div class=styled-select >' | ||
534 | + + ' <input type=text id="i3GEOlegendanclasses" value="5" />' | ||
535 | + + ' </div>' | ||
536 | + + ' <br><p class=paragrafo ><input id=i3GEOlegendabotao8 size="25" type="button" value="' | ||
537 | + + $trad('intervalosIguais', i3GEOF.legenda.dicionario) | ||
538 | + + '">' | ||
539 | + + ' <input id=i3GEOlegendabotaoQN size="25" type="button" value="' | ||
540 | + + $trad('quebrasNaturais', i3GEOF.legenda.dicionario) | ||
541 | + + '">' | ||
542 | + + ' <input id=i3GEOlegendabotaoQuantil size="25" type="button" value="Quantil">' | ||
543 | + + ' <hr><p class=paragrafo >' | ||
544 | + + $trad('criaQuartis', i3GEOF.legenda.dicionario) | ||
545 | + + '</p>' | ||
546 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotao9 size="25" type="button" value="Quartis">' | ||
547 | + + ' <p class=paragrafo >' | ||
548 | + + $trad('estiloNomeClasses', i3GEOF.legenda.dicionario) | ||
549 | + + ': ' | ||
550 | + + ' <div class=styled-select >' | ||
551 | + + ' <select id=estiloClassesQuartis >' | ||
552 | + + ' <option value=minimo select >' | ||
553 | + + $trad('soValores', i3GEOF.legenda.dicionario) | ||
554 | + + '</option>' | ||
555 | + + ' <option value=simples select >' | ||
556 | + + $trad('quartilValores', i3GEOF.legenda.dicionario) | ||
557 | + + '</option>' | ||
558 | + + ' <option value=completo select >' | ||
559 | + + $trad('expressaoCompleta', i3GEOF.legenda.dicionario) | ||
560 | + + '</option>' | ||
561 | + + ' </select></div><br>' | ||
562 | + + '</div>' | ||
563 | + + '</div>' | ||
564 | + + '<div id=i3GEOlegendaguia3obj style="width:99%;text-align:left;">' | ||
565 | + + ' <fieldset style="padding:5px;margin:2px;">' | ||
566 | + + ' <legend>' | ||
567 | + + $trad('etiquetasClasse', i3GEOF.legenda.dicionario) | ||
568 | + + '</legend>' | ||
569 | + + ' <p class=paragrafo >' | ||
570 | + + $trad('itemComTexto', i3GEOF.legenda.dicionario) | ||
571 | + + ': <div class=styled-select id=i3GEOlegendaitensLabel ></div></p>' | ||
572 | + + ' <br><p class=paragrafo style="font-size:10px;">' | ||
573 | + + ' <input id=i3GEOlegendabotaoExcluirLabel size=10 type=buttom value="' | ||
574 | + + $trad('exclui', i3GEOF.legenda.dicionario) | ||
575 | + + '" />' | ||
576 | + + ' <input id=i3GEOlegendabotaoIncluirLabel size=10 type=buttom value="' | ||
577 | + + $trad('adiciona', i3GEOF.legenda.dicionario) | ||
578 | + + '" />' | ||
579 | + + ' <input id=i3GEOlegendabotaoPropriedadeLabel size=10 type=buttom value="' | ||
580 | + + $trad('propriedades2', i3GEOF.legenda.dicionario) | ||
581 | + + '" />' | ||
582 | + + ' </p>' | ||
583 | + + ' </fieldset><br>' | ||
584 | + + ' <fieldset style="padding:5px;margin:2px;">' | ||
585 | + + ' <legend>' | ||
586 | + + $trad('estilos', i3GEOF.legenda.dicionario) | ||
587 | + + '</legend>' | ||
588 | + + ' <p class=paragrafo style="font-size:10px;">' | ||
589 | + + $trad('ajudaEstilo', i3GEOF.legenda.dicionario) | ||
590 | + + '' | ||
591 | + + ' <div id="i3GEOlegendacomboestilos" >' | ||
592 | + + ' </div>' | ||
593 | + + " <br><input id=i3GEOlegendabotao11 class=executar size=10 type=button value='" | ||
594 | + + $trad('exclui', i3GEOF.legenda.dicionario) | ||
595 | + + "' />" | ||
596 | + + " <input id=i3GEOlegendabotao12 class=executar size=14 type=button value='" | ||
597 | + + $trad('adiciona', i3GEOF.legenda.dicionario) | ||
598 | + + "' />" | ||
599 | + + " <input id=i3GEOlegendabotao13 class=executar size=8 type=button value='" | ||
600 | + + $trad('sobe', i3GEOF.legenda.dicionario) | ||
601 | + + "' />" | ||
602 | + + " <input id=i3GEOlegendabotao14 class=executar size=8 type=button value='" | ||
603 | + + $trad('desce', i3GEOF.legenda.dicionario) | ||
604 | + + "' />" | ||
605 | + + ' <div id="i3GEOlegendaParametrosEstilos" style="position:relative;top:10px;left:0px;text-align:left">' | ||
606 | + + ' </div>' | ||
607 | + + ' <br><br><p class=paragrafo style="font-size:10px" ><input id=i3GEOlegendabotao10 size="35" type="button" value="' | ||
608 | + + $trad('aplicaAlteracoes', i3GEOF.legenda.dicionario) | ||
609 | + + '"></p>' | ||
610 | + + ' <div style="position:relative;top:0px;left:0px;text-align:left;" id="i3GEOlegendamostraEstilo">' | ||
611 | + + ' </div>' | ||
612 | + + ' <div style="position:relative;top:0px;left:0px;text-align:left;" id="i3GEOlegendasimbolos">' | ||
613 | + + ' </div>' | ||
614 | + + ' </fieldset>' | ||
615 | + + '</div>' | ||
616 | + + '<div id=i3GEOlegendaguia4obj style="width:99%;text-align:left;">' | ||
617 | + + '</div>' | ||
618 | + + '<div id=i3GEOlegendaguia5obj style="width:99%;text-align:left;">' | ||
619 | + + ' <p class=paragrafo >' | ||
620 | + + $trad('geraSLD', i3GEOF.legenda.dicionario) | ||
621 | + + ' <a href="http://mapserver.org/ogc/sld.html#sld" target=_blank >Mapserver SLD</a> ' | ||
622 | + + $trad('ajudaSLD', i3GEOF.legenda.dicionario) | ||
623 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotaoSLDe size="25" type="button" value="' | ||
624 | + + $trad('exportaSLD', i3GEOF.legenda.dicionario) | ||
625 | + + '"></p>' | ||
626 | + + ' <p class=paragrafo >' | ||
627 | + + $trad('msgAplicaSLD', i3GEOF.legenda.dicionario) | ||
628 | + + ' <p class=paragrafo ><input id=i3GEOlegendabotaoSLDi size="25" type="button" value="' | ||
629 | + + $trad('aplicaSLD', i3GEOF.legenda.dicionario) | ||
630 | + + '"></p>' | ||
631 | + + '</div>' | ||
632 | + + '<input type=hidden value="" id="listaColourRamp" onchange="javascript:i3GEOF.legenda.aplicaColourRamp()" />'; // utilizado | ||
633 | + // pelo | ||
634 | + // seletor | ||
635 | + // de | ||
636 | + // colourramp | ||
637 | + return ins; | ||
638 | + }, | ||
639 | + /* | ||
640 | + * Function: iniciaJanelaFlutuante | ||
641 | + * | ||
642 | + * Cria a janela flutuante para controle da ferramenta. | ||
643 | + */ | ||
644 | + iniciaJanelaFlutuante : function() { | ||
645 | + var minimiza, cabecalho, janela, divid, temp, titulo; | ||
646 | + if ($i("i3GEOF.legenda")) { | ||
647 | + i3GEOF.legenda.tema = i3GEO.temaAtivo; | ||
648 | + i3GEOF.legenda.inicia("i3GEOF.legenda_corpo"); | ||
649 | + return; | ||
650 | + } | ||
651 | + cabecalho = function() { | ||
652 | + i3GEOF.legenda.ativaFoco(); | ||
653 | + }; | ||
654 | + minimiza = function() { | ||
655 | + i3GEO.janela.minimiza("i3GEOF.legenda"); | ||
656 | + }; | ||
657 | + // cria a janela flutuante | ||
658 | + titulo = | ||
659 | + "<div id='i3GEOFlegendaComboCabeca' class='comboTemasCabecalho'> ------</div> " + $trad("t33") | ||
660 | + + " <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic | ||
661 | + + "/ajuda_usuario.php?idcategoria=5&idajuda=41' > </a>"; | ||
662 | + janela = | ||
663 | + i3GEO.janela.cria( | ||
664 | + "490px", | ||
665 | + "340px", | ||
666 | + "", | ||
667 | + "", | ||
668 | + "", | ||
669 | + titulo, | ||
670 | + "i3GEOF.legenda", | ||
671 | + false, | ||
672 | + "hd", | ||
673 | + cabecalho, | ||
674 | + minimiza, | ||
675 | + "", | ||
676 | + true, | ||
677 | + i3GEO.configura.locaplic + "/imagens/oxygen/16x16/format-list-unordered.png"); | ||
678 | + divid = janela[2].id; | ||
679 | + i3GEOF.legenda.aguarde = $i("i3GEOF.legenda_imagemCabecalho").style; | ||
680 | + $i("i3GEOF.legenda_corpo").style.backgroundColor = "white"; | ||
681 | + i3GEOF.legenda.inicia(divid); | ||
682 | + temp = | ||
683 | + function() { | ||
684 | + if (i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search( | ||
685 | + 'i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados")') > 0) { | ||
686 | + i3GEO.eventos.ATUALIZAARVORECAMADAS | ||
687 | + .remove('i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados")'); | ||
688 | + } | ||
689 | + }; | ||
690 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | ||
691 | + }, | ||
692 | + /* | ||
693 | + * Function: ativaFoco | ||
694 | + * | ||
695 | + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado | ||
696 | + */ | ||
697 | + ativaFoco : function() { | ||
698 | + if (i3GEOF.legenda.tema !== "" && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema) === "") { | ||
699 | + i3GEO.janela.tempoMsg($trad('temaInexistente', i3GEOF.legenda.dicionario)); | ||
700 | + } | ||
701 | + var i = $i("i3GEOF.legenda_c").style; | ||
702 | + i.zIndex = i3GEO.janela.ULTIMOZINDEX; | ||
703 | + i3GEO.janela.ULTIMOZINDEX++; | ||
704 | + }, | ||
705 | + /* | ||
706 | + * Function: aposAlterarLegenda | ||
707 | + * | ||
708 | + * Função executada após ocorrer alguma alteração efetiva da legenda do mapa | ||
709 | + */ | ||
710 | + aposAlterarLegenda : function() { | ||
711 | + i3GEO.atualiza(); | ||
712 | + i3GEO.Interface.atualizaTema("", i3GEOF.legenda.tema); | ||
713 | + i3GEO.arvoreDeCamadas.atualizaLegenda(i3GEOF.legenda.tema); | ||
714 | + i3GEO.mapa.legendaHTML.atualiza(); | ||
715 | + }, | ||
716 | + /* | ||
717 | + * Function: mostralegenda | ||
718 | + * | ||
719 | + * Pega os dados da legenda do mapa atual e mostra na tela | ||
720 | + * | ||
721 | + * Veja: | ||
722 | + * | ||
723 | + * <EDITALEGENDA> | ||
724 | + */ | ||
725 | + mostralegenda : function() { | ||
726 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
727 | + return; | ||
638 | } | 728 | } |
639 | - else | ||
640 | - {$i("i3GEOlegendaresultado").innerHTML = "<p style=color:red >Erro<br>";} | ||
641 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
642 | - } | ||
643 | - catch(e){i3GEO.janela.tempoMsg($trad('msgNaoEditaLegenda',i3GEOF.legenda.dicionario));i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
644 | - }, | ||
645 | - /* | ||
646 | - Function: aviso | ||
647 | - | ||
648 | - Mostra um i3GEO.janela.tempoMsga ao usuário quando um campo da tabela que contém os dados da legenda é alterado | ||
649 | - | ||
650 | - O aviso é mostrado apenas uma vez | ||
651 | - */ | ||
652 | - aviso: function(){ | ||
653 | - if(i3GEOF.legenda.aviso == true){ | ||
654 | - i3GEO.janela.tempoMsg($trad('msgAplicaAlteracao',i3GEOF.legenda.dicionario)); | ||
655 | - i3GEOF.legenda.aviso == false; | ||
656 | - } | ||
657 | - }, | ||
658 | - /* | ||
659 | - Function: aplicaColourRamp | ||
660 | - | ||
661 | - Aplica nas classes da legenda as cores escolhidas no seletor de cores | ||
662 | - */ | ||
663 | - aplicaColourRamp: function(){ | ||
664 | - if($i("listaColourRamp").value != ""){ | ||
665 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
666 | - {return;} | ||
667 | i3GEOF.legenda.aguarde.visibility = "visible"; | 729 | i3GEOF.legenda.aguarde.visibility = "visible"; |
668 | - var cores = $i("listaColourRamp").value, | ||
669 | - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), | ||
670 | - temp = function(){ | 730 | + var p, cp; |
731 | + p = | ||
732 | + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + i3GEO.configura.sid | ||
733 | + + "&funcao=editalegenda&opcao=edita&tema=" + i3GEOF.legenda.tema; | ||
734 | + cp = new cpaint(); | ||
735 | + cp.set_response_type("JSON"); | ||
736 | + cp.call(p, "tabelaLegenda", i3GEOF.legenda.montaLegenda); | ||
737 | + }, | ||
738 | + /* | ||
739 | + * Function: montaLegenda | ||
740 | + * | ||
741 | + * Formata a tabela de edição da legenda | ||
742 | + * | ||
743 | + * Parametro: | ||
744 | + * | ||
745 | + * retorno - objeto contendo os dados para formatação da legenda | ||
746 | + */ | ||
747 | + montaLegenda : function(retorno) { | ||
748 | + i3GEOF.legenda.aviso = false; | ||
749 | + try { | ||
750 | + if (retorno.data != undefined) { | ||
751 | + var ins, i, ajuda, id, re, exp, n; | ||
752 | + // se nao for do tipo raster | ||
753 | + if (retorno.data[0].proc === "") { | ||
754 | + ins = | ||
755 | + [ | ||
756 | + "<table class=lista4 id=i3GEOlegendalegenda ><tr>" | ||
757 | + + "<td><img src='" | ||
758 | + + i3GEO.configura.locaplic | ||
759 | + + "/imagens/inverter.png' title='Inverter cores' onclick='i3GEOF.legenda.inverteCores()' style=cursor:pointer /></td>" | ||
760 | + + "<td style=background-color:white ><img src='" | ||
761 | + + i3GEO.configura.locaplic | ||
762 | + + "/imagens/tamanho.png' title='Calcula tamanho' onclick='i3GEOF.legenda.calculaTamanho()' style=cursor:pointer /></td>" | ||
763 | + + "<td style=background-color:yellow ></td>" + "<td style=background-color:yellow >nome</td>" | ||
764 | + + "<td style=background-color:yellow >expressão</td>" | ||
765 | + + "<td style=background-color:yellow >minScale</td>" | ||
766 | + + "<td style=background-color:yellow >maxScale</td>" + "</tr>" | ||
767 | + ]; | ||
768 | + n = retorno.data.length; | ||
769 | + for (i = 0; i < n; i++) { | ||
770 | + id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; // layer+indice da classe | ||
771 | + re = new RegExp("'", "g"); | ||
772 | + exp = (retorno.data[i].expressao).replace(re, '"'); | ||
773 | + | ||
774 | + ins.push("<tr>"); | ||
775 | + ins.push("<td><img style='cursor:pointer' title='" + $trad('cliqueExclui', i3GEOF.legenda.dicionario) | ||
776 | + + "' onclick='i3GEOF.legenda.excluilinhaf(this)' src='" + i3GEO.configura.locaplic | ||
777 | + + "/imagens/x.gif' title='excluir' /></td>"); | ||
778 | + | ||
779 | + ins.push("<td><img width='30px' height='15px' style='cursor:pointer' title='" | ||
780 | + + $trad('cliqueAltera', i3GEOF.legenda.dicionario) + "' src='" + retorno.data[i].imagem | ||
781 | + + "' onclick=i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_" + id + "') /></td>"); | ||
782 | + | ||
783 | + ins.push("<td><img onclick=i3GEOF.legenda.modificaCor('" + retorno.data[i].idclasse | ||
784 | + + "') title='alterar a cor' style='cursor:pointer' src='" + i3GEO.configura.locaplic | ||
785 | + + "/imagens/aquarela.gif' /></td>"); | ||
786 | + | ||
787 | + ins.push("<td>" | ||
788 | + + $inputText( | ||
789 | + "", | ||
790 | + "", | ||
791 | + "i3GEOlegendaid_" + id, | ||
792 | + $trad('digitaNovoNome', i3GEOF.legenda.dicionario), | ||
793 | + 20, | ||
794 | + retorno.data[i].nomeclasse, | ||
795 | + "nome", | ||
796 | + "javascript:i3GEOF.legenda.aviso()") + "</td>"); | ||
797 | + | ||
798 | + ins.push("<td>" | ||
799 | + + $inputText( | ||
800 | + "", | ||
801 | + "", | ||
802 | + "i3GEOlegendaid_" + id, | ||
803 | + $trad('digitaNovaExpressao', i3GEOF.legenda.dicionario), | ||
804 | + 25, | ||
805 | + exp, | ||
806 | + "expressao", | ||
807 | + "javascript:i3GEOF.legenda.aviso()") + "</td>"); | ||
808 | + | ||
809 | + ins.push("<td>" | ||
810 | + + $inputText( | ||
811 | + "", | ||
812 | + "", | ||
813 | + "i3GEOlegendaid_" + id, | ||
814 | + $trad('minScale', i3GEOF.legenda.dicionario), | ||
815 | + 10, | ||
816 | + retorno.data[i].minScale, | ||
817 | + "minScale", | ||
818 | + "javascript:i3GEOF.legenda.aviso()") + "</td>"); | ||
819 | + | ||
820 | + ins.push("<td>" | ||
821 | + + $inputText( | ||
822 | + "", | ||
823 | + "", | ||
824 | + "i3GEOlegendaid_" + id, | ||
825 | + $trad('maxScale', i3GEOF.legenda.dicionario), | ||
826 | + 10, | ||
827 | + retorno.data[i].maxScale, | ||
828 | + "maxScale", | ||
829 | + "javascript:i3GEOF.legenda.aviso()") + "</td>"); | ||
830 | + | ||
831 | + if (n > 1) { | ||
832 | + ins.push("<td><img src='" + i3GEO.configura.locaplic + "/imagens/sobe1.png' style=cursor:pointer title='" | ||
833 | + + $trad('sobe', i3GEOF.legenda.dicionario) + "' onclick=i3GEOF.legenda.sobelinhaf('" | ||
834 | + + retorno.data[i].idclasse + "') /></td>"); | ||
835 | + | ||
836 | + ins.push("<td><img src='" + i3GEO.configura.locaplic + "/imagens/desce1.png' style=cursor:pointer title='" | ||
837 | + + $trad('desce', i3GEOF.legenda.dicionario) + "' onclick=i3GEOF.legenda.descelinhaf('" | ||
838 | + + retorno.data[i].idclasse + "') /></td>"); | ||
839 | + } | ||
840 | + ins.push("</tr>"); | ||
841 | + } | ||
842 | + ins.push("</table><br>"); | ||
843 | + $i("i3GEOlegendaresultado").innerHTML = ins.join(""); | ||
844 | + } else { | ||
845 | + ajuda = | ||
846 | + "<br><p class=paragrafo >" + $trad('ajudaEscalaCores', i3GEOF.legenda.dicionario) + "<p class=paragrafo >" | ||
847 | + + $trad('msgEscalaCoresAuto', i3GEOF.legenda.dicionario) + "<p class=paragrafo >" | ||
848 | + + $trad('msgEscalaCoresIndividual', i3GEOF.legenda.dicionario) + "<p class=paragrafo >" | ||
849 | + + $trad('msgBandas', i3GEOF.legenda.dicionario) + "<p class=paragrafo >" | ||
850 | + + $trad('msgReamostragem', i3GEOF.legenda.dicionario); | ||
851 | + ins = | ||
852 | + "<p class=paragrafo >" + $trad('adicionaProcesso', i3GEOF.legenda.dicionario) + ":" | ||
853 | + + "<select onchange=i3GEOF.legenda.adicionaProcesso(this) >" + "<option value='' >" | ||
854 | + + $trad('selecionaProcesso', i3GEOF.legenda.dicionario) + "</option>" + "<option value='SCALE=' >" | ||
855 | + + $trad('escalaCores', i3GEOF.legenda.dicionario) + "</option>" + "<option value='RESAMPLE=' >" | ||
856 | + + $trad('reamostragem', i3GEOF.legenda.dicionario) + "</option>" + "<option value='BANDS=' >" | ||
857 | + + $trad('bandas', i3GEOF.legenda.dicionario) + "</option>" | ||
858 | + + "<option value='COLOR_MATCH_THRESHOLD=' >Threshold</option>" + "<option value='NODATA=' >Nodata</option>" | ||
859 | + + "</select><br>" | ||
860 | + + '<p class=paragrafo ><input id=i3GEOlegendabotao16 class="executar" size="22" type="buttom" value="' | ||
861 | + + $trad('aplicaProcesso', i3GEOF.legenda.dicionario) + '">'; | ||
862 | + if (retorno.data[0].proc == "") { | ||
863 | + ins += "<div style=width:80% id=i3GEOlegendaprocessos ></div>"; | ||
864 | + } else { | ||
865 | + ins += "<div style='width:80%;text-align:left;' id=i3GEOlegendaprocessos >"; | ||
866 | + for (i = 0; i < retorno.data[0].proc.length; i++) { | ||
867 | + ins += "<br>" + $inputText("", "", "", "", 50, retorno.data[0].proc[i]); | ||
868 | + } | ||
869 | + ins += "</div>"; | ||
870 | + } | ||
871 | + $i("i3GEOlegendaresultado").innerHTML = ins + ajuda; | ||
872 | + new YAHOO.widget.Button("i3GEOlegendabotao16", { | ||
873 | + onclick : { | ||
874 | + fn : i3GEOF.legenda.aplicaProcessos | ||
875 | + } | ||
876 | + }); | ||
877 | + } | ||
878 | + } else { | ||
879 | + $i("i3GEOlegendaresultado").innerHTML = "<p style=color:red >Erro<br>"; | ||
880 | + } | ||
881 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
882 | + } catch (e) { | ||
883 | + i3GEO.janela.tempoMsg($trad('msgNaoEditaLegenda', i3GEOF.legenda.dicionario)); | ||
884 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
885 | + } | ||
886 | + }, | ||
887 | + /* | ||
888 | + * Function: aviso | ||
889 | + * | ||
890 | + * Mostra um i3GEO.janela.tempoMsga ao usuário quando um campo da tabela que contém os dados da legenda é | ||
891 | + * alterado | ||
892 | + * | ||
893 | + * O aviso é mostrado apenas uma vez | ||
894 | + */ | ||
895 | + aviso : function() { | ||
896 | + if (i3GEOF.legenda.aviso == true) { | ||
897 | + i3GEO.janela.tempoMsg($trad('msgAplicaAlteracao', i3GEOF.legenda.dicionario)); | ||
898 | + i3GEOF.legenda.aviso == false; | ||
899 | + } | ||
900 | + }, | ||
901 | + /* | ||
902 | + * Function: aplicaColourRamp | ||
903 | + * | ||
904 | + * Aplica nas classes da legenda as cores escolhidas no seletor de cores | ||
905 | + */ | ||
906 | + aplicaColourRamp : function() { | ||
907 | + if ($i("listaColourRamp").value != "") { | ||
908 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
909 | + return; | ||
910 | + } | ||
911 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
912 | + var cores = $i("listaColourRamp").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), temp = function() { | ||
671 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 913 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
672 | i3GEOF.legenda.mostralegenda(); | 914 | i3GEOF.legenda.mostralegenda(); |
673 | i3GEOF.legenda.aposAlterarLegenda(); | 915 | i3GEOF.legenda.aposAlterarLegenda(); |
674 | - }, | ||
675 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=aplicacoresrgb&ext="+ext+"&tema="+i3GEOF.legenda.tema, | ||
676 | - cp = new cpaint(); | ||
677 | - cp.set_transfer_mode('POST'); | ||
678 | - cp.set_response_type("JSON"); | ||
679 | - cp.call(p,"foo",temp,"cores="+cores); | ||
680 | - } | ||
681 | - }, | ||
682 | - /* | ||
683 | - Function: corj | ||
684 | - | ||
685 | - Abre a janela para o usuário selecionar uma cor interativamente | ||
686 | - */ | ||
687 | - corj: function(obj) | ||
688 | - {i3GEO.util.abreCor("",obj);}, | ||
689 | - /* | ||
690 | - Function: modificaCor | ||
691 | - | ||
692 | - Modifica a cor de uma classe | ||
693 | - */ | ||
694 | - modificaCor: function(id){ | ||
695 | - var obj = $i("tempCorLegenda"); | ||
696 | - if(!obj){ | ||
697 | - var obj = document.createElement("input"); | ||
698 | - obj.id = "tempCorLegenda"; | ||
699 | - obj.style.display = "none"; | ||
700 | - obj.type = "text"; | ||
701 | - obj.value = ""; | ||
702 | - document.body.appendChild(obj); | ||
703 | - obj.onchange = function(){ | ||
704 | - i3GEOF.legenda.aplicaNovaCor($i("tempCorLegenda").name); | 916 | + }, p = |
917 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
918 | + + "&funcao=alteraclasse&opcao=aplicacoresrgb&ext=" + ext + "&tema=" + i3GEOF.legenda.tema, cp = new cpaint(); | ||
919 | + cp.set_transfer_mode('POST'); | ||
920 | + cp.set_response_type("JSON"); | ||
921 | + cp.call(p, "foo", temp, "cores=" + cores); | ||
922 | + } | ||
923 | + }, | ||
924 | + /* | ||
925 | + * Function: corj | ||
926 | + * | ||
927 | + * Abre a janela para o usuário selecionar uma cor interativamente | ||
928 | + */ | ||
929 | + corj : function(obj) { | ||
930 | + i3GEO.util.abreCor("", obj); | ||
931 | + }, | ||
932 | + /* | ||
933 | + * Function: modificaCor | ||
934 | + * | ||
935 | + * Modifica a cor de uma classe | ||
936 | + */ | ||
937 | + modificaCor : function(id) { | ||
938 | + var obj = $i("tempCorLegenda"); | ||
939 | + if (!obj) { | ||
940 | + var obj = document.createElement("input"); | ||
941 | + obj.id = "tempCorLegenda"; | ||
942 | + obj.style.display = "none"; | ||
943 | + obj.type = "text"; | ||
944 | + obj.value = ""; | ||
945 | + document.body.appendChild(obj); | ||
946 | + obj.onchange = function() { | ||
947 | + i3GEOF.legenda.aplicaNovaCor($i("tempCorLegenda").name); | ||
948 | + }; | ||
949 | + } | ||
950 | + obj.name = id; | ||
951 | + i3GEO.util.abreCor("", "tempCorLegenda"); | ||
952 | + }, | ||
953 | + aplicaNovaCor : function(id) { | ||
954 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
955 | + return; | ||
956 | + } | ||
957 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
958 | + var retorna = function() { | ||
959 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
960 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
961 | + i3GEOF.legenda.mostralegenda(); | ||
705 | }; | 962 | }; |
706 | - } | ||
707 | - obj.name = id; | ||
708 | - i3GEO.util.abreCor("","tempCorLegenda"); | ||
709 | - }, | ||
710 | - aplicaNovaCor: function(id){ | ||
711 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
712 | - {return;} | ||
713 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
714 | - var retorna = function(){ | ||
715 | - i3GEOF.legenda.aposAlterarLegenda(); | ||
716 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
717 | - i3GEOF.legenda.mostralegenda(); | ||
718 | - }; | ||
719 | - i3GEO.php.aplicaCorClasseTema(retorna,i3GEOF.legenda.tema,id,$i("tempCorLegenda").value); | ||
720 | - }, | ||
721 | - /* | ||
722 | - Function: mudaLegenda | ||
723 | - | ||
724 | - Altera a legenda conforme os valores existentes na tabela de propriedades (expressão e nome da classe) | ||
725 | - | ||
726 | - Veja: | ||
727 | - | ||
728 | - <ALTERACLASSE> | ||
729 | - */ | ||
730 | - mudaLegenda: function(){ | ||
731 | - i3GEOF.legenda.aviso = false; | ||
732 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
733 | - {return;} | ||
734 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
735 | - try{ | ||
736 | - var tabela = $i("i3GEOlegendalegenda"), | ||
737 | - trs = tabela.getElementsByTagName("tr"), | ||
738 | - nomes = [], | ||
739 | - exps = [], | ||
740 | - ids = [], | ||
741 | - t, | ||
742 | - nn, | ||
743 | - n, | ||
744 | - p, | ||
745 | - cp, | ||
746 | - temp; | ||
747 | - //expn, | ||
748 | - //re = new RegExp('"', "g"); | ||
749 | - for (t=0;t<trs.length;t++){ | ||
750 | - if(trs[t].childNodes){ | ||
751 | - nn = trs[t].childNodes; | ||
752 | - for (n=0;n<nn.length;n++){ | ||
753 | - if(nn[n].childNodes){ | ||
754 | - var isn = nn[n].getElementsByTagName("input"); | ||
755 | - if (isn[0] != undefined){ | ||
756 | - if(isn[0].name == "nome"){ | ||
757 | - nomes.push(isn[0].value); | ||
758 | - temp = (isn[0].id).split("i3GEOlegendaid_"); | ||
759 | - ids.push(temp[1]); | ||
760 | - } | ||
761 | - if(isn[0].name == "expressao"){ | ||
762 | - //expn = (isn[0].value).replace(re,'##'); | ||
763 | - exps.push(isn[0].value); | 963 | + i3GEO.php.aplicaCorClasseTema(retorna, i3GEOF.legenda.tema, id, $i("tempCorLegenda").value); |
964 | + }, | ||
965 | + /* | ||
966 | + * Function: mudaLegenda | ||
967 | + * | ||
968 | + * Altera a legenda conforme os valores existentes na tabela de propriedades (expressão e nome da classe) | ||
969 | + * | ||
970 | + * Veja: | ||
971 | + * | ||
972 | + * <ALTERACLASSE> | ||
973 | + */ | ||
974 | + mudaLegenda : function() { | ||
975 | + i3GEOF.legenda.aviso = false; | ||
976 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
977 | + return; | ||
978 | + } | ||
979 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
980 | + try { | ||
981 | + var tabela = $i("i3GEOlegendalegenda"), trs = tabela.getElementsByTagName("tr"), minScales = [], maxScales = [], nomes = [], exps = [], ids = [], t, nn, n, p, cp, temp; | ||
982 | + // expn, | ||
983 | + // re = new RegExp('"', "g"); | ||
984 | + for (t = 0; t < trs.length; t++) { | ||
985 | + if (trs[t].childNodes) { | ||
986 | + nn = trs[t].childNodes; | ||
987 | + for (n = 0; n < nn.length; n++) { | ||
988 | + if (nn[n].childNodes) { | ||
989 | + var isn = nn[n].getElementsByTagName("input"); | ||
990 | + if (isn[0] != undefined) { | ||
991 | + if (isn[0].name == "nome") { | ||
992 | + nomes.push(isn[0].value); | ||
993 | + temp = (isn[0].id).split("i3GEOlegendaid_"); | ||
994 | + ids.push(temp[1]); | ||
995 | + } | ||
996 | + if (isn[0].name == "expressao") { | ||
997 | + exps.push(isn[0].value); | ||
998 | + } | ||
999 | + if (isn[0].name == "minScale") { | ||
1000 | + minScales.push(parseInt(isn[0].value,10)); | ||
1001 | + } | ||
1002 | + if (isn[0].name == "maxScale") { | ||
1003 | + maxScales.push(parseInt(isn[0].value,10)); | ||
1004 | + } | ||
764 | } | 1005 | } |
765 | } | 1006 | } |
766 | } | 1007 | } |
767 | } | 1008 | } |
768 | } | 1009 | } |
1010 | + ids = ids.join(";"); | ||
1011 | + nomes = nomes.join(";"); | ||
1012 | + exps = exps.join(";"); | ||
1013 | + minScales = minScales.join(";"); | ||
1014 | + maxScales = maxScales.join(";"); | ||
1015 | + temp = function() { | ||
1016 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1017 | + i3GEOF.legenda.mostralegenda(); | ||
1018 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
1019 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1020 | + }; | ||
1021 | + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | ||
1022 | + p = | ||
1023 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?" + "base64=sim" + "&g_sid=" + i3GEO.configura.sid | ||
1024 | + + "&funcao=alteraclasse" + "&opcao=alteraclasses" + "&ext=" + ext; | ||
1025 | + cp = new cpaint(); | ||
1026 | + cp.set_transfer_mode('POST'); | ||
1027 | + cp.set_response_type("JSON"); | ||
1028 | + cp.call(p, "alteraclassesPost", temp, "ids=" + i3GEO.util.base64encode(ids) + "&nomes=" + i3GEO.util.base64encode(nomes) | ||
1029 | + + "&exps=" + i3GEO.util.base64encode(exps) + "&minScales=" + minScales + "&maxScales=" + maxScales); | ||
1030 | + } catch (e) { | ||
1031 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1032 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1033 | + } | ||
1034 | + }, | ||
1035 | + /* | ||
1036 | + * Function: alteraGeometria | ||
1037 | + * | ||
1038 | + * Altera o tipo de representação geométrica dos elementos de um layer | ||
1039 | + * | ||
1040 | + * Veja: | ||
1041 | + * | ||
1042 | + * <ALTERACLASSE> | ||
1043 | + */ | ||
1044 | + alteraGeometriaTema : function() { | ||
1045 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1046 | + return; | ||
769 | } | 1047 | } |
770 | - ids = ids.join(";"); | ||
771 | - nomes = nomes.join(";"); | ||
772 | - exps = exps.join(";"); | ||
773 | - temp = function(){ | 1048 | + i3GEOF.legenda.aguarde.visibility = "visible"; |
1049 | + var retorna = function() { | ||
1050 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
774 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1051 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
775 | i3GEOF.legenda.mostralegenda(); | 1052 | i3GEOF.legenda.mostralegenda(); |
1053 | + }; | ||
1054 | + var p = | ||
1055 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1056 | + + "&funcao=alteraclasse&opcao=alterageometria&tema=" + i3GEOF.legenda.tema + "&tipo=" + $i("i3GEOlegentaTipoGeo").value, cp = | ||
1057 | + new cpaint(); | ||
1058 | + cp.set_response_type("JSON"); | ||
1059 | + cp.call(p, "", retorna); | ||
1060 | + }, | ||
1061 | + /* | ||
1062 | + * Function: adicionaConta | ||
1063 | + * | ||
1064 | + * Adiciona ao nome de cada classe o número de ocorrências em cada uma | ||
1065 | + * | ||
1066 | + * Veja: | ||
1067 | + * | ||
1068 | + * <CONTAGEMCLASSE> | ||
1069 | + */ | ||
1070 | + adicionaConta : function() { | ||
1071 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1072 | + return; | ||
1073 | + } | ||
1074 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1075 | + var p = | ||
1076 | + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + i3GEO.configura.sid + "&funcao=contagemclasse" | ||
1077 | + + "&tema=" + i3GEOF.legenda.tema, cp = new cpaint(); | ||
1078 | + cp.set_response_type("JSON"); | ||
1079 | + cp.call(p, "contagemclasse", i3GEOF.legenda.montaLegenda); | ||
1080 | + i3GEO.janela.tempoMsg($trad('consideraElementosVisiveis', i3GEOF.legenda.dicionario)); | ||
1081 | + }, | ||
1082 | + /* | ||
1083 | + * Function: adicionaClasse | ||
1084 | + * | ||
1085 | + * Adiciona uma nova classe ao tema | ||
1086 | + * | ||
1087 | + * Veja: | ||
1088 | + * | ||
1089 | + * <ALTERACLASSE> | ||
1090 | + */ | ||
1091 | + adicionaClasse : function() { | ||
1092 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1093 | + return; | ||
1094 | + } | ||
1095 | + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | ||
1096 | + var p = | ||
1097 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1098 | + + "&funcao=alteraclasse&opcao=adicionaclasse" + "&tema=" + i3GEOF.legenda.tema + "&ext=" + ext, cp = new cpaint(); | ||
1099 | + cp.set_response_type("JSON"); | ||
1100 | + cp.call(p, "alteraclasse", i3GEOF.legenda.mostralegenda); | ||
1101 | + }, | ||
1102 | + /* | ||
1103 | + * Function: adicionaOpacidade | ||
1104 | + * | ||
1105 | + * Adiciona opacidade variável em cada classe | ||
1106 | + * | ||
1107 | + * Veja: | ||
1108 | + * | ||
1109 | + * <ALTERACLASSE> | ||
1110 | + */ | ||
1111 | + adicionaOpacidade : function() { | ||
1112 | + var retorna = function() { | ||
776 | i3GEOF.legenda.aposAlterarLegenda(); | 1113 | i3GEOF.legenda.aposAlterarLegenda(); |
777 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1114 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1115 | + i3GEOF.legenda.mostralegenda(); | ||
778 | }; | 1116 | }; |
1117 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1118 | + return; | ||
1119 | + } | ||
779 | var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | 1120 | var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); |
780 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?" + | ||
781 | - "base64=sim" + | ||
782 | - "&g_sid="+i3GEO.configura.sid+ | ||
783 | - "&funcao=alteraclasse" + | ||
784 | - "&opcao=alteraclasses" + | ||
785 | - "&ext="+ext; | ||
786 | - cp = new cpaint(); | ||
787 | - cp.set_transfer_mode('POST'); | 1121 | + var p = |
1122 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1123 | + + "&funcao=alteraclasse&opcao=adicionaopacidade" + "&tema=" + i3GEOF.legenda.tema + "&ext=" + ext, cp = new cpaint(); | ||
788 | cp.set_response_type("JSON"); | 1124 | cp.set_response_type("JSON"); |
789 | - cp.call( | ||
790 | - p, | ||
791 | - "alteraclassesPost", | ||
792 | - temp, | ||
793 | - "ids="+i3GEO.util.base64encode(ids)+ | ||
794 | - "&nomes="+i3GEO.util.base64encode(nomes)+ | ||
795 | - "&exps="+i3GEO.util.base64encode(exps) | ||
796 | - ); | ||
797 | - } | ||
798 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
799 | - }, | ||
800 | - /* | ||
801 | - Function: alteraGeometria | ||
802 | - | ||
803 | - Altera o tipo de representação geométrica dos elementos de um layer | ||
804 | - | ||
805 | - Veja: | ||
806 | - | ||
807 | - <ALTERACLASSE> | ||
808 | - */ | ||
809 | - alteraGeometriaTema: function(){ | ||
810 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
811 | - {return;} | ||
812 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
813 | - var retorna = function(){ | ||
814 | - i3GEOF.legenda.aposAlterarLegenda(); | ||
815 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
816 | - i3GEOF.legenda.mostralegenda(); | ||
817 | - }; | ||
818 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=alterageometria&tema="+i3GEOF.legenda.tema+"&tipo="+$i("i3GEOlegentaTipoGeo").value, | ||
819 | - cp = new cpaint(); | ||
820 | - cp.set_response_type("JSON"); | ||
821 | - cp.call(p,"",retorna); | ||
822 | - }, | ||
823 | - /* | ||
824 | - Function: adicionaConta | ||
825 | - | ||
826 | - Adiciona ao nome de cada classe o número de ocorrências em cada uma | ||
827 | - | ||
828 | - Veja: | ||
829 | - | ||
830 | - <CONTAGEMCLASSE> | ||
831 | - */ | ||
832 | - adicionaConta: function(){ | ||
833 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
834 | - {return;} | ||
835 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
836 | - var p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=contagemclasse"+"&tema="+i3GEOF.legenda.tema, | ||
837 | - cp = new cpaint(); | ||
838 | - cp.set_response_type("JSON"); | ||
839 | - cp.call(p,"contagemclasse",i3GEOF.legenda.montaLegenda); | ||
840 | - i3GEO.janela.tempoMsg($trad('consideraElementosVisiveis',i3GEOF.legenda.dicionario)); | ||
841 | - }, | ||
842 | - /* | ||
843 | - Function: adicionaClasse | ||
844 | - | ||
845 | - Adiciona uma nova classe ao tema | ||
846 | - | ||
847 | - Veja: | ||
848 | - | ||
849 | - <ALTERACLASSE> | ||
850 | - */ | ||
851 | - adicionaClasse: function(){ | ||
852 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
853 | - {return;} | ||
854 | - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | ||
855 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=adicionaclasse"+"&tema="+i3GEOF.legenda.tema+"&ext="+ext, | ||
856 | - cp = new cpaint(); | ||
857 | - cp.set_response_type("JSON"); | ||
858 | - cp.call(p,"alteraclasse",i3GEOF.legenda.mostralegenda); | ||
859 | - }, | ||
860 | - /* | ||
861 | - Function: adicionaOpacidade | ||
862 | - | ||
863 | - Adiciona opacidade variável em cada classe | ||
864 | - | ||
865 | - Veja: | ||
866 | - | ||
867 | - <ALTERACLASSE> | ||
868 | - */ | ||
869 | - adicionaOpacidade: function(){ | ||
870 | - var retorna = function(){ | ||
871 | - i3GEOF.legenda.aposAlterarLegenda(); | ||
872 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
873 | - i3GEOF.legenda.mostralegenda(); | ||
874 | - }; | ||
875 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
876 | - {return;} | ||
877 | - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | ||
878 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=adicionaopacidade"+"&tema="+i3GEOF.legenda.tema+"&ext="+ext, | ||
879 | - cp = new cpaint(); | ||
880 | - cp.set_response_type("JSON"); | ||
881 | - cp.call(p,"alteraclasse",retorna); | ||
882 | - }, | ||
883 | - /* | ||
884 | - Function: paleta | ||
885 | - | ||
886 | - Gera as cores para as classes considerando um RGB inicial e um final | ||
887 | - | ||
888 | - Veja: | ||
889 | - | ||
890 | - <ALTERACORESCLASSES> | ||
891 | - */ | ||
892 | - paleta: function(){ | ||
893 | - try{ | ||
894 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
895 | - {return;} | ||
896 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
897 | - var retornapaleta = function(){ | 1125 | + cp.call(p, "alteraclasse", retorna); |
1126 | + }, | ||
1127 | + /* | ||
1128 | + * Function: paleta | ||
1129 | + * | ||
1130 | + * Gera as cores para as classes considerando um RGB inicial e um final | ||
1131 | + * | ||
1132 | + * Veja: | ||
1133 | + * | ||
1134 | + * <ALTERACORESCLASSES> | ||
1135 | + */ | ||
1136 | + paleta : function() { | ||
1137 | + try { | ||
1138 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1139 | + return; | ||
1140 | + } | ||
1141 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1142 | + var retornapaleta = function() { | ||
898 | i3GEOF.legenda.aposAlterarLegenda(); | 1143 | i3GEOF.legenda.aposAlterarLegenda(); |
899 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1144 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
900 | i3GEOF.legenda.mostralegenda(); | 1145 | i3GEOF.legenda.mostralegenda(); |
901 | - }, | ||
902 | - ci = $i("i3GEOlegendaacori").value, | ||
903 | - cf = $i("i3GEOlegendaacorf").value, | ||
904 | - cp = new cpaint(), | ||
905 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraCoresClasses&tema="+i3GEOF.legenda.tema+"&cori="+ci+"&corf="+cf; | ||
906 | - cp.set_response_type("JSON"); | ||
907 | - cp.call(p,"alteraCoresClasses",retornapaleta); | ||
908 | - } | ||
909 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
910 | - }, | ||
911 | - /* | ||
912 | - Function: inverteCores | ||
913 | - | ||
914 | - Inverte as cores utilizadas nos símbolos das classes | ||
915 | - | ||
916 | - Veja: | ||
917 | - | ||
918 | - <INVERTECORESCLASSES> | ||
919 | - */ | ||
920 | - inverteCores: function(){ | ||
921 | - try{ | ||
922 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
923 | - {return;} | ||
924 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
925 | - var retornapaleta = function(){ | 1146 | + }, ci = $i("i3GEOlegendaacori").value, cf = $i("i3GEOlegendaacorf").value, cp = new cpaint(), p = |
1147 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1148 | + + "&funcao=alteraCoresClasses&tema=" + i3GEOF.legenda.tema + "&cori=" + ci + "&corf=" + cf; | ||
1149 | + cp.set_response_type("JSON"); | ||
1150 | + cp.call(p, "alteraCoresClasses", retornapaleta); | ||
1151 | + } catch (e) { | ||
1152 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1153 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1154 | + } | ||
1155 | + }, | ||
1156 | + /* | ||
1157 | + * Function: inverteCores | ||
1158 | + * | ||
1159 | + * Inverte as cores utilizadas nos símbolos das classes | ||
1160 | + * | ||
1161 | + * Veja: | ||
1162 | + * | ||
1163 | + * <INVERTECORESCLASSES> | ||
1164 | + */ | ||
1165 | + inverteCores : function() { | ||
1166 | + try { | ||
1167 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1168 | + return; | ||
1169 | + } | ||
1170 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1171 | + var retornapaleta = function() { | ||
926 | i3GEOF.legenda.aposAlterarLegenda(); | 1172 | i3GEOF.legenda.aposAlterarLegenda(); |
927 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1173 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
928 | i3GEOF.legenda.mostralegenda(); | 1174 | i3GEOF.legenda.mostralegenda(); |
929 | - }, | ||
930 | - cp = new cpaint(), | ||
931 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=inverteCoresClasses&tema="+i3GEOF.legenda.tema; | ||
932 | - cp.set_response_type("JSON"); | ||
933 | - cp.call(p,"alteraCoresClasses",retornapaleta); | ||
934 | - } | ||
935 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
936 | - }, | ||
937 | - /* | ||
938 | - Function: calculaTamanho | ||
939 | - | ||
940 | - Muda o símbolo de cada classe aplicando tamanhos diferentes e lineares | ||
941 | - | ||
942 | - Veja: | ||
943 | - | ||
944 | - <CALCULATAMANHOCLASSES> | ||
945 | - */ | ||
946 | - calculaTamanho: function(){ | ||
947 | - try{ | ||
948 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
949 | - {return;} | ||
950 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
951 | - var retornapaleta = function(){ | 1175 | + }, cp = new cpaint(), p = |
1176 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1177 | + + "&funcao=inverteCoresClasses&tema=" + i3GEOF.legenda.tema; | ||
1178 | + cp.set_response_type("JSON"); | ||
1179 | + cp.call(p, "alteraCoresClasses", retornapaleta); | ||
1180 | + } catch (e) { | ||
1181 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1182 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1183 | + } | ||
1184 | + }, | ||
1185 | + /* | ||
1186 | + * Function: calculaTamanho | ||
1187 | + * | ||
1188 | + * Muda o símbolo de cada classe aplicando tamanhos diferentes e lineares | ||
1189 | + * | ||
1190 | + * Veja: | ||
1191 | + * | ||
1192 | + * <CALCULATAMANHOCLASSES> | ||
1193 | + */ | ||
1194 | + calculaTamanho : function() { | ||
1195 | + try { | ||
1196 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1197 | + return; | ||
1198 | + } | ||
1199 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1200 | + var retornapaleta = function() { | ||
952 | i3GEOF.legenda.aposAlterarLegenda(); | 1201 | i3GEOF.legenda.aposAlterarLegenda(); |
953 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1202 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
954 | i3GEOF.legenda.mostralegenda(); | 1203 | i3GEOF.legenda.mostralegenda(); |
955 | - }, | ||
956 | - cp = new cpaint(), | ||
957 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=calculaTamanhoClasses&tema="+i3GEOF.legenda.tema; | ||
958 | - cp.set_response_type("JSON"); | ||
959 | - cp.call(p,"calculaTamanhoClasses",retornapaleta); | ||
960 | - } | ||
961 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
962 | - }, | ||
963 | - /* | ||
964 | - Function: excluilinhaf | ||
965 | - | ||
966 | - Exclui uma linha da tabela de edição de classes da legendda | ||
967 | - */ | ||
968 | - excluilinhaf: function(celula){ | ||
969 | - var p = celula.parentNode.parentNode; | ||
970 | - do{ | ||
971 | - p.removeChild(p.childNodes[0]); | ||
972 | - } while (p.childNodes.length > 0); | ||
973 | - p.parentNode.removeChild(p); | ||
974 | - i3GEOF.legenda.mudaLegenda(); | ||
975 | - }, | ||
976 | - /* | ||
977 | - Function: sobelinhaf | ||
978 | - | ||
979 | - Sobe uma linha na tabela de edição de classes da legendda | ||
980 | - */ | ||
981 | - sobelinhaf: function(idclasse){ | ||
982 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
983 | - {return;} | ||
984 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
985 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=ALTERACLASSE&opcao=sobeclasse&tema="+i3GEOF.legenda.tema+"&idclasse="+idclasse, | ||
986 | - cp = new cpaint(), | ||
987 | - temp = function(){ | 1204 | + }, cp = new cpaint(), p = |
1205 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1206 | + + "&funcao=calculaTamanhoClasses&tema=" + i3GEOF.legenda.tema; | ||
1207 | + cp.set_response_type("JSON"); | ||
1208 | + cp.call(p, "calculaTamanhoClasses", retornapaleta); | ||
1209 | + } catch (e) { | ||
1210 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
988 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1211 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
989 | - i3GEOF.legenda.mostralegenda(); | ||
990 | - }; | ||
991 | - cp.set_response_type("JSON"); | ||
992 | - cp.call(p,"foo",temp); | ||
993 | - }, | ||
994 | - /* | ||
995 | - Function: descelinhaf | ||
996 | - | ||
997 | - Desce uma linha na tabela de edição de classes da legendda | ||
998 | - */ | ||
999 | - descelinhaf: function(idclasse){ | ||
1000 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1001 | - {return;} | ||
1002 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1003 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=ALTERACLASSE&opcao=desceclasse&tema="+i3GEOF.legenda.tema+"&idclasse="+idclasse, | ||
1004 | - cp = new cpaint(), | ||
1005 | - temp = function(){ | ||
1006 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1007 | - i3GEOF.legenda.mostralegenda(); | ||
1008 | - };; | ||
1009 | - cp.set_response_type("JSON"); | ||
1010 | - cp.call(p,"foo",temp); | ||
1011 | - }, | ||
1012 | - /* | ||
1013 | - Function: editaSimbolo | ||
1014 | - | ||
1015 | - Abre o editor de símbolos | ||
1016 | - | ||
1017 | - Veja: | ||
1018 | - | ||
1019 | - <EDITASIMBOLO> | ||
1020 | - */ | ||
1021 | - editaSimbolo: function(id){ | ||
1022 | - try{ | ||
1023 | - $i("i3GEOlegendaguia1obj").style.display="none"; | ||
1024 | - $i("i3GEOlegendaguia3obj").style.display="block"; | ||
1025 | - id = id.split("-"); | ||
1026 | - i3GEOF.legenda.classe = id[1]; | ||
1027 | - i3GEOF.legenda.estilo = 0; | ||
1028 | - i3GEOF.legenda.formEditorSimbolo(); | ||
1029 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1030 | - } | ||
1031 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1032 | - }, | ||
1033 | - formEditorSimbolo: function(){ | ||
1034 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=pegaparametros&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe, | ||
1035 | - cp = new cpaint(); | ||
1036 | - cp.set_response_type("JSON"); | ||
1037 | - cp.call(p,"pegaParametrosMapa",i3GEOF.legenda.montaEditor); | ||
1038 | - }, | ||
1039 | - /* | ||
1040 | - Function: simbU | ||
1041 | - | ||
1042 | - Altera a leganda do tema para o tipo símbolo único | ||
1043 | - | ||
1044 | - Veja: | ||
1045 | - | ||
1046 | - <ALTERACLASSE> | ||
1047 | - */ | ||
1048 | - simbU: function(){ | ||
1049 | - try{ | ||
1050 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1051 | - {return;} | 1212 | + } |
1213 | + }, | ||
1214 | + /* | ||
1215 | + * Function: excluilinhaf | ||
1216 | + * | ||
1217 | + * Exclui uma linha da tabela de edição de classes da legendda | ||
1218 | + */ | ||
1219 | + excluilinhaf : function(celula) { | ||
1220 | + var p = celula.parentNode.parentNode; | ||
1221 | + do { | ||
1222 | + p.removeChild(p.childNodes[0]); | ||
1223 | + } while (p.childNodes.length > 0); | ||
1224 | + p.parentNode.removeChild(p); | ||
1225 | + i3GEOF.legenda.mudaLegenda(); | ||
1226 | + }, | ||
1227 | + /* | ||
1228 | + * Function: sobelinhaf | ||
1229 | + * | ||
1230 | + * Sobe uma linha na tabela de edição de classes da legendda | ||
1231 | + */ | ||
1232 | + sobelinhaf : function(idclasse) { | ||
1233 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1234 | + return; | ||
1235 | + } | ||
1052 | i3GEOF.legenda.aguarde.visibility = "visible"; | 1236 | i3GEOF.legenda.aguarde.visibility = "visible"; |
1053 | - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | ||
1054 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&opcao=simbolounico&ext="+ext, | ||
1055 | - cp = new cpaint(), | ||
1056 | - fim = function(){ | ||
1057 | - i3GEOF.legenda.aposAlterarLegenda(); | 1237 | + var p = |
1238 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1239 | + + "&funcao=ALTERACLASSE&opcao=sobeclasse&tema=" + i3GEOF.legenda.tema + "&idclasse=" + idclasse, cp = new cpaint(), temp = | ||
1240 | + function() { | ||
1058 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1241 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1242 | + i3GEOF.legenda.mostralegenda(); | ||
1059 | }; | 1243 | }; |
1060 | cp.set_response_type("JSON"); | 1244 | cp.set_response_type("JSON"); |
1061 | - cp.call(p,"alteraclasse",fim); | ||
1062 | - } | ||
1063 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1064 | - }, | ||
1065 | - /* | ||
1066 | - Function: valorU | ||
1067 | - | ||
1068 | - Altera a leganda do tema para o tipo valor único | ||
1069 | - | ||
1070 | - Veja: | ||
1071 | - | ||
1072 | - <ALTERACLASSE> | ||
1073 | - */ | ||
1074 | - valorU: function(){ | ||
1075 | - try{ | ||
1076 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1077 | - {return;} | ||
1078 | - var item = $i("i3GEOlegendaSelItem").value, | ||
1079 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=valorunico&ignorar="+$i("i3GEOlegendaignorar").value, | ||
1080 | - cp = new cpaint(), | ||
1081 | - fim = function(){ | ||
1082 | - i3GEOF.legenda.aposAlterarLegenda(); | 1245 | + cp.call(p, "foo", temp); |
1246 | + }, | ||
1247 | + /* | ||
1248 | + * Function: descelinhaf | ||
1249 | + * | ||
1250 | + * Desce uma linha na tabela de edição de classes da legendda | ||
1251 | + */ | ||
1252 | + descelinhaf : function(idclasse) { | ||
1253 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1254 | + return; | ||
1255 | + } | ||
1256 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1257 | + var p = | ||
1258 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1259 | + + "&funcao=ALTERACLASSE&opcao=desceclasse&tema=" + i3GEOF.legenda.tema + "&idclasse=" + idclasse, cp = new cpaint(), temp = | ||
1260 | + function() { | ||
1083 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1261 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1262 | + i3GEOF.legenda.mostralegenda(); | ||
1084 | }; | 1263 | }; |
1085 | - if($i("i3GEOFlegendaaplicaextent").checked === true){ | ||
1086 | - p += "&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | ||
1087 | - } | ||
1088 | - else{ | ||
1089 | - p += "&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal); | 1264 | + ; |
1265 | + cp.set_response_type("JSON"); | ||
1266 | + cp.call(p, "foo", temp); | ||
1267 | + }, | ||
1268 | + /* | ||
1269 | + * Function: editaSimbolo | ||
1270 | + * | ||
1271 | + * Abre o editor de símbolos | ||
1272 | + * | ||
1273 | + * Veja: | ||
1274 | + * | ||
1275 | + * <EDITASIMBOLO> | ||
1276 | + */ | ||
1277 | + editaSimbolo : function(id) { | ||
1278 | + try { | ||
1279 | + $i("i3GEOlegendaguia1obj").style.display = "none"; | ||
1280 | + $i("i3GEOlegendaguia3obj").style.display = "block"; | ||
1281 | + id = id.split("-"); | ||
1282 | + i3GEOF.legenda.classe = id[1]; | ||
1283 | + i3GEOF.legenda.estilo = 0; | ||
1284 | + i3GEOF.legenda.formEditorSimbolo(); | ||
1285 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1286 | + } catch (e) { | ||
1287 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1288 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1090 | } | 1289 | } |
1091 | - | ||
1092 | - if (item == "") | ||
1093 | - {i3GEO.janela.tempoMsg($trad('selecionaUmItem',i3GEOF.legenda.dicionario));return;} | ||
1094 | - i3GEOF.legenda.aguarde.visibility = "visible"; | 1290 | + }, |
1291 | + formEditorSimbolo : function() { | ||
1292 | + var p = | ||
1293 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1294 | + + "&funcao=editasimbolo&opcao=pegaparametros&tema=" + i3GEOF.legenda.tema + "&classe=" + i3GEOF.legenda.classe, cp = | ||
1295 | + new cpaint(); | ||
1095 | cp.set_response_type("JSON"); | 1296 | cp.set_response_type("JSON"); |
1096 | - //window.parent.g_operacao = "outras" | ||
1097 | - cp.call(p,"alteraclasse",fim); | ||
1098 | - } | ||
1099 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1100 | - }, | ||
1101 | - /* | ||
1102 | - Function: valorC | ||
1103 | - | ||
1104 | - Altera a leganda do tema com um número específico de classes | ||
1105 | - | ||
1106 | - Veja: | ||
1107 | - | ||
1108 | - <ALTERACLASSE> | ||
1109 | - */ | ||
1110 | - valorC: function(){ | ||
1111 | - try{ | ||
1112 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1113 | - {return;} | ||
1114 | - var item = $i("i3GEOlegendaSelItem").value, | ||
1115 | - nclasses = $i("i3GEOlegendanclasses").value, | ||
1116 | - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), | ||
1117 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&nclasses="+nclasses+"&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=intervalosiguais&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+ext, | ||
1118 | - cp = new cpaint(), | ||
1119 | - fim = function(){ | 1297 | + cp.call(p, "pegaParametrosMapa", i3GEOF.legenda.montaEditor); |
1298 | + }, | ||
1299 | + /* | ||
1300 | + * Function: simbU | ||
1301 | + * | ||
1302 | + * Altera a leganda do tema para o tipo símbolo único | ||
1303 | + * | ||
1304 | + * Veja: | ||
1305 | + * | ||
1306 | + * <ALTERACLASSE> | ||
1307 | + */ | ||
1308 | + simbU : function() { | ||
1309 | + try { | ||
1310 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1311 | + return; | ||
1312 | + } | ||
1313 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1314 | + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | ||
1315 | + var p = | ||
1316 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&tema=" | ||
1317 | + + i3GEOF.legenda.tema + "&opcao=simbolounico&ext=" + ext, cp = new cpaint(), fim = function() { | ||
1120 | i3GEOF.legenda.aposAlterarLegenda(); | 1318 | i3GEOF.legenda.aposAlterarLegenda(); |
1121 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1319 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1122 | }; | 1320 | }; |
1123 | - if (item == "") | ||
1124 | - {i3GEO.janela.tempoMsg("Selecione um item!");return;} | ||
1125 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1126 | - cp.set_response_type("JSON"); | ||
1127 | - cp.call(p,"alteraclasse",fim); | ||
1128 | - } | ||
1129 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1130 | - }, | ||
1131 | - /* | ||
1132 | - Function: valorQ | ||
1133 | - | ||
1134 | - Altera a leganda do tema claculando as classes pelo método quartil | ||
1135 | - | ||
1136 | - Veja: | ||
1137 | - | ||
1138 | - <ALTERACLASSE> | ||
1139 | - */ | ||
1140 | - valorQ: function(){ | ||
1141 | - try{ | ||
1142 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1143 | - {return;} | ||
1144 | - var item = $i("i3GEOlegendaSelItem").value, | ||
1145 | - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), | ||
1146 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=quartis&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+ext+"&tipoLegenda="+$i("estiloClassesQuartis").value, | ||
1147 | - cp = new cpaint(), | ||
1148 | - fim = function(){ | 1321 | + cp.set_response_type("JSON"); |
1322 | + cp.call(p, "alteraclasse", fim); | ||
1323 | + } catch (e) { | ||
1324 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1325 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1326 | + } | ||
1327 | + }, | ||
1328 | + /* | ||
1329 | + * Function: valorU | ||
1330 | + * | ||
1331 | + * Altera a leganda do tema para o tipo valor único | ||
1332 | + * | ||
1333 | + * Veja: | ||
1334 | + * | ||
1335 | + * <ALTERACLASSE> | ||
1336 | + */ | ||
1337 | + valorU : function() { | ||
1338 | + try { | ||
1339 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1340 | + return; | ||
1341 | + } | ||
1342 | + var item = $i("i3GEOlegendaSelItem").value, p = | ||
1343 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&tema=" | ||
1344 | + + i3GEOF.legenda.tema + "&item=" + item + "&opcao=valorunico&ignorar=" + $i("i3GEOlegendaignorar").value, cp = | ||
1345 | + new cpaint(), fim = function() { | ||
1149 | i3GEOF.legenda.aposAlterarLegenda(); | 1346 | i3GEOF.legenda.aposAlterarLegenda(); |
1150 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1347 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1151 | }; | 1348 | }; |
1152 | - if (item == "") | ||
1153 | - {i3GEO.janela.tempoMsg($trad('selecionaUmItem',i3GEOF.legenda.dicionario));return;} | ||
1154 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1155 | - cp.set_response_type("JSON"); | ||
1156 | - cp.call(p,"alteraclasse",fim); | ||
1157 | - } | ||
1158 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1159 | - }, | ||
1160 | - /* | ||
1161 | - Function: valorQu | ||
1162 | - | ||
1163 | - Altera a leganda do tema por meio do calculo de quantis | ||
1164 | - | ||
1165 | - Veja: | 1349 | + if ($i("i3GEOFlegendaaplicaextent").checked === true) { |
1350 | + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | ||
1351 | + } else { | ||
1352 | + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal); | ||
1353 | + } | ||
1166 | 1354 | ||
1167 | - <ALTERACLASSE> | ||
1168 | - */ | ||
1169 | - valorQu: function(){ | ||
1170 | - try{ | ||
1171 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1172 | - {return;} | ||
1173 | - var item = $i("i3GEOlegendaSelItem").value, | ||
1174 | - nclasses = $i("i3GEOlegendanclasses").value, | ||
1175 | - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), | ||
1176 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&nclasses="+nclasses+"&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=quantil&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+ext, | ||
1177 | - cp = new cpaint(), | ||
1178 | - fim = function(){ | 1355 | + if (item == "") { |
1356 | + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario)); | ||
1357 | + return; | ||
1358 | + } | ||
1359 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1360 | + cp.set_response_type("JSON"); | ||
1361 | + // window.parent.g_operacao = "outras" | ||
1362 | + cp.call(p, "alteraclasse", fim); | ||
1363 | + } catch (e) { | ||
1364 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1365 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1366 | + } | ||
1367 | + }, | ||
1368 | + /* | ||
1369 | + * Function: valorC | ||
1370 | + * | ||
1371 | + * Altera a leganda do tema com um número específico de classes | ||
1372 | + * | ||
1373 | + * Veja: | ||
1374 | + * | ||
1375 | + * <ALTERACLASSE> | ||
1376 | + */ | ||
1377 | + valorC : function() { | ||
1378 | + try { | ||
1379 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1380 | + return; | ||
1381 | + } | ||
1382 | + var item = $i("i3GEOlegendaSelItem").value, nclasses = $i("i3GEOlegendanclasses").value, ext = | ||
1383 | + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = | ||
1384 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1385 | + + "&funcao=alteraclasse&nclasses=" + nclasses + "&tema=" + i3GEOF.legenda.tema + "&item=" + item | ||
1386 | + + "&opcao=intervalosiguais&ignorar=" + $i("i3GEOlegendaignorar").value + "&ext=" + ext, cp = new cpaint(), fim = | ||
1387 | + function() { | ||
1388 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
1389 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1390 | + }; | ||
1391 | + if (item == "") { | ||
1392 | + i3GEO.janela.tempoMsg("Selecione um item!"); | ||
1393 | + return; | ||
1394 | + } | ||
1395 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1396 | + cp.set_response_type("JSON"); | ||
1397 | + cp.call(p, "alteraclasse", fim); | ||
1398 | + } catch (e) { | ||
1399 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1400 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1401 | + } | ||
1402 | + }, | ||
1403 | + /* | ||
1404 | + * Function: valorQ | ||
1405 | + * | ||
1406 | + * Altera a leganda do tema claculando as classes pelo método quartil | ||
1407 | + * | ||
1408 | + * Veja: | ||
1409 | + * | ||
1410 | + * <ALTERACLASSE> | ||
1411 | + */ | ||
1412 | + valorQ : function() { | ||
1413 | + try { | ||
1414 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1415 | + return; | ||
1416 | + } | ||
1417 | + var item = $i("i3GEOlegendaSelItem").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = | ||
1418 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&tema=" | ||
1419 | + + i3GEOF.legenda.tema + "&item=" + item + "&opcao=quartis&ignorar=" + $i("i3GEOlegendaignorar").value + "&ext=" | ||
1420 | + + ext + "&tipoLegenda=" + $i("estiloClassesQuartis").value, cp = new cpaint(), fim = function() { | ||
1179 | i3GEOF.legenda.aposAlterarLegenda(); | 1421 | i3GEOF.legenda.aposAlterarLegenda(); |
1180 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1422 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1181 | }; | 1423 | }; |
1182 | - if (item == "") | ||
1183 | - {i3GEO.janela.tempoMsg($trad('selecionaUmItem',i3GEOF.legenda.dicionario));return;} | ||
1184 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1185 | - cp.set_response_type("JSON"); | ||
1186 | - cp.call(p,"alteraclasse",fim); | ||
1187 | - } | ||
1188 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1189 | - }, | ||
1190 | - /* | ||
1191 | - Function: valorQN | ||
1192 | - | ||
1193 | - Altera a legenda do tema por meio do calculo de quebras naturais | ||
1194 | - | ||
1195 | - Veja: | ||
1196 | - | ||
1197 | - <ALTERACLASSE> | ||
1198 | - */ | ||
1199 | - valorQN: function(){ | ||
1200 | - try{ | ||
1201 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1202 | - {return;} | ||
1203 | - var item = $i("i3GEOlegendaSelItem").value, | ||
1204 | - nclasses = $i("i3GEOlegendanclasses").value, | ||
1205 | - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), | ||
1206 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&nclasses="+nclasses+"&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=quebrasnaturais&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+ext, | ||
1207 | - cp = new cpaint(), | ||
1208 | - fim = function(){ | 1424 | + if (item == "") { |
1425 | + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario)); | ||
1426 | + return; | ||
1427 | + } | ||
1428 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1429 | + cp.set_response_type("JSON"); | ||
1430 | + cp.call(p, "alteraclasse", fim); | ||
1431 | + } catch (e) { | ||
1432 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1433 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1434 | + } | ||
1435 | + }, | ||
1436 | + /* | ||
1437 | + * Function: valorQu | ||
1438 | + * | ||
1439 | + * Altera a leganda do tema por meio do calculo de quantis | ||
1440 | + * | ||
1441 | + * Veja: | ||
1442 | + * | ||
1443 | + * <ALTERACLASSE> | ||
1444 | + */ | ||
1445 | + valorQu : function() { | ||
1446 | + try { | ||
1447 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1448 | + return; | ||
1449 | + } | ||
1450 | + var item = $i("i3GEOlegendaSelItem").value, nclasses = $i("i3GEOlegendanclasses").value, ext = | ||
1451 | + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = | ||
1452 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1453 | + + "&funcao=alteraclasse&nclasses=" + nclasses + "&tema=" + i3GEOF.legenda.tema + "&item=" + item | ||
1454 | + + "&opcao=quantil&ignorar=" + $i("i3GEOlegendaignorar").value + "&ext=" + ext, cp = new cpaint(), fim = function() { | ||
1209 | i3GEOF.legenda.aposAlterarLegenda(); | 1455 | i3GEOF.legenda.aposAlterarLegenda(); |
1210 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1456 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1211 | }; | 1457 | }; |
1212 | - if (item == "") | ||
1213 | - {i3GEO.janela.tempoMsg($trad('selecionaUmItem',i3GEOF.legenda.dicionario));return;} | ||
1214 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1215 | - cp.set_response_type("JSON"); | ||
1216 | - cp.call(p,"alteraclasse",fim); | ||
1217 | - } | ||
1218 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1219 | - }, | ||
1220 | - | ||
1221 | - /* | ||
1222 | - Function: representacao | ||
1223 | - | ||
1224 | - Altera o tipo de representação do tema (linear ou poligonoal) | ||
1225 | - | ||
1226 | - Veja: | ||
1227 | - | ||
1228 | - <ALTERAREPRESENTACAO> | ||
1229 | - | ||
1230 | - */ | ||
1231 | - representacao: function(){ | ||
1232 | - try{ | ||
1233 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1234 | - {return;} | ||
1235 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alterarepresentacao&tema="+i3GEOF.legenda.tema, | ||
1236 | - cp = new cpaint(), | ||
1237 | - fim = function(){ | 1458 | + if (item == "") { |
1459 | + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario)); | ||
1460 | + return; | ||
1461 | + } | ||
1462 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1463 | + cp.set_response_type("JSON"); | ||
1464 | + cp.call(p, "alteraclasse", fim); | ||
1465 | + } catch (e) { | ||
1466 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1467 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1468 | + } | ||
1469 | + }, | ||
1470 | + /* | ||
1471 | + * Function: valorQN | ||
1472 | + * | ||
1473 | + * Altera a legenda do tema por meio do calculo de quebras naturais | ||
1474 | + * | ||
1475 | + * Veja: | ||
1476 | + * | ||
1477 | + * <ALTERACLASSE> | ||
1478 | + */ | ||
1479 | + valorQN : function() { | ||
1480 | + try { | ||
1481 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1482 | + return; | ||
1483 | + } | ||
1484 | + var item = $i("i3GEOlegendaSelItem").value, nclasses = $i("i3GEOlegendanclasses").value, ext = | ||
1485 | + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = | ||
1486 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1487 | + + "&funcao=alteraclasse&nclasses=" + nclasses + "&tema=" + i3GEOF.legenda.tema + "&item=" + item | ||
1488 | + + "&opcao=quebrasnaturais&ignorar=" + $i("i3GEOlegendaignorar").value + "&ext=" + ext, cp = new cpaint(), fim = | ||
1489 | + function() { | ||
1490 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
1491 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1492 | + }; | ||
1493 | + if (item == "") { | ||
1494 | + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario)); | ||
1495 | + return; | ||
1496 | + } | ||
1497 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1498 | + cp.set_response_type("JSON"); | ||
1499 | + cp.call(p, "alteraclasse", fim); | ||
1500 | + } catch (e) { | ||
1501 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1502 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1503 | + } | ||
1504 | + }, | ||
1505 | + | ||
1506 | + /* | ||
1507 | + * Function: representacao | ||
1508 | + * | ||
1509 | + * Altera o tipo de representação do tema (linear ou poligonoal) | ||
1510 | + * | ||
1511 | + * Veja: | ||
1512 | + * | ||
1513 | + * <ALTERAREPRESENTACAO> | ||
1514 | + * | ||
1515 | + */ | ||
1516 | + representacao : function() { | ||
1517 | + try { | ||
1518 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1519 | + return; | ||
1520 | + } | ||
1521 | + var p = | ||
1522 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1523 | + + "&funcao=alterarepresentacao&tema=" + i3GEOF.legenda.tema, cp = new cpaint(), fim = function() { | ||
1238 | i3GEOF.legenda.aposAlterarLegenda(); | 1524 | i3GEOF.legenda.aposAlterarLegenda(); |
1239 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1525 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1240 | }; | 1526 | }; |
1241 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1242 | - cp.set_response_type("JSON"); | ||
1243 | - cp.call(p,"alteraRepresentacao",fim); | ||
1244 | - } | ||
1245 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1246 | - }, | ||
1247 | - /* | ||
1248 | - Function: montaEditor | ||
1249 | - | ||
1250 | - Monta o editor de símbolos quando o usuário clica em um símbolo na legenda | ||
1251 | - */ | ||
1252 | - montaEditor: function(retorno){ | ||
1253 | - try{ | ||
1254 | - i3GEO.util.comboItens( | ||
1255 | - "i3GEOlegendaSelItemLabel", | ||
1256 | - i3GEOF.legenda.tema, | ||
1257 | - function(retorno){ | ||
1258 | - if($i("i3GEOlegendaitensLabel")) | ||
1259 | - {$i("i3GEOlegendaitensLabel").innerHTML = retorno.dados;} | ||
1260 | - }, | ||
1261 | - "i3GEOlegendaitensLabel" | ||
1262 | - ); | ||
1263 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1264 | - {return;} | ||
1265 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1266 | - if (retorno.data != undefined){ | ||
1267 | - var l,i,sct,combo,n; | ||
1268 | - retorno = retorno.data; | ||
1269 | - i3GEOF.legenda.estilos = retorno.split("|"); | ||
1270 | - combo = "<div class=styled-select style=width:100px ><select id='i3GEOlegendaestilos' onchange=i3GEOF.legenda.mostraEstilo(this.value)>"; | ||
1271 | - n = i3GEOF.legenda.estilos.length; | ||
1272 | - for (i=0;i<n;i++){ | ||
1273 | - l = i3GEOF.legenda.estilos[i].split("#"); | ||
1274 | - sct = "<option value="+l[1]+" />"+l[1]+"</option>"; | ||
1275 | - combo += sct; | 1527 | + i3GEOF.legenda.aguarde.visibility = "visible"; |
1528 | + cp.set_response_type("JSON"); | ||
1529 | + cp.call(p, "alteraRepresentacao", fim); | ||
1530 | + } catch (e) { | ||
1531 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1532 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1533 | + } | ||
1534 | + }, | ||
1535 | + /* | ||
1536 | + * Function: montaEditor | ||
1537 | + * | ||
1538 | + * Monta o editor de símbolos quando o usuário clica em um símbolo na legenda | ||
1539 | + */ | ||
1540 | + montaEditor : function(retorno) { | ||
1541 | + try { | ||
1542 | + i3GEO.util.comboItens("i3GEOlegendaSelItemLabel", i3GEOF.legenda.tema, function(retorno) { | ||
1543 | + if ($i("i3GEOlegendaitensLabel")) { | ||
1544 | + $i("i3GEOlegendaitensLabel").innerHTML = retorno.dados; | ||
1545 | + } | ||
1546 | + }, "i3GEOlegendaitensLabel"); | ||
1547 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1548 | + return; | ||
1276 | } | 1549 | } |
1277 | - combo += "</select></div>"; | ||
1278 | - $i("i3GEOlegendacomboestilos").innerHTML = "<table class='lista5'><tr><td><span class=paragrafo >"+$trad('estiloEdicao',i3GEOF.legenda.dicionario)+":</span></td><td>"+combo+"</td><td></td></tr></table> (após adicionar ou excluir, aplique a alteração)<br>"; | ||
1279 | - new YAHOO.widget.Button( | ||
1280 | - "i3GEOlegendabotao11",{onclick:{fn: function(){ | ||
1281 | - try{ | ||
1282 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1283 | - {return;} | ||
1284 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1285 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=excluiestilo&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo, | ||
1286 | - cp = new cpaint(); | ||
1287 | - cp.set_response_type("JSON"); | ||
1288 | - cp.call(p,"editasimbolo",i3GEOF.legenda.reMontaEditor); | 1550 | + i3GEOF.legenda.aguarde.visibility = "visible"; |
1551 | + if (retorno.data != undefined) { | ||
1552 | + var l, i, sct, combo, n; | ||
1553 | + retorno = retorno.data; | ||
1554 | + i3GEOF.legenda.estilos = retorno.split("|"); | ||
1555 | + combo = | ||
1556 | + "<div class=styled-select style=width:100px ><select id='i3GEOlegendaestilos' onchange=i3GEOF.legenda.mostraEstilo(this.value)>"; | ||
1557 | + n = i3GEOF.legenda.estilos.length; | ||
1558 | + for (i = 0; i < n; i++) { | ||
1559 | + l = i3GEOF.legenda.estilos[i].split("#"); | ||
1560 | + sct = "<option value=" + l[1] + " />" + l[1] + "</option>"; | ||
1561 | + combo += sct; | ||
1562 | + } | ||
1563 | + combo += "</select></div>"; | ||
1564 | + $i("i3GEOlegendacomboestilos").innerHTML = | ||
1565 | + "<table class='lista5'><tr><td><span class=paragrafo >" + $trad('estiloEdicao', i3GEOF.legenda.dicionario) | ||
1566 | + + ":</span></td><td>" + combo | ||
1567 | + + "</td><td></td></tr></table> (após adicionar ou excluir, aplique a alteração)<br>"; | ||
1568 | + new YAHOO.widget.Button("i3GEOlegendabotao11", { | ||
1569 | + onclick : { | ||
1570 | + fn : function() { | ||
1571 | + try { | ||
1572 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1573 | + return; | ||
1574 | + } | ||
1575 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1576 | + var p = | ||
1577 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1578 | + + "&funcao=editasimbolo&opcao=excluiestilo&tema=" + i3GEOF.legenda.tema + "&classe=" | ||
1579 | + + i3GEOF.legenda.classe + "&estilo=" + i3GEOF.legenda.estilo, cp = new cpaint(); | ||
1580 | + cp.set_response_type("JSON"); | ||
1581 | + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor); | ||
1582 | + } catch (e) { | ||
1583 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1584 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1585 | + } | ||
1586 | + } | ||
1289 | } | 1587 | } |
1290 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1291 | - }}} | ||
1292 | - ); | ||
1293 | - new YAHOO.widget.Button( | ||
1294 | - "i3GEOlegendabotao12", | ||
1295 | - {onclick:{fn: function(){ | ||
1296 | - try{ | ||
1297 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1298 | - {return;} | ||
1299 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1300 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=adicionaestilo&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo, | ||
1301 | - cp = new cpaint(); | ||
1302 | - cp.set_response_type("JSON"); | ||
1303 | - cp.call(p,"editasimbolo",i3GEOF.legenda.reMontaEditor); | 1588 | + }); |
1589 | + new YAHOO.widget.Button("i3GEOlegendabotao12", { | ||
1590 | + onclick : { | ||
1591 | + fn : function() { | ||
1592 | + try { | ||
1593 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1594 | + return; | ||
1595 | + } | ||
1596 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1597 | + var p = | ||
1598 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1599 | + + "&funcao=editasimbolo&opcao=adicionaestilo&tema=" + i3GEOF.legenda.tema + "&classe=" | ||
1600 | + + i3GEOF.legenda.classe + "&estilo=" + i3GEOF.legenda.estilo, cp = new cpaint(); | ||
1601 | + cp.set_response_type("JSON"); | ||
1602 | + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor); | ||
1603 | + } catch (e) { | ||
1604 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1605 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1606 | + } | ||
1607 | + } | ||
1304 | } | 1608 | } |
1305 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1306 | - }}} | ||
1307 | - ); | ||
1308 | - new YAHOO.widget.Button( | ||
1309 | - "i3GEOlegendabotao13", | ||
1310 | - {onclick:{fn: function(){ | ||
1311 | - try{ | ||
1312 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1313 | - {return;} | ||
1314 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1315 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=sobeestilo&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo, | ||
1316 | - cp = new cpaint(); | ||
1317 | - cp.set_response_type("JSON"); | ||
1318 | - cp.call(p,"editasimbolo",i3GEOF.legenda.reMontaEditor); | 1609 | + }); |
1610 | + new YAHOO.widget.Button("i3GEOlegendabotao13", { | ||
1611 | + onclick : { | ||
1612 | + fn : function() { | ||
1613 | + try { | ||
1614 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1615 | + return; | ||
1616 | + } | ||
1617 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1618 | + var p = | ||
1619 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1620 | + + "&funcao=editasimbolo&opcao=sobeestilo&tema=" + i3GEOF.legenda.tema + "&classe=" | ||
1621 | + + i3GEOF.legenda.classe + "&estilo=" + i3GEOF.legenda.estilo, cp = new cpaint(); | ||
1622 | + cp.set_response_type("JSON"); | ||
1623 | + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor); | ||
1624 | + } catch (e) { | ||
1625 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1626 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1627 | + } | ||
1628 | + } | ||
1319 | } | 1629 | } |
1320 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1321 | - }}} | ||
1322 | - ); | ||
1323 | - new YAHOO.widget.Button( | ||
1324 | - "i3GEOlegendabotao14", | ||
1325 | - {onclick:{fn: function(){ | ||
1326 | - try{ | ||
1327 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1328 | - {return;} | ||
1329 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1330 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=desceestilo&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo, | ||
1331 | - cp = new cpaint(); | ||
1332 | - cp.set_response_type("JSON"); | ||
1333 | - cp.call(p,"editasimbolo",i3GEOF.legenda.reMontaEditor); | 1630 | + }); |
1631 | + new YAHOO.widget.Button("i3GEOlegendabotao14", { | ||
1632 | + onclick : { | ||
1633 | + fn : function() { | ||
1634 | + try { | ||
1635 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1636 | + return; | ||
1637 | + } | ||
1638 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1639 | + var p = | ||
1640 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1641 | + + "&funcao=editasimbolo&opcao=desceestilo&tema=" + i3GEOF.legenda.tema + "&classe=" | ||
1642 | + + i3GEOF.legenda.classe + "&estilo=" + i3GEOF.legenda.estilo, cp = new cpaint(); | ||
1643 | + cp.set_response_type("JSON"); | ||
1644 | + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor); | ||
1645 | + } catch (e) { | ||
1646 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1647 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1648 | + } | ||
1649 | + } | ||
1334 | } | 1650 | } |
1335 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1336 | - }}} | ||
1337 | - ); | 1651 | + }); |
1652 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1653 | + i3GEOF.legenda.mostraEstilo(0); | ||
1654 | + } else { | ||
1655 | + $i("i3GEOlegendacomboestilos").innerHTML = "<p style=color:red >Erro<br>"; | ||
1656 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1657 | + } | ||
1658 | + } catch (e) { | ||
1659 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1338 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1660 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1339 | - i3GEOF.legenda.mostraEstilo(0); | ||
1340 | } | 1661 | } |
1341 | - else{ | ||
1342 | - $i("i3GEOlegendacomboestilos").innerHTML = "<p style=color:red >Erro<br>"; | 1662 | + }, |
1663 | + /* | ||
1664 | + * Function: mostraEstilo | ||
1665 | + * | ||
1666 | + * Mostra as propriedades de um estilo de um símbolo | ||
1667 | + */ | ||
1668 | + mostraEstilo : function(e) { | ||
1669 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1670 | + try { | ||
1671 | + var linha, tipoLayer, d, p, cp; | ||
1672 | + i3GEOF.legenda.estilo = e; // esta e uma variavel global | ||
1673 | + linha = i3GEOF.legenda.estilos[i3GEOF.legenda.estilo]; | ||
1674 | + linha = linha.split("#"); | ||
1675 | + tipoLayer = linha[0]; | ||
1676 | + d = | ||
1677 | + "<table class=lista6 ><tr><td style='text-align:left;'>Cor do contorno:</td><td>" + "<div class=styled-select >" | ||
1678 | + + "<input type=text value='" | ||
1679 | + + linha[2] | ||
1680 | + + "' id='i3GEOlegendaoutlinecolor' />" | ||
1681 | + + "</div>" | ||
1682 | + + "</td><td><img style=cursor:pointer src='" | ||
1683 | + + i3GEO.configura.locaplic | ||
1684 | + + "/imagens/aquarela.gif' onclick=\"i3GEOF.legenda.corj('i3GEOlegendaoutlinecolor')\" /></td></tr>" | ||
1685 | + + "<tr><td style='text-align:left;'>" | ||
1686 | + + $trad('corFundo', i3GEOF.legenda.dicionario) | ||
1687 | + + ":</td><td>" | ||
1688 | + + "<div class=styled-select >" | ||
1689 | + + "<input type=text value='" | ||
1690 | + + linha[3] | ||
1691 | + + "' id='i3GEOlegendabackgroundcolor' />" | ||
1692 | + + "</div>" | ||
1693 | + + "</td><td><img style=cursor:pointer src='" | ||
1694 | + + i3GEO.configura.locaplic | ||
1695 | + + "/imagens/aquarela.gif' onclick=\"i3GEOF.legenda.corj('i3GEOlegendabackgroundcolor')\" /></td></tr>" | ||
1696 | + + "<tr><td style='text-align:left;'>" | ||
1697 | + + $trad('corFrente', i3GEOF.legenda.dicionario) | ||
1698 | + + ":</td><td>" | ||
1699 | + + "<div class=styled-select >" | ||
1700 | + + "<input type=text value='" | ||
1701 | + + linha[4] | ||
1702 | + + "' id='i3GEOlegendacolor' />" | ||
1703 | + + "</div>" | ||
1704 | + + "</td><td><img style=cursor:pointer src='" | ||
1705 | + + i3GEO.configura.locaplic | ||
1706 | + + "/imagens/aquarela.gif' onclick=\"i3GEOF.legenda.corj('i3GEOlegendacolor')\" /></td></tr>" | ||
1707 | + + "<tr><td style='text-align:left;'>" | ||
1708 | + + $trad('tamanhoEspacamento', i3GEOF.legenda.dicionario) | ||
1709 | + + ":</td><td>" | ||
1710 | + + "<div class=styled-select >" | ||
1711 | + + "<input type=text value='" | ||
1712 | + + linha[6] | ||
1713 | + + "' id='i3GEOlegendasizes' />" | ||
1714 | + + "</div>" | ||
1715 | + + "</td><td></td></tr>" | ||
1716 | + + "<tr><td style='text-align:left;'>" | ||
1717 | + + $trad('espessura', i3GEOF.legenda.dicionario) | ||
1718 | + + ":</td><td>" | ||
1719 | + + "<div class=styled-select >" | ||
1720 | + + "<input type=text value='" | ||
1721 | + + linha[8] | ||
1722 | + + "' id='i3GEOlegendawidth' />" | ||
1723 | + + "</div>" | ||
1724 | + + "</td><td></td></tr>" | ||
1725 | + + "<tr><td style='text-align:left;'>" | ||
1726 | + + $trad('padraoRepeticao', i3GEOF.legenda.dicionario) | ||
1727 | + + ":</td><td>" | ||
1728 | + + "<div class=styled-select >" | ||
1729 | + + "<input type=text value='" | ||
1730 | + + linha[9] | ||
1731 | + + "' id='i3GEOlegendapattern' />" | ||
1732 | + + "</div>" | ||
1733 | + + "</td><td></td></tr>" | ||
1734 | + + "<tr><td style='text-align:left;'>" | ||
1735 | + + $trad('opacidade', i3GEOF.legenda.dicionario) | ||
1736 | + + ":</td><td>" | ||
1737 | + + "<div class=styled-select >" | ||
1738 | + + "<input type=text value='" | ||
1739 | + + linha[7] | ||
1740 | + + "' id='i3GEOlegendaopacidade' />" | ||
1741 | + + "</div>" | ||
1742 | + + "</td><td></td></tr>" | ||
1743 | + + "<tr><td style='text-align:left;'>" | ||
1744 | + + $trad('angulo', i3GEOF.legenda.dicionario) | ||
1745 | + + ":</td><td>" | ||
1746 | + + "<div class=styled-select >" | ||
1747 | + + "<input type=text value='" | ||
1748 | + + linha[10] | ||
1749 | + + "' id='i3GEOlegendaangulo' />" | ||
1750 | + + "</div>" | ||
1751 | + + "</td><td></td></tr>" | ||
1752 | + + "<tr><td style='text-align:left;'>" | ||
1753 | + + $trad('simbolo', i3GEOF.legenda.dicionario) | ||
1754 | + + ":</td><td>" | ||
1755 | + + "<div class=styled-select >" | ||
1756 | + + "<input type=text value='" | ||
1757 | + + linha[5] | ||
1758 | + + "' id='i3GEOlegendasymbolname' />" | ||
1759 | + + "</div>" + "</td><td></td></tr></table>"; | ||
1760 | + $i("i3GEOlegendaParametrosEstilos").innerHTML = d; | ||
1761 | + p = | ||
1762 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=editasimbolo&tipo=" | ||
1763 | + + tipoLayer + "&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)"; | ||
1764 | + cp = new cpaint(); | ||
1765 | + cp.set_response_type("JSON"); | ||
1766 | + cp.call(p, "editasimbolo", i3GEOF.legenda.listaSimbolos); | ||
1767 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1768 | + } catch (e) { | ||
1769 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1343 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1770 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1344 | } | 1771 | } |
1345 | - } | ||
1346 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1347 | - }, | ||
1348 | - /* | ||
1349 | - Function: mostraEstilo | ||
1350 | - | ||
1351 | - Mostra as propriedades de um estilo de um símbolo | ||
1352 | - */ | ||
1353 | - mostraEstilo: function(e){ | ||
1354 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1355 | - try{ | ||
1356 | - var linha,tipoLayer,d,p,cp; | ||
1357 | - i3GEOF.legenda.estilo = e; //esta e uma variavel global | ||
1358 | - linha = i3GEOF.legenda.estilos[i3GEOF.legenda.estilo]; | ||
1359 | - linha = linha.split("#"); | ||
1360 | - tipoLayer = linha[0]; | ||
1361 | - d = "<table class=lista6 ><tr><td style='text-align:left;'>Cor do contorno:</td><td>" + | ||
1362 | - "<div class=styled-select >" + | ||
1363 | - "<input type=text value='"+linha[2]+"' id='i3GEOlegendaoutlinecolor' />" + | ||
1364 | - "</div>" + | ||
1365 | - "</td><td><img style=cursor:pointer src='"+i3GEO.configura.locaplic+"/imagens/aquarela.gif' onclick=\"i3GEOF.legenda.corj('i3GEOlegendaoutlinecolor')\" /></td></tr>"+ | ||
1366 | - "<tr><td style='text-align:left;'>"+$trad('corFundo',i3GEOF.legenda.dicionario)+":</td><td>" + | ||
1367 | - "<div class=styled-select >" + | ||
1368 | - "<input type=text value='"+linha[3]+"' id='i3GEOlegendabackgroundcolor' />" + | ||
1369 | - "</div>" + | ||
1370 | - "</td><td><img style=cursor:pointer src='"+i3GEO.configura.locaplic+"/imagens/aquarela.gif' onclick=\"i3GEOF.legenda.corj('i3GEOlegendabackgroundcolor')\" /></td></tr>"+ | ||
1371 | - "<tr><td style='text-align:left;'>"+$trad('corFrente',i3GEOF.legenda.dicionario)+":</td><td>"+ | ||
1372 | - "<div class=styled-select >" + | ||
1373 | - "<input type=text value='"+linha[4]+"' id='i3GEOlegendacolor' />" + | ||
1374 | - "</div>" + | ||
1375 | - "</td><td><img style=cursor:pointer src='"+i3GEO.configura.locaplic+"/imagens/aquarela.gif' onclick=\"i3GEOF.legenda.corj('i3GEOlegendacolor')\" /></td></tr>"+ | ||
1376 | - "<tr><td style='text-align:left;'>"+$trad('tamanhoEspacamento',i3GEOF.legenda.dicionario)+":</td><td>"+ | ||
1377 | - "<div class=styled-select >" + | ||
1378 | - "<input type=text value='"+linha[6]+"' id='i3GEOlegendasizes' />" + | ||
1379 | - "</div>" + | ||
1380 | - "</td><td></td></tr>" + | ||
1381 | - "<tr><td style='text-align:left;'>"+$trad('espessura',i3GEOF.legenda.dicionario)+":</td><td>"+ | ||
1382 | - "<div class=styled-select >" + | ||
1383 | - "<input type=text value='"+linha[8]+"' id='i3GEOlegendawidth' />" + | ||
1384 | - "</div>" + | ||
1385 | - "</td><td></td></tr>" + | ||
1386 | - "<tr><td style='text-align:left;'>"+$trad('padraoRepeticao',i3GEOF.legenda.dicionario)+":</td><td>"+ | ||
1387 | - "<div class=styled-select >" + | ||
1388 | - "<input type=text value='"+linha[9]+"' id='i3GEOlegendapattern' />" + | ||
1389 | - "</div>" + | ||
1390 | - "</td><td></td></tr>" + | ||
1391 | - "<tr><td style='text-align:left;'>"+$trad('opacidade',i3GEOF.legenda.dicionario)+":</td><td>"+ | ||
1392 | - "<div class=styled-select >" + | ||
1393 | - "<input type=text value='"+linha[7]+"' id='i3GEOlegendaopacidade' />" + | ||
1394 | - "</div>" + | ||
1395 | - "</td><td></td></tr>" + | ||
1396 | - "<tr><td style='text-align:left;'>"+$trad('angulo',i3GEOF.legenda.dicionario)+":</td><td>"+ | ||
1397 | - "<div class=styled-select >" + | ||
1398 | - "<input type=text value='"+linha[10]+"' id='i3GEOlegendaangulo' />" + | ||
1399 | - "</div>" + | ||
1400 | - "</td><td></td></tr>" + | ||
1401 | - "<tr><td style='text-align:left;'>"+$trad('simbolo',i3GEOF.legenda.dicionario)+":</td><td>"+ | ||
1402 | - "<div class=styled-select >" + | ||
1403 | - "<input type=text value='"+linha[5]+"' id='i3GEOlegendasymbolname' />" + | ||
1404 | - "</div>" + | ||
1405 | - "</td><td></td></tr></table>"; | ||
1406 | - $i("i3GEOlegendaParametrosEstilos").innerHTML = d; | ||
1407 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&tipo="+tipoLayer+"&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)"; | ||
1408 | - cp = new cpaint(); | ||
1409 | - cp.set_response_type("JSON"); | ||
1410 | - cp.call(p,"editasimbolo",i3GEOF.legenda.listaSimbolos); | ||
1411 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1412 | - } | ||
1413 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1414 | - }, | ||
1415 | - /* | ||
1416 | - Function: listaSimbolos | ||
1417 | - | ||
1418 | - Monta a lista de símbolos com imagem | ||
1419 | - */ | ||
1420 | - listaSimbolos: function(retorno){ | ||
1421 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1422 | - try{ | ||
1423 | - if (retorno.data != undefined){ | ||
1424 | - retorno = retorno.data; | ||
1425 | - $i("i3GEOlegendasimbolos").innerHTML = "<br>"+$trad('listaSimbolo',i3GEOF.legenda.dicionario)+":<br><br>"+retorno; | ||
1426 | - } | ||
1427 | - else | ||
1428 | - {$i("i3GEOlegendasimbolos").innerHTML = "<p style=color:red >Erro<br>";} | ||
1429 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1430 | - } | ||
1431 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1432 | - }, | ||
1433 | - /* | ||
1434 | - Function: aplicaSimbolo | ||
1435 | - | ||
1436 | - Muda o valor do campo com o código do símbolo escolhido | ||
1437 | - */ | ||
1438 | - aplicaSimbolo: function(s) | ||
1439 | - {$i("i3GEOlegendasymbolname").value = s.title;}, | ||
1440 | - /* | ||
1441 | - Function: aplicaEstilo | ||
1442 | - | ||
1443 | - Aplica ao estilo as propriedades definidas | ||
1444 | - | ||
1445 | - Veja: | ||
1446 | - | ||
1447 | - <EDITASIMBOLO> | ||
1448 | - */ | ||
1449 | - aplicaEstilo: function(){ | ||
1450 | - try{ | ||
1451 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1452 | - {return;} | 1772 | + }, |
1773 | + /* | ||
1774 | + * Function: listaSimbolos | ||
1775 | + * | ||
1776 | + * Monta a lista de símbolos com imagem | ||
1777 | + */ | ||
1778 | + listaSimbolos : function(retorno) { | ||
1453 | i3GEOF.legenda.aguarde.visibility = "visible"; | 1779 | i3GEOF.legenda.aguarde.visibility = "visible"; |
1454 | - var outlinecolor = $i("i3GEOlegendaoutlinecolor").value, | ||
1455 | - backgroundcolor = $i("i3GEOlegendabackgroundcolor").value, | ||
1456 | - color = $i("i3GEOlegendacolor").value, | ||
1457 | - symbolname = $i("i3GEOlegendasymbolname").value, | ||
1458 | - simbolos = $i("i3GEOlegendasimbolos").getElementsByTagName("img"), | ||
1459 | - valido = "nao", | ||
1460 | - n = simbolos.length, | ||
1461 | - size = $i("i3GEOlegendasizes").value, | ||
1462 | - width = $i("i3GEOlegendawidth").value, | ||
1463 | - pattern = $i("i3GEOlegendapattern").value, | ||
1464 | - opacidade = $i("i3GEOlegendaopacidade").value, | ||
1465 | - angle = $i("i3GEOlegendaangulo").value, | ||
1466 | - i,p,cp,fim; | ||
1467 | - for (i=0;i<n;i++){ | ||
1468 | - if(simbolos[i].title == symbolname || symbolname == i) | ||
1469 | - {valido = "sim";} | ||
1470 | - } | ||
1471 | - if(valido === "nao"){ | ||
1472 | - //i3GEO.janela.tempoMsg("Nome do simbolo nao encontrado"); | ||
1473 | - //i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1474 | - //return; | 1780 | + try { |
1781 | + if (retorno.data != undefined) { | ||
1782 | + retorno = retorno.data; | ||
1783 | + $i("i3GEOlegendasimbolos").innerHTML = | ||
1784 | + "<br>" + $trad('listaSimbolo', i3GEOF.legenda.dicionario) + ":<br><br>" + retorno; | ||
1785 | + } else { | ||
1786 | + $i("i3GEOlegendasimbolos").innerHTML = "<p style=color:red >Erro<br>"; | ||
1787 | + } | ||
1788 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1789 | + } catch (e) { | ||
1790 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1791 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1475 | } | 1792 | } |
1476 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=aplica&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo+"&outlinecolor="+outlinecolor+"&backgroundcolor="+backgroundcolor+"&color="+color+"&symbolname="+symbolname+"&width="+width+"&pattern="+pattern+"&size="+size+"&opacidade="+opacidade+"&angle="+angle; | ||
1477 | - cp = new cpaint(); | ||
1478 | - fim = function(){ | ||
1479 | - i3GEOF.legenda.aposAlterarLegenda(); | 1793 | + }, |
1794 | + /* | ||
1795 | + * Function: aplicaSimbolo | ||
1796 | + * | ||
1797 | + * Muda o valor do campo com o código do símbolo escolhido | ||
1798 | + */ | ||
1799 | + aplicaSimbolo : function(s) { | ||
1800 | + $i("i3GEOlegendasymbolname").value = s.title; | ||
1801 | + }, | ||
1802 | + /* | ||
1803 | + * Function: aplicaEstilo | ||
1804 | + * | ||
1805 | + * Aplica ao estilo as propriedades definidas | ||
1806 | + * | ||
1807 | + * Veja: | ||
1808 | + * | ||
1809 | + * <EDITASIMBOLO> | ||
1810 | + */ | ||
1811 | + aplicaEstilo : function() { | ||
1812 | + try { | ||
1813 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1814 | + return; | ||
1815 | + } | ||
1816 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1817 | + var outlinecolor = $i("i3GEOlegendaoutlinecolor").value, backgroundcolor = $i("i3GEOlegendabackgroundcolor").value, color = | ||
1818 | + $i("i3GEOlegendacolor").value, symbolname = $i("i3GEOlegendasymbolname").value, simbolos = | ||
1819 | + $i("i3GEOlegendasimbolos").getElementsByTagName("img"), valido = "nao", n = simbolos.length, size = | ||
1820 | + $i("i3GEOlegendasizes").value, width = $i("i3GEOlegendawidth").value, pattern = $i("i3GEOlegendapattern").value, opacidade = | ||
1821 | + $i("i3GEOlegendaopacidade").value, angle = $i("i3GEOlegendaangulo").value, i, p, cp, fim; | ||
1822 | + for (i = 0; i < n; i++) { | ||
1823 | + if (simbolos[i].title == symbolname || symbolname == i) { | ||
1824 | + valido = "sim"; | ||
1825 | + } | ||
1826 | + } | ||
1827 | + if (valido === "nao") { | ||
1828 | + // i3GEO.janela.tempoMsg("Nome do simbolo nao encontrado"); | ||
1829 | + // i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1830 | + // return; | ||
1831 | + } | ||
1832 | + p = | ||
1833 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1834 | + + "&funcao=editasimbolo&opcao=aplica&tema=" + i3GEOF.legenda.tema + "&classe=" + i3GEOF.legenda.classe + "&estilo=" | ||
1835 | + + i3GEOF.legenda.estilo + "&outlinecolor=" + outlinecolor + "&backgroundcolor=" + backgroundcolor + "&color=" | ||
1836 | + + color + "&symbolname=" + symbolname + "&width=" + width + "&pattern=" + pattern + "&size=" + size + "&opacidade=" | ||
1837 | + + opacidade + "&angle=" + angle; | ||
1838 | + cp = new cpaint(); | ||
1839 | + fim = function() { | ||
1840 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
1841 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1842 | + i3GEOF.legenda.reMontaEditor(); | ||
1843 | + }; | ||
1844 | + // cp.set_debug(2) | ||
1845 | + cp.set_response_type("JSON"); | ||
1846 | + cp.call(p, "editasimbolo", fim); | ||
1847 | + } catch (e) { | ||
1848 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1480 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1849 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1481 | - i3GEOF.legenda.reMontaEditor(); | ||
1482 | - }; | ||
1483 | - //cp.set_debug(2) | ||
1484 | - cp.set_response_type("JSON"); | ||
1485 | - cp.call(p,"editasimbolo",fim); | ||
1486 | - } | ||
1487 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1488 | - }, | ||
1489 | - /* | ||
1490 | - Function: reMontaEditor | ||
1491 | - | ||
1492 | - Gera novamente o editor de símbolo após ter sido feita alguma alteração nos estilos | ||
1493 | - */ | ||
1494 | - reMontaEditor: function(){ | ||
1495 | - var id = i3GEOF.legenda.tema+"-"+i3GEOF.legenda.classe; | ||
1496 | - i3GEOF.legenda.editaSimbolo(id); | ||
1497 | - }, | ||
1498 | - /* | ||
1499 | - Function: mostraGrafico | ||
1500 | - | ||
1501 | - Mostra um gráfico com a contegem de elementos em caada classe | ||
1502 | - | ||
1503 | - Veja: | ||
1504 | - | ||
1505 | - <CONTAGEMCLASSE> | ||
1506 | - */ | ||
1507 | - mostraGrafico: function(){ | ||
1508 | - try{ | ||
1509 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1510 | - {return;} | ||
1511 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1512 | - var monta = function(retorno){ | ||
1513 | - if (retorno.data && retorno.data[0].proc == ""){ | ||
1514 | - var ins = [],i,re,t; | ||
1515 | - ins.push("<p class='paragrafo' ><input type=button value='"+$trad('graficoPizza',i3GEOF.legenda.dicionario)+"' id=i3GEOlegendaGraficoPizza /></p>"); | ||
1516 | - ins.push("<p class='paragrafo' >"+$trad('numeroOcorrenciasClasses',i3GEOF.legenda.dicionario)+"</p>"); | ||
1517 | - ins.push("<table width=100% >"); | ||
1518 | - i3GEOF.legenda.dadosGrafico = ["n;x"]; | ||
1519 | - if(retorno.data.length < 2){ | ||
1520 | - i3GEO.janela.tempoMsg($trad('msgNumeroClasses',i3GEOF.legenda.dicionario)); | ||
1521 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | 1850 | + } |
1851 | + }, | ||
1852 | + /* | ||
1853 | + * Function: reMontaEditor | ||
1854 | + * | ||
1855 | + * Gera novamente o editor de símbolo após ter sido feita alguma alteração nos estilos | ||
1856 | + */ | ||
1857 | + reMontaEditor : function() { | ||
1858 | + var id = i3GEOF.legenda.tema + "-" + i3GEOF.legenda.classe; | ||
1859 | + i3GEOF.legenda.editaSimbolo(id); | ||
1860 | + }, | ||
1861 | + /* | ||
1862 | + * Function: mostraGrafico | ||
1863 | + * | ||
1864 | + * Mostra um gráfico com a contegem de elementos em caada classe | ||
1865 | + * | ||
1866 | + * Veja: | ||
1867 | + * | ||
1868 | + * <CONTAGEMCLASSE> | ||
1869 | + */ | ||
1870 | + mostraGrafico : function() { | ||
1871 | + try { | ||
1872 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1873 | + return; | ||
1874 | + } | ||
1875 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1876 | + var monta = | ||
1877 | + function(retorno) { | ||
1878 | + if (retorno.data && retorno.data[0].proc == "") { | ||
1879 | + var ins = [], i, re, t; | ||
1880 | + ins.push("<p class='paragrafo' ><input type=button value='" + $trad('graficoPizza', i3GEOF.legenda.dicionario) | ||
1881 | + + "' id=i3GEOlegendaGraficoPizza /></p>"); | ||
1882 | + ins.push("<p class='paragrafo' >" + $trad('numeroOcorrenciasClasses', i3GEOF.legenda.dicionario) + "</p>"); | ||
1883 | + ins.push("<table width=100% >"); | ||
1884 | + i3GEOF.legenda.dadosGrafico = [ | ||
1885 | + "n;x" | ||
1886 | + ]; | ||
1887 | + if (retorno.data.length < 2) { | ||
1888 | + i3GEO.janela.tempoMsg($trad('msgNumeroClasses', i3GEOF.legenda.dicionario)); | ||
1889 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1890 | + return; | ||
1891 | + } else { | ||
1892 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia4", "i3GEOlegendaguia"); | ||
1893 | + } | ||
1894 | + for (i = 0; i < retorno.data.length; i++) { | ||
1895 | + id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; // layer+indice da classe | ||
1896 | + re = new RegExp("'", "g"); | ||
1897 | + exp = (retorno.data[i].expressao).replace(re, '"'); | ||
1898 | + ins.push("<tr><td style='text-align:left;border-bottom:0 none white' >" + retorno.data[i].nomeclasse | ||
1899 | + + "</td></tr>"); | ||
1900 | + t = (retorno.data[i].nreg * 100) / retorno.data[i].totalreg; | ||
1901 | + ins.push("<tr><td style=text-align:left ><img height=15px width=" + t + "% src='" + retorno.data[i].imagem | ||
1902 | + + "' /></td></tr>"); | ||
1903 | + i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse + ";" + retorno.data[i].nreg); | ||
1904 | + } | ||
1905 | + ins.push("</table><br>"); | ||
1906 | + $i("i3GEOlegendaguia4obj").innerHTML = ins.join(""); | ||
1907 | + } else { | ||
1908 | + $i("i3GEOlegendaguia4obj").innerHTML = "<p style=color:red >Erro<br>"; | ||
1522 | return; | 1909 | return; |
1523 | } | 1910 | } |
1524 | - else | ||
1525 | - {i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia4","i3GEOlegendaguia");} | ||
1526 | - for (i=0;i<retorno.data.length;i++){ | ||
1527 | - id = retorno.data[i].tema+"-"+retorno.data[i].idclasse; //layer+indice da classe | ||
1528 | - re = new RegExp("'", "g"); | ||
1529 | - exp = (retorno.data[i].expressao).replace(re,'"'); | ||
1530 | - ins.push("<tr><td style='text-align:left;border-bottom:0 none white' >"+retorno.data[i].nomeclasse+"</td></tr>"); | ||
1531 | - t = (retorno.data[i].nreg * 100)/retorno.data[i].totalreg; | ||
1532 | - ins.push("<tr><td style=text-align:left ><img height=15px width="+t+"% src='"+retorno.data[i].imagem+"' /></td></tr>"); | ||
1533 | - i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse+";"+retorno.data[i].nreg); | ||
1534 | - } | ||
1535 | - ins.push("</table><br>"); | ||
1536 | - $i("i3GEOlegendaguia4obj").innerHTML = ins.join(""); | ||
1537 | - } | ||
1538 | - else | ||
1539 | - {$i("i3GEOlegendaguia4obj").innerHTML = "<p style=color:red >Erro<br>";return;} | ||
1540 | - i3GEOF.legenda.aguarde.visibility = "hidden"; | 1911 | + i3GEOF.legenda.aguarde.visibility = "hidden"; |
1541 | 1912 | ||
1542 | - new YAHOO.widget.Button( | ||
1543 | - "i3GEOlegendaGraficoPizza", | ||
1544 | - {onclick:{fn: function(){ | ||
1545 | - var js = i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php"; | ||
1546 | - i3GEO.util.scriptTag(js,"i3GEOF.legenda.iniciaGraficoPizza()","i3GEOF.graficointerativo1_script"); | 1913 | + new YAHOO.widget.Button("i3GEOlegendaGraficoPizza", { |
1914 | + onclick : { | ||
1915 | + fn : function() { | ||
1916 | + var js = i3GEO.configura.locaplic + "/ferramentas/graficointerativo1/dependencias.php"; | ||
1917 | + i3GEO.util.scriptTag(js, "i3GEOF.legenda.iniciaGraficoPizza()", "i3GEOF.graficointerativo1_script"); | ||
1918 | + } | ||
1547 | } | 1919 | } |
1548 | - }} | ||
1549 | - ); | ||
1550 | - $i("i3GEOlegendaGraficoPizza-button").style.width = "200px"; | ||
1551 | - }, | ||
1552 | - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=contagemclasse&tema="+i3GEOF.legenda.tema, | ||
1553 | - cp = new cpaint(); | ||
1554 | - //cp.set_debug(2) | ||
1555 | - cp.set_response_type("JSON"); | ||
1556 | - cp.call(p,"cocontagemclasse",monta); | ||
1557 | - } | ||
1558 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1559 | - }, | ||
1560 | - iniciaGraficoPizza: function(){ | ||
1561 | - var dados = { | ||
1562 | - "attributes":{"id":""}, | ||
1563 | - "data":{ | ||
1564 | - "dados":i3GEOF.legenda.dadosGrafico | 1920 | + }); |
1921 | + $i("i3GEOlegendaGraficoPizza-button").style.width = "200px"; | ||
1922 | + }, p = | ||
1923 | + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + i3GEO.configura.sid | ||
1924 | + + "&funcao=contagemclasse&tema=" + i3GEOF.legenda.tema, cp = new cpaint(); | ||
1925 | + // cp.set_debug(2) | ||
1926 | + cp.set_response_type("JSON"); | ||
1927 | + cp.call(p, "cocontagemclasse", monta); | ||
1928 | + } catch (e) { | ||
1929 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1930 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1565 | } | 1931 | } |
1566 | - }; | ||
1567 | - i3GEOF.graficointerativo1.tipo = "pizza_1"; | ||
1568 | - i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados); | ||
1569 | - }, | ||
1570 | - /* | ||
1571 | - Function: aplicaProcessos | ||
1572 | - | ||
1573 | - Aplica processos de ajuste em imagens de satélite | ||
1574 | - | ||
1575 | - Veja: | ||
1576 | - | ||
1577 | - <APLICAPROCESSOS> | ||
1578 | - */ | ||
1579 | - aplicaProcessos: function(){ | ||
1580 | - try{ | ||
1581 | - if(i3GEOF.legenda.aguarde.visibility === "visible") | ||
1582 | - {return;} | ||
1583 | - i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1584 | - var lista = [],ipt,i,p,cp,temp; | ||
1585 | - if ($i("i3GEOlegendaprocessos").innerHTML != ""){ | ||
1586 | - ipt = $i("i3GEOlegendaprocessos").getElementsByTagName("input"); | ||
1587 | - for (i=0;i<ipt.length; i++){ | ||
1588 | - if (ipt[i].value != ""){ | ||
1589 | - lista.push(ipt[i].value); | 1932 | + }, |
1933 | + iniciaGraficoPizza : function() { | ||
1934 | + var dados = { | ||
1935 | + "attributes" : { | ||
1936 | + "id" : "" | ||
1937 | + }, | ||
1938 | + "data" : { | ||
1939 | + "dados" : i3GEOF.legenda.dadosGrafico | ||
1940 | + } | ||
1941 | + }; | ||
1942 | + i3GEOF.graficointerativo1.tipo = "pizza_1"; | ||
1943 | + i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados); | ||
1944 | + }, | ||
1945 | + /* | ||
1946 | + * Function: aplicaProcessos | ||
1947 | + * | ||
1948 | + * Aplica processos de ajuste em imagens de satélite | ||
1949 | + * | ||
1950 | + * Veja: | ||
1951 | + * | ||
1952 | + * <APLICAPROCESSOS> | ||
1953 | + */ | ||
1954 | + aplicaProcessos : function() { | ||
1955 | + try { | ||
1956 | + if (i3GEOF.legenda.aguarde.visibility === "visible") { | ||
1957 | + return; | ||
1958 | + } | ||
1959 | + i3GEOF.legenda.aguarde.visibility = "visible"; | ||
1960 | + var lista = [], ipt, i, p, cp, temp; | ||
1961 | + if ($i("i3GEOlegendaprocessos").innerHTML != "") { | ||
1962 | + ipt = $i("i3GEOlegendaprocessos").getElementsByTagName("input"); | ||
1963 | + for (i = 0; i < ipt.length; i++) { | ||
1964 | + if (ipt[i].value != "") { | ||
1965 | + lista.push(ipt[i].value); | ||
1966 | + } | ||
1590 | } | 1967 | } |
1591 | } | 1968 | } |
1592 | - } | ||
1593 | - lista = lista.join("|"); | ||
1594 | - temp = function(){ | 1969 | + lista = lista.join("|"); |
1970 | + temp = function() { | ||
1971 | + i3GEOF.legenda.aguarde.visibility = "hidden"; | ||
1972 | + i3GEOF.legenda.mostralegenda(); | ||
1973 | + i3GEOF.legenda.aposAlterarLegenda(); | ||
1974 | + }; | ||
1975 | + p = | ||
1976 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid | ||
1977 | + + "&funcao=aplicaProcessos&lista=" + lista + "&tema=" + i3GEOF.legenda.tema; | ||
1978 | + cp = new cpaint(); | ||
1979 | + cp.set_response_type("JSON"); | ||
1980 | + cp.call(p, "aplicaProcessos", temp); | ||
1981 | + } catch (e) { | ||
1982 | + i3GEO.janela.tempoMsg("Erro: " + e); | ||
1595 | i3GEOF.legenda.aguarde.visibility = "hidden"; | 1983 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
1596 | - i3GEOF.legenda.mostralegenda(); | ||
1597 | - i3GEOF.legenda.aposAlterarLegenda(); | ||
1598 | - }; | ||
1599 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=aplicaProcessos&lista="+lista+"&tema="+i3GEOF.legenda.tema; | ||
1600 | - cp = new cpaint(); | ||
1601 | - cp.set_response_type("JSON"); | ||
1602 | - cp.call(p,"aplicaProcessos",temp); | 1984 | + } |
1985 | + }, | ||
1986 | + /* | ||
1987 | + * Function: adicionaProcesso | ||
1988 | + * | ||
1989 | + * Adiciona um novo processo na lista de processos | ||
1990 | + */ | ||
1991 | + adicionaProcesso : function(s) { | ||
1992 | + $i("i3GEOlegendaprocessos").innerHTML += $inputText("", "", "", "", 50, s.value); | ||
1603 | } | 1993 | } |
1604 | - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} | ||
1605 | - }, | ||
1606 | - /* | ||
1607 | - Function: adicionaProcesso | ||
1608 | - | ||
1609 | - Adiciona um novo processo na lista de processos | ||
1610 | - */ | ||
1611 | - adicionaProcesso: function(s){ | ||
1612 | - $i("i3GEOlegendaprocessos").innerHTML += $inputText("","","","",50,s.value); | ||
1613 | - } | ||
1614 | -}; | ||
1615 | \ No newline at end of file | 1994 | \ No newline at end of file |
1995 | + }; | ||
1616 | \ No newline at end of file | 1996 | \ No newline at end of file |