Commit 2c25a45ee0b7b81ca4a74a86dbeb966092c8129c
1 parent
40ddaf5a
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
143 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,143 @@ |
1 | +<?php error_reporting(0);if(extension_loaded('zlib')){ob_start('ob_gzhandler');} header("Content-type: text/javascript"); ?> | |
2 | +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ | |
3 | +/* | |
4 | +About: Licença | |
5 | + | |
6 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
7 | + | |
8 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
9 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
10 | + | |
11 | +Este programa é software livre; você pode redistribuí-lo | |
12 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
13 | +GNU conforme publicada pela Free Software Foundation; | |
14 | +tanto a versão 2 da Licença. | |
15 | +Este programa é distribuído na expectativa de que seja útil, | |
16 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
17 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
18 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
19 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
20 | +GNU junto com este programa; se não, escreva para a | |
21 | +Free Software Foundation, Inc., no endereço | |
22 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
23 | +*/ | |
24 | +if(typeof(i3GEOF) === 'undefined'){ | |
25 | + i3GEOF = []; | |
26 | +} | |
27 | +/* | |
28 | +Class: i3GEOF.outputformat | |
29 | + | |
30 | +Abre janela de opções para escolha do formato de imagem utilizada na geração do mapa | |
31 | +*/ | |
32 | +i3GEOF.outputformat = { | |
33 | + /* | |
34 | + Variavel: aguarde | |
35 | + | |
36 | + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. | |
37 | + */ | |
38 | + aguarde: "", | |
39 | + /* | |
40 | + Function: inicia | |
41 | + | |
42 | + Inicia a ferramenta. É chamado por criaJanelaFlutuante | |
43 | + | |
44 | + Parametro: | |
45 | + | |
46 | + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | |
47 | + */ | |
48 | + inicia: function(iddiv){ | |
49 | + try{ | |
50 | + $i(iddiv).innerHTML += i3GEOF.outputformat.html(); | |
51 | + } | |
52 | + catch(erro){alert(erro);} | |
53 | + | |
54 | + }, | |
55 | + /* | |
56 | + Function: html | |
57 | + | |
58 | + Gera o código html para apresentação das opções da ferramenta | |
59 | + | |
60 | + Retorno: | |
61 | + | |
62 | + String com o código html | |
63 | + */ | |
64 | + html:function(){ | |
65 | + var ins = '<p class=paragrafo >Escolha o tipo de imagem para a geração do mapa. Para mais detalhes veja <a href="http://mapserver.org/mapfile/outputformat.html" target=_blank >outputformat</a></p>' + | |
66 | + '<table class=lista4 width="250px">' + | |
67 | + ' <tr>' + | |
68 | + ' <td><input onclick="i3GEOF.outputformat.aplicar(\'AGG_Q\')" style="cursor:pointer" type=radio name=i3GEOoutputformattipo value=nenhum ></td>' + | |
69 | + ' <td>AGG_Q</td>' + | |
70 | + ' <td>Formato PNG com 256 cores gerado com a tecnologia AGG. Utilizado como default na versão 4.3 e posteriores do i3Geo</td>' + | |
71 | + ' </tr>' + | |
72 | + ' <tr>' + | |
73 | + ' <td><input onclick="i3GEOF.outputformat.aplicar(\'png1\')" style="cursor:pointer" type=radio name=i3GEOoutputformattipo value=nenhum ></td>' + | |
74 | + ' <td>png1</td>' + | |
75 | + ' <td>Formato PNG com 256 cores gerado com o driver GD</td>' + | |
76 | + ' </tr>' + | |
77 | + ' <tr>' + | |
78 | + ' <td><input onclick="i3GEOF.outputformat.aplicar(\'jpeg\')" style="cursor:pointer" type=radio name=i3GEOoutputformattipo value=nenhum ></td>' + | |
79 | + ' <td>jpeg</td>' + | |
80 | + ' <td>Formato JPEG com 256 cores gerado com o driver GD</td>' + | |
81 | + ' </tr>' + | |
82 | + | |
83 | + '</table>'; | |
84 | + return ins; | |
85 | + }, | |
86 | + /* | |
87 | + Function: criaJanelaFlutuante | |
88 | + | |
89 | + Cria a janela flutuante para controle da ferramenta. | |
90 | + */ | |
91 | + criaJanelaFlutuante: function(){ | |
92 | + var janela,divid,temp,titulo,cabecalho,minimiza; | |
93 | + cabecalho = function(){}; | |
94 | + minimiza = function(){ | |
95 | + i3GEO.janela.minimiza("i3GEOF.outputformat"); | |
96 | + }; | |
97 | + //cria a janela flutuante | |
98 | + titulo = "Formato da imagem <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=1&idajuda=89' > </a>"; | |
99 | + janela = i3GEO.janela.cria( | |
100 | + "300px", | |
101 | + "260px", | |
102 | + "", | |
103 | + "", | |
104 | + "", | |
105 | + titulo, | |
106 | + "i3GEOF.outputformat", | |
107 | + false, | |
108 | + "hd", | |
109 | + cabecalho, | |
110 | + minimiza | |
111 | + ); | |
112 | + divid = janela[2].id; | |
113 | + $i("i3GEOF.outputformat_corpo").style.backgroundColor = "white"; | |
114 | + $i("i3GEOF.outputformat_corpo").style.textAlign = "left"; | |
115 | + i3GEOF.outputformat.aguarde = $i("i3GEOF.outputformat_imagemCabecalho").style; | |
116 | + i3GEOF.outputformat.inicia(divid); | |
117 | + }, | |
118 | + /* | |
119 | + Function: aplicar | |
120 | + | |
121 | + Aplica o filtro de imagem escolhido | |
122 | + */ | |
123 | + aplicar: function(tipo){ | |
124 | + if(i3GEOF.outputformat.aguarde.visibility === "visible") | |
125 | + {return;} | |
126 | + i3GEOF.outputformat.aguarde.visibility = "visible"; | |
127 | + try{ | |
128 | + var cp = new cpaint(), | |
129 | + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=mudaOutputFormat&tipo="+tipo, | |
130 | + temp = function(retorno){ | |
131 | + i3GEOF.outputformat.aguarde.visibility = "hidden"; | |
132 | + if(retorno.data != "erro") | |
133 | + {i3GEO.atualiza();} | |
134 | + else | |
135 | + {alert("Nao foi possivel alterar o tipo");} | |
136 | + }; | |
137 | + cp.set_response_type("JSON"); | |
138 | + cp.call(p,"void",temp); | |
139 | + } | |
140 | + catch(e){alert("Nao foi possivel alterar o tipo");i3GEOF.outputformat.aguarde.visibility = "hidden";} | |
141 | + } | |
142 | +}; | |
143 | +<?php error_reporting(0);if(extension_loaded('zlib')){ob_end_flush();}?> | |
0 | 144 | \ No newline at end of file | ... | ... |