Commit fd7cc2113b0872be819d570a26737fb04e9e0387
1 parent
bf4b4321
Exists in
master
and in
6 other branches
Inclusão dos valores das cores das classes na função que obtém os parâmetros da legenda em JSON
Showing
7 changed files
with
1302 additions
and
1235 deletions
Show diff stats
classesphp/classe_legenda.php
1 | -<?php | |
2 | -/* | |
3 | - Title: classe_legenda.php | |
4 | - | |
5 | -Manipulação da legenda. | |
6 | - | |
7 | -Cria legenda, edita simbolos, etc. | |
8 | - | |
9 | -Licenca: | |
10 | - | |
11 | -GPL2 | |
12 | - | |
13 | - | |
14 | -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
15 | - | |
16 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
17 | -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | |
18 | - | |
19 | -Este programa é software livre; você pode redistribuí-lo | |
20 | -e/ou modificá-lo sob os termos da Licença Pública Geral | |
21 | -GNU conforme publicada pela Free Software Foundation; | |
22 | - | |
23 | -Este programa é distribuído na expectativa de que seja útil, | |
24 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
25 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
26 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | |
27 | -Você deve ter recebido uma c�pia da Licença Pública Geral do | |
28 | - GNU junto com este programa; se não, escreva para a | |
29 | -Free Software Foundation, Inc., no endereço | |
30 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
31 | - | |
32 | -Arquivo: | |
33 | - | |
34 | -i3geo/classesphp/classe_legenda.php | |
35 | -*/ | |
36 | -/* | |
37 | - Classe: Legenda | |
38 | - | |
39 | -*/ | |
40 | -class Legenda | |
41 | -{ | |
42 | - /* | |
43 | - Variavel: $mapa | |
44 | - | |
45 | - Objeto mapa | |
46 | - */ | |
47 | - public $mapa; | |
48 | - /* | |
49 | - Variavel: $arquivo | |
50 | - | |
51 | - Arquivo map file | |
52 | - */ | |
53 | - protected $arquivo; | |
54 | - /* | |
55 | - Variavel: $layer | |
56 | - | |
57 | - Objeto layer | |
58 | - */ | |
59 | - public $layer; | |
60 | - /* | |
61 | - Variavel: $nome | |
62 | - | |
63 | - Nome do layer | |
64 | - */ | |
65 | - protected $nome; | |
66 | - /* | |
67 | - Variavel: $grupo | |
68 | - | |
69 | - Array com os temas do grupo, se houver | |
70 | - */ | |
71 | - protected $grupo; | |
72 | - /* | |
73 | - Variavel: $visiveis | |
74 | - | |
75 | - Temas do grupo que são visíveis em função da escala | |
76 | - */ | |
77 | - protected $visiveis; | |
78 | - /* | |
79 | - Variavel: $indices | |
80 | - | |
81 | - Indices dos layers do grupo | |
82 | - */ | |
83 | - protected $indices; | |
84 | - /* | |
85 | - Variavel: $templateleg | |
86 | - | |
87 | - Template da legenda | |
88 | - */ | |
89 | - protected $templateleg; | |
90 | - /* | |
91 | - Variavel: $localaplicacao | |
92 | - | |
93 | - Localização da aplicação | |
94 | - */ | |
95 | - protected $localaplicacao; | |
96 | - /* | |
97 | - Variavel: $v | |
98 | - | |
99 | - Versão atual do Mapserver (primeiro dígito) | |
100 | - */ | |
101 | - public $v; | |
102 | - /* | |
103 | - Function: __construct | |
104 | - | |
105 | - Cria um objeto Legenda | |
106 | - | |
107 | - parameters: | |
108 | - | |
109 | - $map_file - Endereço do mapfile no servidor. | |
110 | - | |
111 | - $locaplic - localização do I3Geo no servidor | |
112 | - | |
113 | - $tema - nome do tema | |
114 | - | |
115 | - $template - nome do template para processar a legenda | |
116 | - */ | |
117 | - | |
118 | - function __construct($map_file="",$locaplic="",$tema="",$template="") | |
119 | - { | |
120 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
121 | - $this->postgis_mapa = $postgis_mapa; | |
122 | - include_once(dirname(__FILE__)."/funcoes_gerais.php"); | |
123 | - $this->v = versao(); | |
124 | - $this->v = $this->v["principal"]; | |
125 | - $this->localaplicacao = $locaplic; | |
126 | - if($map_file == "") | |
127 | - { | |
128 | - return; | |
129 | - } | |
130 | - $this->mapa = ms_newMapObj($map_file); | |
131 | - substituiConObj($this->mapa,$postgis_mapa); | |
132 | - $this->arquivo = str_replace(".map","",$map_file).".map"; | |
133 | - | |
134 | - if($tema != "" && @$this->mapa->getlayerbyname($tema)) | |
135 | - { | |
136 | - $this->layer = $this->mapa->getlayerbyname($tema); | |
137 | - $this->nome = $tema; | |
138 | - $vermultilayer = new vermultilayer(); | |
139 | - $vermultilayer->verifica($map_file,$tema); | |
140 | - if ($vermultilayer->resultado == 1) // o tema e multi layer | |
141 | - { | |
142 | - $ls = $vermultilayer->temas; | |
143 | - $this->visiveis = $vermultilayer->temasvisiveis; | |
144 | - } | |
145 | - else | |
146 | - { | |
147 | - $ls[] = $tema; | |
148 | - $this->visiveis = array($tema); | |
149 | - } | |
150 | - $this->grupo = $ls; | |
151 | - foreach ($ls as $l) | |
152 | - { | |
153 | - $t = $this->mapa->getlayerbyname($l); | |
154 | - $this->indices[] = $t->index; | |
155 | - } | |
156 | - } | |
157 | - if ($template == ""){ | |
158 | - $template="legenda.htm"; | |
159 | - } | |
160 | - if(file_exists($template)) | |
161 | - { | |
162 | - $this->templateleg = $template; | |
163 | - return; | |
164 | - } | |
165 | - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | |
166 | - { | |
167 | - $this->templateleg = $locaplic."\\aplicmap\\".$template; | |
168 | - } | |
169 | - else | |
170 | - {$this->templateleg = $locaplic."/aplicmap/".$template; | |
171 | - } | |
172 | - } | |
173 | - /* | |
174 | - function: salva | |
175 | - | |
176 | - Salva o mapfile atual | |
177 | - */ | |
178 | - function salva() | |
179 | - { | |
180 | - $this->recalculaSLD(); | |
181 | - restauraConObj($this->mapa,$this->postgis_mapa); | |
182 | - $this->mapa->save($this->arquivo); | |
183 | - } | |
184 | - /* | |
185 | - function: recalculaSLD | |
186 | - | |
187 | - Constroi o SLD que é aplicado ao metadata wms_sld_body. O SLD resultante é baseado nas definições das classes existentes no layer | |
188 | - */ | |
189 | - function recalculaSLD(){ | |
190 | - if($this->layer->classitem != "" && $this->layer->connectiontype == 7 && $this->layer->numclasses > 0){ | |
191 | - $tipotemp = $this->layer->type; | |
192 | - $tiporep = $this->layer->getmetadata("tipooriginal"); | |
193 | - $this->layer->set("type",MS_LAYER_POLYGON); | |
194 | - if ($tiporep == "linear") | |
195 | - { | |
196 | - $this->layer->set("type",MS_LAYER_LINE); | |
197 | - } | |
198 | - if ($tiporep == "pontual") | |
199 | - { | |
200 | - $this->layer->set("type",MS_LAYER_POINT); | |
201 | - } | |
202 | - $this->layer->set("status",MS_DEFAULT); | |
203 | - $this->layer->setmetadata("wms_sld_body",""); | |
204 | - $sld = $this->layer->generateSLD(); | |
205 | - if($sld != "") | |
206 | - { | |
207 | - $this->layer->setmetadata("wms_sld_body",str_replace('"',"'",$sld)); | |
208 | - } | |
209 | - $this->layer->set("type",$tipotemp); | |
210 | - } | |
211 | - } | |
212 | - /* | |
213 | - function: aplicaLegendaImg | |
214 | - | |
215 | - Aplica o metadata legendaimg que define um arquivo de imagem no lugar da criacao automatica da legenda | |
216 | - */ | |
217 | - function aplicaLegendaImg($imagem){ | |
218 | - $this->layer->setmetadata("legendaimg",$imagem); | |
219 | - } | |
220 | - /* | |
221 | - function: criaLegenda | |
222 | - | |
223 | - Gera a legenda processando o template HTML definido na construção da classe. | |
224 | - | |
225 | - Se o tema for um WMS ou se o metadata legendaimg estiver definido, executa $this->tabelaLegenda | |
226 | - | |
227 | - Return: | |
228 | - | |
229 | - string com a legenda HTML | |
230 | - */ | |
231 | - function criaLegenda() | |
232 | - { | |
233 | - $l = ""; | |
234 | - $numlayers = $this->mapa->numlayers; | |
235 | - if($this->nome != ""){ | |
236 | - //verifica se é wms ou se o metadata legendaimg está definido | |
237 | - $c = $this->layer->connectiontype; | |
238 | - if ($c == 7 || $this->layer->getmetadata("legendaimg") != ""){ | |
239 | - return($this->tabelaLegenda()); | |
240 | - } | |
241 | - for ($i=0;$i < $numlayers;++$i){ | |
242 | - $la = $this->mapa->getlayer($i); | |
243 | - if ($la->name != $this->nome) | |
244 | - { | |
245 | - $la->set("status",MS_OFF); | |
246 | - } | |
247 | - if ($la->group == $this->nome) | |
248 | - { | |
249 | - $la->set("status",MS_DEFAULT); | |
250 | - } | |
251 | - $la->set("minscaledenom",0); | |
252 | - $la->set("maxscaledenom",0); | |
253 | - } | |
254 | - $this->layer->set("status",MS_DEFAULT); | |
255 | - } | |
256 | - $desligar = array(); | |
257 | - for ($i=0;$i < $numlayers;++$i){ | |
258 | - $la = $this->mapa->getlayer($i); | |
259 | - if (strtoupper($la->getmetadata("ESCONDIDO")) == "SIM"){ | |
260 | - $la->set("status",MS_OFF); | |
261 | - } | |
262 | - $desligarLayer = array(); | |
263 | - if($la->status == MS_DEFAULT){ | |
264 | - $nc = $la->numclasses; | |
265 | - for ($c = 0;$c < $nc;$c++){ | |
266 | - $classe = $la->getclass($c); | |
267 | - if($classe->status == MS_OFF){ | |
268 | - $desligarLayer[] = $c; | |
269 | - } | |
270 | - //remove o offset em simbolos do tipo imagem | |
271 | - if($classe->numstyles > 0){ | |
272 | - $estilo = $classe->getstyle(0); | |
273 | - if($estilo->symbolname != "" && file_exists($estilo->symbolname)){ | |
274 | - $estilo->set("offsetx",0); | |
275 | - $estilo->set("offsety",0); | |
276 | - } | |
277 | - } | |
278 | - } | |
279 | - $la->set("minscaledenom",0); | |
280 | - $la->set("maxscaledenom",0); | |
281 | - } | |
282 | - $desligar[$la->name] = $desligarLayer; | |
283 | - } | |
284 | - $legenda = $this->mapa->legend; | |
285 | - $legenda->set("template",$this->templateleg); | |
286 | - $tmparray["my_tag"] = "value_of_my_tag"; | |
287 | - if(!$l = @$this->mapa->processlegendtemplate($tmparray)){ | |
288 | - return ("erro"); | |
289 | - } | |
290 | - //e necessario explodir as partes da legenda para converter os caracteres | |
291 | - $pedacos = explode("<tr>",$l); | |
292 | - $n = count($pedacos); | |
293 | - for($i=0;$i<$n;$i++){ | |
294 | - $pedacos[$i] = $this->converte($pedacos[$i]); | |
295 | - } | |
296 | - $l = implode("<tr>",$pedacos); | |
297 | - return (array("legenda"=>$l,"desativar"=>$desligar)); | |
298 | - } | |
299 | - function criaLegendaJson($w=25,$h=25) | |
300 | - { | |
301 | - $l = ""; | |
302 | - $numlayers = $this->mapa->numlayers; | |
303 | - if($this->nome != ""){ | |
304 | - //verifica se é wms ou se o metadata legendaimg está definido | |
305 | - $c = $this->layer->connectiontype; | |
306 | - if ($c == 7 || $this->layer->getmetadata("legendaimg") != ""){ | |
307 | - return($this->tabelaLegenda()); | |
308 | - } | |
309 | - for ($i=0;$i < $numlayers;++$i){ | |
310 | - $la = $this->mapa->getlayer($i); | |
311 | - if ($la->name != $this->nome) | |
312 | - { | |
313 | - $la->set("status",MS_OFF); | |
314 | - } | |
315 | - if ($la->group == $this->nome) | |
316 | - { | |
317 | - $la->set("status",MS_DEFAULT); | |
318 | - } | |
319 | - $la->set("minscaledenom",0); | |
320 | - $la->set("maxscaledenom",0); | |
321 | - } | |
322 | - $this->layer->set("status",MS_DEFAULT); | |
323 | - } | |
324 | - $desligar = array(); | |
325 | - $legenda = array(); | |
326 | - for ($i=0;$i < $numlayers;++$i){ | |
327 | - $la = $this->mapa->getlayer($i); | |
328 | - if (strtoupper($la->getmetadata("ESCONDIDO")) == "SIM"){ | |
329 | - $la->set("status",MS_OFF); | |
330 | - } | |
331 | - $desligarLayer = array(); | |
332 | - if($la->status == MS_DEFAULT){ | |
333 | - if($la->getmetadata("legendaimg") != ""){ | |
334 | - $classes = array(); | |
335 | - $classes[] = array("nome"=>"","img"=>$la->getmetadata("legendaimg"), "checked"=>"checked", "index" => 0, "layer"=> $la->name ); | |
336 | - $legenda[] = array("layer"=>$la->name,"nome"=>$this->converte($la->getmetadata("tema")),"classes"=>$classes); | |
337 | - } else { | |
338 | - $la->set("minscaledenom",0); | |
339 | - $la->set("maxscaledenom",0); | |
340 | - $nc = $la->numclasses; | |
341 | - $classes = array(); | |
342 | - for ($c = 0;$c < $nc;$c++){ | |
343 | - $ck = "checked"; | |
344 | - $classe = $la->getclass($c); | |
345 | - if($classe->status == MS_OFF){ | |
346 | - $ck = ""; | |
347 | - } | |
348 | - //remove o offset em simbolos do tipo imagem | |
349 | - if($classe->numstyles > 0){ | |
350 | - $estilo = $classe->getstyle(0); | |
351 | - if($estilo->symbolname != "" && file_exists($estilo->symbolname)){ | |
352 | - $estilo->set("offsetx",0); | |
353 | - $estilo->set("offsety",0); | |
354 | - } | |
355 | - } | |
356 | - $imagem = $classe->createLegendIcon($w,$h)->saveWebImage(); | |
357 | - | |
358 | - $classes[] = array("nome"=>$this->converte($classe->name),"img"=>$imagem, "checked"=>$ck, "index" => $c, "layer"=> $la->name ); | |
359 | - } | |
360 | - $legenda[] = array("layer"=>$la->name,"nome"=>$this->converte($la->getmetadata("tema")),"classes"=>$classes); | |
361 | - } | |
362 | - } | |
363 | - $desligar[$la->name] = $desligarLayer; | |
364 | - } | |
365 | - return (array("legenda"=>$legenda)); | |
366 | - } | |
367 | - | |
368 | - /* | |
369 | - function: legendaGrafica | |
370 | - | |
371 | - Desenha a imagem da legenda. | |
372 | - | |
373 | - return: | |
374 | - string de variaveis no formato javascript que permitem montar a legenda. | |
375 | - */ | |
376 | - function legendaGrafica(){ | |
377 | - $numlayers = $this->mapa->numlayers; | |
378 | - for ($i=0;$i < $numlayers;++$i){ | |
379 | - $layer = $this->mapa->getlayer($i); | |
380 | - if (($layer->data != "") && (strtoupper($layer->getmetadata("escondido")) != "SIM") && (strtoupper($layer->getmetadata("tema")) != "NAO")){ | |
381 | - if ($layer->numclasses > 0){ | |
382 | - $classe = $layer->getclass(0); | |
383 | - if (($classe->name == "") || ($classe->name == " ")) | |
384 | - { | |
385 | - $classe->set("name",$layer->getmetadata("tema")); | |
386 | - } | |
387 | - //corrige o titulo da legenda | |
388 | - if($layer->type != 3 && $layer->type != 4){ | |
389 | - $nclass = $layer->numclasses; | |
390 | - for($j=0;$j<$nclass;$j++){ | |
391 | - $classe = $layer->getclass($j); | |
392 | - if($classe->title === ""){ | |
393 | - $classe->title = $classe->name; | |
394 | - } | |
395 | - } | |
396 | - } | |
397 | - } | |
398 | - } | |
399 | - } | |
400 | - $nomeImagem = nomeRandomico(); | |
401 | - $imgo = $this->mapa->drawlegend(); | |
402 | - if($imgo->imagepath == "") | |
403 | - { | |
404 | - echo "Erro IMAGEPATH vazio";exit; | |
405 | - } | |
406 | - $nomer = ($imgo->imagepath)."leg".$nomeImagem.".png"; | |
407 | - $imgo->saveImage($nomer); | |
408 | - $nomer = ($imgo->imageurl).basename($nomer); | |
409 | - return("var legimagem='".$nomer."';var legwidth=".$imgo->width.";var legheight=".$imgo->height.";var legpath='".$imgo->imagepath."';var legurl='".$imgo->imageurl."'"); | |
410 | - } | |
411 | - /* | |
412 | - function: tabelaLegenda | |
413 | - | |
414 | - Cria elementos para construir uma legenda no formato de tabela em HTML. | |
415 | - | |
416 | - Utilizado na função de edição de legenda e legenda de WMS | |
417 | - | |
418 | - parameters: | |
419 | - | |
420 | - totaliza - sim|nao indica se os totais de elementos devem ser acrescentados ao nome da classe | |
421 | - | |
422 | - return: | |
423 | - array | |
424 | - */ | |
425 | - function tabelaLegenda($totaliza="nao"){ | |
426 | - $linhas = array(); | |
427 | - foreach ($this->visiveis as $l){ | |
428 | - $layer = $this->mapa->getlayerbyname($l); | |
429 | - //verifica se é wms ou wfs | |
430 | - $c = $layer->connectiontype; | |
431 | - | |
432 | - $s = $layer->getmetadata("wms_sld_url"); | |
433 | - $im = $layer->getmetadata("legendaimg"); | |
434 | - $nc = $layer->numclasses; | |
435 | - // | |
436 | - //se for wms e tiver classes define o tipo de layer para poder gerar a legenda corretamente | |
437 | - // | |
438 | - if($c == 7 && $nc > 0){ | |
439 | - $tipotemp = $layer->type; | |
440 | - $tiporep = $layer->getmetadata("tipooriginal"); | |
441 | - $layer->set("type",MS_LAYER_POLYGON); | |
442 | - if($tiporep == "linear"){ | |
443 | - $layer->set("type",MS_LAYER_LINE); | |
444 | - } | |
445 | - if ($tiporep == "pontual"){ | |
446 | - $layer->set("type",MS_LAYER_POINT); | |
447 | - } | |
448 | - } | |
449 | - // | |
450 | - //se for WMS e não tiver classes, tenta pegar a legenda via requisição WMS | |
451 | - // | |
452 | - if ($c == 7) { | |
453 | - if($c == 7){ | |
454 | - $con = $layer->connection; | |
455 | - $ver = $layer->getmetadata("wms_server_version"); | |
456 | - $lwms = $layer->getmetadata("wms_name"); | |
457 | - $f = $layer->getmetadata("wms_formatlist"); | |
458 | - $f = explode(",",$f); | |
459 | - $f = $f[0]; | |
460 | - $imgLeg = $con."&request=GetLegendGraphic&version=".$ver."&service=wms&layer=".$lwms."&format=".$f."&SLD=".$s; | |
461 | - if ($layer->getmetadata("legendawms") != ""){ | |
462 | - $imgLeg = $layer->getmetadata("legendawms"); | |
463 | - } | |
464 | - } | |
465 | - else{ | |
466 | - $imgLeg = $im; | |
467 | - } | |
468 | - $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","expressao"=>"","imagem"=>$imgLeg,"minScale"=>0,"maxScale"=>0); | |
469 | - } | |
470 | - else { | |
471 | - for ($c = 0;$c < $nc;$c++) { | |
472 | - $classe = $layer->getclass($c); | |
473 | - $imgi = $classe->createlegendicon(30,15); | |
474 | - $classe->drawlegendicon(30,15,$imgi,0,0); | |
475 | - $nomes = nomeRandomico(12); | |
476 | - $nomer = ($imgi->imagepath)."icone".$nomes.".png"; | |
477 | - $imgi->saveImage($nomer); | |
478 | - $i = ($imgi->imageurl).basename($nomer); | |
479 | - $nomeclasse = $classe->name; | |
480 | - | |
481 | - //if (function_exists("mb_convert_encoding")) | |
482 | - //{$nomeclasse = mb_convert_encoding($nomeclasse,"UTF-8","ISO-8859-1");} | |
483 | - $nomeclasse = $this->converte($nomeclasse); | |
484 | - $nomeexp = $classe->getExpressionString(); | |
485 | - if (function_exists("mb_convert_encoding")) { | |
486 | - $nomeexp = mb_convert_encoding($nomeexp,"UTF-8","ISO-8859-1"); | |
487 | - } | |
488 | - $linhas[] = array("tema"=>$l,"idclasse"=>$c,"nomeclasse"=>$nomeclasse,"expressao"=>$nomeexp,"imagem"=>$i,"proc"=>"","minScale"=>$classe->minscaledenom,"maxScale"=>$classe->maxscaledenom); | |
489 | - } | |
490 | - if (($totaliza=="sim") && ($nc > 1)){ | |
491 | - $layer->set("template","none.htm"); | |
492 | - $sopen = $layer->open(); | |
493 | - if($sopen == MS_FAILURE){ | |
494 | - return "erro"; | |
495 | - } | |
496 | - $itens = $layer->getitems(); | |
497 | - $total = 0; | |
498 | - $nreg = array(); | |
499 | - for ($c = 0;$c < $nc;$c++){ | |
500 | - $exp = $linhas[$c]; | |
501 | - $exp = $exp["expressao"]; | |
502 | - if($exp !== ""){ | |
503 | - if($this->layer->connectiontype == MS_POSTGIS){ | |
504 | - $exp = str_replace("eq"," = ",$exp); | |
505 | - $exp = str_replace("ne"," != ",$exp); | |
506 | - $exp = str_replace("lt"," < ",$exp); | |
507 | - $exp = str_replace("gt"," < ",$exp); | |
508 | - $exp = str_replace("(","",$exp); | |
509 | - $exp = str_replace(")","",$exp); | |
510 | - $exp = str_replace("'[","",$exp); | |
511 | - $exp = str_replace("]'","",$exp); | |
512 | - $exp = str_replace("' [","",$exp); | |
513 | - $exp = str_replace("] '","",$exp); | |
514 | - $exp = str_replace("and"," and ",$exp); | |
515 | - $exp = str_replace("or"," or ",$exp); | |
516 | - $exp = str_replace("[","",$exp); | |
517 | - $exp = str_replace("]","",$exp); | |
518 | - } | |
519 | - $teste = $layer->queryByAttributes($itens[0], $exp, 1); | |
520 | - if($teste != MS_SUCCESS){ | |
521 | - $teste = $layer->queryByAttributes($itens[0], mb_convert_encoding($exp,"ISO-8859-1","UTF-8"), 1); | |
522 | - } | |
523 | - if($teste != MS_SUCCESS){ | |
524 | - $teste = $layer->queryByAttributes($itens[0], mb_convert_encoding($exp,"UTF-8","ISO-8859-1"), 1); | |
525 | - } | |
526 | - } | |
527 | - else{ | |
528 | - $teste = 0; | |
529 | - } | |
530 | - if ($teste == MS_SUCCESS){ | |
531 | - $n = $layer->getNumResults(); | |
532 | - $nreg[] = $n; | |
533 | - } | |
534 | - else { | |
535 | - $nreg[] = "erro"; | |
536 | - } | |
537 | - $total = $total + $n; | |
538 | - } | |
539 | - $layer->close(); | |
540 | - for ($c = 0;$c < $nc;$c++){ | |
541 | - $classe = $layer->getclass($c); | |
542 | - $nome = $linhas[$c]["nomeclasse"]; | |
543 | - $nome = explode(" - n=",$nome); | |
544 | - $nome = $nome[0]." - n=".$nreg[$c]."(".(round(($nreg[$c] * 100 / $total)))."%)"; | |
545 | - $classe->set("name",$nome); | |
546 | - $linhas[$c]["nomeclasse"] = $nome; | |
547 | - $linhas[$c]["nreg"] = $nreg[$c]; | |
548 | - $linhas[$c]["totalreg"] = $total; | |
549 | - } | |
550 | - } | |
551 | - if ($layer->type == MS_LAYER_RASTER && $nc == 1){ | |
552 | - $proc = ""; | |
553 | - $linhas = array(); | |
554 | - if($layer->num_processing > 0){ | |
555 | - $proc = $layer->getProcessing(); | |
556 | - } | |
557 | - if($layer->type == MS_LAYER_RASTER && $proc == ""){ | |
558 | - $proc = array("RESAMPLE=NEAREST"); | |
559 | - } | |
560 | - $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","imagem"=>"","proc"=>$proc,"minScale"=>0,"maxScale"=>0); | |
561 | - } | |
562 | - } | |
563 | - } | |
564 | - return $linhas; | |
565 | - } | |
566 | - /* | |
567 | - function: excluiEstilo | |
568 | - | |
569 | - Exclui um estilo de uma classe. | |
570 | - */ | |
571 | - function excluiEstilo($classe,$estilo) | |
572 | - { | |
573 | - if(!$this->layer){ | |
574 | - return "erro"; | |
575 | - } | |
576 | - $classe = $this->layer->getclass($classe); | |
577 | - $classe->deletestyle($estilo); | |
578 | - $this->layer->removeMetaData("cache"); | |
579 | - return "ok"; | |
580 | - } | |
581 | - /* | |
582 | - function: adicionaEstilo | |
583 | - | |
584 | - Adiciona um estilo em uma classe. | |
585 | - | |
586 | - return: | |
587 | - objeto estilo | |
588 | - */ | |
589 | - function adicionaEstilo($classe,$estilo) | |
590 | - { | |
591 | - if(!$this->layer){ | |
592 | - return "erro"; | |
593 | - } | |
594 | - $classe = $this->layer->getclass($classe); | |
595 | - $estilo = $classe->getstyle($estilo); | |
596 | - $e = ms_newStyleObj($classe,$estilo); | |
597 | - $this->layer->removeMetaData("cache"); | |
598 | - return($e); | |
599 | - } | |
600 | - /* | |
601 | - function: sobeEstilo | |
602 | - | |
603 | - | |
604 | - Sobe um estilo na ordem de desenho de uma classe. | |
605 | - | |
606 | - parameters: | |
607 | - $classe - Índice da classe. | |
608 | - $estilo - Índice do estilo de uma classe que será clonado. | |
609 | - */ | |
610 | - function sobeEstilo($classe,$estilo) | |
611 | - { | |
612 | - if(!$this->layer){ | |
613 | - return "erro"; | |
614 | - } | |
615 | - $classe = $this->layer->getclass($classe); | |
616 | - $classe->movestyleup($estilo); | |
617 | - $this->layer->removeMetaData("cache"); | |
618 | - } | |
619 | - /* | |
620 | - function: desceEstilo | |
621 | - | |
622 | - Desce um estilo na ordem de desenho de uma classe. | |
623 | - | |
624 | - parameters: | |
625 | - $classe - Índice da classe. | |
626 | - | |
627 | - $estilo - Índice do estilo de uma classe que será clonado. | |
628 | - */ | |
629 | - function desceEstilo($classe,$estilo) | |
630 | - { | |
631 | - if(!$this->layer){ | |
632 | - return "erro"; | |
633 | - } | |
634 | - $classe = $this->layer->getclass($classe); | |
635 | - $classe->movestyledown($estilo); | |
636 | - $this->layer->removeMetaData("cache"); | |
637 | - } | |
638 | - /* | |
639 | - function: listaSimbolos | |
640 | - | |
641 | - Retorna uma lista de símbolos clicáveis no formato HTML. | |
642 | - | |
643 | - Para cada tipo de simbologia deve haver um arquivo .map com as definições básicas. | |
644 | - | |
645 | - Todos os símbolos do arquivo symbols/simbolos serão retornados como imagens. | |
646 | - | |
647 | - parameters: | |
648 | - | |
649 | - $tipo - Tipo de representação do símbolo, 0 pontos, 1 linhas e 2 polígonos. | |
650 | - | |
651 | - $dir_tmp - Diretório temporário do mapserver. | |
652 | - | |
653 | - $imgdir - Diretório temporário das imagens. | |
654 | - | |
655 | - $onclick - Função que será incluída no HTML no evento onclick sobre o símbolo | |
656 | - | |
657 | - $tamanho - Tamanho (size) do símbolo | |
658 | - | |
659 | - $forca {boolean} - forca a exclusao dos simbolos atualmente em cache | |
660 | - | |
661 | - return: | |
662 | - | |
663 | - String no formato HTML com as imagens dos símbolos | |
664 | - */ | |
665 | - function listaSimbolos($tipo,$dir_tmp,$imgdir,$onclick,$tamanho=8,$width=1,$forca=false) | |
666 | - { | |
667 | - $versao = versao(); | |
668 | - $versao = $versao["principal"]; | |
669 | - //error_reporting(0); | |
670 | - if ($tipo == 3){ | |
671 | - $tipo = 2; | |
672 | - } //tipo raster | |
673 | - if($imgdir == ""){ | |
674 | - $dir = $dir_tmp; | |
675 | - } | |
676 | - else{ | |
677 | - $dir = $dir_tmp."/".$imgdir; | |
678 | - } | |
679 | - if($forca == true){ | |
680 | - unlink($dir."/simbolos".$tipo.".inc"); | |
681 | - } | |
682 | - $ins = ""; | |
683 | - //pega imagens que podem ser usadas como simbolos | |
684 | - if($tipo == 0){ | |
685 | - if(!isset($locaplic)){ | |
686 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
687 | - } | |
688 | - //veja esse codigo tambem em ferramentas/uploadsimbolo/exec.php | |
689 | - $pasta = $locaplic."/temas"; | |
690 | - $url = "../temas"; | |
691 | - if($customDir != "interface"){ | |
692 | - $teste = $locaplic."/".$customDir; | |
693 | - if(file_exists($teste)){ | |
694 | - $pasta = $teste; | |
695 | - $url = "../".$customDir; | |
696 | - } | |
697 | - $teste = $locaplic."/".$customDir."/images"; | |
698 | - if(file_exists($teste)){ | |
699 | - $pasta = $teste; | |
700 | - $url = "../".$customDir."/images"; | |
701 | - } | |
702 | - $teste = $locaplic."/".$customDir."/imagens"; | |
703 | - if(file_exists($teste)){ | |
704 | - $pasta = $teste; | |
705 | - $url = "../".$customDir."/imagens"; | |
706 | - } | |
707 | - } | |
708 | - if(file_exists($pasta)){ | |
709 | - $lista = listaArquivos($pasta,true,array("png","PNG")); | |
710 | - //var_dump($lista);exit; | |
711 | - $n = count($lista["nomes"]); | |
712 | - for($i = 0; $i < $n; $i++){ | |
713 | - $ins .= "<img src='".$url."/".$lista["nomes"][$i]."' style='max-width: 80px;cursor:pointer;border: 5px solid #FFFFFF' title=".$pasta."/".$lista["nomes"][$i]." onclick='".$onclick."'>"; | |
714 | - } | |
715 | - } | |
716 | - } | |
717 | - if (!file_exists($dir."/simbolos".$tipo.".inc")) | |
718 | - { | |
719 | - $f = fopen($dir."/simbolos".$tipo.".inc","w"); | |
720 | - if ($tipo == 2){ | |
721 | - $t="simpolv".$versao.".map"; | |
722 | - } | |
723 | - if ($tipo == 0){ | |
724 | - $t="simptv".$versao.".map"; | |
725 | - } | |
726 | - if ($tipo == 1){ | |
727 | - $t="simlinv".$versao.".map"; | |
728 | - $tamanho = $tamanho / 4; | |
729 | - } | |
730 | - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | |
731 | - { | |
732 | - $mapatemp = ms_newMapObj($this->localaplicacao."\\aplicmap\\".$t); | |
733 | - } | |
734 | - else{ | |
735 | - $mapatemp = ms_newMapObj($this->localaplicacao."/aplicmap/".$t); | |
736 | - } | |
737 | - $l = $mapatemp->getlayer(0); | |
738 | - | |
739 | - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | |
740 | - { | |
741 | - $novoss = dirname($this->mapa->symbolsetfilename)."\\".basename($mapatemp->symbolsetfilename); | |
742 | - } | |
743 | - else{ | |
744 | - $novoss = dirname($this->mapa->symbolsetfilename)."/".basename($mapatemp->symbolsetfilename); | |
745 | - } | |
746 | - | |
747 | - $this->mapa->setsymbolset($novoss); | |
748 | - | |
749 | - $ns = $this->mapa->getnumsymbols(); | |
750 | - $inis = 0; | |
751 | - | |
752 | - //na versao 7 nao tem o simbolo 0 | |
753 | - if($this->v >= 7){ | |
754 | - $inis = 1; | |
755 | - //se for versao 7 inclui um primeiro simbolo com valor 0 e imagem | |
756 | - $oSymbol = $this->mapa->getSymbolObjectById(1); | |
757 | - $adiciona = ms_newLayerObj($this->mapa, $l); | |
758 | - $nomel = $l->name; | |
759 | - $tematemp= $this->mapa->getlayerbyname($nomel); | |
760 | - $c = $tematemp->getClass(0); | |
761 | - $e = $c->getstyle(0); | |
762 | - $e->set("size",1); | |
763 | - $e->set("width",1); | |
764 | - $ico = $c->createLegendIcon(40,40); | |
765 | - $nimg = $ico->saveWebImage(); | |
766 | - $pat = $this->mapa->web->imageurl; | |
767 | - $ins .= "<img src='".$nimg."' style='cursor:pointer;border: 5px solid #FFFFFF' title='0' onclick='".$onclick."'>"; | |
768 | - } | |
769 | - for ($i=$inis;$i < $ns;++$i){ | |
770 | - $oSymbol = $this->mapa->getSymbolObjectById($i); | |
771 | - $nomes = $oSymbol->name; | |
772 | - if($nomes == ""){ | |
773 | - $nomes = $i; | |
774 | - } | |
775 | - $adiciona = ms_newLayerObj($this->mapa, $l); | |
776 | - $nomel = $l->name; | |
777 | - $tematemp= $this->mapa->getlayerbyname($nomel); | |
778 | - $c = $tematemp->getClass(0); | |
779 | - $e = $c->getstyle(0); | |
780 | - $e->set("symbolname",$nomes); | |
781 | - $e->set("size",$tamanho); | |
782 | - $e->set("width",$width); | |
783 | - $ico = $c->createLegendIcon(40,40); | |
784 | - $nimg = $ico->saveWebImage(); | |
785 | - $pat = $this->mapa->web->imageurl; | |
786 | - $ins .= "<img src='".$nimg."' style='cursor:pointer;border: 5px solid #FFFFFF' title=".$nomes." onclick='".$onclick."'>"; | |
787 | - } | |
788 | - fwrite($f,"<?php \$res = \"".$ins."\";?>"); | |
789 | - fclose($f); | |
790 | - //copy ($dir."/simbolos".$tipo.".inc",$dir_tmp."/comum/simbolos".$tipo.".inc"); | |
791 | - return $ins; | |
792 | - } | |
793 | - else { | |
794 | - $res = ""; | |
795 | - include_once $dir."/simbolos".$tipo.".inc"; | |
796 | - return $res; | |
797 | - } | |
798 | - } | |
799 | - /* | |
800 | - function: pegaParametros | |
801 | - | |
802 | - Retorna uma lista com parâmetros sobre cada estilo de uma classe. | |
803 | - | |
804 | - parameters: | |
805 | - $classe - Índice da classe. | |
806 | - | |
807 | - return: | |
808 | - string com o | |
809 | - tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size,symbolscaledenom,maxsize,minsize| | |
810 | - */ | |
811 | - function pegaParametros($classe) | |
812 | - { | |
813 | - if(!$this->layer){ | |
814 | - return "erro"; | |
815 | - } | |
816 | - $tipoLayer = $this->layer->type; | |
817 | - $classe = $this->layer->getclass($classe); | |
818 | - $numestilos = $classe->numstyles; | |
819 | - for ($i=0;$i<$numestilos;++$i){ | |
820 | - $linha = array(); | |
821 | - $estilo = $classe->getstyle($i); | |
822 | - $linha[] = $i; | |
823 | - $linha[] = corRGB($estilo->outlinecolor); | |
824 | - $linha[] = corRGB($estilo->backgroundcolor); | |
825 | - $linha[] = corRGB($estilo->color); | |
826 | - $linha[] = $estilo->symbolname; | |
827 | - if($estilo->getbinding(MS_STYLE_BINDING_SIZE)){ | |
828 | - $linha[] = $estilo->getbinding(MS_STYLE_BINDING_SIZE); | |
829 | - } | |
830 | - else{ | |
831 | - $linha[] = $estilo->size; | |
832 | - } | |
833 | - $linha[] = $estilo->opacity; | |
834 | - if($this->v >= 6){ | |
835 | - $linha[] = $estilo->width; | |
836 | - $s = $estilo->symbol; | |
837 | - $linha[] = implode(" ",$s->getPatternArray); | |
838 | - $linha[] = $estilo->angle; | |
839 | - } | |
840 | - else{ | |
841 | - $linha[] = ""; | |
842 | - $linha[] = ""; | |
843 | - } | |
844 | - $linha[] = $this->layer->symbolscaledenom; | |
845 | - $linha[] = $estilo->minsize; | |
846 | - $linha[] = $estilo->maxsize; | |
847 | - $linha[] = $estilo->offsetx; | |
848 | - $linha[] = $estilo->offsety; | |
849 | - $linhas[] = $tipoLayer."#".implode("#",$linha); | |
850 | - } | |
851 | - //retorna tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size,symbolscaledenom | |
852 | - return implode("|",$linhas); | |
853 | - } | |
854 | - /* | |
855 | - function: aplicaParametro | |
856 | - | |
857 | - Aplica um parâmetro em um estilo de uma classe. | |
858 | - | |
859 | - parameters: | |
860 | - | |
861 | - $classe - Índice da classe. | |
862 | - | |
863 | - $estilo - Índice do estilo que será alterado. | |
864 | - | |
865 | - $outlinecolor - Cor do contorno. | |
866 | - | |
867 | - $backgroundcolor - Cor do fundo. | |
868 | - | |
869 | - $color - Cor da frente. | |
870 | - | |
871 | - $symbolname - Nome do símbolo. | |
872 | - | |
873 | - $size - Tamanho que será aplicado ao símbolo. | |
874 | - | |
875 | - $opacidade - Opacidade | |
876 | - */ | |
877 | - function aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle,$minsize=0,$maxsize=500,$offsetx=0,$offsety=0) | |
878 | - { | |
879 | - if(!$this->layer){ | |
880 | - return "erro"; | |
881 | - } | |
882 | - if(!empty($pattern)) | |
883 | - { | |
884 | - $pattern = str_replace(","," ",$pattern); | |
885 | - } | |
886 | - $classe = $this->layer->getclass($classe); | |
887 | - //isso é necessário pq o mapserver não consegue apagar o nome de um estilo | |
888 | - if(isset($symbolname) && ($symbolname == "" || $symbolname == "0")){ | |
889 | - $classe->deletestyle($estilo); | |
890 | - $estilo = ms_newStyleObj($classe); | |
891 | - } | |
892 | - else{ | |
893 | - $estilo = $classe->getstyle($estilo); | |
894 | - } | |
895 | - if (isset($outlinecolor)) | |
896 | - { | |
897 | - $cor = $estilo->outlinecolor; | |
898 | - $nc = explode(",",$outlinecolor); | |
899 | - $cor->setRGB($nc[0],$nc[1],$nc[2]); | |
900 | - } | |
901 | - if (isset($backgroundcolor)) | |
902 | - { | |
903 | - $cor = $estilo->backgroundcolor; | |
904 | - $nc = explode(",",$backgroundcolor); | |
905 | - $cor->setRGB($nc[0],$nc[1],$nc[2]); | |
906 | - } | |
907 | - if (isset($color)) | |
908 | - { | |
909 | - $cor = $estilo->color; | |
910 | - $nc = explode(",",$color); | |
911 | - $cor->setRGB($nc[0],$nc[1],$nc[2]); | |
912 | - } | |
913 | - if((isset($symbolname)) && ($symbolname != "")) | |
914 | - { | |
915 | - if(is_numeric($symbolname)) | |
916 | - { | |
917 | - $estilo->set("symbol",$symbolname); | |
918 | - } | |
919 | - else | |
920 | - {$estilo->set("symbolname",$symbolname); | |
921 | - } | |
922 | - } | |
923 | - if ((isset ($size)) && ($size != "-1")) | |
924 | - { | |
925 | - if(is_numeric($size)){ | |
926 | - $estilo->removebinding(MS_STYLE_BINDING_SIZE); | |
927 | - $estilo->set("size",$size); | |
928 | - } | |
929 | - else{ | |
930 | - $estilo->setbinding(MS_STYLE_BINDING_SIZE, $size); | |
931 | - } | |
932 | - } | |
933 | - if ((isset ($width)) && ($width != "-1") && ($this->v >= 6)) | |
934 | - { | |
935 | - $estilo->set("width",$width); | |
936 | - } | |
937 | - if ((isset ($pattern)) && ($pattern != "-1") && ($this->v >= 6) && ($pattern != "")) | |
938 | - { | |
939 | - $estilo->updatefromstring("STYLE PATTERN ".$pattern." END"); | |
940 | - } | |
941 | - if(isset($opacidade)) | |
942 | - { | |
943 | - $estilo->set("opacity",$opacidade); | |
944 | - } | |
945 | - if(isset($angle)) | |
946 | - { | |
947 | - $estilo->set("angle",$angle); | |
948 | - } | |
949 | - $estilo->set("minsize",$minsize); | |
950 | - $estilo->set("maxsize",$maxsize); | |
951 | - $estilo->set("offsetx",$offsetx); | |
952 | - $estilo->set("offsety",$offsety); | |
953 | - if ($this->layer->getmetadata("sld") != "") | |
954 | - { | |
955 | - $sld = $this->layer->getmetadata("sld"); | |
956 | - $this->reSLD($this->arquivo,$this->nome,$sld); | |
957 | - } | |
958 | - $this->layer->setMetaData("cache",""); | |
959 | - return "ok"; | |
960 | - } | |
961 | - /* | |
962 | - function: pegaParametrosLegImg | |
963 | - | |
964 | - Pega os parâmetros da legenda embebida no mapa. | |
965 | - | |
966 | - return: | |
967 | - | |
968 | - array - "imagecolor"=>$imagecolor,"transparent"=>transparent,"position"=>$position,"status"=>$status,"outlinecolor"=>$outlinecolor,"keyspacingy"=>$keyspacingy,"keyspacingx"=>$keyspacingx,"keysizey"=>$keysizey,"keysizex"=>$keysizex,"heigt"=>$height,"width"=>$width | |
969 | - | |
970 | - */ | |
971 | - function pegaParametrosLegImg() | |
972 | - { | |
973 | - //error_reporting(0); | |
974 | - $legenda = $this->mapa->legend; | |
975 | - $height = $legenda->height; | |
976 | - $width = $legenda->width; | |
977 | - $keysizex = $legenda->keysizex; | |
978 | - $keysizey = $legenda->keysizey; | |
979 | - $keyspacingx = $legenda->keyspacingx; | |
980 | - $keyspacingy = $legenda->keyspacingy; | |
981 | - $outlinecolor = corRGB($legenda->outlinecolor); //Color of outline of box, -1 for no outline | |
982 | - $status = $legenda->status; //MS_ON, MS_OFF, MS_EMBED | |
983 | - $position = $legenda->position; | |
984 | - if ($position < 99){ | |
985 | - $position = "10".$position; | |
986 | - } | |
987 | - $transparent = 100; | |
988 | - $imagecolor = corRGB($legenda->imagecolor); | |
989 | - $label = $legenda->label; | |
990 | - $font = $label->font; | |
991 | - if($font == MS_BITMAP) | |
992 | - { | |
993 | - $l = $label->size; | |
994 | - if ($l == MS_TINY){ | |
995 | - $t = 5; | |
996 | - } | |
997 | - if ($l == MS_SMALL){ | |
998 | - $t = 7; | |
999 | - } | |
1000 | - if ($l == MS_MEDIUM){ | |
1001 | - $t = 10; | |
1002 | - } | |
1003 | - if ($l == MS_LARGE){ | |
1004 | - $t = 12; | |
1005 | - } | |
1006 | - if ($l == MS_GIANT){ | |
1007 | - $t = 14; | |
1008 | - } | |
1009 | - $labelsize = $t; | |
1010 | - } | |
1011 | - else | |
1012 | - $labelsize = $label->size; | |
1013 | - | |
1014 | - $tipofonte = $label->type; | |
1015 | - return(array("tipofonte"=>$tipofonte,"font"=>$font,"imagecolor"=>$imagecolor,"transparent"=>transparent,"position"=>$position,"status"=>$status,"outlinecolor"=>$outlinecolor,"keyspacingy"=>$keyspacingy,"keyspacingx"=>$keyspacingx,"keysizey"=>$keysizey,"keysizex"=>$keysizex,"height"=>$height,"width"=>$width,"labelsize"=>$labelsize)); | |
1016 | - } | |
1017 | - /* | |
1018 | - function: aplicaParametrosLegImg | |
1019 | - | |
1020 | - Aplica os parâmetros da legenda embebida no mapa. | |
1021 | - | |
1022 | - parameters: | |
1023 | - | |
1024 | - $imagecolor | |
1025 | - | |
1026 | - $position | |
1027 | - | |
1028 | - $status | |
1029 | - | |
1030 | - $outlinecolor | |
1031 | - | |
1032 | - $keyspacingy | |
1033 | - | |
1034 | - $keyspacingx | |
1035 | - | |
1036 | - $keysizey | |
1037 | - | |
1038 | - $keysizex | |
1039 | - | |
1040 | - $heigt | |
1041 | - | |
1042 | - $width | |
1043 | - */ | |
1044 | - function aplicaParametrosLegImg($fonte,$imagecolor,$position,$status,$outlinecolor,$keyspacingy,$keyspacingx,$keysizey,$keysizex,$height,$width,$labelsize) | |
1045 | - { | |
1046 | - $legenda = $this->mapa->legend; | |
1047 | - $legenda->set("height",$height); | |
1048 | - $legenda->set("width",$width); | |
1049 | - $legenda->set("keysizex",$keysizex); | |
1050 | - $legenda->set("keysizey",$keysizey); | |
1051 | - $legenda->set("keyspacingx",$keyspacingx); | |
1052 | - $legenda->set("keyspacingy",$keyspacingy); | |
1053 | - $corres = $legenda->outlinecolor; | |
1054 | - $cor = explode(",",$outlinecolor); | |
1055 | - $corres->setRGB($cor[0],$cor[1],$cor[2]); | |
1056 | - | |
1057 | - if ($status == 3) | |
1058 | - { | |
1059 | - $legenda->set("status",MS_EMBED); | |
1060 | - } | |
1061 | - else{ | |
1062 | - $legenda->set("status",MS_OFF); | |
1063 | - } | |
1064 | - $verifica = $legenda->position; | |
1065 | - if ($verifica < 100){ | |
1066 | - if($position > 99){ | |
1067 | - $position = 3; | |
1068 | - } | |
1069 | - } | |
1070 | - $legenda->set("position",$position); | |
1071 | - | |
1072 | - $corres = $legenda->imagecolor; | |
1073 | - $cor = explode(",",$imagecolor); | |
1074 | - $corres->setRGB($cor[0],$cor[1],$cor[2]); | |
1075 | - $label = $legenda->label; | |
1076 | - if ($fonte != "bitmap") | |
1077 | - { | |
1078 | - $label->updatefromstring("LABEL TYPE TRUETYPE END"); | |
1079 | - $label->set("font",$fonte); | |
1080 | - $label->set("size",$labelsize); | |
1081 | - } | |
1082 | - else | |
1083 | - { | |
1084 | - $label->updatefromstring("LABEL TYPE BITMAP END"); | |
1085 | - $t = MS_TINY; | |
1086 | - if ($labelsize > 5 ){ | |
1087 | - $t = MS_TINY; | |
1088 | - } | |
1089 | - if ($labelsize >= 7 ){ | |
1090 | - $t = MS_SMALL; | |
1091 | - } | |
1092 | - if ($labelsize >= 10 ){ | |
1093 | - $t = MS_MEDIUM; | |
1094 | - } | |
1095 | - if ($labelsize >= 12 ){ | |
1096 | - $t = MS_LARGE; | |
1097 | - } | |
1098 | - if ($labelsize >= 14 ){ | |
1099 | - $t = MS_GIANT; | |
1100 | - } | |
1101 | - $label->set("size",$t); | |
1102 | - } | |
1103 | - | |
1104 | - return("ok"); | |
1105 | - } | |
1106 | - /* | |
1107 | - Function: reSLD | |
1108 | - | |
1109 | - Gera o SLD de um tema WMS. | |
1110 | - | |
1111 | - Parametros: | |
1112 | - | |
1113 | - $map_file {string} - arquivo map_file | |
1114 | - | |
1115 | - $tema {string} - c�digo do tema | |
1116 | - | |
1117 | - $sld {string} - arquivo onde o sld será gravado | |
1118 | - */ | |
1119 | - function reSLD($map_file,$tema,$sld) | |
1120 | - { | |
1121 | - $map = ms_newMapObj($map_file); | |
1122 | - $layer = $map->getlayerbyname($tema); | |
1123 | - $layer->set("name",$layer->getmetadata("nomeoriginal")); | |
1124 | - $tiporep = $layer->getmetadata("tipooriginal"); | |
1125 | - $layer->set("type",MS_LAYER_POLYGON); | |
1126 | - if ($tiporep == "linear") | |
1127 | - { | |
1128 | - $layer->set("type",MS_LAYER_LINE); | |
1129 | - } | |
1130 | - if ($tiporep == "pontual") | |
1131 | - { | |
1132 | - $layer->set("type",MS_LAYER_POINT); | |
1133 | - } | |
1134 | - $sldf = $layer->generateSLD(); | |
1135 | - if (file_exists($sld)) | |
1136 | - { | |
1137 | - unlink($sld); | |
1138 | - } | |
1139 | - $fp = fopen($sld, "a"); | |
1140 | - fputs( $fp, $sldf ); | |
1141 | - fclose($fp); | |
1142 | - } | |
1143 | - function aplicaTodasClasses($parametro,$valor) | |
1144 | - { | |
1145 | - if(!$this->layer){ | |
1146 | - return "erro"; | |
1147 | - } | |
1148 | - $numc = $this->layer->numclasses; | |
1149 | - for ($c = 0;$c < $numc;$c++){ | |
1150 | - $classe = $this->layer->getclass($c); | |
1151 | - $estilo = $classe->getstyle(0); | |
1152 | - switch ($parametro){ | |
1153 | - case "pattern": | |
1154 | - if(!empty($pattern)){ | |
1155 | - $pattern = str_replace(","," ",$valor); | |
1156 | - if ($this->v >= 6){ | |
1157 | - $estilo->updatefromstring("STYLE PATTERN ".$valor." END"); | |
1158 | - } | |
1159 | - } | |
1160 | - continue; | |
1161 | - case "symbolname": | |
1162 | - if($parametro == "" || $parametro == "0"){ | |
1163 | - $classe->deletestyle($estilo); | |
1164 | - $estilo = ms_newStyleObj($classe); | |
1165 | - } | |
1166 | - else{ | |
1167 | - if(is_numeric($valor)){ | |
1168 | - $estilo->set("symbol",$valor); | |
1169 | - } | |
1170 | - else{ | |
1171 | - $estilo->set("symbolname",$valor); | |
1172 | - } | |
1173 | - } | |
1174 | - continue; | |
1175 | - case "outlinecolor": | |
1176 | - $cor = $estilo->outlinecolor; | |
1177 | - $nc = explode(",",$valor); | |
1178 | - $cor->setRGB($nc[0],$nc[1],$nc[2]); | |
1179 | - continue; | |
1180 | - case "backgroundcolor": | |
1181 | - $cor = $estilo->backgroundcolor; | |
1182 | - $nc = explode(",",$valor); | |
1183 | - $cor->setRGB($nc[0],$nc[1],$nc[2]); | |
1184 | - continue; | |
1185 | - case "color": | |
1186 | - $cor = $estilo->color; | |
1187 | - $nc = explode(",",$valor); | |
1188 | - $cor->setRGB($nc[0],$nc[1],$nc[2]); | |
1189 | - continue; | |
1190 | - case "size": | |
1191 | - if(is_numeric($valor)){ | |
1192 | - $estilo->removebinding(MS_STYLE_BINDING_SIZE); | |
1193 | - $estilo->set("size",$valor); | |
1194 | - } | |
1195 | - else{ | |
1196 | - $estilo->setbinding(MS_STYLE_BINDING_SIZE, $valor); | |
1197 | - } | |
1198 | - continue; | |
1199 | - case "width": | |
1200 | - $estilo->set("width",$valor); | |
1201 | - continue; | |
1202 | - case "offsetx": | |
1203 | - $estilo->set("offsetx",$valor); | |
1204 | - continue; | |
1205 | - case "offsety": | |
1206 | - $estilo->set("offsety",$valor); | |
1207 | - continue; | |
1208 | - case "opacity": | |
1209 | - $estilo->set("opacity",$valor); | |
1210 | - continue; | |
1211 | - case "angle": | |
1212 | - $estilo->set("angle",$valor); | |
1213 | - continue; | |
1214 | - } | |
1215 | - } | |
1216 | - $this->layer->setMetaData("cache",""); | |
1217 | - return "ok"; | |
1218 | - } | |
1219 | - function converte($texto) | |
1220 | - { | |
1221 | - if (function_exists("mb_convert_encoding")) | |
1222 | - { | |
1223 | - if (!mb_detect_encoding($texto,"UTF-8",true)) | |
1224 | - { | |
1225 | - $texto = mb_convert_encoding($texto,"UTF-8","ISO-8859-1"); | |
1226 | - } | |
1227 | - } | |
1228 | - return $texto; | |
1229 | - } | |
1230 | -} | |
1 | +<?php | |
2 | + | |
3 | +/* | |
4 | + * Title: classe_legenda.php | |
5 | + * | |
6 | + * Manipulação da legenda. | |
7 | + * | |
8 | + * Cria legenda, edita simbolos, etc. | |
9 | + * | |
10 | + * Licenca: | |
11 | + * | |
12 | + * GPL2 | |
13 | + * | |
14 | + * | |
15 | + * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
16 | + * | |
17 | + * Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
18 | + * Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | |
19 | + * | |
20 | + * Este programa é software livre; você pode redistribuí-lo | |
21 | + * e/ou modificá-lo sob os termos da Licença Pública Geral | |
22 | + * GNU conforme publicada pela Free Software Foundation; | |
23 | + * | |
24 | + * Este programa é distribuído na expectativa de que seja útil, | |
25 | + * porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
26 | + * de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
27 | + * Consulte a Licença Pública Geral do GNU para mais detalhes. | |
28 | + * Você deve ter recebido uma c�pia da Licença Pública Geral do | |
29 | + * GNU junto com este programa; se não, escreva para a | |
30 | + * Free Software Foundation, Inc., no endereço | |
31 | + * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
32 | + * | |
33 | + * Arquivo: | |
34 | + * | |
35 | + * i3geo/classesphp/classe_legenda.php | |
36 | + */ | |
37 | +/* | |
38 | + * Classe: Legenda | |
39 | + * | |
40 | + */ | |
41 | +class Legenda | |
42 | +{ | |
43 | + | |
44 | + /* | |
45 | + * Variavel: $mapa | |
46 | + * | |
47 | + * Objeto mapa | |
48 | + */ | |
49 | + public $mapa; | |
50 | + | |
51 | + /* | |
52 | + * Variavel: $arquivo | |
53 | + * | |
54 | + * Arquivo map file | |
55 | + */ | |
56 | + protected $arquivo; | |
57 | + | |
58 | + /* | |
59 | + * Variavel: $layer | |
60 | + * | |
61 | + * Objeto layer | |
62 | + */ | |
63 | + public $layer; | |
64 | + | |
65 | + /* | |
66 | + * Variavel: $nome | |
67 | + * | |
68 | + * Nome do layer | |
69 | + */ | |
70 | + protected $nome; | |
71 | + | |
72 | + /* | |
73 | + * Variavel: $grupo | |
74 | + * | |
75 | + * Array com os temas do grupo, se houver | |
76 | + */ | |
77 | + protected $grupo; | |
78 | + | |
79 | + /* | |
80 | + * Variavel: $visiveis | |
81 | + * | |
82 | + * Temas do grupo que são visíveis em função da escala | |
83 | + */ | |
84 | + protected $visiveis; | |
85 | + | |
86 | + /* | |
87 | + * Variavel: $indices | |
88 | + * | |
89 | + * Indices dos layers do grupo | |
90 | + */ | |
91 | + protected $indices; | |
92 | + | |
93 | + /* | |
94 | + * Variavel: $templateleg | |
95 | + * | |
96 | + * Template da legenda | |
97 | + */ | |
98 | + protected $templateleg; | |
99 | + | |
100 | + /* | |
101 | + * Variavel: $localaplicacao | |
102 | + * | |
103 | + * Localização da aplicação | |
104 | + */ | |
105 | + protected $localaplicacao; | |
106 | + | |
107 | + /* | |
108 | + * Variavel: $v | |
109 | + * | |
110 | + * Versão atual do Mapserver (primeiro dígito) | |
111 | + */ | |
112 | + public $v; | |
113 | + | |
114 | + /* | |
115 | + * Function: __construct | |
116 | + * | |
117 | + * Cria um objeto Legenda | |
118 | + * | |
119 | + * parameters: | |
120 | + * | |
121 | + * $map_file - Endereço do mapfile no servidor. | |
122 | + * | |
123 | + * $locaplic - localização do I3Geo no servidor | |
124 | + * | |
125 | + * $tema - nome do tema | |
126 | + * | |
127 | + * $template - nome do template para processar a legenda | |
128 | + */ | |
129 | + function __construct($map_file = "", $locaplic = "", $tema = "", $template = "") | |
130 | + { | |
131 | + include (dirname(__FILE__) . "/../ms_configura.php"); | |
132 | + $this->postgis_mapa = $postgis_mapa; | |
133 | + include_once (dirname(__FILE__) . "/funcoes_gerais.php"); | |
134 | + $this->v = versao(); | |
135 | + $this->v = $this->v["principal"]; | |
136 | + $this->localaplicacao = $locaplic; | |
137 | + if ($map_file == "") { | |
138 | + return; | |
139 | + } | |
140 | + $this->mapa = ms_newMapObj($map_file); | |
141 | + substituiConObj($this->mapa, $postgis_mapa); | |
142 | + $this->arquivo = str_replace(".map", "", $map_file) . ".map"; | |
143 | + | |
144 | + if ($tema != "" && @$this->mapa->getlayerbyname($tema)) { | |
145 | + $this->layer = $this->mapa->getlayerbyname($tema); | |
146 | + $this->nome = $tema; | |
147 | + $vermultilayer = new vermultilayer(); | |
148 | + $vermultilayer->verifica($map_file, $tema); | |
149 | + if ($vermultilayer->resultado == 1) // o tema e multi layer | |
150 | +{ | |
151 | + $ls = $vermultilayer->temas; | |
152 | + $this->visiveis = $vermultilayer->temasvisiveis; | |
153 | + } else { | |
154 | + $ls[] = $tema; | |
155 | + $this->visiveis = array( | |
156 | + $tema | |
157 | + ); | |
158 | + } | |
159 | + $this->grupo = $ls; | |
160 | + foreach ($ls as $l) { | |
161 | + $t = $this->mapa->getlayerbyname($l); | |
162 | + $this->indices[] = $t->index; | |
163 | + } | |
164 | + } | |
165 | + if ($template == "") { | |
166 | + $template = "legenda.htm"; | |
167 | + } | |
168 | + if (file_exists($template)) { | |
169 | + $this->templateleg = $template; | |
170 | + return; | |
171 | + } | |
172 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { | |
173 | + $this->templateleg = $locaplic . "\\aplicmap\\" . $template; | |
174 | + } else { | |
175 | + $this->templateleg = $locaplic . "/aplicmap/" . $template; | |
176 | + } | |
177 | + } | |
178 | + | |
179 | + /* | |
180 | + * function: salva | |
181 | + * | |
182 | + * Salva o mapfile atual | |
183 | + */ | |
184 | + function salva() | |
185 | + { | |
186 | + $this->recalculaSLD(); | |
187 | + restauraConObj($this->mapa, $this->postgis_mapa); | |
188 | + $this->mapa->save($this->arquivo); | |
189 | + } | |
190 | + | |
191 | + /* | |
192 | + * function: recalculaSLD | |
193 | + * | |
194 | + * Constroi o SLD que é aplicado ao metadata wms_sld_body. O SLD resultante é baseado nas definições das classes existentes no layer | |
195 | + */ | |
196 | + function recalculaSLD() | |
197 | + { | |
198 | + if ($this->layer->classitem != "" && $this->layer->connectiontype == 7 && $this->layer->numclasses > 0) { | |
199 | + $tipotemp = $this->layer->type; | |
200 | + $tiporep = $this->layer->getmetadata("tipooriginal"); | |
201 | + $this->layer->set("type", MS_LAYER_POLYGON); | |
202 | + if ($tiporep == "linear") { | |
203 | + $this->layer->set("type", MS_LAYER_LINE); | |
204 | + } | |
205 | + if ($tiporep == "pontual") { | |
206 | + $this->layer->set("type", MS_LAYER_POINT); | |
207 | + } | |
208 | + $this->layer->set("status", MS_DEFAULT); | |
209 | + $this->layer->setmetadata("wms_sld_body", ""); | |
210 | + $sld = $this->layer->generateSLD(); | |
211 | + if ($sld != "") { | |
212 | + $this->layer->setmetadata("wms_sld_body", str_replace('"', "'", $sld)); | |
213 | + } | |
214 | + $this->layer->set("type", $tipotemp); | |
215 | + } | |
216 | + } | |
217 | + | |
218 | + /* | |
219 | + * function: aplicaLegendaImg | |
220 | + * | |
221 | + * Aplica o metadata legendaimg que define um arquivo de imagem no lugar da criacao automatica da legenda | |
222 | + */ | |
223 | + function aplicaLegendaImg($imagem) | |
224 | + { | |
225 | + $this->layer->setmetadata("legendaimg", $imagem); | |
226 | + } | |
227 | + | |
228 | + /* | |
229 | + * function: criaLegenda | |
230 | + * | |
231 | + * Gera a legenda processando o template HTML definido na construção da classe. | |
232 | + * | |
233 | + * Se o tema for um WMS ou se o metadata legendaimg estiver definido, executa $this->tabelaLegenda | |
234 | + * | |
235 | + * Return: | |
236 | + * | |
237 | + * string com a legenda HTML | |
238 | + */ | |
239 | + function criaLegenda() | |
240 | + { | |
241 | + $l = ""; | |
242 | + $numlayers = $this->mapa->numlayers; | |
243 | + if ($this->nome != "") { | |
244 | + // verifica se é wms ou se o metadata legendaimg está definido | |
245 | + $c = $this->layer->connectiontype; | |
246 | + if ($c == 7 || $this->layer->getmetadata("legendaimg") != "") { | |
247 | + return ($this->tabelaLegenda()); | |
248 | + } | |
249 | + for ($i = 0; $i < $numlayers; ++ $i) { | |
250 | + $la = $this->mapa->getlayer($i); | |
251 | + if ($la->name != $this->nome) { | |
252 | + $la->set("status", MS_OFF); | |
253 | + } | |
254 | + if ($la->group == $this->nome) { | |
255 | + $la->set("status", MS_DEFAULT); | |
256 | + } | |
257 | + $la->set("minscaledenom", 0); | |
258 | + $la->set("maxscaledenom", 0); | |
259 | + } | |
260 | + $this->layer->set("status", MS_DEFAULT); | |
261 | + } | |
262 | + $desligar = array(); | |
263 | + for ($i = 0; $i < $numlayers; ++ $i) { | |
264 | + $la = $this->mapa->getlayer($i); | |
265 | + if (strtoupper($la->getmetadata("ESCONDIDO")) == "SIM") { | |
266 | + $la->set("status", MS_OFF); | |
267 | + } | |
268 | + $desligarLayer = array(); | |
269 | + if ($la->status == MS_DEFAULT) { | |
270 | + $nc = $la->numclasses; | |
271 | + for ($c = 0; $c < $nc; $c ++) { | |
272 | + $classe = $la->getclass($c); | |
273 | + if ($classe->status == MS_OFF) { | |
274 | + $desligarLayer[] = $c; | |
275 | + } | |
276 | + // remove o offset em simbolos do tipo imagem | |
277 | + if ($classe->numstyles > 0) { | |
278 | + $estilo = $classe->getstyle(0); | |
279 | + if ($estilo->symbolname != "" && file_exists($estilo->symbolname)) { | |
280 | + $estilo->set("offsetx", 0); | |
281 | + $estilo->set("offsety", 0); | |
282 | + } | |
283 | + } | |
284 | + } | |
285 | + $la->set("minscaledenom", 0); | |
286 | + $la->set("maxscaledenom", 0); | |
287 | + } | |
288 | + $desligar[$la->name] = $desligarLayer; | |
289 | + } | |
290 | + $legenda = $this->mapa->legend; | |
291 | + $legenda->set("template", $this->templateleg); | |
292 | + $tmparray["my_tag"] = "value_of_my_tag"; | |
293 | + if (! $l = @$this->mapa->processlegendtemplate($tmparray)) { | |
294 | + return ("erro"); | |
295 | + } | |
296 | + // e necessario explodir as partes da legenda para converter os caracteres | |
297 | + $pedacos = explode("<tr>", $l); | |
298 | + $n = count($pedacos); | |
299 | + for ($i = 0; $i < $n; $i ++) { | |
300 | + $pedacos[$i] = $this->converte($pedacos[$i]); | |
301 | + } | |
302 | + $l = implode("<tr>", $pedacos); | |
303 | + return (array( | |
304 | + "legenda" => $l, | |
305 | + "desativar" => $desligar | |
306 | + )); | |
307 | + } | |
308 | + | |
309 | + function criaLegendaJson($w = 25, $h = 25) | |
310 | + { | |
311 | + $l = ""; | |
312 | + $numlayers = $this->mapa->numlayers; | |
313 | + if ($this->nome != "") { | |
314 | + // verifica se é wms ou se o metadata legendaimg está definido | |
315 | + $c = $this->layer->connectiontype; | |
316 | + if ($c == 7 || $this->layer->getmetadata("legendaimg") != "") { | |
317 | + return ($this->tabelaLegenda()); | |
318 | + } | |
319 | + for ($i = 0; $i < $numlayers; ++ $i) { | |
320 | + $la = $this->mapa->getlayer($i); | |
321 | + if ($la->name != $this->nome) { | |
322 | + $la->set("status", MS_OFF); | |
323 | + } | |
324 | + if ($la->group == $this->nome) { | |
325 | + $la->set("status", MS_DEFAULT); | |
326 | + } | |
327 | + $la->set("minscaledenom", 0); | |
328 | + $la->set("maxscaledenom", 0); | |
329 | + } | |
330 | + $this->layer->set("status", MS_DEFAULT); | |
331 | + } | |
332 | + $desligar = array(); | |
333 | + $legenda = array(); | |
334 | + for ($i = 0; $i < $numlayers; ++ $i) { | |
335 | + $la = $this->mapa->getlayer($i); | |
336 | + if (strtoupper($la->getmetadata("ESCONDIDO")) == "SIM") { | |
337 | + $la->set("status", MS_OFF); | |
338 | + } | |
339 | + $desligarLayer = array(); | |
340 | + if ($la->status == MS_DEFAULT) { | |
341 | + if ($la->getmetadata("legendaimg") != "") { | |
342 | + $classes = array(); | |
343 | + $classes[] = array( | |
344 | + "nome" => "", | |
345 | + "img" => $la->getmetadata("legendaimg"), | |
346 | + "checked" => "checked", | |
347 | + "index" => 0, | |
348 | + "layer" => $la->name | |
349 | + ); | |
350 | + $legenda[] = array( | |
351 | + "layer" => $la->name, | |
352 | + "nome" => $this->converte($la->getmetadata("tema")), | |
353 | + "classes" => $classes | |
354 | + ); | |
355 | + } else { | |
356 | + $la->set("minscaledenom", 0); | |
357 | + $la->set("maxscaledenom", 0); | |
358 | + $nc = $la->numclasses; | |
359 | + $classes = array(); | |
360 | + for ($c = 0; $c < $nc; $c ++) { | |
361 | + $ck = "checked"; | |
362 | + $classe = $la->getclass($c); | |
363 | + if ($classe->status == MS_OFF) { | |
364 | + $ck = ""; | |
365 | + } | |
366 | + $cores = array( | |
367 | + "color" => "-1 -1 -1", | |
368 | + "outline" => "-1 -1 -1", | |
369 | + "background" => "-1 -1 -1" | |
370 | + ); | |
371 | + // remove o offset em simbolos do tipo imagem | |
372 | + | |
373 | + | |
374 | + if ($classe->numstyles > 0) { | |
375 | + $estilo = $classe->getstyle(0); | |
376 | + if ($estilo->symbolname != "" && file_exists($estilo->symbolname)) { | |
377 | + $estilo->set("offsetx", 0); | |
378 | + $estilo->set("offsety", 0); | |
379 | + } | |
380 | + $cor = array( | |
381 | + "color" => corRGB($estilo->color), | |
382 | + "outline" => corRGB($estilo->outlinecolor), | |
383 | + "background" => corRGB($estilo->backgroundcolor) | |
384 | + ); | |
385 | + } | |
386 | + $imagem = $classe->createLegendIcon($w, $h)->saveWebImage(); | |
387 | + | |
388 | + $classes[] = array( | |
389 | + "nome" => $this->converte($classe->name), | |
390 | + "img" => $imagem, | |
391 | + "checked" => $ck, | |
392 | + "index" => $c, | |
393 | + "layer" => $la->name, | |
394 | + "cor"=>$cor | |
395 | + ); | |
396 | + } | |
397 | + $legenda[] = array( | |
398 | + "layer" => $la->name, | |
399 | + "nome" => $this->converte($la->getmetadata("tema")), | |
400 | + "classes" => $classes | |
401 | + ); | |
402 | + } | |
403 | + } | |
404 | + $desligar[$la->name] = $desligarLayer; | |
405 | + } | |
406 | + return (array( | |
407 | + "legenda" => $legenda | |
408 | + )); | |
409 | + } | |
410 | + | |
411 | + /* | |
412 | + * function: legendaGrafica | |
413 | + * | |
414 | + * Desenha a imagem da legenda. | |
415 | + * | |
416 | + * return: | |
417 | + * string de variaveis no formato javascript que permitem montar a legenda. | |
418 | + */ | |
419 | + function legendaGrafica() | |
420 | + { | |
421 | + $numlayers = $this->mapa->numlayers; | |
422 | + for ($i = 0; $i < $numlayers; ++ $i) { | |
423 | + $layer = $this->mapa->getlayer($i); | |
424 | + if (($layer->data != "") && (strtoupper($layer->getmetadata("escondido")) != "SIM") && (strtoupper($layer->getmetadata("tema")) != "NAO")) { | |
425 | + if ($layer->numclasses > 0) { | |
426 | + $classe = $layer->getclass(0); | |
427 | + if (($classe->name == "") || ($classe->name == " ")) { | |
428 | + $classe->set("name", $layer->getmetadata("tema")); | |
429 | + } | |
430 | + // corrige o titulo da legenda | |
431 | + if ($layer->type != 3 && $layer->type != 4) { | |
432 | + $nclass = $layer->numclasses; | |
433 | + for ($j = 0; $j < $nclass; $j ++) { | |
434 | + $classe = $layer->getclass($j); | |
435 | + if ($classe->title === "") { | |
436 | + $classe->title = $classe->name; | |
437 | + } | |
438 | + } | |
439 | + } | |
440 | + } | |
441 | + } | |
442 | + } | |
443 | + $nomeImagem = nomeRandomico(); | |
444 | + $imgo = $this->mapa->drawlegend(); | |
445 | + if ($imgo->imagepath == "") { | |
446 | + echo "Erro IMAGEPATH vazio"; | |
447 | + exit(); | |
448 | + } | |
449 | + $nomer = ($imgo->imagepath) . "leg" . $nomeImagem . ".png"; | |
450 | + $imgo->saveImage($nomer); | |
451 | + $nomer = ($imgo->imageurl) . basename($nomer); | |
452 | + return ("var legimagem='" . $nomer . "';var legwidth=" . $imgo->width . ";var legheight=" . $imgo->height . ";var legpath='" . $imgo->imagepath . "';var legurl='" . $imgo->imageurl . "'"); | |
453 | + } | |
454 | + | |
455 | + /* | |
456 | + * function: tabelaLegenda | |
457 | + * | |
458 | + * Cria elementos para construir uma legenda no formato de tabela em HTML. | |
459 | + * | |
460 | + * Utilizado na função de edição de legenda e legenda de WMS | |
461 | + * | |
462 | + * parameters: | |
463 | + * | |
464 | + * totaliza - sim|nao indica se os totais de elementos devem ser acrescentados ao nome da classe | |
465 | + * | |
466 | + * return: | |
467 | + * array | |
468 | + */ | |
469 | + function tabelaLegenda($totaliza = "nao") | |
470 | + { | |
471 | + $linhas = array(); | |
472 | + foreach ($this->visiveis as $l) { | |
473 | + $layer = $this->mapa->getlayerbyname($l); | |
474 | + // verifica se é wms ou wfs | |
475 | + $c = $layer->connectiontype; | |
476 | + | |
477 | + $s = $layer->getmetadata("wms_sld_url"); | |
478 | + $im = $layer->getmetadata("legendaimg"); | |
479 | + $nc = $layer->numclasses; | |
480 | + // | |
481 | + // se for wms e tiver classes define o tipo de layer para poder gerar a legenda corretamente | |
482 | + // | |
483 | + if ($c == 7 && $nc > 0) { | |
484 | + $tipotemp = $layer->type; | |
485 | + $tiporep = $layer->getmetadata("tipooriginal"); | |
486 | + $layer->set("type", MS_LAYER_POLYGON); | |
487 | + if ($tiporep == "linear") { | |
488 | + $layer->set("type", MS_LAYER_LINE); | |
489 | + } | |
490 | + if ($tiporep == "pontual") { | |
491 | + $layer->set("type", MS_LAYER_POINT); | |
492 | + } | |
493 | + } | |
494 | + // | |
495 | + // se for WMS e não tiver classes, tenta pegar a legenda via requisição WMS | |
496 | + // | |
497 | + if ($c == 7) { | |
498 | + if ($c == 7) { | |
499 | + $con = $layer->connection; | |
500 | + $ver = $layer->getmetadata("wms_server_version"); | |
501 | + $lwms = $layer->getmetadata("wms_name"); | |
502 | + $f = $layer->getmetadata("wms_formatlist"); | |
503 | + $f = explode(",", $f); | |
504 | + $f = $f[0]; | |
505 | + $imgLeg = $con . "&request=GetLegendGraphic&version=" . $ver . "&service=wms&layer=" . $lwms . "&format=" . $f . "&SLD=" . $s; | |
506 | + if ($layer->getmetadata("legendawms") != "") { | |
507 | + $imgLeg = $layer->getmetadata("legendawms"); | |
508 | + } | |
509 | + } else { | |
510 | + $imgLeg = $im; | |
511 | + } | |
512 | + $linhas[] = array( | |
513 | + "tema" => $l, | |
514 | + "idclasse" => "", | |
515 | + "nomeclasse" => "", | |
516 | + "expressao" => "", | |
517 | + "expressao" => "", | |
518 | + "imagem" => $imgLeg, | |
519 | + "minScale" => 0, | |
520 | + "maxScale" => 0 | |
521 | + ); | |
522 | + } else { | |
523 | + for ($c = 0; $c < $nc; $c ++) { | |
524 | + $classe = $layer->getclass($c); | |
525 | + $imgi = $classe->createlegendicon(30, 15); | |
526 | + $classe->drawlegendicon(30, 15, $imgi, 0, 0); | |
527 | + $nomes = nomeRandomico(12); | |
528 | + $nomer = ($imgi->imagepath) . "icone" . $nomes . ".png"; | |
529 | + $imgi->saveImage($nomer); | |
530 | + $i = ($imgi->imageurl) . basename($nomer); | |
531 | + $nomeclasse = $classe->name; | |
532 | + | |
533 | + // if (function_exists("mb_convert_encoding")) | |
534 | + // {$nomeclasse = mb_convert_encoding($nomeclasse,"UTF-8","ISO-8859-1");} | |
535 | + $nomeclasse = $this->converte($nomeclasse); | |
536 | + $nomeexp = $classe->getExpressionString(); | |
537 | + if (function_exists("mb_convert_encoding")) { | |
538 | + $nomeexp = mb_convert_encoding($nomeexp, "UTF-8", "ISO-8859-1"); | |
539 | + } | |
540 | + $linhas[] = array( | |
541 | + "tema" => $l, | |
542 | + "idclasse" => $c, | |
543 | + "nomeclasse" => $nomeclasse, | |
544 | + "expressao" => $nomeexp, | |
545 | + "imagem" => $i, | |
546 | + "proc" => "", | |
547 | + "minScale" => $classe->minscaledenom, | |
548 | + "maxScale" => $classe->maxscaledenom | |
549 | + ); | |
550 | + } | |
551 | + if (($totaliza == "sim") && ($nc > 1)) { | |
552 | + $layer->set("template", "none.htm"); | |
553 | + $sopen = $layer->open(); | |
554 | + if ($sopen == MS_FAILURE) { | |
555 | + return "erro"; | |
556 | + } | |
557 | + $itens = $layer->getitems(); | |
558 | + $total = 0; | |
559 | + $nreg = array(); | |
560 | + for ($c = 0; $c < $nc; $c ++) { | |
561 | + $exp = $linhas[$c]; | |
562 | + $exp = $exp["expressao"]; | |
563 | + if ($exp !== "") { | |
564 | + if ($this->layer->connectiontype == MS_POSTGIS) { | |
565 | + $exp = str_replace("eq", " = ", $exp); | |
566 | + $exp = str_replace("ne", " != ", $exp); | |
567 | + $exp = str_replace("lt", " < ", $exp); | |
568 | + $exp = str_replace("gt", " < ", $exp); | |
569 | + $exp = str_replace("(", "", $exp); | |
570 | + $exp = str_replace(")", "", $exp); | |
571 | + $exp = str_replace("'[", "", $exp); | |
572 | + $exp = str_replace("]'", "", $exp); | |
573 | + $exp = str_replace("' [", "", $exp); | |
574 | + $exp = str_replace("] '", "", $exp); | |
575 | + $exp = str_replace("and", " and ", $exp); | |
576 | + $exp = str_replace("or", " or ", $exp); | |
577 | + $exp = str_replace("[", "", $exp); | |
578 | + $exp = str_replace("]", "", $exp); | |
579 | + } | |
580 | + $teste = $layer->queryByAttributes($itens[0], $exp, 1); | |
581 | + if ($teste != MS_SUCCESS) { | |
582 | + $teste = $layer->queryByAttributes($itens[0], mb_convert_encoding($exp, "ISO-8859-1", "UTF-8"), 1); | |
583 | + } | |
584 | + if ($teste != MS_SUCCESS) { | |
585 | + $teste = $layer->queryByAttributes($itens[0], mb_convert_encoding($exp, "UTF-8", "ISO-8859-1"), 1); | |
586 | + } | |
587 | + } else { | |
588 | + $teste = 0; | |
589 | + } | |
590 | + if ($teste == MS_SUCCESS) { | |
591 | + $n = $layer->getNumResults(); | |
592 | + $nreg[] = $n; | |
593 | + } else { | |
594 | + $nreg[] = "erro"; | |
595 | + } | |
596 | + $total = $total + $n; | |
597 | + } | |
598 | + $layer->close(); | |
599 | + for ($c = 0; $c < $nc; $c ++) { | |
600 | + $classe = $layer->getclass($c); | |
601 | + $nome = $linhas[$c]["nomeclasse"]; | |
602 | + $nome = explode(" - n=", $nome); | |
603 | + $nome = $nome[0] . " - n=" . $nreg[$c] . "(" . (round(($nreg[$c] * 100 / $total))) . "%)"; | |
604 | + $classe->set("name", $nome); | |
605 | + $linhas[$c]["nomeclasse"] = $nome; | |
606 | + $linhas[$c]["nreg"] = $nreg[$c]; | |
607 | + $linhas[$c]["totalreg"] = $total; | |
608 | + } | |
609 | + } | |
610 | + if ($layer->type == MS_LAYER_RASTER && $nc == 1) { | |
611 | + $proc = ""; | |
612 | + $linhas = array(); | |
613 | + if ($layer->num_processing > 0) { | |
614 | + $proc = $layer->getProcessing(); | |
615 | + } | |
616 | + if ($layer->type == MS_LAYER_RASTER && $proc == "") { | |
617 | + $proc = array( | |
618 | + "RESAMPLE=NEAREST" | |
619 | + ); | |
620 | + } | |
621 | + $linhas[] = array( | |
622 | + "tema" => $l, | |
623 | + "idclasse" => "", | |
624 | + "nomeclasse" => "", | |
625 | + "expressao" => "", | |
626 | + "imagem" => "", | |
627 | + "proc" => $proc, | |
628 | + "minScale" => 0, | |
629 | + "maxScale" => 0 | |
630 | + ); | |
631 | + } | |
632 | + } | |
633 | + } | |
634 | + return $linhas; | |
635 | + } | |
636 | + | |
637 | + /* | |
638 | + * function: excluiEstilo | |
639 | + * | |
640 | + * Exclui um estilo de uma classe. | |
641 | + */ | |
642 | + function excluiEstilo($classe, $estilo) | |
643 | + { | |
644 | + if (! $this->layer) { | |
645 | + return "erro"; | |
646 | + } | |
647 | + $classe = $this->layer->getclass($classe); | |
648 | + $classe->deletestyle($estilo); | |
649 | + $this->layer->removeMetaData("cache"); | |
650 | + return "ok"; | |
651 | + } | |
652 | + | |
653 | + /* | |
654 | + * function: adicionaEstilo | |
655 | + * | |
656 | + * Adiciona um estilo em uma classe. | |
657 | + * | |
658 | + * return: | |
659 | + * objeto estilo | |
660 | + */ | |
661 | + function adicionaEstilo($classe, $estilo) | |
662 | + { | |
663 | + if (! $this->layer) { | |
664 | + return "erro"; | |
665 | + } | |
666 | + $classe = $this->layer->getclass($classe); | |
667 | + $estilo = $classe->getstyle($estilo); | |
668 | + $e = ms_newStyleObj($classe, $estilo); | |
669 | + $this->layer->removeMetaData("cache"); | |
670 | + return ($e); | |
671 | + } | |
672 | + | |
673 | + /* | |
674 | + * function: sobeEstilo | |
675 | + * | |
676 | + * | |
677 | + * Sobe um estilo na ordem de desenho de uma classe. | |
678 | + * | |
679 | + * parameters: | |
680 | + * $classe - Índice da classe. | |
681 | + * $estilo - Índice do estilo de uma classe que será clonado. | |
682 | + */ | |
683 | + function sobeEstilo($classe, $estilo) | |
684 | + { | |
685 | + if (! $this->layer) { | |
686 | + return "erro"; | |
687 | + } | |
688 | + $classe = $this->layer->getclass($classe); | |
689 | + $classe->movestyleup($estilo); | |
690 | + $this->layer->removeMetaData("cache"); | |
691 | + } | |
692 | + | |
693 | + /* | |
694 | + * function: desceEstilo | |
695 | + * | |
696 | + * Desce um estilo na ordem de desenho de uma classe. | |
697 | + * | |
698 | + * parameters: | |
699 | + * $classe - Índice da classe. | |
700 | + * | |
701 | + * $estilo - Índice do estilo de uma classe que será clonado. | |
702 | + */ | |
703 | + function desceEstilo($classe, $estilo) | |
704 | + { | |
705 | + if (! $this->layer) { | |
706 | + return "erro"; | |
707 | + } | |
708 | + $classe = $this->layer->getclass($classe); | |
709 | + $classe->movestyledown($estilo); | |
710 | + $this->layer->removeMetaData("cache"); | |
711 | + } | |
712 | + | |
713 | + /* | |
714 | + * function: listaSimbolos | |
715 | + * | |
716 | + * Retorna uma lista de símbolos clicáveis no formato HTML. | |
717 | + * | |
718 | + * Para cada tipo de simbologia deve haver um arquivo .map com as definições básicas. | |
719 | + * | |
720 | + * Todos os símbolos do arquivo symbols/simbolos serão retornados como imagens. | |
721 | + * | |
722 | + * parameters: | |
723 | + * | |
724 | + * $tipo - Tipo de representação do símbolo, 0 pontos, 1 linhas e 2 polígonos. | |
725 | + * | |
726 | + * $dir_tmp - Diretório temporário do mapserver. | |
727 | + * | |
728 | + * $imgdir - Diretório temporário das imagens. | |
729 | + * | |
730 | + * $onclick - Função que será incluída no HTML no evento onclick sobre o símbolo | |
731 | + * | |
732 | + * $tamanho - Tamanho (size) do símbolo | |
733 | + * | |
734 | + * $forca {boolean} - forca a exclusao dos simbolos atualmente em cache | |
735 | + * | |
736 | + * return: | |
737 | + * | |
738 | + * String no formato HTML com as imagens dos símbolos | |
739 | + */ | |
740 | + function listaSimbolos($tipo, $dir_tmp, $imgdir, $onclick, $tamanho = 8, $width = 1, $forca = false) | |
741 | + { | |
742 | + $versao = versao(); | |
743 | + $versao = $versao["principal"]; | |
744 | + // error_reporting(0); | |
745 | + if ($tipo == 3) { | |
746 | + $tipo = 2; | |
747 | + } // tipo raster | |
748 | + if ($imgdir == "") { | |
749 | + $dir = $dir_tmp; | |
750 | + } else { | |
751 | + $dir = $dir_tmp . "/" . $imgdir; | |
752 | + } | |
753 | + if ($forca == true) { | |
754 | + unlink($dir . "/simbolos" . $tipo . ".inc"); | |
755 | + } | |
756 | + $ins = ""; | |
757 | + // pega imagens que podem ser usadas como simbolos | |
758 | + if ($tipo == 0) { | |
759 | + if (! isset($locaplic)) { | |
760 | + include (dirname(__FILE__) . "/../ms_configura.php"); | |
761 | + } | |
762 | + // veja esse codigo tambem em ferramentas/uploadsimbolo/exec.php | |
763 | + $pasta = $locaplic . "/temas"; | |
764 | + $url = "../temas"; | |
765 | + if ($customDir != "interface") { | |
766 | + $teste = $locaplic . "/" . $customDir; | |
767 | + if (file_exists($teste)) { | |
768 | + $pasta = $teste; | |
769 | + $url = "../" . $customDir; | |
770 | + } | |
771 | + $teste = $locaplic . "/" . $customDir . "/images"; | |
772 | + if (file_exists($teste)) { | |
773 | + $pasta = $teste; | |
774 | + $url = "../" . $customDir . "/images"; | |
775 | + } | |
776 | + $teste = $locaplic . "/" . $customDir . "/imagens"; | |
777 | + if (file_exists($teste)) { | |
778 | + $pasta = $teste; | |
779 | + $url = "../" . $customDir . "/imagens"; | |
780 | + } | |
781 | + } | |
782 | + if (file_exists($pasta)) { | |
783 | + $lista = listaArquivos($pasta, true, array( | |
784 | + "png", | |
785 | + "PNG" | |
786 | + )); | |
787 | + // var_dump($lista);exit; | |
788 | + $n = count($lista["nomes"]); | |
789 | + for ($i = 0; $i < $n; $i ++) { | |
790 | + $ins .= "<img src='" . $url . "/" . $lista["nomes"][$i] . "' style='max-width: 80px;cursor:pointer;border: 5px solid #FFFFFF' title=" . $pasta . "/" . $lista["nomes"][$i] . " onclick='" . $onclick . "'>"; | |
791 | + } | |
792 | + } | |
793 | + } | |
794 | + if (! file_exists($dir . "/simbolos" . $tipo . ".inc")) { | |
795 | + $f = fopen($dir . "/simbolos" . $tipo . ".inc", "w"); | |
796 | + if ($tipo == 2) { | |
797 | + $t = "simpolv" . $versao . ".map"; | |
798 | + } | |
799 | + if ($tipo == 0) { | |
800 | + $t = "simptv" . $versao . ".map"; | |
801 | + } | |
802 | + if ($tipo == 1) { | |
803 | + $t = "simlinv" . $versao . ".map"; | |
804 | + $tamanho = $tamanho / 4; | |
805 | + } | |
806 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { | |
807 | + $mapatemp = ms_newMapObj($this->localaplicacao . "\\aplicmap\\" . $t); | |
808 | + } else { | |
809 | + $mapatemp = ms_newMapObj($this->localaplicacao . "/aplicmap/" . $t); | |
810 | + } | |
811 | + $l = $mapatemp->getlayer(0); | |
812 | + | |
813 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { | |
814 | + $novoss = dirname($this->mapa->symbolsetfilename) . "\\" . basename($mapatemp->symbolsetfilename); | |
815 | + } else { | |
816 | + $novoss = dirname($this->mapa->symbolsetfilename) . "/" . basename($mapatemp->symbolsetfilename); | |
817 | + } | |
818 | + | |
819 | + $this->mapa->setsymbolset($novoss); | |
820 | + | |
821 | + $ns = $this->mapa->getnumsymbols(); | |
822 | + $inis = 0; | |
823 | + | |
824 | + // na versao 7 nao tem o simbolo 0 | |
825 | + if ($this->v >= 7) { | |
826 | + $inis = 1; | |
827 | + // se for versao 7 inclui um primeiro simbolo com valor 0 e imagem | |
828 | + $oSymbol = $this->mapa->getSymbolObjectById(1); | |
829 | + $adiciona = ms_newLayerObj($this->mapa, $l); | |
830 | + $nomel = $l->name; | |
831 | + $tematemp = $this->mapa->getlayerbyname($nomel); | |
832 | + $c = $tematemp->getClass(0); | |
833 | + $e = $c->getstyle(0); | |
834 | + $e->set("size", 1); | |
835 | + $e->set("width", 1); | |
836 | + $ico = $c->createLegendIcon(40, 40); | |
837 | + $nimg = $ico->saveWebImage(); | |
838 | + $pat = $this->mapa->web->imageurl; | |
839 | + $ins .= "<img src='" . $nimg . "' style='cursor:pointer;border: 5px solid #FFFFFF' title='0' onclick='" . $onclick . "'>"; | |
840 | + } | |
841 | + for ($i = $inis; $i < $ns; ++ $i) { | |
842 | + $oSymbol = $this->mapa->getSymbolObjectById($i); | |
843 | + $nomes = $oSymbol->name; | |
844 | + if ($nomes == "") { | |
845 | + $nomes = $i; | |
846 | + } | |
847 | + $adiciona = ms_newLayerObj($this->mapa, $l); | |
848 | + $nomel = $l->name; | |
849 | + $tematemp = $this->mapa->getlayerbyname($nomel); | |
850 | + $c = $tematemp->getClass(0); | |
851 | + $e = $c->getstyle(0); | |
852 | + $e->set("symbolname", $nomes); | |
853 | + $e->set("size", $tamanho); | |
854 | + $e->set("width", $width); | |
855 | + $ico = $c->createLegendIcon(40, 40); | |
856 | + $nimg = $ico->saveWebImage(); | |
857 | + $pat = $this->mapa->web->imageurl; | |
858 | + $ins .= "<img src='" . $nimg . "' style='cursor:pointer;border: 5px solid #FFFFFF' title=" . $nomes . " onclick='" . $onclick . "'>"; | |
859 | + } | |
860 | + fwrite($f, "<?php \$res = \"" . $ins . "\";?>"); | |
861 | + fclose($f); | |
862 | + // copy ($dir."/simbolos".$tipo.".inc",$dir_tmp."/comum/simbolos".$tipo.".inc"); | |
863 | + return $ins; | |
864 | + } else { | |
865 | + $res = ""; | |
866 | + include_once $dir . "/simbolos" . $tipo . ".inc"; | |
867 | + return $res; | |
868 | + } | |
869 | + } | |
870 | + | |
871 | + /* | |
872 | + * function: pegaParametros | |
873 | + * | |
874 | + * Retorna uma lista com parâmetros sobre cada estilo de uma classe. | |
875 | + * | |
876 | + * parameters: | |
877 | + * $classe - Índice da classe. | |
878 | + * | |
879 | + * return: | |
880 | + * string com o | |
881 | + * tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size,symbolscaledenom,maxsize,minsize| | |
882 | + */ | |
883 | + function pegaParametros($classe) | |
884 | + { | |
885 | + if (! $this->layer) { | |
886 | + return "erro"; | |
887 | + } | |
888 | + $tipoLayer = $this->layer->type; | |
889 | + $classe = $this->layer->getclass($classe); | |
890 | + $numestilos = $classe->numstyles; | |
891 | + for ($i = 0; $i < $numestilos; ++ $i) { | |
892 | + $linha = array(); | |
893 | + $estilo = $classe->getstyle($i); | |
894 | + $linha[] = $i; | |
895 | + $linha[] = corRGB($estilo->outlinecolor); | |
896 | + $linha[] = corRGB($estilo->backgroundcolor); | |
897 | + $linha[] = corRGB($estilo->color); | |
898 | + $linha[] = $estilo->symbolname; | |
899 | + if ($estilo->getbinding(MS_STYLE_BINDING_SIZE)) { | |
900 | + $linha[] = $estilo->getbinding(MS_STYLE_BINDING_SIZE); | |
901 | + } else { | |
902 | + $linha[] = $estilo->size; | |
903 | + } | |
904 | + $linha[] = $estilo->opacity; | |
905 | + if ($this->v >= 6) { | |
906 | + $linha[] = $estilo->width; | |
907 | + $s = $estilo->symbol; | |
908 | + $linha[] = implode(" ", $s->getPatternArray); | |
909 | + $linha[] = $estilo->angle; | |
910 | + } else { | |
911 | + $linha[] = ""; | |
912 | + $linha[] = ""; | |
913 | + } | |
914 | + $linha[] = $this->layer->symbolscaledenom; | |
915 | + $linha[] = $estilo->minsize; | |
916 | + $linha[] = $estilo->maxsize; | |
917 | + $linha[] = $estilo->offsetx; | |
918 | + $linha[] = $estilo->offsety; | |
919 | + $linhas[] = $tipoLayer . "#" . implode("#", $linha); | |
920 | + } | |
921 | + // retorna tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size,symbolscaledenom | |
922 | + return implode("|", $linhas); | |
923 | + } | |
924 | + | |
925 | + /* | |
926 | + * function: aplicaParametro | |
927 | + * | |
928 | + * Aplica um parâmetro em um estilo de uma classe. | |
929 | + * | |
930 | + * parameters: | |
931 | + * | |
932 | + * $classe - Índice da classe. | |
933 | + * | |
934 | + * $estilo - Índice do estilo que será alterado. | |
935 | + * | |
936 | + * $outlinecolor - Cor do contorno. | |
937 | + * | |
938 | + * $backgroundcolor - Cor do fundo. | |
939 | + * | |
940 | + * $color - Cor da frente. | |
941 | + * | |
942 | + * $symbolname - Nome do símbolo. | |
943 | + * | |
944 | + * $size - Tamanho que será aplicado ao símbolo. | |
945 | + * | |
946 | + * $opacidade - Opacidade | |
947 | + */ | |
948 | + function aplicaParametro($classe, $estilo, $outlinecolor, $backgroundcolor, $color, $symbolname, $size, $opacidade, $width, $pattern, $angle, $minsize = 0, $maxsize = 500, $offsetx = 0, $offsety = 0) | |
949 | + { | |
950 | + if (! $this->layer) { | |
951 | + return "erro"; | |
952 | + } | |
953 | + if (! empty($pattern)) { | |
954 | + $pattern = str_replace(",", " ", $pattern); | |
955 | + } | |
956 | + $classe = $this->layer->getclass($classe); | |
957 | + // isso é necessário pq o mapserver não consegue apagar o nome de um estilo | |
958 | + if (isset($symbolname) && ($symbolname == "" || $symbolname == "0")) { | |
959 | + $classe->deletestyle($estilo); | |
960 | + $estilo = ms_newStyleObj($classe); | |
961 | + } else { | |
962 | + $estilo = $classe->getstyle($estilo); | |
963 | + } | |
964 | + if (isset($outlinecolor)) { | |
965 | + $cor = $estilo->outlinecolor; | |
966 | + $nc = explode(",", $outlinecolor); | |
967 | + $cor->setRGB($nc[0], $nc[1], $nc[2]); | |
968 | + } | |
969 | + if (isset($backgroundcolor)) { | |
970 | + $cor = $estilo->backgroundcolor; | |
971 | + $nc = explode(",", $backgroundcolor); | |
972 | + $cor->setRGB($nc[0], $nc[1], $nc[2]); | |
973 | + } | |
974 | + if (isset($color)) { | |
975 | + $cor = $estilo->color; | |
976 | + $nc = explode(",", $color); | |
977 | + $cor->setRGB($nc[0], $nc[1], $nc[2]); | |
978 | + } | |
979 | + if ((isset($symbolname)) && ($symbolname != "")) { | |
980 | + if (is_numeric($symbolname)) { | |
981 | + $estilo->set("symbol", $symbolname); | |
982 | + } else { | |
983 | + $estilo->set("symbolname", $symbolname); | |
984 | + } | |
985 | + } | |
986 | + if ((isset($size)) && ($size != "-1")) { | |
987 | + if (is_numeric($size)) { | |
988 | + $estilo->removebinding(MS_STYLE_BINDING_SIZE); | |
989 | + $estilo->set("size", $size); | |
990 | + } else { | |
991 | + $estilo->setbinding(MS_STYLE_BINDING_SIZE, $size); | |
992 | + } | |
993 | + } | |
994 | + if ((isset($width)) && ($width != "-1") && ($this->v >= 6)) { | |
995 | + $estilo->set("width", $width); | |
996 | + } | |
997 | + if ((isset($pattern)) && ($pattern != "-1") && ($this->v >= 6) && ($pattern != "")) { | |
998 | + $estilo->updatefromstring("STYLE PATTERN " . $pattern . " END"); | |
999 | + } | |
1000 | + if (isset($opacidade)) { | |
1001 | + $estilo->set("opacity", $opacidade); | |
1002 | + } | |
1003 | + if (isset($angle)) { | |
1004 | + $estilo->set("angle", $angle); | |
1005 | + } | |
1006 | + $estilo->set("minsize", $minsize); | |
1007 | + $estilo->set("maxsize", $maxsize); | |
1008 | + $estilo->set("offsetx", $offsetx); | |
1009 | + $estilo->set("offsety", $offsety); | |
1010 | + if ($this->layer->getmetadata("sld") != "") { | |
1011 | + $sld = $this->layer->getmetadata("sld"); | |
1012 | + $this->reSLD($this->arquivo, $this->nome, $sld); | |
1013 | + } | |
1014 | + $this->layer->setMetaData("cache", ""); | |
1015 | + return "ok"; | |
1016 | + } | |
1017 | + | |
1018 | + /* | |
1019 | + * function: pegaParametrosLegImg | |
1020 | + * | |
1021 | + * Pega os parâmetros da legenda embebida no mapa. | |
1022 | + * | |
1023 | + * return: | |
1024 | + * | |
1025 | + * array - "imagecolor"=>$imagecolor,"transparent"=>transparent,"position"=>$position,"status"=>$status,"outlinecolor"=>$outlinecolor,"keyspacingy"=>$keyspacingy,"keyspacingx"=>$keyspacingx,"keysizey"=>$keysizey,"keysizex"=>$keysizex,"heigt"=>$height,"width"=>$width | |
1026 | + * | |
1027 | + */ | |
1028 | + function pegaParametrosLegImg() | |
1029 | + { | |
1030 | + // error_reporting(0); | |
1031 | + $legenda = $this->mapa->legend; | |
1032 | + $height = $legenda->height; | |
1033 | + $width = $legenda->width; | |
1034 | + $keysizex = $legenda->keysizex; | |
1035 | + $keysizey = $legenda->keysizey; | |
1036 | + $keyspacingx = $legenda->keyspacingx; | |
1037 | + $keyspacingy = $legenda->keyspacingy; | |
1038 | + $outlinecolor = corRGB($legenda->outlinecolor); // Color of outline of box, -1 for no outline | |
1039 | + $status = $legenda->status; // MS_ON, MS_OFF, MS_EMBED | |
1040 | + $position = $legenda->position; | |
1041 | + if ($position < 99) { | |
1042 | + $position = "10" . $position; | |
1043 | + } | |
1044 | + $transparent = 100; | |
1045 | + $imagecolor = corRGB($legenda->imagecolor); | |
1046 | + $label = $legenda->label; | |
1047 | + $font = $label->font; | |
1048 | + if ($font == MS_BITMAP) { | |
1049 | + $l = $label->size; | |
1050 | + if ($l == MS_TINY) { | |
1051 | + $t = 5; | |
1052 | + } | |
1053 | + if ($l == MS_SMALL) { | |
1054 | + $t = 7; | |
1055 | + } | |
1056 | + if ($l == MS_MEDIUM) { | |
1057 | + $t = 10; | |
1058 | + } | |
1059 | + if ($l == MS_LARGE) { | |
1060 | + $t = 12; | |
1061 | + } | |
1062 | + if ($l == MS_GIANT) { | |
1063 | + $t = 14; | |
1064 | + } | |
1065 | + $labelsize = $t; | |
1066 | + } else | |
1067 | + $labelsize = $label->size; | |
1068 | + | |
1069 | + $tipofonte = $label->type; | |
1070 | + return (array( | |
1071 | + "tipofonte" => $tipofonte, | |
1072 | + "font" => $font, | |
1073 | + "imagecolor" => $imagecolor, | |
1074 | + "transparent" => transparent, | |
1075 | + "position" => $position, | |
1076 | + "status" => $status, | |
1077 | + "outlinecolor" => $outlinecolor, | |
1078 | + "keyspacingy" => $keyspacingy, | |
1079 | + "keyspacingx" => $keyspacingx, | |
1080 | + "keysizey" => $keysizey, | |
1081 | + "keysizex" => $keysizex, | |
1082 | + "height" => $height, | |
1083 | + "width" => $width, | |
1084 | + "labelsize" => $labelsize | |
1085 | + )); | |
1086 | + } | |
1087 | + | |
1088 | + /* | |
1089 | + * function: aplicaParametrosLegImg | |
1090 | + * | |
1091 | + * Aplica os parâmetros da legenda embebida no mapa. | |
1092 | + * | |
1093 | + * parameters: | |
1094 | + * | |
1095 | + * $imagecolor | |
1096 | + * | |
1097 | + * $position | |
1098 | + * | |
1099 | + * $status | |
1100 | + * | |
1101 | + * $outlinecolor | |
1102 | + * | |
1103 | + * $keyspacingy | |
1104 | + * | |
1105 | + * $keyspacingx | |
1106 | + * | |
1107 | + * $keysizey | |
1108 | + * | |
1109 | + * $keysizex | |
1110 | + * | |
1111 | + * $heigt | |
1112 | + * | |
1113 | + * $width | |
1114 | + */ | |
1115 | + function aplicaParametrosLegImg($fonte, $imagecolor, $position, $status, $outlinecolor, $keyspacingy, $keyspacingx, $keysizey, $keysizex, $height, $width, $labelsize) | |
1116 | + { | |
1117 | + $legenda = $this->mapa->legend; | |
1118 | + $legenda->set("height", $height); | |
1119 | + $legenda->set("width", $width); | |
1120 | + $legenda->set("keysizex", $keysizex); | |
1121 | + $legenda->set("keysizey", $keysizey); | |
1122 | + $legenda->set("keyspacingx", $keyspacingx); | |
1123 | + $legenda->set("keyspacingy", $keyspacingy); | |
1124 | + $corres = $legenda->outlinecolor; | |
1125 | + $cor = explode(",", $outlinecolor); | |
1126 | + $corres->setRGB($cor[0], $cor[1], $cor[2]); | |
1127 | + | |
1128 | + if ($status == 3) { | |
1129 | + $legenda->set("status", MS_EMBED); | |
1130 | + } else { | |
1131 | + $legenda->set("status", MS_OFF); | |
1132 | + } | |
1133 | + $verifica = $legenda->position; | |
1134 | + if ($verifica < 100) { | |
1135 | + if ($position > 99) { | |
1136 | + $position = 3; | |
1137 | + } | |
1138 | + } | |
1139 | + $legenda->set("position", $position); | |
1140 | + | |
1141 | + $corres = $legenda->imagecolor; | |
1142 | + $cor = explode(",", $imagecolor); | |
1143 | + $corres->setRGB($cor[0], $cor[1], $cor[2]); | |
1144 | + $label = $legenda->label; | |
1145 | + if ($fonte != "bitmap") { | |
1146 | + $label->updatefromstring("LABEL TYPE TRUETYPE END"); | |
1147 | + $label->set("font", $fonte); | |
1148 | + $label->set("size", $labelsize); | |
1149 | + } else { | |
1150 | + $label->updatefromstring("LABEL TYPE BITMAP END"); | |
1151 | + $t = MS_TINY; | |
1152 | + if ($labelsize > 5) { | |
1153 | + $t = MS_TINY; | |
1154 | + } | |
1155 | + if ($labelsize >= 7) { | |
1156 | + $t = MS_SMALL; | |
1157 | + } | |
1158 | + if ($labelsize >= 10) { | |
1159 | + $t = MS_MEDIUM; | |
1160 | + } | |
1161 | + if ($labelsize >= 12) { | |
1162 | + $t = MS_LARGE; | |
1163 | + } | |
1164 | + if ($labelsize >= 14) { | |
1165 | + $t = MS_GIANT; | |
1166 | + } | |
1167 | + $label->set("size", $t); | |
1168 | + } | |
1169 | + | |
1170 | + return ("ok"); | |
1171 | + } | |
1172 | + | |
1173 | + /* | |
1174 | + * Function: reSLD | |
1175 | + * | |
1176 | + * Gera o SLD de um tema WMS. | |
1177 | + * | |
1178 | + * Parametros: | |
1179 | + * | |
1180 | + * $map_file {string} - arquivo map_file | |
1181 | + * | |
1182 | + * $tema {string} - c�digo do tema | |
1183 | + * | |
1184 | + * $sld {string} - arquivo onde o sld será gravado | |
1185 | + */ | |
1186 | + function reSLD($map_file, $tema, $sld) | |
1187 | + { | |
1188 | + $map = ms_newMapObj($map_file); | |
1189 | + $layer = $map->getlayerbyname($tema); | |
1190 | + $layer->set("name", $layer->getmetadata("nomeoriginal")); | |
1191 | + $tiporep = $layer->getmetadata("tipooriginal"); | |
1192 | + $layer->set("type", MS_LAYER_POLYGON); | |
1193 | + if ($tiporep == "linear") { | |
1194 | + $layer->set("type", MS_LAYER_LINE); | |
1195 | + } | |
1196 | + if ($tiporep == "pontual") { | |
1197 | + $layer->set("type", MS_LAYER_POINT); | |
1198 | + } | |
1199 | + $sldf = $layer->generateSLD(); | |
1200 | + if (file_exists($sld)) { | |
1201 | + unlink($sld); | |
1202 | + } | |
1203 | + $fp = fopen($sld, "a"); | |
1204 | + fputs($fp, $sldf); | |
1205 | + fclose($fp); | |
1206 | + } | |
1207 | + | |
1208 | + function aplicaTodasClasses($parametro, $valor) | |
1209 | + { | |
1210 | + if (! $this->layer) { | |
1211 | + return "erro"; | |
1212 | + } | |
1213 | + $numc = $this->layer->numclasses; | |
1214 | + for ($c = 0; $c < $numc; $c ++) { | |
1215 | + $classe = $this->layer->getclass($c); | |
1216 | + $estilo = $classe->getstyle(0); | |
1217 | + switch ($parametro) { | |
1218 | + case "pattern": | |
1219 | + if (! empty($pattern)) { | |
1220 | + $pattern = str_replace(",", " ", $valor); | |
1221 | + if ($this->v >= 6) { | |
1222 | + $estilo->updatefromstring("STYLE PATTERN " . $valor . " END"); | |
1223 | + } | |
1224 | + } | |
1225 | + continue; | |
1226 | + case "symbolname": | |
1227 | + if ($parametro == "" || $parametro == "0") { | |
1228 | + $classe->deletestyle($estilo); | |
1229 | + $estilo = ms_newStyleObj($classe); | |
1230 | + } else { | |
1231 | + if (is_numeric($valor)) { | |
1232 | + $estilo->set("symbol", $valor); | |
1233 | + } else { | |
1234 | + $estilo->set("symbolname", $valor); | |
1235 | + } | |
1236 | + } | |
1237 | + continue; | |
1238 | + case "outlinecolor": | |
1239 | + $cor = $estilo->outlinecolor; | |
1240 | + $nc = explode(",", $valor); | |
1241 | + $cor->setRGB($nc[0], $nc[1], $nc[2]); | |
1242 | + continue; | |
1243 | + case "backgroundcolor": | |
1244 | + $cor = $estilo->backgroundcolor; | |
1245 | + $nc = explode(",", $valor); | |
1246 | + $cor->setRGB($nc[0], $nc[1], $nc[2]); | |
1247 | + continue; | |
1248 | + case "color": | |
1249 | + $cor = $estilo->color; | |
1250 | + $nc = explode(",", $valor); | |
1251 | + $cor->setRGB($nc[0], $nc[1], $nc[2]); | |
1252 | + continue; | |
1253 | + case "size": | |
1254 | + if (is_numeric($valor)) { | |
1255 | + $estilo->removebinding(MS_STYLE_BINDING_SIZE); | |
1256 | + $estilo->set("size", $valor); | |
1257 | + } else { | |
1258 | + $estilo->setbinding(MS_STYLE_BINDING_SIZE, $valor); | |
1259 | + } | |
1260 | + continue; | |
1261 | + case "width": | |
1262 | + $estilo->set("width", $valor); | |
1263 | + continue; | |
1264 | + case "offsetx": | |
1265 | + $estilo->set("offsetx", $valor); | |
1266 | + continue; | |
1267 | + case "offsety": | |
1268 | + $estilo->set("offsety", $valor); | |
1269 | + continue; | |
1270 | + case "opacity": | |
1271 | + $estilo->set("opacity", $valor); | |
1272 | + continue; | |
1273 | + case "angle": | |
1274 | + $estilo->set("angle", $valor); | |
1275 | + continue; | |
1276 | + } | |
1277 | + } | |
1278 | + $this->layer->setMetaData("cache", ""); | |
1279 | + return "ok"; | |
1280 | + } | |
1281 | + | |
1282 | + function converte($texto) | |
1283 | + { | |
1284 | + if (function_exists("mb_convert_encoding")) { | |
1285 | + if (! mb_detect_encoding($texto, "UTF-8", true)) { | |
1286 | + $texto = mb_convert_encoding($texto, "UTF-8", "ISO-8859-1"); | |
1287 | + } | |
1288 | + } | |
1289 | + return $texto; | |
1290 | + } | |
1291 | +} | |
1231 | 1292 | ?> |
1232 | 1293 | \ No newline at end of file | ... | ... |
js/arvoredecamadas.js
... | ... | @@ -473,7 +473,7 @@ i3GEO.arvoreDeCamadas = |
473 | 473 | */ |
474 | 474 | atualizaLegenda : function(idtema) { |
475 | 475 | if (typeof (console) !== 'undefined') |
476 | - console.info("oops i3GEO.arvoreDeCamadas.atualizaLegenda()"); | |
476 | + console.info("depreciado i3GEO.arvoreDeCamadas.atualizaLegenda()"); | |
477 | 477 | |
478 | 478 | }, |
479 | 479 | /** | ... | ... |
js/compactados/tema_compacto.js
1 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.tema={TEMPORIZADORESID:{},ativaFerramentas:function(camada){if(camada.ferramentas&&camada.ferramentas!=""){var f=camada.ferramentas;if(f.tme&&f.tme.auto&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto&&f.animagif.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.animagif(camada.name)}}},exclui:function(tema,confirma){if(confirma&&confirma===true){i3GEO.janela.confirma($trad("removerDoMapa"),300,$trad("x14"),"",function(){i3GEO.tema.exclui(tema)});return}try{try{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}try{var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p)}catch(rr){}}catch(e){}i3GEO.php.excluitema(i3GEO.atualiza,[tema]);i3GEO.mapa.ativaTema();i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/ferramentas/abrefontemapfile.php?tema="+tema}if(!popup){window.open(link)}else{i3GEO.janela.cria((i3GEO.parametros.w/2)+25+"px",(i3GEO.parametros.h/2)+18+"px",link,"","","<div class='i3GeoTituloJanela'>Metadata</div>","metadata"+tema)}},sobe:function(tema){i3GEO.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(tema){i3GEO.php.descetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},zoom:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.limpasel(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,tema)},tema)},mudatransp:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){if($i("tr"+idtema)){valor=$i("tr"+idtema).value}}if(valor!==""){i3GEO.php.mudatransp(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,idtema)},idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x16"))}},invertestatuslegenda:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb){i3GEO.mapa.ativaTema(idtema);i3GEO.php.aplicaCorClasseTema(temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)},idtema,idclasse,rgb)},mudanome:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){return}if(valor!==""){i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x18"))}},copia:function(idtema){i3GEO.php.copiatema(i3GEO.atualiza,idtema)},contorno:function(idtema){var temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)};i3GEO.php.contorno(temp,idtema)},temporizador:function(idtema,tempo){var t;if(!tempo){if($i("temporizador"+idtema)){tempo=$i("temporizador"+idtema).value}else{tempo=0}}if(tempo!=""&&parseInt(tempo,10)>0){t=function(){if(!$i("arrastar_"+idtema)){delete(i3GEO.tema.TEMPORIZADORESID[idtema]);return}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.tema.TEMPORIZADORESID[idtema]={tempo:tempo,idtemporizador:setInterval(t,parseInt(tempo,10)*1000)}}else{try{window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador);delete(i3GEO.tema.TEMPORIZADORESID[idtema])}catch(e){}}},dialogo:{animagif:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.animagif.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animagif()","animagif","animagif","dependencias.php",temp)},storymap:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.storymap.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.storymap()","storymap","storymap","dependencias.php",temp)},tme:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.tme.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","dependencias.php",temp)},mostraWms:function(tema){i3GEO.janela.mensagemSimples(i3GEO.configura.locaplic+"/ogc.php?tema="+tema,"WMS url")},comentario:function(tema){i3GEO.janela.cria("530px","330px",i3GEO.configura.locaplic+"/ferramentas/comentarios/index.php?tema="+tema+"&g_sid="+i3GEO.configura.sid+"&locaplic="+i3GEO.configura.locaplic,"","","<img src='"+i3GEO.configura.locaplic+"/imagens/player_volta.png' style=cursor:pointer onclick='javascript:history.go(-1)'><span style=position:relative;top:-2px; > "+$trad("x19")+" "+tema+"</span><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a>","comentario"+Math.random())},cortina:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema)}i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.cortina()","cortina","cortina","dependencias.php","i3GEOF.cortina.iniciaJanelaFlutuante()")},mmscale:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.mmscale()","mmscale","mmscale","dependencias.php","i3GEOF.mmscale.iniciaJanelaFlutuante()")},atalhoscamada:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.atalhoscamada()","atalhoscamada","atalhoscamada","dependencias.php","i3GEOF.atalhoscamada.iniciaJanelaFlutuante()")},abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js","i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}else{i3GEOF.converteKml.criaJanelaFlutuante(tema,tipo)}},salvaMapfile:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.salvaMapfile()","salvamapfile","salvamapfile")},graficotema:function(idtema,propriedades){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.graficoTema.iniciaJanelaFlutuante(propriedades)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.graficotema()","graficotema","graficoTema","dependencias.php",temp)},toponimia:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.filtro.iniciaJanelaFlutuante(modoCalculadora,idRetorno)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.filtro()","filtro","filtro","dependencias.php",temp)},procuraratrib:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.procuraratrib()","busca","busca","dependencias.php","i3GEOF.busca.iniciaJanelaFlutuante()")},tabela:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.legenda.aposIniciar=function(){i3GEOF.legenda.classe=0;i3GEOF.legenda.estilo=0;i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_'+idtema+"-"+idclasse);i3GEOF.legenda.aposIniciar=function(){}};i3GEOF.legenda.iniciaJanelaFlutuante(idtema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php",temp)},download:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.download()","download","download")},ogcwindow:function(idtema){i3GEO.mapa.ativaTema(idtema);window.open(i3GEO.configura.locaplic+"/ogc.htm?temaOgc="+idtema)},sld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","<div class='i3GeoTituloJanela'>SLD<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' ><b> </b></a></div>")},aplicarsld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.aplicarsld()","aplicarsld","aplicarsld","dependencias.php","i3GEOF.aplicarsld.iniciaJanelaFlutuante()")},editorsql:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql","dependencias.php","i3GEOF.editorsql.iniciaJanelaFlutuante()")},mudanome:function(idtema){i3GEO.mapa.ativaTema(idtema);var temp=function(){var valor=$i("i3GEOjanelaprompt").value;i3GEO.tema.mudanome(idtema,valor)};i3GEO.janela.prompt($trad("novonome"),temp)}}}; | |
2 | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.tema={TEMPORIZADORESID:{},ativaFerramentas:function(camada){if(camada.ferramentas&&camada.ferramentas!=""){var f=camada.ferramentas;if(f.tme&&f.tme.auto&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto&&f.animagif.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.animagif(camada.name)}}},exclui:function(tema,confirma){if(confirma&&confirma===true){i3GEO.janela.confirma($trad("removerDoMapa"),300,$trad("x14"),"",function(){i3GEO.tema.exclui(tema)});return}try{try{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}try{var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p)}catch(rr){}}catch(e){}i3GEO.php.excluitema(i3GEO.atualiza,[tema]);i3GEO.mapa.ativaTema();i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/ferramentas/abrefontemapfile.php?tema="+tema}if(!popup){window.open(link)}else{i3GEO.janela.cria((i3GEO.parametros.w/2)+25+"px",(i3GEO.parametros.h/2)+18+"px",link,"","","<div class='i3GeoTituloJanela'>Metadata</div>","metadata"+tema)}},sobe:function(tema){i3GEO.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(tema){i3GEO.php.descetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},zoom:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.limpasel(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,tema)},tema)},mudatransp:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){if($i("tr"+idtema)){valor=$i("tr"+idtema).value}}if(valor!==""){i3GEO.php.mudatransp(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,idtema)},idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x16"))}},invertestatuslegenda:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb){i3GEO.mapa.ativaTema(idtema);i3GEO.php.aplicaCorClasseTema(temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema)},idtema,idclasse,rgb)},mudanome:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){return}if(valor!==""){i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x18"))}},copia:function(idtema){i3GEO.php.copiatema(i3GEO.atualiza,idtema)},contorno:function(idtema){var temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)};i3GEO.php.contorno(temp,idtema)},temporizador:function(idtema,tempo){var t;if(!tempo){if($i("temporizador"+idtema)){tempo=$i("temporizador"+idtema).value}else{tempo=0}}if(tempo!=""&&parseInt(tempo,10)>0){t=function(){if(!$i("arrastar_"+idtema)){delete(i3GEO.tema.TEMPORIZADORESID[idtema]);return}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.tema.TEMPORIZADORESID[idtema]={tempo:tempo,idtemporizador:setInterval(t,parseInt(tempo,10)*1000)}}else{try{window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador);delete(i3GEO.tema.TEMPORIZADORESID[idtema])}catch(e){}}},dialogo:{animagif:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.animagif.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animagif()","animagif","animagif","dependencias.php",temp)},storymap:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.storymap.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.storymap()","storymap","storymap","dependencias.php",temp)},tme:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.tme.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","dependencias.php",temp)},mostraWms:function(tema){i3GEO.janela.mensagemSimples(i3GEO.configura.locaplic+"/ogc.php?tema="+tema,"WMS url")},comentario:function(tema){i3GEO.janela.cria("530px","330px",i3GEO.configura.locaplic+"/ferramentas/comentarios/index.php?tema="+tema+"&g_sid="+i3GEO.configura.sid+"&locaplic="+i3GEO.configura.locaplic,"","","<img src='"+i3GEO.configura.locaplic+"/imagens/player_volta.png' style=cursor:pointer onclick='javascript:history.go(-1)'><span style=position:relative;top:-2px; > "+$trad("x19")+" "+tema+"</span><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a>","comentario"+Math.random())},cortina:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema)}i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.cortina()","cortina","cortina","dependencias.php","i3GEOF.cortina.iniciaJanelaFlutuante()")},mmscale:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.mmscale()","mmscale","mmscale","dependencias.php","i3GEOF.mmscale.iniciaJanelaFlutuante()")},atalhoscamada:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.atalhoscamada()","atalhoscamada","atalhoscamada","dependencias.php","i3GEOF.atalhoscamada.iniciaJanelaFlutuante()")},abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js","i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}else{i3GEOF.converteKml.criaJanelaFlutuante(tema,tipo)}},salvaMapfile:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.salvaMapfile()","salvamapfile","salvamapfile")},graficotema:function(idtema,propriedades){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.graficoTema.iniciaJanelaFlutuante(propriedades)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.graficotema()","graficotema","graficoTema","dependencias.php",temp)},toponimia:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.filtro.iniciaJanelaFlutuante(modoCalculadora,idRetorno)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.filtro()","filtro","filtro","dependencias.php",temp)},procuraratrib:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.procuraratrib()","busca","busca","dependencias.php","i3GEOF.busca.iniciaJanelaFlutuante()")},tabela:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.legenda.aposIniciar=function(){i3GEOF.legenda.classe=0;i3GEOF.legenda.estilo=0;i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_'+idtema+"-"+idclasse);i3GEOF.legenda.aposIniciar=function(){}};i3GEOF.legenda.iniciaJanelaFlutuante(idtema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php",temp)},download:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.download()","download","download")},ogcwindow:function(idtema){i3GEO.mapa.ativaTema(idtema);window.open(i3GEO.configura.locaplic+"/ogc.htm?temaOgc="+idtema)},sld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","<div class='i3GeoTituloJanela'>SLD<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' ><b> </b></a></div>")},aplicarsld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.aplicarsld()","aplicarsld","aplicarsld","dependencias.php","i3GEOF.aplicarsld.iniciaJanelaFlutuante()")},editorsql:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql","dependencias.php","i3GEOF.editorsql.iniciaJanelaFlutuante()")},mudanome:function(idtema){i3GEO.mapa.ativaTema(idtema);var temp=function(){var valor=$i("i3GEOjanelaprompt").value;i3GEO.tema.mudanome(idtema,valor)};i3GEO.janela.prompt($trad("novonome"),temp)}}}; | |
3 | 3 | \ No newline at end of file | ... | ... |
js/i3geo_tudo_compacto7.js
... | ... | @@ -239,7 +239,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}var i3GEOtouchesPosMapa="";var i3ge |
239 | 239 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={BALAOATIVO:true,TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",GEOXML:[],limpasel:function(){i3GEO.php.limpasel(function(retorno){i3GEO.atualiza();i3GEO.Interface.atualizaMapa()},"")},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=window.innerWidth;Dh=window.innerHeight;i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.guias.abreFecha("fecha");ativo=true},2000)}ativo=false}},ativaIdentifica:function(){i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"];i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.verificaTipDefault()"]);i3GEO.eventos.cliquePerm.ativa()},ativaIdentificaBalao:function(){i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.verificaTipDefault()"];i3GEO.eventos.cliquePerm.ativa()},ativaTema:function(codigo){if(codigo){i3GEO.temaAtivo=codigo}},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert($trad("x21"));return}i3GEO.php.ativalogo(i3GEO.atualiza);var cr=$i("i3GEOcopyright");if(cr){if(cr.style.display==="block"){cr.style.display="none"}else{cr.style.display="block"}}},verifica:function(retorno){try{if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.janela.fechaAguarde();if(this.recupera&&this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},compactaLayerGrafico:function(){var geos=false,geometrias=[],n=0,i,g;if(i3GEO.editorOL&&i3GEO.desenho.layergrafico&&i3GEO.desenho.layergrafico.features){geos=i3GEO.desenho.layergrafico.features;n=geos.length;for(i=0;i<n;i++){g={"atributos":geos[i].attributes,"geometria":geos[i].geometry.toString()};geometrias.push(g)}}g=JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.editor[i3GEO.Interface.ATUAL].ativaPainel();var n=geometrias.length,i;for(i=0;i<n;i++){i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos)}i3GEO.editorOL.sobeLayersGraficos()};if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/classesjs/compactados/classe_editorol_compacto.js",inicia,"editorol.js",true)}}},restauraGraficos:function(graficos){if(graficos.length>0){var inicia=function(){i3GEOF.graficointerativo1.restauraGraficos(graficos)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",inicia,"graficointerativo1",true)}},restauraTabelas:function(tabelas){if(tabelas.length>0){var inicia=function(){i3GEOF.tabela.restauraTabelas(tabelas)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/tabela/dependencias.php",inicia,"tabela",true)}},aplicaPreferencias:function(cookies){var props,nprops,i,temp=[],pint;if(!cookies){cookies=i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo")}if(cookies){props=cookies.split("::");nprops=props.length;for(i=0;i<nprops;i++){try{temp=props[i].split("|");pint=parseInt(temp[1],10);if(temp[1]==='true'||temp[1]==='false'){if(temp[1]==='true'){temp[1]=true}if(temp[1]==='false'){temp[1]=false}eval(temp[0]+" = "+temp[1]+";")}else if(pint+"px"==temp[1]){eval(temp[0]+" = '"+temp[1]+"';")}else if($.isNumeric(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}}catch(e){}}}},dialogo:{listaLayersWms:function(servico){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwms/listalayers.php?servico="+servico,"","","<div class='i3GeoTituloJanela'>"+$trad("a4")+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=28' ><b> </b></a></div>","i3GEO.conectarwms",false,"hd","","","",true)},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.iniciaJanelaFlutuante()")},html2canvas:function(obj){var temp=function(){i3GEOF.html2canvas.iniciaJanelaFlutuante(obj)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.html2canvas()","html2canvas","html2canvas","dependencias.php",temp)},wkt2layer:function(wkt,texto){var temp=function(){i3GEOF.wkt2layer.iniciaJanelaFlutuante(wkt,texto)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wkt2layer()","wkt2layer","wkt2layer","dependencias.php",temp)},atalhosedicao:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.atalhosedicao()","atalhosedicao","atalhosedicao","dependencias.php","i3GEOF.atalhosedicao.iniciaJanelaFlutuante()")},geolocal:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal","dependencias.php","i3GEOF.geolocal.iniciaJanelaFlutuante()")},listaDeMapasBanco:function(idonde){if(idonde){i3GEO.guias.CONFIGURA["mapas"].click.call(this,idonde);return}if(i3GEO.guias.CONFIGURA["mapas"]){var temp,janela,id="listaMapa"+Math.random();janela=i3GEO.janela.cria("800px","500px",i3GEO.configura.locaplic+"/mapas/indexnomenu.php","","","<span class='i3GeoTituloJanelaBsNolink' ></span></div>",id)}else{window.open(i3GEO.configura.locaplic+"/rss/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=i3GEO.util.generateId(),cabecalho=function(){},titulo,minimiza=function(){i3GEO.janela.minimiza(idjanela)};if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){url=i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers3.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<span class='i3GeoTituloJanelaBsNolink' ></span></div>";i3GEO.janela.cria("520px","370px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza,"","","","",false,"","123")}},metaestat:function(largura,altura,topo,esquerda,Interface,conexao){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;if(Interface){i3GEOF.metaestat.INTERFACE=Interface}if(conexao){i3GEOF.metaestat.CONEXAODEFAULT=conexao}i3GEOF.metaestat.INTERFACE="flutuante";i3GEOF.metaestat.principal.inicia(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","dependencias.php",temp)},metaestatListaMapas:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()")},preferencias:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias")},locregiao:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.locregiao.iniciaDicionario(largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js",temp)},filtraregiao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()")},filtraperiodo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraperiodo()","filtraperiodo","filtraperiodo","dependencias.php","i3GEOF.filtraperiodo.iniciaJanelaFlutuante()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa","dependencias.php","i3GEOF.opacidademapa.iniciaJanelaFlutuante()")},t3d:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d")},imprimir:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir","dependencias.php","i3GEOF.imprimir.iniciaJanelaFlutuante()")},mostraExten:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten","dependencias.php","i3GEOF.mostraExten.iniciaJanelaFlutuante()")},outputformat:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat","dependencias.php","i3GEOF.outputformat.iniciaJanelaFlutuante()")},autoredesenha:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo","dependencias.php","i3GEOF.opcoesTempo.iniciaJanelaFlutuante()")},salvaMapa:function(){if(i3GEO.parametros===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa","dependencias.php","i3GEOF.salvaMapa.iniciaJanelaFlutuante()")},carregaMapa:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.carregaMapa()","carregamapa","carregaMapa","dependencias.php","i3GEOF.carregaMapa.iniciaJanelaFlutuante()")},convertews:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml","dependencias.php","i3GEOF.converteMapaKml.iniciaJanelaFlutuante()")},queryMap:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery","dependencias.php","i3GEOF.opcoesQuery.iniciaJanelaFlutuante()")},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","<div class='i3GeoTituloJanela'>Template<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' ><b> </b></a></div>")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho","dependencias.php","i3GEOF.opcoesTamanho.iniciaJanelaFlutuante()")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem","dependencias.php","i3GEOF.tipoimagem.iniciaJanelaFlutuante()")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo","dependencias.php","i3GEOF.opcoesFundo.iniciaJanelaFlutuante()")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala","dependencias.php","i3GEOF.opcoesEscala.iniciaJanelaFlutuante()")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda","dependencias.php","i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord","dependencias.php","i3GEOF.gradeCoord.iniciaJanelaFlutuante()")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt","dependencias.php","i3GEOF.inseretxt.iniciaJanelaFlutuante()")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao","dependencias.php","i3GEOF.selecao.iniciaJanelaFlutuante()")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy","dependencias.php","i3GEOF.inserexy.iniciaJanelaFlutuante()")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico","dependencias.php","i3GEOF.insereGrafico.iniciaJanelaFlutuante()")},cliqueIdentificaDefault:function(x,y){if(i3GEO.eventos.cliquePerm.ativo===false){return}if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php",temp=function(){if(x){i3GEOF.identifica.criaJanelaFlutuante(x,y)}else{i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy)}};i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{if(x){i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y)}else{i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy)}return}},verificaTipDefault:function(e){if(i3GEO.mapa.BALAOATIVO==false){return}if(i3GEO.eventos.cliquePerm.ativo==false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}var ntemas,etiquetas,j,x=objposicaocursor.ddx,y=objposicaocursor.ddy,temp;if(x===-1||y===-1){return}objposicaocursor.ddx=-1;objposicaocursor.ddy=-1;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""||i3GEO.arvoreDeCamadas.CAMADAS[j].identifica=="SIM"){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""&&i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal==""){$.get(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y,function(data){i3GEO.janela.closeMsg(data)});return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal!=""){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""){var temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y;temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal.replace("{{{url}}}",temp);i3GEO.janela.closeMsg(temp)}else{i3GEO.janela.closeMsg(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal)}return}temp=function(retorno){i3GEO.mapa.montaTip(retorno,x,y)};i3GEO.php.identifica3(temp,x,y,i3GEO.configura.ferramentas.identifica.resolution,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten,"","sim")}},montaTip:function(retorno,xx,yy){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",x,y,classeCor,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,wkts=[];i3GEO.eventos.cliquePerm.status=true;mostra=false;if(retorno==""){}if(retorno.data){retorno=retorno.data;temp=retorno[0].xy.split(",");x=temp[0]*1;y=temp[1]*1}else{x=xx;y=yy;mostra=true;textoSimples=$trad("balaoVazio");textoCompleto="";wkt=[]}if(retorno!==""){res="";ntemas=0;temas=retorno;if(temas){ntemas=temas.length}for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;titulo="<div class='toolTipBalaoTitulo'><b>"+titulo+"</b></div>";tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempCompleto="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;classeCor="toolTipBalaoTexto";for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='"+classeCor+"'>";textoTempSimples+="<div class='"+classeCor+"'>";for(r=0;r<ntips;r+=1){try{temp="";var alias=ds[s][tips[r]].alias;var valor=ds[s][tips[r]].valor;var link=ds[s][tips[r]].link;var img=ds[s][tips[r]].img;var estilo="tooltip-"+temas[j].tema;if(valor!==""&&link===""){temp+="<span class='"+estilo+"'><label>"+alias+": </label>"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span class='"+estilo+"'><label>"+alias+" : </label><a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}textoTempCompleto+="</div>";textoTempSimples+="</div>";if(ds[s].wkt&&ds[s].wkt.valor!=""){wkts.push(ds[s].wkt.valor)}}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){res=textoSimples;if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal==true){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.janela.closeMsg(textoSimples);return}else{i3GEO.janela.closeMsg(textoCompleto);return}}else{if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y)}else{i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoCompleto,textoSimples,x,y)}}}}n=wkts.length;if(n>0){i3GEO.desenho[i3GEO.Interface.ATUAL].criaLayerGrafico();var g,format,f,idunico,c=i3GEO.desenho.layergrafico.getSource();if(i3GEO.Interface.ATUAL=="openlayers"){format=new ol.format.WKT();for(r=0;r<n;r+=1){f=format.readFeatures(wkts[r]);f=f[0];f.setProperties({origem:"pin"});g=f.getGeometry();g=i3GEO.util.projGeo2OSM(g);f.setGeometry(g);c.addFeature(f)}}}}}; |
240 | 240 | // |
241 | 241 | //compactados/tema_compacto.js |
242 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.tema={TEMPORIZADORESID:{},ativaFerramentas:function(camada){if(camada.ferramentas&&camada.ferramentas!=""){var f=camada.ferramentas;if(f.tme&&f.tme.auto&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto&&f.animagif.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.animagif(camada.name)}}},exclui:function(tema,confirma){if(confirma&&confirma===true){i3GEO.janela.confirma($trad("removerDoMapa"),300,$trad("x14"),"",function(){i3GEO.tema.exclui(tema)});return}try{try{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}try{var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p)}catch(rr){}}catch(e){}i3GEO.php.excluitema(i3GEO.atualiza,[tema]);i3GEO.mapa.ativaTema();i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/ferramentas/abrefontemapfile.php?tema="+tema}if(!popup){window.open(link)}else{i3GEO.janela.cria((i3GEO.parametros.w/2)+25+"px",(i3GEO.parametros.h/2)+18+"px",link,"","","<div class='i3GeoTituloJanela'>Metadata</div>","metadata"+tema)}},sobe:function(tema){i3GEO.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(tema){i3GEO.php.descetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},zoom:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.limpasel(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,tema)},tema)},mudatransp:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){if($i("tr"+idtema)){valor=$i("tr"+idtema).value}}if(valor!==""){i3GEO.php.mudatransp(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,idtema)},idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x16"))}},invertestatuslegenda:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb){i3GEO.mapa.ativaTema(idtema);i3GEO.php.aplicaCorClasseTema(temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)},idtema,idclasse,rgb)},mudanome:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){return}if(valor!==""){i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x18"))}},copia:function(idtema){i3GEO.php.copiatema(i3GEO.atualiza,idtema)},contorno:function(idtema){var temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)};i3GEO.php.contorno(temp,idtema)},temporizador:function(idtema,tempo){var t;if(!tempo){if($i("temporizador"+idtema)){tempo=$i("temporizador"+idtema).value}else{tempo=0}}if(tempo!=""&&parseInt(tempo,10)>0){t=function(){if(!$i("arrastar_"+idtema)){delete(i3GEO.tema.TEMPORIZADORESID[idtema]);return}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.tema.TEMPORIZADORESID[idtema]={tempo:tempo,idtemporizador:setInterval(t,parseInt(tempo,10)*1000)}}else{try{window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador);delete(i3GEO.tema.TEMPORIZADORESID[idtema])}catch(e){}}},dialogo:{animagif:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.animagif.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animagif()","animagif","animagif","dependencias.php",temp)},storymap:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.storymap.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.storymap()","storymap","storymap","dependencias.php",temp)},tme:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.tme.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","dependencias.php",temp)},mostraWms:function(tema){i3GEO.janela.mensagemSimples(i3GEO.configura.locaplic+"/ogc.php?tema="+tema,"WMS url")},comentario:function(tema){i3GEO.janela.cria("530px","330px",i3GEO.configura.locaplic+"/ferramentas/comentarios/index.php?tema="+tema+"&g_sid="+i3GEO.configura.sid+"&locaplic="+i3GEO.configura.locaplic,"","","<img src='"+i3GEO.configura.locaplic+"/imagens/player_volta.png' style=cursor:pointer onclick='javascript:history.go(-1)'><span style=position:relative;top:-2px; > "+$trad("x19")+" "+tema+"</span><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a>","comentario"+Math.random())},cortina:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema)}i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.cortina()","cortina","cortina","dependencias.php","i3GEOF.cortina.iniciaJanelaFlutuante()")},mmscale:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.mmscale()","mmscale","mmscale","dependencias.php","i3GEOF.mmscale.iniciaJanelaFlutuante()")},atalhoscamada:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.atalhoscamada()","atalhoscamada","atalhoscamada","dependencias.php","i3GEOF.atalhoscamada.iniciaJanelaFlutuante()")},abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js","i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}else{i3GEOF.converteKml.criaJanelaFlutuante(tema,tipo)}},salvaMapfile:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.salvaMapfile()","salvamapfile","salvamapfile")},graficotema:function(idtema,propriedades){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.graficoTema.iniciaJanelaFlutuante(propriedades)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.graficotema()","graficotema","graficoTema","dependencias.php",temp)},toponimia:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.filtro.iniciaJanelaFlutuante(modoCalculadora,idRetorno)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.filtro()","filtro","filtro","dependencias.php",temp)},procuraratrib:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.procuraratrib()","busca","busca","dependencias.php","i3GEOF.busca.iniciaJanelaFlutuante()")},tabela:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.legenda.aposIniciar=function(){i3GEOF.legenda.classe=0;i3GEOF.legenda.estilo=0;i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_'+idtema+"-"+idclasse);i3GEOF.legenda.aposIniciar=function(){}};i3GEOF.legenda.iniciaJanelaFlutuante(idtema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php",temp)},download:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.download()","download","download")},ogcwindow:function(idtema){i3GEO.mapa.ativaTema(idtema);window.open(i3GEO.configura.locaplic+"/ogc.htm?temaOgc="+idtema)},sld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","<div class='i3GeoTituloJanela'>SLD<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' ><b> </b></a></div>")},aplicarsld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.aplicarsld()","aplicarsld","aplicarsld","dependencias.php","i3GEOF.aplicarsld.iniciaJanelaFlutuante()")},editorsql:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql","dependencias.php","i3GEOF.editorsql.iniciaJanelaFlutuante()")},mudanome:function(idtema){i3GEO.mapa.ativaTema(idtema);var temp=function(){var valor=$i("i3GEOjanelaprompt").value;i3GEO.tema.mudanome(idtema,valor)};i3GEO.janela.prompt($trad("novonome"),temp)}}}; | |
242 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.tema={TEMPORIZADORESID:{},ativaFerramentas:function(camada){if(camada.ferramentas&&camada.ferramentas!=""){var f=camada.ferramentas;if(f.tme&&f.tme.auto&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto&&f.animagif.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.animagif(camada.name)}}},exclui:function(tema,confirma){if(confirma&&confirma===true){i3GEO.janela.confirma($trad("removerDoMapa"),300,$trad("x14"),"",function(){i3GEO.tema.exclui(tema)});return}try{try{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}try{var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p)}catch(rr){}}catch(e){}i3GEO.php.excluitema(i3GEO.atualiza,[tema]);i3GEO.mapa.ativaTema();i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/ferramentas/abrefontemapfile.php?tema="+tema}if(!popup){window.open(link)}else{i3GEO.janela.cria((i3GEO.parametros.w/2)+25+"px",(i3GEO.parametros.h/2)+18+"px",link,"","","<div class='i3GeoTituloJanela'>Metadata</div>","metadata"+tema)}},sobe:function(tema){i3GEO.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(tema){i3GEO.php.descetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},zoom:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.limpasel(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,tema)},tema)},mudatransp:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){if($i("tr"+idtema)){valor=$i("tr"+idtema).value}}if(valor!==""){i3GEO.php.mudatransp(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,idtema)},idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x16"))}},invertestatuslegenda:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb){i3GEO.mapa.ativaTema(idtema);i3GEO.php.aplicaCorClasseTema(temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema)},idtema,idclasse,rgb)},mudanome:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){return}if(valor!==""){i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x18"))}},copia:function(idtema){i3GEO.php.copiatema(i3GEO.atualiza,idtema)},contorno:function(idtema){var temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)};i3GEO.php.contorno(temp,idtema)},temporizador:function(idtema,tempo){var t;if(!tempo){if($i("temporizador"+idtema)){tempo=$i("temporizador"+idtema).value}else{tempo=0}}if(tempo!=""&&parseInt(tempo,10)>0){t=function(){if(!$i("arrastar_"+idtema)){delete(i3GEO.tema.TEMPORIZADORESID[idtema]);return}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.tema.TEMPORIZADORESID[idtema]={tempo:tempo,idtemporizador:setInterval(t,parseInt(tempo,10)*1000)}}else{try{window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador);delete(i3GEO.tema.TEMPORIZADORESID[idtema])}catch(e){}}},dialogo:{animagif:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.animagif.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animagif()","animagif","animagif","dependencias.php",temp)},storymap:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.storymap.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.storymap()","storymap","storymap","dependencias.php",temp)},tme:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.tme.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","dependencias.php",temp)},mostraWms:function(tema){i3GEO.janela.mensagemSimples(i3GEO.configura.locaplic+"/ogc.php?tema="+tema,"WMS url")},comentario:function(tema){i3GEO.janela.cria("530px","330px",i3GEO.configura.locaplic+"/ferramentas/comentarios/index.php?tema="+tema+"&g_sid="+i3GEO.configura.sid+"&locaplic="+i3GEO.configura.locaplic,"","","<img src='"+i3GEO.configura.locaplic+"/imagens/player_volta.png' style=cursor:pointer onclick='javascript:history.go(-1)'><span style=position:relative;top:-2px; > "+$trad("x19")+" "+tema+"</span><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a>","comentario"+Math.random())},cortina:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema)}i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.cortina()","cortina","cortina","dependencias.php","i3GEOF.cortina.iniciaJanelaFlutuante()")},mmscale:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.mmscale()","mmscale","mmscale","dependencias.php","i3GEOF.mmscale.iniciaJanelaFlutuante()")},atalhoscamada:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.atalhoscamada()","atalhoscamada","atalhoscamada","dependencias.php","i3GEOF.atalhoscamada.iniciaJanelaFlutuante()")},abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js","i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}else{i3GEOF.converteKml.criaJanelaFlutuante(tema,tipo)}},salvaMapfile:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.salvaMapfile()","salvamapfile","salvamapfile")},graficotema:function(idtema,propriedades){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.graficoTema.iniciaJanelaFlutuante(propriedades)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.graficotema()","graficotema","graficoTema","dependencias.php",temp)},toponimia:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.filtro.iniciaJanelaFlutuante(modoCalculadora,idRetorno)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.filtro()","filtro","filtro","dependencias.php",temp)},procuraratrib:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.procuraratrib()","busca","busca","dependencias.php","i3GEOF.busca.iniciaJanelaFlutuante()")},tabela:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.legenda.aposIniciar=function(){i3GEOF.legenda.classe=0;i3GEOF.legenda.estilo=0;i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_'+idtema+"-"+idclasse);i3GEOF.legenda.aposIniciar=function(){}};i3GEOF.legenda.iniciaJanelaFlutuante(idtema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php",temp)},download:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.download()","download","download")},ogcwindow:function(idtema){i3GEO.mapa.ativaTema(idtema);window.open(i3GEO.configura.locaplic+"/ogc.htm?temaOgc="+idtema)},sld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","<div class='i3GeoTituloJanela'>SLD<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' ><b> </b></a></div>")},aplicarsld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.aplicarsld()","aplicarsld","aplicarsld","dependencias.php","i3GEOF.aplicarsld.iniciaJanelaFlutuante()")},editorsql:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql","dependencias.php","i3GEOF.editorsql.iniciaJanelaFlutuante()")},mudanome:function(idtema){i3GEO.mapa.ativaTema(idtema);var temp=function(){var valor=$i("i3GEOjanelaprompt").value;i3GEO.tema.mudanome(idtema,valor)};i3GEO.janela.prompt($trad("novonome"),temp)}}}; | |
243 | 243 | // |
244 | 244 | //compactados/analise_compacto.js |
245 | 245 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.analise={pontos:{xpt:[],ypt:[]},dialogo:{markercluster:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.markercluster()","markercluster","markercluster","dependencias.php","i3GEOF.markercluster.iniciaJanelaFlutuante()")},heatmap:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.heatmap()","heatmap","heatmap","dependencias.php","i3GEOF.heatmap.iniciaJanelaFlutuante()")},saiku:function(){if(i3GEO.parametros.statusFerramentas&&i3GEO.parametros.statusFerramentas.saiku===false){i3GEO.janela.tempoMsg($trad("naoInstalado"));return}i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.saiku()","saiku","saiku")},saikuMapa:function(){if(i3GEO.parametros.statusFerramentas&&i3GEO.parametros.statusFerramentas.saiku===false){i3GEO.janela.tempoMsg($trad("naoInstalado"));return}i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.saiku()","saiku","saiku","index.js","i3GEOF.saiku.iniciaJanelaFlutuante2()")},graficoInterativo:function(){alert("depreciado. Use graficointerativo1")},graficoInterativo1:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.graficointerativo1()","graficointerativo1","graficointerativo1","dependencias.php","i3GEOF.graficointerativo1.iniciaJanelaFlutuante()")},linhaDoTempo:function(){i3GEO.janela.cria("650px","450px",i3GEO.configura.locaplic+"/ferramentas/linhadotempo/index.php","","","</div><a class='i3GeoTituloJanelaBs' target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=88' >Linha do tempo</a>","i3GEOF.linhaDoTempo",false,"hd","","","",true,i3GEO.configura.locaplic+"/imagens/oxygen/16x16/clock.png");i3GEO.analise.atualizaLinhaDoTempo=function(){var doc="",ifr="";try{ifr=$i("i3GEOF.linhaDoTempoi");if(navn){if(ifr){doc=ifr.contentDocument}}else{if(document.frames("i3GEOF.linhaDoTempoi")){doc=document.frames("i3GEOF.linhaDoTempoi").document}}doc.getElementById("tl")?window.parent["i3GEOF.linhaDoTempoi"].carregaDados():i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.analise.atualizaLinhaDoTempo()"])}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.analise.atualizaLinhaDoTempo()"])}};i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.analise.atualizaLinhaDoTempo()"]);var ifr=$i("i3GEOF.linhaDoTempoi");if(ifr){ifr.style.width="100%"}},perfil:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.perfil()","perfil","perfil")},rota:function(){if(i3GEO.Interface.ATUAL!=="googlemaps"){alert("Operacao disponivel apenas na interface Google Maps");return}counterClick=1;var parametrosRota=function(overlay,latlng){var temp,janela;if(counterClick===1){counterClick++;alert("Clique o ponto de destino da rota");pontoRota1=latlng;return}if(counterClick===2){pontoRota2=latlng;counterClick=0;GEvent.removeListener(rotaEvento);janela=i3GEO.janela.cria("300px","300px","","center","","<div class='i3GeoTituloJanela'>"+$trad("x48")+"</div>");janela[2].style.overflow="auto";janela[2].style.height="300px";directions=new GDirections(i3GeoMap,janela[2]);temp=function(){$i("wdoca_corpo").innerHTML="Não foi possível criar a rota"};GEvent.addListener(directions,"error",temp);directions.load("from: "+pontoRota1.lat()+","+pontoRota1.lng()+" to: "+pontoRota2.lat()+","+pontoRota2.lng())}};rotaEvento=GEvent.addListener(i3GeoMap,"click",parametrosRota);i3GEO.janela.tempoMsg("Clique o ponto de origem da rota")},melhorcaminho:function(){if(i3GEO.parametros.statusFerramentas&&i3GEO.parametros.statusFerramentas.melhorcaminho===false){i3GEO.janela.tempoMsg($trad("naoInstalado"));return}i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.melhorcaminho()","melhorcaminho","melhorcaminho")},gradePontos:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.gradePontos()","gradepontos","gradeDePontos","dependencias.php","i3GEOF.gradeDePontos.iniciaJanelaFlutuante()")},gradePol:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.gradePol()","gradepol","gradeDePoligonos","dependencias.php","i3GEOF.gradeDePoligonos.iniciaJanelaFlutuante()")},gradeHex:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.gradeHex()","gradehex","gradeDeHex","dependencias.php","i3GEOF.gradeDeHex.iniciaJanelaFlutuante()")},analisaGeometrias:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","analisageometrias","analisaGeometrias","dependencias.php","i3GEOF.analisaGeometrias.iniciaJanelaFlutuante()")},pontosdistri:function(){i3GEO.parametros.r==="nao"?i3GEO.janela.tempoMsg($trad("x22")):i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.pontosdistri()","pontosdistri","pontosDistri","dependencias.php","i3GEOF.pontosDistri.iniciaJanelaFlutuante()")},pontoempoligono:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.pontoempoligono()","pontoempoligono","pontoEmPoligono","dependencias.php","i3GEOF.pontoEmPoligono.iniciaJanelaFlutuante()")},centromassa:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.centromassa()","centromassa","centromassa","dependencias.php","i3GEOF.centromassa.iniciaJanelaFlutuante()")},nptPol:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.nptpol()","nptpol","nptpol","dependencias.php","i3GEOF.nptpol.iniciaJanelaFlutuante()")},buffer:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.buffer()","buffer","buffer","dependencias.php","i3GEOF.buffer.iniciaJanelaFlutuante()")},distanciaptpt:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.distanciaptpt()","distanciaptpt","distanciaptpt","dependencias.php","i3GEOF.distanciaptpt.iniciaJanelaFlutuante()")},centroide:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.centroide()","centroide","centroide","dependencias.php","i3GEOF.centroide.iniciaJanelaFlutuante()")},dissolve:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.dissolve()","dissolve","dissolve","dependencias.php","i3GEOF.dissolve.iniciaJanelaFlutuante()")},agrupaElementos:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.agrupaElementos()","agrupaelementos","agrupaElementos","dependencias.php","i3GEOF.agrupaElementos.iniciaJanelaFlutuante()")},distancia:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.distancia()","distancia","distancia","dependencias.php","i3GEOF.distancia.iniciaJanelaFlutuante()")},area:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.area()","area","area","dependencias.php","i3GEOF.area.iniciaJanelaFlutuante()")},juntamedidasvariavel:function(tema){if(!tema){tema=i3GEO.temaAtivo}var temp=function(){i3GEOF.juntamedidasvariavel.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.juntamedidasvariavel()","juntamedidasvariavel","juntamedidasvariavel","dependencias.php",temp)}}}; | ... | ... |
js/i3geo_tudo_compacto7.js.php
... | ... | @@ -239,7 +239,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}var i3GEOtouchesPosMapa="";var i3ge |
239 | 239 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.mapa={BALAOATIVO:true,TEMASINICIAISLIGADOS:"",TEMASINICIAIS:"",GEOXML:[],limpasel:function(){i3GEO.php.limpasel(function(retorno){i3GEO.atualiza();i3GEO.Interface.atualizaMapa()},"")},ativaAutoResize:function(){var ativo=true;window.onresize=function(){var Dw,Dh;Dw=window.innerWidth;Dh=window.innerHeight;i3GEO.tamanhodoc=[Dw,Dh];if(ativo===true){setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.guias.abreFecha("fecha");ativo=true},2000)}ativo=false}},ativaIdentifica:function(){i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"];i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.verificaTipDefault()"]);i3GEO.eventos.cliquePerm.ativa()},ativaIdentificaBalao:function(){i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]);i3GEO.eventos.MOUSECLIQUE=["i3GEO.mapa.dialogo.verificaTipDefault()"];i3GEO.eventos.cliquePerm.ativa()},ativaTema:function(codigo){if(codigo){i3GEO.temaAtivo=codigo}},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert($trad("x21"));return}i3GEO.php.ativalogo(i3GEO.atualiza);var cr=$i("i3GEOcopyright");if(cr){if(cr.style.display==="block"){cr.style.display="none"}else{cr.style.display="block"}}},verifica:function(retorno){try{if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.janela.fechaAguarde();if(this.recupera&&this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaIMAGEM:{obtem:function(funcao){i3GEO.php.criaLegendaImagem(funcao)}},compactaLayerGrafico:function(){var geos=false,geometrias=[],n=0,i,g;if(i3GEO.editorOL&&i3GEO.desenho.layergrafico&&i3GEO.desenho.layergrafico.features){geos=i3GEO.desenho.layergrafico.features;n=geos.length;for(i=0;i<n;i++){g={"atributos":geos[i].attributes,"geometria":geos[i].geometry.toString()};geometrias.push(g)}}g=JSON.stringify(geometrias);return i3GEO.util.base64encode(g)},desCompactaLayerGrafico:function(geometrias){geometrias=JSON.parse(geometrias);if(geometrias.length>0){var inicia=function(){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}i3GEO.editor[i3GEO.Interface.ATUAL].ativaPainel();var n=geometrias.length,i;for(i=0;i<n;i++){i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos)}i3GEO.editorOL.sobeLayersGraficos()};if(!i3GEO.editorOL){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/classesjs/compactados/classe_editorol_compacto.js",inicia,"editorol.js",true)}}},restauraGraficos:function(graficos){if(graficos.length>0){var inicia=function(){i3GEOF.graficointerativo1.restauraGraficos(graficos)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",inicia,"graficointerativo1",true)}},restauraTabelas:function(tabelas){if(tabelas.length>0){var inicia=function(){i3GEOF.tabela.restauraTabelas(tabelas)};i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/tabela/dependencias.php",inicia,"tabela",true)}},aplicaPreferencias:function(cookies){var props,nprops,i,temp=[],pint;if(!cookies){cookies=i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo")}if(cookies){props=cookies.split("::");nprops=props.length;for(i=0;i<nprops;i++){try{temp=props[i].split("|");pint=parseInt(temp[1],10);if(temp[1]==='true'||temp[1]==='false'){if(temp[1]==='true'){temp[1]=true}if(temp[1]==='false'){temp[1]=false}eval(temp[0]+" = "+temp[1]+";")}else if(pint+"px"==temp[1]){eval(temp[0]+" = '"+temp[1]+"';")}else if($.isNumeric(pint)){eval(temp[0]+" = "+temp[1]+";")}else{eval(temp[0]+" = '"+temp[1]+"';")}}catch(e){}}}},dialogo:{listaLayersWms:function(servico){i3GEO.janela.cria("400px","300px",i3GEO.configura.locaplic+"/ferramentas/conectarwms/listalayers.php?servico="+servico,"","","<div class='i3GeoTituloJanela'>"+$trad("a4")+"<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=28' ><b> </b></a></div>","i3GEO.conectarwms",false,"hd","","","",true)},mascara:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mascara()","mascara","mascara","dependencias.php","i3GEOF.mascara.iniciaJanelaFlutuante()")},html2canvas:function(obj){var temp=function(){i3GEOF.html2canvas.iniciaJanelaFlutuante(obj)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.html2canvas()","html2canvas","html2canvas","dependencias.php",temp)},wkt2layer:function(wkt,texto){var temp=function(){i3GEOF.wkt2layer.iniciaJanelaFlutuante(wkt,texto)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.wkt2layer()","wkt2layer","wkt2layer","dependencias.php",temp)},atalhosedicao:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.atalhosedicao()","atalhosedicao","atalhosedicao","dependencias.php","i3GEOF.atalhosedicao.iniciaJanelaFlutuante()")},geolocal:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal","dependencias.php","i3GEOF.geolocal.iniciaJanelaFlutuante()")},listaDeMapasBanco:function(idonde){if(idonde){i3GEO.guias.CONFIGURA["mapas"].click.call(this,idonde);return}if(i3GEO.guias.CONFIGURA["mapas"]){var temp,janela,id="listaMapa"+Math.random();janela=i3GEO.janela.cria("800px","500px",i3GEO.configura.locaplic+"/mapas/indexnomenu.php","","","<span class='i3GeoTituloJanelaBsNolink' ></span></div>",id)}else{window.open(i3GEO.configura.locaplic+"/rss/rssmapas.php","_blank")}},congelaMapa:function(){var url="",idjanela=i3GEO.util.generateId(),cabecalho=function(){},titulo,minimiza=function(){i3GEO.janela.minimiza(idjanela)};if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){url=i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers3.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);titulo="<span class='i3GeoTituloJanelaBsNolink' ></span></div>";i3GEO.janela.cria("520px","370px",url,"","",titulo,idjanela,false,"hd",cabecalho,minimiza,"","","","",false,"","123")}},metaestat:function(largura,altura,topo,esquerda,Interface,conexao){var temp=function(){i3GEOF.metaestat.MULTIPARAMETROS=true;if(Interface){i3GEOF.metaestat.INTERFACE=Interface}if(conexao){i3GEOF.metaestat.CONEXAODEFAULT=conexao}i3GEOF.metaestat.INTERFACE="flutuante";i3GEOF.metaestat.principal.inicia(null,largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","dependencias.php",temp)},metaestatListaMapas:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()")},preferencias:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias")},locregiao:function(largura,altura,topo,esquerda){var temp=function(){i3GEOF.locregiao.iniciaDicionario(largura,altura,topo,esquerda)};i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js",temp)},filtraregiao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()")},filtraperiodo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraperiodo()","filtraperiodo","filtraperiodo","dependencias.php","i3GEOF.filtraperiodo.iniciaJanelaFlutuante()")},animacao:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animacao()","animacao","animacao","dependencias.php","i3GEOF.animacao.iniciaJanelaFlutuante()")},opacidade:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa","dependencias.php","i3GEOF.opacidademapa.iniciaJanelaFlutuante()")},t3d:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d")},imprimir:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir","dependencias.php","i3GEOF.imprimir.iniciaJanelaFlutuante()")},mostraExten:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten","dependencias.php","i3GEOF.mostraExten.iniciaJanelaFlutuante()")},outputformat:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat","dependencias.php","i3GEOF.outputformat.iniciaJanelaFlutuante()")},autoredesenha:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo","dependencias.php","i3GEOF.opcoesTempo.iniciaJanelaFlutuante()")},salvaMapa:function(){if(i3GEO.parametros===""){i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return}i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa","dependencias.php","i3GEOF.salvaMapa.iniciaJanelaFlutuante()")},carregaMapa:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.carregaMapa()","carregamapa","carregaMapa","dependencias.php","i3GEOF.carregaMapa.iniciaJanelaFlutuante()")},convertews:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS","dependencias.php","i3GEOF.converteMapaWS.iniciaJanelaFlutuante()")},convertekml:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml","dependencias.php","i3GEOF.converteMapaKml.iniciaJanelaFlutuante()")},queryMap:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery","dependencias.php","i3GEOF.opcoesQuery.iniciaJanelaFlutuante()")},template:function(){i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","<div class='i3GeoTituloJanela'>Template<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' ><b> </b></a></div>")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho","dependencias.php","i3GEOF.opcoesTamanho.iniciaJanelaFlutuante()")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem","dependencias.php","i3GEOF.tipoimagem.iniciaJanelaFlutuante()")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo","dependencias.php","i3GEOF.opcoesFundo.iniciaJanelaFlutuante()")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala","dependencias.php","i3GEOF.opcoesEscala.iniciaJanelaFlutuante()")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda","dependencias.php","i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord","dependencias.php","i3GEOF.gradeCoord.iniciaJanelaFlutuante()")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt","dependencias.php","i3GEOF.inseretxt.iniciaJanelaFlutuante()")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao","dependencias.php","i3GEOF.selecao.iniciaJanelaFlutuante()")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy","dependencias.php","i3GEOF.inserexy.iniciaJanelaFlutuante()")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico","dependencias.php","i3GEOF.insereGrafico.iniciaJanelaFlutuante()")},cliqueIdentificaDefault:function(x,y){if(i3GEO.eventos.cliquePerm.ativo===false){return}if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/dependencias.php",temp=function(){if(x){i3GEOF.identifica.criaJanelaFlutuante(x,y)}else{i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy)}};i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script")}else{if(x){i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y)}else{i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy)}return}},verificaTipDefault:function(e){if(i3GEO.mapa.BALAOATIVO==false){return}if(i3GEO.eventos.cliquePerm.ativo==false){return}if(i3GEO.eventos.cliquePerm.status===false){return}else{i3GEO.eventos.cliquePerm.status=false}var ntemas,etiquetas,j,x=objposicaocursor.ddx,y=objposicaocursor.ddy,temp;if(x===-1||y===-1){return}objposicaocursor.ddx=-1;objposicaocursor.ddy=-1;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j<ntemas;j+=1){if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas!==""||i3GEO.arvoreDeCamadas.CAMADAS[j].identifica=="SIM"){etiquetas=true}}if(etiquetas===false){return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""&&i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal==""){$.get(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y,function(data){i3GEO.janela.closeMsg(data)});return}if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal!=""){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url!=""){var temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.url+"&xx="+x+"&yy="+y;temp=i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal.replace("{{{url}}}",temp);i3GEO.janela.closeMsg(temp)}else{i3GEO.janela.closeMsg(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.templateModal)}return}temp=function(retorno){i3GEO.mapa.montaTip(retorno,x,y)};i3GEO.php.identifica3(temp,x,y,i3GEO.configura.ferramentas.identifica.resolution,"tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten,"","sim")}},montaTip:function(retorno,xx,yy){var textoCompleto="",textoSimples="",textoTempCompleto="",textoTempSimples="",x,y,classeCor,temp,n,mostra,res,temas,ntemas,titulo,tips,j,ntips,r,ds,nds,s,configura=i3GEO.configura,wkts=[];i3GEO.eventos.cliquePerm.status=true;mostra=false;if(retorno==""){}if(retorno.data){retorno=retorno.data;temp=retorno[0].xy.split(",");x=temp[0]*1;y=temp[1]*1}else{x=xx;y=yy;mostra=true;textoSimples=$trad("balaoVazio");textoCompleto="";wkt=[]}if(retorno!==""){res="";ntemas=0;temas=retorno;if(temas){ntemas=temas.length}for(j=0;j<ntemas;j+=1){titulo=temas[j].nome;titulo="<div class='toolTipBalaoTitulo'><b>"+titulo+"</b></div>";tips=temas[j].resultado.todosItens;ntips=tips.length;ins="";textoTempCompleto="";textoTempSimples="";ds=temas[j].resultado.dados;if(ds!==" "&&ds[0]&&ds[0]!=" "){try{nds=ds.length;classeCor="toolTipBalaoTexto";for(s=0;s<nds;s+=1){textoTempCompleto+="<div class='"+classeCor+"'>";textoTempSimples+="<div class='"+classeCor+"'>";for(r=0;r<ntips;r+=1){try{temp="";var alias=ds[s][tips[r]].alias;var valor=ds[s][tips[r]].valor;var link=ds[s][tips[r]].link;var img=ds[s][tips[r]].img;var estilo="tooltip-"+temas[j].tema;if(valor!==""&&link===""){temp+="<span class='"+estilo+"'><label>"+alias+": </label>"+valor+"</span><br>"}if(valor!==""&&link!==""){temp+="<span class='"+estilo+"'><label>"+alias+" : </label><a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >"+valor+"</a></span><br>"}if(img!==""){temp+=img+"<br>"}if(ds[s][tips[r]].tip.toLowerCase()==="sim"){textoTempSimples+=temp}textoTempCompleto+=temp;mostra=true}catch(e){}}textoTempCompleto+="</div>";textoTempSimples+="</div>";if(ds[s].wkt&&ds[s].wkt.valor!=""){wkts.push(ds[s].wkt.valor)}}}catch(e){}}if(textoTempSimples!==""){textoCompleto+=titulo+textoTempCompleto;textoSimples+=titulo+textoTempSimples}}if(mostra===true){res=textoSimples;if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.modal==true){if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.janela.closeMsg(textoSimples);return}else{i3GEO.janela.closeMsg(textoCompleto);return}}else{if(i3GEO.Interface[i3GEO.Interface.ATUAL].BALAOPROP.simple==true){i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoSimples,textoCompleto,x,y)}else{i3GEO.Interface[i3GEO.Interface.ATUAL].balao(textoCompleto,textoSimples,x,y)}}}}n=wkts.length;if(n>0){i3GEO.desenho[i3GEO.Interface.ATUAL].criaLayerGrafico();var g,format,f,idunico,c=i3GEO.desenho.layergrafico.getSource();if(i3GEO.Interface.ATUAL=="openlayers"){format=new ol.format.WKT();for(r=0;r<n;r+=1){f=format.readFeatures(wkts[r]);f=f[0];f.setProperties({origem:"pin"});g=f.getGeometry();g=i3GEO.util.projGeo2OSM(g);f.setGeometry(g);c.addFeature(f)}}}}}; |
240 | 240 | // |
241 | 241 | //compactados/tema_compacto.js |
242 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.tema={TEMPORIZADORESID:{},ativaFerramentas:function(camada){if(camada.ferramentas&&camada.ferramentas!=""){var f=camada.ferramentas;if(f.tme&&f.tme.auto&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto&&f.animagif.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.animagif(camada.name)}}},exclui:function(tema,confirma){if(confirma&&confirma===true){i3GEO.janela.confirma($trad("removerDoMapa"),300,$trad("x14"),"",function(){i3GEO.tema.exclui(tema)});return}try{try{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}try{var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p)}catch(rr){}}catch(e){}i3GEO.php.excluitema(i3GEO.atualiza,[tema]);i3GEO.mapa.ativaTema();i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/ferramentas/abrefontemapfile.php?tema="+tema}if(!popup){window.open(link)}else{i3GEO.janela.cria((i3GEO.parametros.w/2)+25+"px",(i3GEO.parametros.h/2)+18+"px",link,"","","<div class='i3GeoTituloJanela'>Metadata</div>","metadata"+tema)}},sobe:function(tema){i3GEO.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(tema){i3GEO.php.descetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},zoom:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.limpasel(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,tema)},tema)},mudatransp:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){if($i("tr"+idtema)){valor=$i("tr"+idtema).value}}if(valor!==""){i3GEO.php.mudatransp(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,idtema)},idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x16"))}},invertestatuslegenda:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb){i3GEO.mapa.ativaTema(idtema);i3GEO.php.aplicaCorClasseTema(temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)},idtema,idclasse,rgb)},mudanome:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){return}if(valor!==""){i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x18"))}},copia:function(idtema){i3GEO.php.copiatema(i3GEO.atualiza,idtema)},contorno:function(idtema){var temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)};i3GEO.php.contorno(temp,idtema)},temporizador:function(idtema,tempo){var t;if(!tempo){if($i("temporizador"+idtema)){tempo=$i("temporizador"+idtema).value}else{tempo=0}}if(tempo!=""&&parseInt(tempo,10)>0){t=function(){if(!$i("arrastar_"+idtema)){delete(i3GEO.tema.TEMPORIZADORESID[idtema]);return}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.tema.TEMPORIZADORESID[idtema]={tempo:tempo,idtemporizador:setInterval(t,parseInt(tempo,10)*1000)}}else{try{window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador);delete(i3GEO.tema.TEMPORIZADORESID[idtema])}catch(e){}}},dialogo:{animagif:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.animagif.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animagif()","animagif","animagif","dependencias.php",temp)},storymap:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.storymap.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.storymap()","storymap","storymap","dependencias.php",temp)},tme:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.tme.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","dependencias.php",temp)},mostraWms:function(tema){i3GEO.janela.mensagemSimples(i3GEO.configura.locaplic+"/ogc.php?tema="+tema,"WMS url")},comentario:function(tema){i3GEO.janela.cria("530px","330px",i3GEO.configura.locaplic+"/ferramentas/comentarios/index.php?tema="+tema+"&g_sid="+i3GEO.configura.sid+"&locaplic="+i3GEO.configura.locaplic,"","","<img src='"+i3GEO.configura.locaplic+"/imagens/player_volta.png' style=cursor:pointer onclick='javascript:history.go(-1)'><span style=position:relative;top:-2px; > "+$trad("x19")+" "+tema+"</span><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a>","comentario"+Math.random())},cortina:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema)}i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.cortina()","cortina","cortina","dependencias.php","i3GEOF.cortina.iniciaJanelaFlutuante()")},mmscale:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.mmscale()","mmscale","mmscale","dependencias.php","i3GEOF.mmscale.iniciaJanelaFlutuante()")},atalhoscamada:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.atalhoscamada()","atalhoscamada","atalhoscamada","dependencias.php","i3GEOF.atalhoscamada.iniciaJanelaFlutuante()")},abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js","i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}else{i3GEOF.converteKml.criaJanelaFlutuante(tema,tipo)}},salvaMapfile:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.salvaMapfile()","salvamapfile","salvamapfile")},graficotema:function(idtema,propriedades){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.graficoTema.iniciaJanelaFlutuante(propriedades)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.graficotema()","graficotema","graficoTema","dependencias.php",temp)},toponimia:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.filtro.iniciaJanelaFlutuante(modoCalculadora,idRetorno)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.filtro()","filtro","filtro","dependencias.php",temp)},procuraratrib:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.procuraratrib()","busca","busca","dependencias.php","i3GEOF.busca.iniciaJanelaFlutuante()")},tabela:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.legenda.aposIniciar=function(){i3GEOF.legenda.classe=0;i3GEOF.legenda.estilo=0;i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_'+idtema+"-"+idclasse);i3GEOF.legenda.aposIniciar=function(){}};i3GEOF.legenda.iniciaJanelaFlutuante(idtema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php",temp)},download:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.download()","download","download")},ogcwindow:function(idtema){i3GEO.mapa.ativaTema(idtema);window.open(i3GEO.configura.locaplic+"/ogc.htm?temaOgc="+idtema)},sld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","<div class='i3GeoTituloJanela'>SLD<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' ><b> </b></a></div>")},aplicarsld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.aplicarsld()","aplicarsld","aplicarsld","dependencias.php","i3GEOF.aplicarsld.iniciaJanelaFlutuante()")},editorsql:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql","dependencias.php","i3GEOF.editorsql.iniciaJanelaFlutuante()")},mudanome:function(idtema){i3GEO.mapa.ativaTema(idtema);var temp=function(){var valor=$i("i3GEOjanelaprompt").value;i3GEO.tema.mudanome(idtema,valor)};i3GEO.janela.prompt($trad("novonome"),temp)}}}; | |
242 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.tema={TEMPORIZADORESID:{},ativaFerramentas:function(camada){if(camada.ferramentas&&camada.ferramentas!=""){var f=camada.ferramentas;if(f.tme&&f.tme.auto&&f.tme.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.tme(camada.name)}if(f.storymap&&f.storymap.auto&&f.storymap.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.storymap(camada.name)}if(f.animagif&&f.animagif.auto&&f.animagif.auto.toLowerCase()==="sim"){i3GEO.tema.dialogo.animagif(camada.name)}}},exclui:function(tema,confirma){if(confirma&&confirma===true){i3GEO.janela.confirma($trad("removerDoMapa"),300,$trad("x14"),"",function(){i3GEO.tema.exclui(tema)});return}try{try{i3GEO.pluginI3geo.removeCamada(tema)}catch(r){}try{var p=document.getElementById("idx"+tema).parentNode.parentNode.parentNode;do{p.removeChild(p.childNodes[0])}while(p.childNodes.length>0);p.parentNode.removeChild(p)}catch(rr){}}catch(e){}i3GEO.php.excluitema(i3GEO.atualiza,[tema]);i3GEO.mapa.ativaTema();i3GEO.temaAtivo=""},fonte:function(tema,popup,link){i3GEO.mapa.ativaTema(tema);if(!link){link=i3GEO.configura.locaplic+"/ferramentas/abrefontemapfile.php?tema="+tema}if(!popup){window.open(link)}else{i3GEO.janela.cria((i3GEO.parametros.w/2)+25+"px",(i3GEO.parametros.h/2)+18+"px",link,"","","<div class='i3GeoTituloJanela'>Metadata</div>","metadata"+tema)}},sobe:function(tema){i3GEO.php.sobetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},desce:function(tema){i3GEO.php.descetema(function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}},tema)},zoom:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomtema(i3GEO.atualiza,tema)},zoomsel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.zoomsel(i3GEO.atualiza,tema)},limpasel:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.php.limpasel(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,tema)},tema)},mudatransp:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){if($i("tr"+idtema)){valor=$i("tr"+idtema).value}}if(valor!==""){i3GEO.php.mudatransp(function(retorno){i3GEO.atualiza(retorno);i3GEO.Interface.atualizaTema(retorno,idtema)},idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x16"))}},invertestatuslegenda:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.php.invertestatuslegenda(function(retorno){i3GEO.atualiza(retorno);i3GEO.arvoreDeCamadas.atualiza()},idtema)},alteracorclasse:function(idtema,idclasse,rgb){i3GEO.mapa.ativaTema(idtema);i3GEO.php.aplicaCorClasseTema(temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema)},idtema,idclasse,rgb)},mudanome:function(idtema,valor){i3GEO.mapa.ativaTema(idtema);if(!valor){return}if(valor!==""){i3GEO.php.mudanome(i3GEO.atualiza,idtema,valor)}else{i3GEO.janela.tempoMsg($trad("x18"))}},copia:function(idtema){i3GEO.php.copiatema(i3GEO.atualiza,idtema)},contorno:function(idtema){var temp=function(){i3GEO.atualiza();i3GEO.Interface.atualizaTema("",idtema);i3GEO.arvoreDeCamadas.atualizaLegenda(idtema)};i3GEO.php.contorno(temp,idtema)},temporizador:function(idtema,tempo){var t;if(!tempo){if($i("temporizador"+idtema)){tempo=$i("temporizador"+idtema).value}else{tempo=0}}if(tempo!=""&&parseInt(tempo,10)>0){t=function(){if(!$i("arrastar_"+idtema)){delete(i3GEO.tema.TEMPORIZADORESID[idtema]);return}i3GEO.Interface.atualizaTema("",idtema)};i3GEO.tema.TEMPORIZADORESID[idtema]={tempo:tempo,idtemporizador:setInterval(t,parseInt(tempo,10)*1000)}}else{try{window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador);delete(i3GEO.tema.TEMPORIZADORESID[idtema])}catch(e){}}},dialogo:{animagif:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.animagif.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.animagif()","animagif","animagif","dependencias.php",temp)},storymap:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.storymap.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.storymap()","storymap","storymap","dependencias.php",temp)},tme:function(tema){if(!tema){tema=""}var temp=function(){i3GEOF.tme.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","dependencias.php",temp)},mostraWms:function(tema){i3GEO.janela.mensagemSimples(i3GEO.configura.locaplic+"/ogc.php?tema="+tema,"WMS url")},comentario:function(tema){i3GEO.janela.cria("530px","330px",i3GEO.configura.locaplic+"/ferramentas/comentarios/index.php?tema="+tema+"&g_sid="+i3GEO.configura.sid+"&locaplic="+i3GEO.configura.locaplic,"","","<img src='"+i3GEO.configura.locaplic+"/imagens/player_volta.png' style=cursor:pointer onclick='javascript:history.go(-1)'><span style=position:relative;top:-2px; > "+$trad("x19")+" "+tema+"</span><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a>","comentario"+Math.random())},cortina:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema)}i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.cortina()","cortina","cortina","dependencias.php","i3GEOF.cortina.iniciaJanelaFlutuante()")},mmscale:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.mmscale()","mmscale","mmscale","dependencias.php","i3GEOF.mmscale.iniciaJanelaFlutuante()")},atalhoscamada:function(tema){i3GEO.mapa.ativaTema(tema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.atalhoscamada()","atalhoscamada","atalhoscamada","dependencias.php","i3GEOF.atalhoscamada.iniciaJanelaFlutuante()")},abreKml:function(tema,tipo){if(arguments.lenght===1){tipo="kml"}if(typeof(i3GEOF.converteKml)==='undefined'){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/ferramentas/convertekml/index.js","i3GEOF.converteKml.criaJanelaFlutuante('"+tema+"','"+tipo+"')","i3GEOF.converteKml_script")}else{i3GEOF.converteKml.criaJanelaFlutuante(tema,tipo)}},salvaMapfile:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.salvaMapfile()","salvamapfile","salvamapfile")},graficotema:function(idtema,propriedades){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.graficoTema.iniciaJanelaFlutuante(propriedades)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.graficotema()","graficotema","graficoTema","dependencias.php",temp)},toponimia:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","dependencias.php","i3GEOF.toponimia.iniciaJanelaFlutuante()")},filtro:function(idtema,modoCalculadora,idRetorno){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.filtro.iniciaJanelaFlutuante(modoCalculadora,idRetorno)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.filtro()","filtro","filtro","dependencias.php",temp)},procuraratrib:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.procuraratrib()","busca","busca","dependencias.php","i3GEOF.busca.iniciaJanelaFlutuante()")},tabela:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","tabela","tabela","dependencias.php","i3GEOF.tabela.iniciaJanelaFlutuante()")},etiquetas:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.etiquetas()","etiqueta","etiqueta","dependencias.php","i3GEOF.etiqueta.iniciaJanelaFlutuante()")},editaLegenda:function(idtema){if(idtema&&idtema!=""){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}}i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php","i3GEOF.legenda.iniciaJanelaFlutuante()")},editaClasseLegenda:function(idtema,idclasse){var t=i3GEO.arvoreDeCamadas.pegaTema(idtema);if(t.status<2){i3GEO.janela.tempoMsg($trad("deveLigada"));return}i3GEO.mapa.ativaTema(idtema);var temp=function(){i3GEOF.legenda.aposIniciar=function(){i3GEOF.legenda.classe=0;i3GEOF.legenda.estilo=0;i3GEOF.legenda.editaSimbolo('i3GEOlegendaid_'+idtema+"-"+idclasse);i3GEOF.legenda.aposIniciar=function(){}};i3GEOF.legenda.iniciaJanelaFlutuante(idtema)};i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","dependencias.php",temp)},download:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.download()","download","download")},ogcwindow:function(idtema){i3GEO.mapa.ativaTema(idtema);window.open(i3GEO.configura.locaplic+"/ogc.htm?temaOgc="+idtema)},sld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.janela.cria("500px","350px",i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=tema2sld&tema="+idtema+"&g_sid="+i3GEO.configura.sid,"","","<div class='i3GeoTituloJanela'>SLD<a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=41' ><b> </b></a></div>")},aplicarsld:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.aplicarsld()","aplicarsld","aplicarsld","dependencias.php","i3GEOF.aplicarsld.iniciaJanelaFlutuante()")},editorsql:function(idtema){i3GEO.mapa.ativaTema(idtema);i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql","dependencias.php","i3GEOF.editorsql.iniciaJanelaFlutuante()")},mudanome:function(idtema){i3GEO.mapa.ativaTema(idtema);var temp=function(){var valor=$i("i3GEOjanelaprompt").value;i3GEO.tema.mudanome(idtema,valor)};i3GEO.janela.prompt($trad("novonome"),temp)}}}; | |
243 | 243 | // |
244 | 244 | //compactados/analise_compacto.js |
245 | 245 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.analise={pontos:{xpt:[],ypt:[]},dialogo:{markercluster:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.markercluster()","markercluster","markercluster","dependencias.php","i3GEOF.markercluster.iniciaJanelaFlutuante()")},heatmap:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.heatmap()","heatmap","heatmap","dependencias.php","i3GEOF.heatmap.iniciaJanelaFlutuante()")},saiku:function(){if(i3GEO.parametros.statusFerramentas&&i3GEO.parametros.statusFerramentas.saiku===false){i3GEO.janela.tempoMsg($trad("naoInstalado"));return}i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.saiku()","saiku","saiku")},saikuMapa:function(){if(i3GEO.parametros.statusFerramentas&&i3GEO.parametros.statusFerramentas.saiku===false){i3GEO.janela.tempoMsg($trad("naoInstalado"));return}i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.saiku()","saiku","saiku","index.js","i3GEOF.saiku.iniciaJanelaFlutuante2()")},graficoInterativo:function(){alert("depreciado. Use graficointerativo1")},graficoInterativo1:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.graficointerativo1()","graficointerativo1","graficointerativo1","dependencias.php","i3GEOF.graficointerativo1.iniciaJanelaFlutuante()")},linhaDoTempo:function(){i3GEO.janela.cria("650px","450px",i3GEO.configura.locaplic+"/ferramentas/linhadotempo/index.php","","","</div><a class='i3GeoTituloJanelaBs' target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=88' >Linha do tempo</a>","i3GEOF.linhaDoTempo",false,"hd","","","",true,i3GEO.configura.locaplic+"/imagens/oxygen/16x16/clock.png");i3GEO.analise.atualizaLinhaDoTempo=function(){var doc="",ifr="";try{ifr=$i("i3GEOF.linhaDoTempoi");if(navn){if(ifr){doc=ifr.contentDocument}}else{if(document.frames("i3GEOF.linhaDoTempoi")){doc=document.frames("i3GEOF.linhaDoTempoi").document}}doc.getElementById("tl")?window.parent["i3GEOF.linhaDoTempoi"].carregaDados():i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.analise.atualizaLinhaDoTempo()"])}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.analise.atualizaLinhaDoTempo()"])}};i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.analise.atualizaLinhaDoTempo()"]);var ifr=$i("i3GEOF.linhaDoTempoi");if(ifr){ifr.style.width="100%"}},perfil:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.perfil()","perfil","perfil")},rota:function(){if(i3GEO.Interface.ATUAL!=="googlemaps"){alert("Operacao disponivel apenas na interface Google Maps");return}counterClick=1;var parametrosRota=function(overlay,latlng){var temp,janela;if(counterClick===1){counterClick++;alert("Clique o ponto de destino da rota");pontoRota1=latlng;return}if(counterClick===2){pontoRota2=latlng;counterClick=0;GEvent.removeListener(rotaEvento);janela=i3GEO.janela.cria("300px","300px","","center","","<div class='i3GeoTituloJanela'>"+$trad("x48")+"</div>");janela[2].style.overflow="auto";janela[2].style.height="300px";directions=new GDirections(i3GeoMap,janela[2]);temp=function(){$i("wdoca_corpo").innerHTML="Não foi possível criar a rota"};GEvent.addListener(directions,"error",temp);directions.load("from: "+pontoRota1.lat()+","+pontoRota1.lng()+" to: "+pontoRota2.lat()+","+pontoRota2.lng())}};rotaEvento=GEvent.addListener(i3GeoMap,"click",parametrosRota);i3GEO.janela.tempoMsg("Clique o ponto de origem da rota")},melhorcaminho:function(){if(i3GEO.parametros.statusFerramentas&&i3GEO.parametros.statusFerramentas.melhorcaminho===false){i3GEO.janela.tempoMsg($trad("naoInstalado"));return}i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.melhorcaminho()","melhorcaminho","melhorcaminho")},gradePontos:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.gradePontos()","gradepontos","gradeDePontos","dependencias.php","i3GEOF.gradeDePontos.iniciaJanelaFlutuante()")},gradePol:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.gradePol()","gradepol","gradeDePoligonos","dependencias.php","i3GEOF.gradeDePoligonos.iniciaJanelaFlutuante()")},gradeHex:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.gradeHex()","gradehex","gradeDeHex","dependencias.php","i3GEOF.gradeDeHex.iniciaJanelaFlutuante()")},analisaGeometrias:function(){i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tabela()","analisageometrias","analisaGeometrias","dependencias.php","i3GEOF.analisaGeometrias.iniciaJanelaFlutuante()")},pontosdistri:function(){i3GEO.parametros.r==="nao"?i3GEO.janela.tempoMsg($trad("x22")):i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.pontosdistri()","pontosdistri","pontosDistri","dependencias.php","i3GEOF.pontosDistri.iniciaJanelaFlutuante()")},pontoempoligono:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.pontoempoligono()","pontoempoligono","pontoEmPoligono","dependencias.php","i3GEOF.pontoEmPoligono.iniciaJanelaFlutuante()")},centromassa:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.centromassa()","centromassa","centromassa","dependencias.php","i3GEOF.centromassa.iniciaJanelaFlutuante()")},nptPol:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.nptpol()","nptpol","nptpol","dependencias.php","i3GEOF.nptpol.iniciaJanelaFlutuante()")},buffer:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.buffer()","buffer","buffer","dependencias.php","i3GEOF.buffer.iniciaJanelaFlutuante()")},distanciaptpt:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.distanciaptpt()","distanciaptpt","distanciaptpt","dependencias.php","i3GEOF.distanciaptpt.iniciaJanelaFlutuante()")},centroide:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.centroide()","centroide","centroide","dependencias.php","i3GEOF.centroide.iniciaJanelaFlutuante()")},dissolve:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.dissolve()","dissolve","dissolve","dependencias.php","i3GEOF.dissolve.iniciaJanelaFlutuante()")},agrupaElementos:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.agrupaElementos()","agrupaelementos","agrupaElementos","dependencias.php","i3GEOF.agrupaElementos.iniciaJanelaFlutuante()")},distancia:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.distancia()","distancia","distancia","dependencias.php","i3GEOF.distancia.iniciaJanelaFlutuante()")},area:function(){i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.area()","area","area","dependencias.php","i3GEOF.area.iniciaJanelaFlutuante()")},juntamedidasvariavel:function(tema){if(!tema){tema=i3GEO.temaAtivo}var temp=function(){i3GEOF.juntamedidasvariavel.iniciaJanelaFlutuante(tema)};i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.juntamedidasvariavel()","juntamedidasvariavel","juntamedidasvariavel","dependencias.php",temp)}}}; | ... | ... |
js/legenda.js
... | ... | @@ -200,6 +200,9 @@ i3GEO.legenda = |
200 | 200 | i3GEO.php.inverteStatusClasse(temp, leg.name, leg.value); |
201 | 201 | }, |
202 | 202 | mudaCorClasse : function(tema,idclasse) { |
203 | + if (typeof (console) !== 'undefined') | |
204 | + console.info("i3GEO.legenda.mudaCorClasse() cria um input hidden com id=tempinputcorclasse e abre o colorpicker"); | |
205 | + | |
203 | 206 | var obj, novoel; |
204 | 207 | if (!$i("tempinputcorclasse")) { |
205 | 208 | novoel = document.createElement("input"); | ... | ... |
js/tema.js
... | ... | @@ -278,11 +278,14 @@ i3GEO.tema = |
278 | 278 | * {string} - nova cor (r,g,b) |
279 | 279 | */ |
280 | 280 | alteracorclasse : function(idtema, idclasse, rgb) { |
281 | + if (typeof (console) !== 'undefined') | |
282 | + console.info("i3GEO.tema.alteracorclasse()"); | |
283 | + | |
281 | 284 | i3GEO.mapa.ativaTema(idtema); |
282 | 285 | i3GEO.php.aplicaCorClasseTema(temp = function() { |
283 | 286 | i3GEO.atualiza(); |
284 | 287 | i3GEO.Interface.atualizaTema("", idtema); |
285 | - i3GEO.arvoreDeCamadas.atualizaLegenda(idtema); | |
288 | + //i3GEO.arvoreDeCamadas.atualizaLegenda(idtema); | |
286 | 289 | }, idtema, idclasse, rgb); |
287 | 290 | }, |
288 | 291 | /** | ... | ... |