Commit a4002de45b2c1b5e37617c5b22275a6de9d44dc4
1 parent
7c9f4e2f
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
0 additions
and
2031 deletions
Show diff stats
ferramentas/metaestat/index.js.edited
@@ -1,2031 +0,0 @@ | @@ -1,2031 +0,0 @@ | ||
1 | -/* | ||
2 | - Title: Cartogramas estatísticos | ||
3 | - | ||
4 | - Arquivo: | ||
5 | - | ||
6 | - i3geo/ferramentas/metaestat/index.js | ||
7 | - | ||
8 | - Licenca: | ||
9 | - | ||
10 | - GPL2 | ||
11 | - | ||
12 | - i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
13 | - | ||
14 | - Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
15 | - Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
16 | - | ||
17 | - Este programa é software livre; você pode redistribuí-lo | ||
18 | - e/ou modificá-lo sob os termos da Licença Pública Geral | ||
19 | - GNU conforme publicada pela Free Software Foundation; | ||
20 | - | ||
21 | - Este programa é distribuído na expectativa de que seja útil, | ||
22 | - porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
23 | - de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
24 | - Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
25 | - Você deve ter recebido uma cópia da Licença Pública Geral do | ||
26 | - GNU junto com este programa; se não, escreva para a | ||
27 | - Free Software Foundation, Inc., no endereço | ||
28 | - 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
29 | - */ | ||
30 | -if(typeof(i3GEOF) === 'undefined'){ | ||
31 | - var i3GEOF = {}; | ||
32 | -} | ||
33 | -/* | ||
34 | - Classe: i3GEOF.metaestat | ||
35 | - | ||
36 | - Gerencia os componentes do módulo de geração de cartogramas estatísticos | ||
37 | - */ | ||
38 | -i3GEOF.metaestat = { | ||
39 | - /** | ||
40 | - * Tipo de interface utilizada para construcao dos parametros | ||
41 | - */ | ||
42 | - INTERFACE: "flutuante", | ||
43 | - //codigo da variavel definido na inicializacao (opcional) | ||
44 | - CODIGO_VARIAVEL: "", | ||
45 | - //id da medida da variavel definido na inicializacao (opcional) | ||
46 | - ID_MEDIDA_VARIAVEL: "", | ||
47 | - CONEXAODEFAULT: 0, | ||
48 | - TOP: 50, | ||
49 | - LEFT: 100, | ||
50 | - LARGURA: 270, | ||
51 | - ALTURA: 250, | ||
52 | - //lista das camadas que foram adicionadas ao mapa | ||
53 | - CAMADAS: [], | ||
54 | - //dados das medidas obtidos para a ultima variavel escolhida | ||
55 | - DADOSMEDIDASVARIAVEL: [], | ||
56 | - //para efeitos de compatibilidade com i3GEO.mapa.dialogo | ||
57 | - criaJanelaFlutuante: function(){ | ||
58 | - i3GEOF.metaestat.inicia(); | ||
59 | - }, | ||
60 | - inicia: function(Interface,codigo_variavel,id_medida_variavel){ | ||
61 | - if(Interface && Interface != ""){ | ||
62 | - i3GEOF.metaestat.INTERFACE = Interface; | ||
63 | - } | ||
64 | - if(codigo_variavel && codigo_variavel != ""){ | ||
65 | - i3GEOF.metaestat.CODIGO_VARIAVEL = codigo_variavel; | ||
66 | - } | ||
67 | - if(id_medida_variavel && id_medida_variavel != ""){ | ||
68 | - i3GEOF.metaestat.ID_MEDIDA_VARIAVEL = id_medida_variavel; | ||
69 | - } | ||
70 | - i3GEOF.metaestat.comum.iniciaDicionario(); | ||
71 | - }, | ||
72 | - analise: { | ||
73 | - botoes: [{ | ||
74 | - titulo:"Focar o mapa em um determinado limite geográfico", | ||
75 | - onclick:"i3GEO.mapa.dialogo.locregiao()", | ||
76 | - icone: "imagens/gisicons/open-street-maps.png" | ||
77 | - },{ | ||
78 | - titulo: "Mostrar no mapa os limites geográficos cadastrados", | ||
79 | - onclick: "i3GEOF.metaestat.analise.mostraRegiao()", | ||
80 | - icone: "imagens/gisicons/open-street-maps-show.png" | ||
81 | - },{ | ||
82 | - titulo: "Mostrar apenas os dados de determinado limite geográfico", | ||
83 | - onclick: "i3GEO.mapa.dialogo.filtraregiao()", | ||
84 | - icone: "imagens/gisicons/open-street-maps-filtro.png" | ||
85 | - },{ | ||
86 | - titulo: "Mostrar apenas os dados de um período de tempo", | ||
87 | - onclick: "i3GEOF.metaestat.analise.filtraPeriodo.inicia()", | ||
88 | - icone: "imagens/gisicons/open-street-maps-filtrotime.png" | ||
89 | - },{ | ||
90 | - titulo: "Tabela de atributos", | ||
91 | - onclick: "i3GEO.tema.dialogo.tabela()", | ||
92 | - icone: "imagens/gisicons/table.png" | ||
93 | - },{ | ||
94 | - titulo: "Gráfico interativo", | ||
95 | - onclick: "i3GEO.analise.dialogo.graficoInterativo()", | ||
96 | - icone: "imagens/oxygen/22x22/view_statistics.png" | ||
97 | - },{ | ||
98 | - titulo: "Opacidade", | ||
99 | - onclick: "i3GEO.mapa.dialogo.opacidade()", | ||
100 | - icone: "imagens/gisicons/layer-opacity.png" | ||
101 | - },{ | ||
102 | - titulo: "Animação", | ||
103 | - onclick: "i3GEOF.metaestat.analise.ativaAnimacao()", | ||
104 | - icone: "imagens/gisicons/player-forward.png" | ||
105 | - },{ | ||
106 | - titulo: "Alterar classificação", | ||
107 | - onclick: "i3GEOF.metaestat.analise.alteraClasses()", | ||
108 | - icone: "imagens/gisicons/calculator.png" | ||
109 | - },{ | ||
110 | - titulo: "Alterar cores", | ||
111 | - onclick: "i3GEOF.metaestat.analise.alteraCores()", | ||
112 | - icone: "imagens/gisicons/24-to-8-bits.png" | ||
113 | - },{ | ||
114 | - titulo: $trad("t42"), | ||
115 | - onclick: "i3GEO.tema.dialogo.cortina()", | ||
116 | - icone: "imagens/gisicons/mapset.png" | ||
117 | - },{ | ||
118 | - titulo: $trad("t49"), | ||
119 | - onclick: "i3GEOF.metaestat.analise.ativaTme()", | ||
120 | - icone: "imagens/gisicons/3d-light.png" | ||
121 | - },{ | ||
122 | - titulo: "Estatísticas gerais", | ||
123 | - onclick: "i3GEOF.metaestat.analise.estatistica()", | ||
124 | - icone: "imagens/gisicons/stats.png" | ||
125 | - },{ | ||
126 | - titulo: "Ativa/Desativa contorno dos limites geográficos", | ||
127 | - onclick: "i3GEOF.metaestat.analise.contorno()", | ||
128 | - icone: "imagens/gisicons/boundary-remove-add.png" | ||
129 | - },{ | ||
130 | - titulo: "Altera a forma de representação gráfica", | ||
131 | - onclick: "i3GEOF.metaestat.analise.alteraRep()", | ||
132 | - icone: "imagens/gisicons/shape.png" | ||
133 | - },{ | ||
134 | - titulo: "Mapa de calor", | ||
135 | - onclick: "i3GEOF.metaestat.analise.calor()", | ||
136 | - icone: "imagens/gisicons/dem.png" | ||
137 | - },{ | ||
138 | - titulo: "Congela visão", | ||
139 | - onclick: "i3GEO.mapa.dialogo.congelaMapa()", | ||
140 | - icone: "imagens/gisicons/mapset-add.png" | ||
141 | - },{ | ||
142 | - titulo: "Mostra os valores como textos no mapa", | ||
143 | - onclick: "i3GEOF.metaestat.analise.toponimia()", | ||
144 | - icone: "imagens/gisicons/label.png" | ||
145 | - } | ||
146 | - ], | ||
147 | - inicia: function(iddiv){ | ||
148 | - var ics,n,i; | ||
149 | - if(!iddiv || !$i(iddiv)){ | ||
150 | - iddiv = "i3geoCartoAnalise_corpo"; | ||
151 | - } | ||
152 | - if(i3GEOF.metaestat.INTERFACE == "flutuante"){ | ||
153 | - i3GEOF.metaestat.analise.abreJanela(); | ||
154 | - } | ||
155 | - $i(iddiv).innerHTML = i3GEOF.metaestat.analise.html(); | ||
156 | - ics = $i(iddiv).getElementsByTagName("button"); | ||
157 | - n = ics.length; | ||
158 | - for(i=0;i<n;i++){ | ||
159 | - ics[i].style.backgroundColor = "white"; | ||
160 | - ics[i].className = "iconeGuiaMovel"; | ||
161 | - ics[i].onmouseout = function(){this.className = "iconeGuiaMovel iconeGuiaMovelMouseOut";}; | ||
162 | - ics[i].onmouseover = function(){this.className = "iconeGuiaMovel iconeGuiaMovelMouseOver";}; | ||
163 | - ics[i].style.backgroundImage = "none"; | ||
164 | - ics[i].style.height = "32px"; | ||
165 | - ics[i].style.width = "32px"; | ||
166 | - ics[i].style.border = "1px solid gray"; | ||
167 | - ics[i].style.margin = "0px"; | ||
168 | - ics[i].style.position = "relative"; | ||
169 | - } | ||
170 | - i3GEOF.metaestat.analise.comboCamadas(); | ||
171 | - }, | ||
172 | - abreJanela: function(){ | ||
173 | - var cabecalho,minimiza,imagemxy,janela; | ||
174 | - if (!$i("i3geoCartoAnalise")){ | ||
175 | - cabecalho = function(){ | ||
176 | - }; | ||
177 | - minimiza = function(){ | ||
178 | - i3GEO.janela.minimiza("i3geoCartoAnalise"); | ||
179 | - }; | ||
180 | - janela = i3GEO.janela.cria( | ||
181 | - "270px", | ||
182 | - "170px", | ||
183 | - "", | ||
184 | - "", | ||
185 | - "", | ||
186 | - $trad(11,i3GEOF.metaestat.dicionario), | ||
187 | - "i3geoCartoAnalise", | ||
188 | - false, | ||
189 | - "hd", | ||
190 | - cabecalho, | ||
191 | - minimiza | ||
192 | - ); | ||
193 | - janela = janela[0]; | ||
194 | - YAHOO.i3GEO.janela.manager.register(janela); | ||
195 | - janela.render(); | ||
196 | - } | ||
197 | - else{ | ||
198 | - janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoAnalise"); | ||
199 | - } | ||
200 | - janela.show(); | ||
201 | - imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); | ||
202 | - janela.moveTo(imagemxy[0]+(i3GEOF.metaestat.LEFT*2)+i3GEOF.metaestat.LARGURA+10,i3GEOF.metaestat.TOP); | ||
203 | - }, | ||
204 | - html: function(){ | ||
205 | - var ins = '<div id="i3geoCartoAnaliseContainer" style="margin-left:5px;line-height:25px">', | ||
206 | - b = i3GEOF.metaestat.analise.botoes, | ||
207 | - n = b.length, | ||
208 | - i; | ||
209 | - ins += '<div id="i3geoCartoAnaliseCamadas" style="top:-5px;height:50px;display:none"></div>'; | ||
210 | - for(i=0;i<n;i++){ | ||
211 | - ins += '<button title="'+b[i].titulo+'" onclick="'+b[i].onclick+'"><img src="'+i3GEO.configura.locaplic+"/"+b[i].icone+'" /></button>'; | ||
212 | - } | ||
213 | - ins += '</div><input type=hidden value="" id="listaColourRampAnaliseMetaestat" onchange="i3GEOF.metaestat.analise.aplicaColourRamp()" />'; //utilizado pelo seletor de colourramp | ||
214 | - return ins; | ||
215 | - }, | ||
216 | - comboCamadas: function(){ | ||
217 | - if(!$i("i3geoCartoAnaliseCamadas")){ | ||
218 | - return; | ||
219 | - } | ||
220 | - var temp = function(retorno){ | ||
221 | - var temas = retorno.data, | ||
222 | - n = temas.length, | ||
223 | - i,t,ins; | ||
224 | - ins = "<p class=paragrafo style='position:relative;top:5px;'>Ativar a camada:</p><select id='i3geoCartoAnaliseCamadasCombo' onchange='i3GEOF.metaestat.comum.ativaCamada(this.value)' style='width:250px;' ><option value=''>---</option>"; | ||
225 | - for(i=0;i<n;i++){ | ||
226 | - t = i3GEO.arvoreDeCamadas.pegaTema(temas[i]); | ||
227 | - if(t != ""){ | ||
228 | - ins += "<option value='"+temas[i]+"'>"+t.tema+"</option>"; | ||
229 | - } | ||
230 | - } | ||
231 | - $i("i3geoCartoAnaliseCamadas").innerHTML = ins+"</select>"; | ||
232 | - if(i3GEO.temaAtivo != ""){ | ||
233 | - $i("i3geoCartoAnaliseCamadasCombo").value = i3GEO.temaAtivo; | ||
234 | - } | ||
235 | - $i("i3geoCartoAnaliseCamadas").style.display = "block"; | ||
236 | - //if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search('i3GEOF.metaestat.analise.comboCamadas()') < 0) | ||
237 | - //{i3GEO.eventos.ATUALIZAARVORECAMADAS.push('i3GEOF.metaestat.analise.comboCamadas()');} | ||
238 | - }; | ||
239 | - i3GEO.php.listaCamadasMetaestat(temp); | ||
240 | - }, | ||
241 | - toponimia: function(){ | ||
242 | - if($i("i3geoCartoAnaliseCamadasCombo").value == ""){ | ||
243 | - i3GEO.janela.tempoMsg("Ative uma camada primeiro"); | ||
244 | - return; | ||
245 | - } | ||
246 | - i3GEO.mapa.ativaTema($i("i3geoCartoAnaliseCamadasCombo").value); | ||
247 | - i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.toponimia()","toponimia","toponimia","index.js","i3GEOF.metaestat.analise.abreToponimia()"); | ||
248 | - }, | ||
249 | - abreToponimia: function(){ | ||
250 | - var p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?g_sid="+i3GEO.configura.sid + | ||
251 | - "&funcao=pegaDadosTME&tema="+i3GEO.temaAtivo, | ||
252 | - temp = function(retorno){ | ||
253 | - i3GEO.janela.fechaAguarde("aguardeBuscaDados"); | ||
254 | - i3GEOF.toponimia.ATIVAITEM = retorno.data.itemDados; | ||
255 | - i3GEOF.toponimia.iniciaJanelaFlutuante(); | ||
256 | - }; | ||
257 | - i3GEO.janela.abreAguarde("aguardeBuscaDados","Aguarde..."); | ||
258 | - i3GEO.util.ajaxGet(p,temp); | ||
259 | - }, | ||
260 | - alteraRep: function(){ | ||
261 | - if(typeof(i3GEOF.alterarep) === 'undefined'){ | ||
262 | - i3GEO.util.scriptTag( | ||
263 | - i3GEO.configura.locaplic+"/ferramentas/metaestat/alterarep.js", | ||
264 | - "i3GEOF.alterarep.iniciaJanelaFlutuante()", | ||
265 | - "i3GEOF.alterarep_script" | ||
266 | - ); | ||
267 | - } | ||
268 | - else{ | ||
269 | - i3GEOF.alterarep.iniciaJanelaFlutuante(); | ||
270 | - } | ||
271 | - }, | ||
272 | - calor: function(){ | ||
273 | - if($i("i3geoCartoAnaliseCamadasCombo").value == ""){ | ||
274 | - i3GEO.janela.tempoMsg("Ative uma camada primeiro"); | ||
275 | - return; | ||
276 | - } | ||
277 | - if(!window.confirm("Gera o mapa de calor? Isso pode demorar...")){ | ||
278 | - return; | ||
279 | - } | ||
280 | - i3GEO.janela.tempoMsg("Será considerada apenas a região mostrada no mapa"); | ||
281 | - i3GEO.mapa.ativaTema($i("i3geoCartoAnaliseCamadasCombo").value); | ||
282 | - var p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?g_sid="+i3GEO.configura.sid + | ||
283 | - "&funcao=calor&tema="+$i("i3geoCartoAnaliseCamadasCombo").value+"&ext="+i3GEO.parametros.mapexten, | ||
284 | - temp = function(retorno){ | ||
285 | - i3GEO.janela.fechaAguarde("aguardecalor"); | ||
286 | - i3GEO.atualiza(); | ||
287 | - }; | ||
288 | - i3GEO.janela.abreAguarde("aguardecalor","Aguarde..."); | ||
289 | - i3GEO.util.ajaxGet(p,temp); | ||
290 | - }, | ||
291 | - mostraRegiao: function(){ | ||
292 | - if(typeof(i3GEOF.mostraregiao) === 'undefined'){ | ||
293 | - i3GEO.util.scriptTag( | ||
294 | - i3GEO.configura.locaplic+"/ferramentas/metaestat/mostraregiao.js", | ||
295 | - "i3GEOF.mostraregiao.iniciaJanelaFlutuante()", | ||
296 | - "i3GEOF.mostraregiao_script" | ||
297 | - ); | ||
298 | - } | ||
299 | - else{ | ||
300 | - i3GEOF.mostraregiao.iniciaJanelaFlutuante(); | ||
301 | - } | ||
302 | - }, | ||
303 | - contorno: function(){ | ||
304 | - if($i("i3geoCartoAnaliseCamadasCombo").value == ""){ | ||
305 | - i3GEO.janela.tempoMsg("Ative uma camada primeiro"); | ||
306 | - return; | ||
307 | - } | ||
308 | - i3GEO.mapa.ativaTema($i("i3geoCartoAnaliseCamadasCombo").value); | ||
309 | - var p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?g_sid="+i3GEO.configura.sid + | ||
310 | - "&funcao=alteraContorno&tema="+$i("i3geoCartoAnaliseCamadasCombo").value, | ||
311 | - temp = function(retorno){ | ||
312 | - i3GEO.janela.fechaAguarde("aguardecontorno"); | ||
313 | - i3GEO.atualiza(); | ||
314 | - i3GEO.Interface.atualizaTema("",i3GEO.temaAtivo); | ||
315 | - i3GEO.arvoreDeCamadas.atualizaLegenda(i3GEO.temaAtivo); | ||
316 | - }; | ||
317 | - i3GEO.janela.abreAguarde("aguardecontorno","Aguarde..."); | ||
318 | - i3GEO.util.ajaxGet(p,temp); | ||
319 | - }, | ||
320 | - ativaTme: function(){ | ||
321 | - if($i("i3geoCartoAnaliseCamadasCombo").value == ""){ | ||
322 | - i3GEO.janela.tempoMsg("Ative uma camada primeiro"); | ||
323 | - return; | ||
324 | - } | ||
325 | - i3GEO.mapa.ativaTema($i("i3geoCartoAnaliseCamadasCombo").value); | ||
326 | - i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","index.js","i3GEOF.metaestat.analise.abreTme()"); | ||
327 | - }, | ||
328 | - abreTme: function(){ | ||
329 | - //i3GEOF.tme.ITEMNOMEREGIOES | ||
330 | - var p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?g_sid="+i3GEO.configura.sid + | ||
331 | - "&funcao=pegaDadosTME&tema="+i3GEO.temaAtivo, | ||
332 | - temp = function(retorno){ | ||
333 | - i3GEO.janela.fechaAguarde("aguardeBuscaDados"); | ||
334 | - i3GEOF.tme.ITEMNOMEREGIOES = retorno.data.itemNomeRegioes; | ||
335 | - i3GEOF.tme.ITEMDADOS = retorno.data.itemDados; | ||
336 | - i3GEOF.tme.iniciaJanelaFlutuante(); | ||
337 | - }; | ||
338 | - i3GEO.janela.abreAguarde("aguardeBuscaDados","Aguarde..."); | ||
339 | - i3GEO.util.ajaxGet(p,temp); | ||
340 | - }, | ||
341 | - estatistica: function(){ | ||
342 | - if($i("i3geoCartoAnaliseCamadasCombo").value == ""){ | ||
343 | - i3GEO.janela.tempoMsg("Ative uma camada primeiro"); | ||
344 | - return; | ||
345 | - } | ||
346 | - i3GEO.mapa.ativaTema($i("i3geoCartoAnaliseCamadasCombo").value); | ||
347 | - //primeiro pega o nome da coluna que contem os dados | ||
348 | - //depois busca as estatisticas | ||
349 | - var p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?g_sid="+i3GEO.configura.sid + | ||
350 | - "&funcao=pegaDadosTME&tema="+i3GEO.temaAtivo, | ||
351 | - temp = function(retorno){ | ||
352 | - if(retorno && retorno.data && retorno.data.itemDados != ""){ | ||
353 | - var item = retorno.data.itemDados, | ||
354 | - p = i3GEO.configura.locaplic+"/ferramentas/tabela/exec.php?g_sid=" + | ||
355 | - i3GEO.configura.sid+"&funcao=estatistica&item="+item+ | ||
356 | - "&tema="+i3GEO.temaAtivo+"&exclui=&ext="+i3GEO.parametros.extentTotal, | ||
357 | - monta = function(retorno){ | ||
358 | - i3GEO.janela.fechaAguarde("aguardeBuscaDados"); | ||
359 | - var ins = "", | ||
360 | - nometema, | ||
361 | - nome, | ||
362 | - valor, | ||
363 | - i, | ||
364 | - n; | ||
365 | - nometema = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo); | ||
366 | - if(nometema && nometema.tema){ | ||
367 | - ins = "<p style='text-align:left'> <span style='color:gray'><b>Camada: </b></span>"+nometema.tema+"</p>" + | ||
368 | - "<p style='text-align:left'> <span style='color:gray'><b>Coluna: </b></span>"+item+"</p>"; | ||
369 | - } | ||
370 | - if(retorno.data.indices !== undefined){ | ||
371 | - if (retorno.data.indices){ | ||
372 | - n = retorno.data.indices.length; | ||
373 | - for (i=0;i<n;i++){ | ||
374 | - nome = eval("retorno.data.variaveis."+retorno.data.indices[i]); | ||
375 | - valor = eval("retorno.data.valores."+retorno.data.indices[i]); | ||
376 | - ins += "<p style='text-align:left'> <span style='color:gray'>"+nome+": </span>"+valor+"</p>"; | ||
377 | - } | ||
378 | - } | ||
379 | - } | ||
380 | - else{ | ||
381 | - ins = retorno.data; | ||
382 | - } | ||
383 | - i3GEO.janela.mensagemSimples(ins,"Estatísticas"); | ||
384 | - }; | ||
385 | - i3GEO.util.ajaxGet(p,monta); | ||
386 | - } | ||
387 | - else{ | ||
388 | - i3GEO.janela.fechaAguarde("aguardeBuscaDados"); | ||
389 | - i3GEO.janela.tempoMsg("Ocorreu algum erro"); | ||
390 | - } | ||
391 | - }; | ||
392 | - i3GEO.janela.abreAguarde("aguardeBuscaDados","Aguarde..."); | ||
393 | - i3GEO.util.ajaxGet(p,temp); | ||
394 | - }, | ||
395 | - ativaAnimacao: function(){ | ||
396 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.animacao()","animacao","animacao","index.js","i3GEOF.metaestat.analise.listaCamadasAnimacao()"); | ||
397 | - }, | ||
398 | - listaCamadasAnimacao: function(){ | ||
399 | - var temp = function(retorno){ | ||
400 | - var temas = retorno.data, | ||
401 | - n = temas.length, | ||
402 | - camadas = [], | ||
403 | - i,t; | ||
404 | - i3GEOF.animacao.iniciaJanelaFlutuante(); | ||
405 | - for(i=0;i<n;i++){ | ||
406 | - t = i3GEO.arvoreDeCamadas.pegaTema(temas[i]); | ||
407 | - if(t != ""){ | ||
408 | - camadas.push(t); | ||
409 | - } | ||
410 | - } | ||
411 | - i3GEOF.animacao.listaDeCamadas(camadas); | ||
412 | - }; | ||
413 | - i3GEO.php.listaCamadasMetaestat(temp); | ||
414 | - }, | ||
415 | - ativaEditorLegenda: function(){ | ||
416 | - if($i("i3geoCartoAnaliseCamadasCombo").value == ""){ | ||
417 | - i3GEO.janela.tempoMsg("Ative uma camada primeiro"); | ||
418 | - return; | ||
419 | - } | ||
420 | - i3GEO.mapa.ativaTema($i("i3geoCartoAnaliseCamadasCombo").value); | ||
421 | - i3GEOF.legenda.iniciaJanelaFlutuante(); | ||
422 | - i3GEO.guias.mostraGuiaFerramenta('i3GEOlegendaguia2','i3GEOlegendaguia'); | ||
423 | - //desmarca a opcao que considera apenas os elementos visiveis | ||
424 | - if($i("i3GEOFlegendaaplicaextent")){ | ||
425 | - $i("i3GEOFlegendaaplicaextent").checked = false; | ||
426 | - } | ||
427 | - if($i("i3GEOFlegendaClassesOpcionais")){ | ||
428 | - $i("i3GEOFlegendaClassesOpcionais").style.display = "none"; | ||
429 | - } | ||
430 | - var temp = $i("i3GEOF.legenda_corpo"); | ||
431 | - temp.getElementsByTagName("div")[0].style.display = "none"; | ||
432 | - }, | ||
433 | - alteraClasses: function(){ | ||
434 | - i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editaLegenda()","legenda","legenda","index.js","i3GEOF.metaestat.analise.ativaEditorLegenda()"); | ||
435 | - }, | ||
436 | - alteraCores: function(){ | ||
437 | - //listaColourRampAnaliseMetaestat e o id do elemento input que recebera a lista de cores | ||
438 | - i3GEO.util.abreColourRamp("","listaColourRampAnaliseMetaestat",10); | ||
439 | - }, | ||
440 | - //disparado no evento onchange do input que guarda o numero de cores | ||
441 | - aplicaColourRamp: function(){ | ||
442 | - var i = $i("listaColourRampAnaliseMetaestat"); | ||
443 | - if(i.value != ""){ | ||
444 | - var p,temp,cores = i.value; | ||
445 | - temp = function(){ | ||
446 | - i3GEO.janela.fechaAguarde("aguardeAplicaCores"); | ||
447 | - i3GEO.atualiza(); | ||
448 | - i3GEO.Interface.atualizaTema("",i3GEO.temaAtivo); | ||
449 | - i3GEO.arvoreDeCamadas.atualizaLegenda(i3GEO.temaAtivo); | ||
450 | - }; | ||
451 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid + | ||
452 | - "&funcao=alteraclasse&opcao=aplicacoresrgb&ext=" + | ||
453 | - i3GEO.parametros.mapexten + | ||
454 | - "&tema="+i3GEO.temaAtivo + | ||
455 | - "&cores=" + cores; | ||
456 | - i3GEO.janela.AGUARDEMODAL = true; | ||
457 | - i3GEO.janela.abreAguarde("aguardeAplicaCores","Aplicando..."); | ||
458 | - i3GEO.janela.AGUARDEMODAL = false; | ||
459 | - i3GEO.util.ajaxGet(p,temp); | ||
460 | - } | ||
461 | - }, | ||
462 | - filtraPeriodo: { | ||
463 | - //CAMADAS: "", | ||
464 | - inicia: function(){ | ||
465 | - i3GEO.janela.tempoMsg("Ao agregar dados por período a forma de cálculo (soma ou média) é mantida conforme o orginal da camada já existente"); | ||
466 | - if($i("i3GEOF.filtraperiodo_corpo")){ | ||
467 | - return; | ||
468 | - } | ||
469 | - var minimiza,cabecalho,titulo,ins; | ||
470 | - cabecalho = function(){ | ||
471 | - }; | ||
472 | - minimiza = function(){ | ||
473 | - i3GEO.janela.minimiza("i3GEOF.filtraperiodo"); | ||
474 | - }; | ||
475 | - //cria a janela flutuante | ||
476 | - titulo = "Filtro temporal </a>"; | ||
477 | - i3GEO.janela.cria( | ||
478 | - "260px", | ||
479 | - "340px", | ||
480 | - "", | ||
481 | - "", | ||
482 | - "", | ||
483 | - titulo, | ||
484 | - "i3GEOF.filtraperiodo", | ||
485 | - false, | ||
486 | - "hd", | ||
487 | - cabecalho, | ||
488 | - minimiza | ||
489 | - ); | ||
490 | - $i("i3GEOF.filtraperiodo_corpo").style.backgroundColor = "white"; | ||
491 | - ins = "" + | ||
492 | - '<p class=paragrafo ><b>Camada que receberá o filtro:</b></p>' + | ||
493 | - '<div id="i3GEOF.filtraperiodo.camadas" ></div>' + | ||
494 | - '<p class=paragrafo ><b>Início do período:</b></p>' + | ||
495 | - '<div id="i3GEOF.filtraperiodo.Pi_0" ></div>' + | ||
496 | - '<p class=paragrafo ><b>Fim do período:</b></p>' + | ||
497 | - '<div id="i3GEOF.filtraperiodo.Pf_0" ></div>' + | ||
498 | - '<br><br><input id=i3geofiltraperiodoAplica type="button" value="Aplicar" />' + | ||
499 | - '<input id=i3geofiltraperiodoRemove type="button" value="Remover" />'; | ||
500 | - $i("i3GEOF.filtraperiodo_corpo").innerHTML = ins; | ||
501 | - new YAHOO.widget.Button( | ||
502 | - "i3geofiltraperiodoAplica", | ||
503 | - {onclick:{fn: i3GEOF.metaestat.analise.filtraPeriodo.adicionaFiltro}} | ||
504 | - ); | ||
505 | - new YAHOO.widget.Button( | ||
506 | - "i3geofiltraperiodoRemove", | ||
507 | - {onclick:{fn: function(){}}} | ||
508 | - ); | ||
509 | - i3GEOF.metaestat.analise.filtraPeriodo.comboCamadas(); | ||
510 | - }, | ||
511 | - comboCamadas: function(retorno){ | ||
512 | - var temp = function(retorno){ | ||
513 | - //i3GEOF.metaestat.analise.filtraPeriodo.CAMADAS = retorno.data; | ||
514 | - var i, | ||
515 | - n = retorno.data.length, | ||
516 | - ins = '<select id="i3GEOF.filtraperiodo.comboCamada" onchange="javascript:i3GEOF.metaestat.analise.filtraPeriodo.comboParametrosReinicia();i3GEOF.metaestat.analise.filtraPeriodo.comboParametros()" style="width:220px;" id="i3GEOF.filtraperiodo.temas" ><option value="">---</option>'; | ||
517 | - for(i=0;i<n;i++){ | ||
518 | - ins += '<option value="'+retorno.data[i].layer+'" >'+retorno.data[i].nome+'</option>'; | ||
519 | - } | ||
520 | - ins += "</select><br><br>"; | ||
521 | - $i("i3GEOF.filtraperiodo.camadas").innerHTML = ins; | ||
522 | - }; | ||
523 | - i3GEO.util.ajaxGet( | ||
524 | - i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?funcao=listaCamadasFiltroTempo&g_sid="+i3GEO.configura.sid, | ||
525 | - temp | ||
526 | - ); | ||
527 | - }, | ||
528 | - comboParametrosReinicia: function(operacao){ | ||
529 | - $i("i3GEOF.filtraperiodo.Pi_0").innerHTML = ""; | ||
530 | - $i("i3GEOF.filtraperiodo.Pf_0").innerHTML = ""; | ||
531 | - }, | ||
532 | - comboParametros: function(){ | ||
533 | - if($i("i3GEOF.filtraperiodo.comboCamada").value == ""){ | ||
534 | - return; | ||
535 | - } | ||
536 | - if($i("i3GEOF.filtraperiodo.Pi_0").innerHTML == ""){ | ||
537 | - i3GEOF.metaestat.analise.filtraPeriodo.parametro(0); | ||
538 | - return; | ||
539 | - } | ||
540 | - }, | ||
541 | - parametro: function(nivel){ | ||
542 | - var layer = $i("i3GEOF.filtraperiodo.comboCamada").value, | ||
543 | - temp = function(retorno){ | ||
544 | - var n = retorno.data.length, | ||
545 | - i, | ||
546 | - ins = ""; | ||
547 | - if(retorno.data[0] && retorno.data[0].id_pai){ | ||
548 | - for(i=0;i<n;i++){ | ||
549 | - ins += "<option value='"+retorno.data[i].id_parametro_medida+"'>"+retorno.data[i].nome+"</option>"; | ||
550 | - } | ||
551 | - $i("i3GEOF.filtraperiodo.Pi_"+nivel).innerHTML = "<p class=paragrafo>Nome do parâmetro:<br>" + | ||
552 | - "<select name='' onchange='i3GEOF.metaestat.analise.filtraPeriodo.valoresParametro(this.value,"+nivel+",\"Pi_"+nivel+"\")' style='wisth:150px;'>" + | ||
553 | - "<option value='' >---</option>"+ins+"</select></p><div class=paragrafo id='Pi_"+nivel+"'></div>"; | ||
554 | - $i("i3GEOF.filtraperiodo.Pf_"+nivel).innerHTML = "<p class=paragrafo>Nome do parâmetro:<br>" + | ||
555 | - "<select name='' onchange='i3GEOF.metaestat.analise.filtraPeriodo.valoresParametro(this.value,"+nivel+",\"Pf_"+nivel+"\")' style='wisth:150px;'>" + | ||
556 | - "<option value='' >---</option>"+ins+"</select></p><div class=paragrafo id='Pf_"+nivel+"'></div>"; | ||
557 | - } | ||
558 | - }; | ||
559 | - i3GEO.util.ajaxGet( | ||
560 | - i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?funcao=listaFiltroTempo&g_sid="+i3GEO.configura.sid+"&layer="+layer+"&nivel="+nivel, | ||
561 | - temp | ||
562 | - ); | ||
563 | - }, | ||
564 | - valoresParametro: function(id_parametro_medida,nivel,onde){ | ||
565 | - if(id_parametro_medida === ""){ | ||
566 | - $i(onde).innerHTML = ""; | ||
567 | - return; | ||
568 | - } | ||
569 | - var temp = function(retorno){ | ||
570 | - var ins="",i=0,n = retorno.length; | ||
571 | - ins += "<p class=paragrafo>Valor:<br>" + | ||
572 | - "<select name='"+id_parametro_medida+"' onchange='i3GEOF.metaestat.analise.filtraPeriodo.parametro("+(nivel*1 + 1)+")' style='wisth:150px;background-color:yellow;'><option value=''>---</option>"; | ||
573 | - for(i=0;i<n;i++){ | ||
574 | - ins += "<option value='"+retorno[i]+"'>"+retorno[i]+"</option>"; | ||
575 | - } | ||
576 | - $i(onde).innerHTML = ins+"</select>"; | ||
577 | - }; | ||
578 | - i3GEO.php.listaValoresParametroMedidaVariavel(id_parametro_medida,temp); | ||
579 | - }, | ||
580 | - adicionaFiltro: function(){ | ||
581 | - i3GEO.janela.tempoMsg("O filtro de tempo não modifica as camadas que foram criadas considerando-se uma data específica"); | ||
582 | - var p,pini,pfim, | ||
583 | - temp = function(retorno){ | ||
584 | - i3GEO.janela.fechaAguarde("aguardeAplicaFiltro"); | ||
585 | - i3GEO.Interface.atualizaMapa(); | ||
586 | - }; | ||
587 | - i3GEO.janela.AGUARDEMODAL = true; | ||
588 | - i3GEO.janela.abreAguarde("aguardeAplicaFiltro","Aplicando..."); | ||
589 | - i3GEO.janela.AGUARDEMODAL = false; | ||
590 | - //pega o filtro | ||
591 | - pini = i3GEOF.metaestat.analise.filtraPeriodo.pegaParametros("i3GEOF.filtraperiodo.Pi_0"); | ||
592 | - pfim = i3GEOF.metaestat.analise.filtraPeriodo.pegaParametros("i3GEOF.filtraperiodo.Pf_0"); | ||
593 | - // | ||
594 | - p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?funcao=aplicaFiltroTempo" + | ||
595 | - "&pari="+pini[0] + | ||
596 | - "&vali="+pini[1] + | ||
597 | - "&parf="+pfim[0] + | ||
598 | - "&valf="+pfim[1] + | ||
599 | - "&tema="+$i("i3GEOF.filtraperiodo.comboCamada").value + | ||
600 | - "&g_sid="+i3GEO.configura.sid; | ||
601 | - if(pini[0].length == 0 || pini[1].length == 0){ | ||
602 | - i3GEO.janela.fechaAguarde("aguardeAplicaFiltro"); | ||
603 | - return; | ||
604 | - } | ||
605 | - i3GEO.util.ajaxGet(p,temp); | ||
606 | - }, | ||
607 | - removeFiltro: function(){ | ||
608 | - var p, | ||
609 | - temp = function(retorno){ | ||
610 | - i3GEO.janela.fechaAguarde("aguardeAplicaFiltro"); | ||
611 | - i3GEO.Interface.atualizaMapa(); | ||
612 | - }; | ||
613 | - i3GEO.janela.AGUARDEMODAL = true; | ||
614 | - i3GEO.janela.abreAguarde("aguardeAplicaFiltro","Aplicando..."); | ||
615 | - i3GEO.janela.AGUARDEMODAL = false; | ||
616 | - p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?funcao=removeFiltroTempo" + | ||
617 | - "&tema="+$i("i3GEOF.filtraperiodo.comboCamada").value + | ||
618 | - "&g_sid="+i3GEO.configura.sid; | ||
619 | - i3GEO.util.ajaxGet(p,temp); | ||
620 | - }, | ||
621 | - pegaParametros:function(id){ | ||
622 | - var c = $i(id).getElementsByTagName("select"), | ||
623 | - n = c.length, | ||
624 | - par = [], | ||
625 | - val = [], | ||
626 | - i; | ||
627 | - if(!c){ | ||
628 | - return [par,val]; | ||
629 | - } | ||
630 | - for(i=0;i<n;i++){ | ||
631 | - if(c[i].name != "" && c[i].value != ""){ | ||
632 | - par.push(c[i].name); | ||
633 | - val.push(c[i].value); | ||
634 | - } | ||
635 | - } | ||
636 | - return [par,val]; | ||
637 | - } | ||
638 | - } | ||
639 | - }, | ||
640 | - classes:{ | ||
641 | - inicia: function(iddiv){ | ||
642 | - if(!$i("i3geoCartoComboMedidasVariavel")){ | ||
643 | - i3GEO.janela.tempoMsg("erro: i3geoCartoComboMedidasVariavel???"); | ||
644 | - return; | ||
645 | - } | ||
646 | - if($i("i3geoCartoComboMedidasVariavel").value === ""){ | ||
647 | - i3GEO.janela.tempoMsg("erro: i3geoCartoComboMedidasVariavel???"); | ||
648 | - return; | ||
649 | - } | ||
650 | - if(!iddiv || !$i(iddiv)){ | ||
651 | - iddiv = "i3geoCartoClasses_corpo"; | ||
652 | - } | ||
653 | - if(i3GEOF.metaestat.INTERFACE == "flutuante"){ | ||
654 | - i3GEOF.metaestat.classes.abreJanela(); | ||
655 | - $i(iddiv).innerHTML = i3GEOF.metaestat.classes.html(); | ||
656 | - i3GEOF.metaestat.classes.comboTipoRep(); | ||
657 | - i3GEOF.metaestat.classes.comboTipoClassificacao(); | ||
658 | - i3GEOF.metaestat.classes.comboRegiao(); | ||
659 | - } | ||
660 | - if(i3GEOF.metaestat.INTERFACE == "flutuanteSimples"){ | ||
661 | - i3GEOF.metaestat.classes.abreJanela(); | ||
662 | - $i(iddiv).innerHTML = i3GEOF.metaestat.classes.html(); | ||
663 | - i3GEOF.metaestat.classes.comboTipoClassificacao(); | ||
664 | - } | ||
665 | - }, | ||
666 | - abreJanela: function(){ | ||
667 | - var cabecalho,minimiza,janela; | ||
668 | - if (!$i("i3geoCartoClasses")){ | ||
669 | - cabecalho = function(){ | ||
670 | - }; | ||
671 | - minimiza = function(){ | ||
672 | - }; | ||
673 | - janela = i3GEO.janela.cria( | ||
674 | - i3GEOF.metaestat.LARGURA+10+"px", | ||
675 | - i3GEOF.metaestat.ALTURA - 50 +"px", | ||
676 | - "", | ||
677 | - "", | ||
678 | - "", | ||
679 | - $trad(6,i3GEOF.metaestat.dicionario), | ||
680 | - "i3geoCartoClasses", | ||
681 | - true, | ||
682 | - "hd", | ||
683 | - cabecalho, | ||
684 | - minimiza | ||
685 | - ); | ||
686 | - janela = janela[0]; | ||
687 | - YAHOO.i3GEO.janela.manager.register(janela); | ||
688 | - janela.render(); | ||
689 | - } | ||
690 | - else{ | ||
691 | - janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoClasses"); | ||
692 | - } | ||
693 | - janela.show(); | ||
694 | - i3GEOF.metaestat.classes.botaoAplicar(); | ||
695 | - //imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); | ||
696 | - //janela.moveTo(imagemxy[0]+i3GEOF.metaestat.LEFT+i3GEOF.metaestat.LARGURA+20,i3GEOF.metaestat.TOP); | ||
697 | - }, | ||
698 | - botaoAplicar: function(){ | ||
699 | - YAHOO.i3GEO.janela.manager.find("i3geoCartoClasses").setFooter('<input type="button" id="i3GEOcartoClassesBotaoAaplicar" value="Aplicar" class="paragrafo" style="width:200px;cursor:pointer;color:blue" />'); | ||
700 | - new YAHOO.widget.Button( | ||
701 | - "i3GEOcartoClassesBotaoAaplicar", | ||
702 | - {onclick:{fn: i3GEOF.metaestat.classes.aplicar}} | ||
703 | - ); | ||
704 | - $i("i3GEOcartoClassesBotaoAaplicar-button").style.width = i3GEOF.metaestat.LARGURA - 15 + "px"; | ||
705 | - }, | ||
706 | - aplicar: function(){ | ||
707 | - if($i("i3geoCartoComboTipoRep") && $i("i3geoCartoComboTipoRep").options){ | ||
708 | - i3GEOF.metaestat.comum.tipoRep = [$i("i3geoCartoComboTipoRep").value,$i("i3geoCartoComboTipoRep").options[$i("i3geoCartoComboTipoRep").selectedIndex].label]; | ||
709 | - } | ||
710 | - else{ | ||
711 | - i3GEOF.metaestat.comum.tipoRep = [$i("i3geoCartoComboTipoRep").value,""]; | ||
712 | - } | ||
713 | - i3GEOF.metaestat.comum.tipoClassificacao = [$i("i3geoCartoComboTipoClassificacao").value,$i("i3geoCartoComboTipoClassificacao").options[$i("i3geoCartoComboTipoClassificacao").selectedIndex].label]; | ||
714 | - i3GEOF.metaestat.comum.tipoRegiao = [$i("i3geoCartoComboRegioesMedidasVariavel").value,$i("i3geoCartoComboRegioesMedidasVariavel").options[$i("i3geoCartoComboRegioesMedidasVariavel").selectedIndex].label]; | ||
715 | - | ||
716 | - i3GEOF.metaestat.classes.destroiJanela(); | ||
717 | - }, | ||
718 | - zeraParametros: function(){ | ||
719 | - i3GEOF.metaestat.comum.tipoRep = ["",""]; | ||
720 | - i3GEOF.metaestat.comum.tipoClassificacao = ["",""]; | ||
721 | - i3GEOF.metaestat.comum.tipoRegiao = ["",""]; | ||
722 | - }, | ||
723 | - destroiJanela: function(){ | ||
724 | - var janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoClasses"); | ||
725 | - if(janela){ | ||
726 | - janela.destroy(); | ||
727 | - } | ||
728 | - }, | ||
729 | - html: function(){ | ||
730 | - var ins = '<div id="i3geoCartoClassesContainer" style="margin-left:5px;">' + | ||
731 | - '<div class="paragrafo" id="i3geoCartoTipoRep" >' + | ||
732 | - '</div>' + | ||
733 | - '<div class="paragrafo" id="i3geoCartoTipoClassificacao" >' + | ||
734 | - '</div>' + | ||
735 | - '<div class="paragrafo" id="i3geoCartoRegioesMedidasVariavel" >' + | ||
736 | - '</div>' + | ||
737 | - '</div>'; | ||
738 | - return ins; | ||
739 | - }, | ||
740 | - comboTipoRep: function(){ | ||
741 | - var onde = $i("i3geoCartoTipoRep"), | ||
742 | - ins,i, | ||
743 | - dados = [ | ||
744 | - {"codigo":"polygon","nome":"polígonos"}, | ||
745 | - {"codigo":"point","nome":"pontos"} | ||
746 | - ], | ||
747 | - n = dados.length; | ||
748 | - ins = '' + | ||
749 | - '<br><p class="paragrafo" >'+$trad(8,i3GEOF.metaestat.dicionario)+'</p>' + | ||
750 | - "<select id='i3geoCartoComboTipoRep' style='box-shadow:0 1px 5px gray;width:"+(i3GEOF.metaestat.LARGURA - 20)+"px' onchange=''>"; | ||
751 | - for(i=0;i<n;i++){ | ||
752 | - ins += "<option value='"+dados[i].codigo+"'>"+dados[i].nome+"</option>"; | ||
753 | - } | ||
754 | - ins += "</select>"; | ||
755 | - if(onde){ | ||
756 | - onde.innerHTML = ins; | ||
757 | - //i3GEOF.metaestat.classes.botaoAdicionarCamada(); | ||
758 | - } | ||
759 | - return ins; | ||
760 | - }, | ||
761 | - comboTipoClassificacao: function(){ | ||
762 | - var onde = $i("i3geoCartoTipoClassificacao"), | ||
763 | - combo = $i("i3geoCartoComboMedidasVariavel"), | ||
764 | - temp = function(dados){ | ||
765 | - var n = dados.length, | ||
766 | - ins = '<p class="paragrafo" >'+$trad(9,i3GEOF.metaestat.dicionario)+'</p>', | ||
767 | - i; | ||
768 | - ins += "<select id='i3geoCartoComboTipoClassificacao' style='width:"+(i3GEOF.metaestat.LARGURA - 20)+"px' onchange='i3GEOF.metaestat.classes.comboTipoClassificacaoOnchange(this)'><option value=''>---</option>"; | ||
769 | - for(i=0;i<n;i++){ | ||
770 | - ins += "<option title='"+dados[i].observacao+"' value='"+dados[i].id_classificacao+"'>"+dados[i].nome+"</option>"; | ||
771 | - } | ||
772 | - ins += "</select>"; | ||
773 | - //{"id_classificacao":"1","nome":"Pela media","id_medida_variavel":"1","observacao":""} | ||
774 | - if(onde){ | ||
775 | - onde.innerHTML = ins; | ||
776 | - } | ||
777 | - return ins; | ||
778 | - }; | ||
779 | - if(combo.value != ""){ | ||
780 | - i3GEOF.metaestat.comum.aguarde(onde); | ||
781 | - i3GEO.php.listaClassificacaoMedida(combo.value,temp); | ||
782 | - } | ||
783 | - else{ | ||
784 | - onde.innerHTML = ""; | ||
785 | - } | ||
786 | - }, | ||
787 | - comboTipoClassificacaoOnchange: function(){ | ||
788 | - | ||
789 | - }, | ||
790 | - comboRegiao: function(id_medida_variavel){ | ||
791 | - i3GEOF.metaestat.comum.aguarde($i("i3geoCartoRegioesMedidasVariavel")); | ||
792 | - var onde = $i("i3geoCartoRegioesMedidasVariavel"), | ||
793 | - combo = $i("i3geoCartoComboMedidasVariavel"), | ||
794 | - temp = function(dados){ | ||
795 | - var n = dados.length, | ||
796 | - ins = '<p class="paragrafo" >'+$trad(13,i3GEOF.metaestat.dicionario)+'</p>', | ||
797 | - i; | ||
798 | - ins += "<select id='i3geoCartoComboRegioesMedidasVariavel' style='width:"+(i3GEOF.metaestat.LARGURA - 20)+"px' ><option value=''>---</option>"; | ||
799 | - for(i=0;i<n;i++){ | ||
800 | - ins += "<option title='"+dados[i].observacao+"' value='"+dados[i].codigo_tipo_regiao+"'>"+dados[i].nome_tipo_regiao+"</option>"; | ||
801 | - } | ||
802 | - ins += "</select>"; | ||
803 | - if(onde){ | ||
804 | - onde.innerHTML = ins; | ||
805 | - } | ||
806 | - return ins; | ||
807 | - }; | ||
808 | - if(combo.value != ""){ | ||
809 | - i3GEOF.metaestat.comum.aguarde(onde); | ||
810 | - i3GEO.php.listaRegioesMedidaVariavel(combo.value,temp); | ||
811 | - } | ||
812 | - } | ||
813 | - }, | ||
814 | - comum:{ | ||
815 | - iniciaDicionario: function(){ | ||
816 | - if(typeof(i3GEOF.metaestat.dicionario) === 'undefined'){ | ||
817 | - i3GEO.util.scriptTag( | ||
818 | - i3GEO.configura.locaplic+"/ferramentas/metaestat/dicionario.js", | ||
819 | - "i3GEOF.metaestat.principal.inicia()", | ||
820 | - "i3GEOF.metaestat.dicionario_script" | ||
821 | - ); | ||
822 | - } | ||
823 | - else{ | ||
824 | - i3GEOF.metaestat.principal.inicia(); | ||
825 | - } | ||
826 | - }, | ||
827 | - desligaCamadas: function(){ | ||
828 | - if(i3GEOF.metaestat.CAMADAS.length > 0){ | ||
829 | - i3GEO.arvoreDeCamadas.ligaDesligaTemas(i3GEOF.metaestat.CAMADAS.join(","),false); | ||
830 | - } | ||
831 | - }, | ||
832 | - //parametros para adicionar a camada | ||
833 | - tipoRep: [], | ||
834 | - tipoRegiao: [], | ||
835 | - tipoClassificacao: [], | ||
836 | - adicionaCamada: function(){ | ||
837 | - //function mapfileMedidaVariavel($id_medida_variavel,$filtro="",$todasascolunas = 0,$tipolayer="polygon",$titulolayer="",$id_classificacao="",$agruparpor=""){ | ||
838 | - var v = i3GEOF.metaestat.comum.verificaParametros(), | ||
839 | - temp = function(retorno){ | ||
840 | - var atualiza = function(){ | ||
841 | - i3GEO.atualiza(); | ||
842 | - i3GEOF.metaestat.CAMADAS.push(retorno.layer); | ||
843 | - i3GEO.mapa.ativaTema(retorno.layer); | ||
844 | - i3GEOF.metaestat.analise.comboCamadas(); | ||
845 | - }, | ||
846 | - c = i3GEO.arvoreDeCamadas.capturaCheckBox(retorno.layer); | ||
847 | - if(i3GEO.arvoreDeCamadas.pegaTema(retorno.layer) == ""){ | ||
848 | - i3GEOF.metaestat.comum.desligaCamadas(); | ||
849 | - i3GEO.php.adtema(atualiza,retorno.mapfile); | ||
850 | - } | ||
851 | - else{ | ||
852 | - if(c){ | ||
853 | - i3GEOF.metaestat.comum.desligaCamadas(); | ||
854 | - i3GEO.mapa.ativaTema(retorno.layer); | ||
855 | - c.checked = true; | ||
856 | - i3GEO.Interface.ligaDesliga(c); | ||
857 | - } | ||
858 | - } | ||
859 | - }; | ||
860 | - if(v != true){ | ||
861 | - i3GEO.janela.tempoMsg("erro: "+v); | ||
862 | - return; | ||
863 | - } | ||
864 | - //e necessario obter os parametros nessa interface | ||
865 | - if(i3GEOF.metaestat.INTERFACE == "flutuanteSimples"){ | ||
866 | - i3GEOF.metaestat.classes.aplicar(); | ||
867 | - } | ||
868 | - i3GEO.php.mapfileMedidaVariavel( | ||
869 | - temp, | ||
870 | - $i("i3geoCartoComboMedidasVariavel").value, | ||
871 | - i3GEOF.metaestat.comum.defineFiltro(), | ||
872 | - 0, | ||
873 | - i3GEOF.metaestat.comum.tipoRep[0], | ||
874 | - i3GEOF.metaestat.comum.defineTitulo(), | ||
875 | - i3GEOF.metaestat.comum.tipoClassificacao[0], | ||
876 | - i3GEOF.metaestat.comum.defineAgruparPor(), | ||
877 | - i3GEOF.metaestat.comum.tipoRegiao[0] | ||
878 | - ); | ||
879 | - }, | ||
880 | - ativaCamada: function(camada){ | ||
881 | - if(i3GEOF.metaestat.CAMADAS.length > 0){ | ||
882 | - i3GEO.arvoreDeCamadas.ligaDesligaTemas(i3GEOF.metaestat.CAMADAS.join(","),false); | ||
883 | - i3GEO.arvoreDeCamadas.ligaDesligaTemas(camada,true); | ||
884 | - i3GEO.mapa.ativaTema(camada); | ||
885 | - } | ||
886 | - }, | ||
887 | - defineTitulo: function(){ | ||
888 | - //se nao tiver parametros, filtro e vazio | ||
889 | - if(i3GEOF.metaestat.parametros.dados.length == 0 || i3GEOF.metaestat.INTERFACE === "flutuanteSimples"){ | ||
890 | - return ""; | ||
891 | - } | ||
892 | - //deixa vazio para que o titulo seja definido pelo PHP que monta o mapfile | ||
893 | - if(i3GEOF.metaestat.comum.tipoRep[1] == ""){ | ||
894 | - return ""; | ||
895 | - } | ||
896 | - var i,n,c,titulo="", | ||
897 | - t=[], | ||
898 | - dados = i3GEOF.metaestat.parametros.dados; | ||
899 | - if($i("i3geoCartoComboVariavel") && $i("i3geoCartoComboVariavel").options){ | ||
900 | - titulo = $i("i3geoCartoComboVariavel").options[$i("i3geoCartoComboVariavel").selectedIndex].label +" - "; | ||
901 | - } | ||
902 | - titulo += $i("i3geoCartoComboMedidasVariavel").options[$i("i3geoCartoComboMedidasVariavel").selectedIndex].label +" - "+ | ||
903 | - i3GEOF.metaestat.comum.tipoRep[1] +" - "+ | ||
904 | - i3GEOF.metaestat.comum.tipoClassificacao[1] + " - " + | ||
905 | - i3GEOF.metaestat.comum.tipoRegiao[1]; | ||
906 | - n = dados.length; | ||
907 | - for(i=0;i<n;i++){ | ||
908 | - c = $i("comboparametro_"+dados[i].id_parametro_medida+"_"+dados[i].id_pai); | ||
909 | - if(c && c.value != ""){ | ||
910 | - t.push(dados[i].nome+" = "+c.value); | ||
911 | - } | ||
912 | - } | ||
913 | - if(t.length > 0){ | ||
914 | - return titulo+" - "+t.join(", "); | ||
915 | - } | ||
916 | - else{ | ||
917 | - return titulo; | ||
918 | - } | ||
919 | - }, | ||
920 | - defineFiltro: function(){ | ||
921 | - //se nao tiver parametros, filtro e vazio | ||
922 | - if(i3GEOF.metaestat.parametros.dados.length == 0){ | ||
923 | - return ""; | ||
924 | - } | ||
925 | - //se tiver parametro e todos estiverem vazios, aborta | ||
926 | - var i,n,c, | ||
927 | - t=[], | ||
928 | - dados = i3GEOF.metaestat.parametros.dados; | ||
929 | - n = dados.length; | ||
930 | - for(i=0;i<n;i++){ | ||
931 | - c = $i("comboparametro_"+dados[i].id_parametro_medida+"_"+dados[i].id_pai); | ||
932 | - if(c && c.value != ""){ | ||
933 | - t.push(dados[i].coluna+"="+c.value); | ||
934 | - } | ||
935 | - } | ||
936 | - if(t.length > 0){ | ||
937 | - return t.join(" and "); | ||
938 | - } | ||
939 | - else{ | ||
940 | - return ""; | ||
941 | - } | ||
942 | - }, | ||
943 | - defineAgruparPor: function(){ | ||
944 | - //se nao tiver parametros, filtro e vazio | ||
945 | - if(i3GEOF.metaestat.parametros.dados.length == 0){ | ||
946 | - return ""; | ||
947 | - } | ||
948 | - //se tiver parametro e todos estiverem vazios, aborta | ||
949 | - var i,n,c, | ||
950 | - t=[], | ||
951 | - dados = i3GEOF.metaestat.parametros.dados; | ||
952 | - n = dados.length; | ||
953 | - for(i=0;i<n;i++){ | ||
954 | - c = $i("comboparametro_"+dados[i].id_parametro_medida+"_"+dados[i].id_pai); | ||
955 | - if(c && c.value != ""){ | ||
956 | - t.push(dados[i].coluna); | ||
957 | - } | ||
958 | - } | ||
959 | - if(t.length > 0){ | ||
960 | - return t.join(","); | ||
961 | - } | ||
962 | - else{ | ||
963 | - return ""; | ||
964 | - } | ||
965 | - }, | ||
966 | - verificaParametros: function(){ | ||
967 | - var ok = true, | ||
968 | - combos = ["i3geoCartoComboMedidasVariavel"], | ||
969 | - n = combos.length, | ||
970 | - i,temp; | ||
971 | - for(i=0;i<n;i++){ | ||
972 | - temp = $i(combos[i]); | ||
973 | - if(!temp){ | ||
974 | - return combos[i]; | ||
975 | - } | ||
976 | - if(temp.value == ""){ | ||
977 | - return combos[i]; | ||
978 | - } | ||
979 | - } | ||
980 | - return ok; | ||
981 | - }, | ||
982 | - aguarde: function(obj){ | ||
983 | - if(!obj){ | ||
984 | - return "<img style='display:block;z-index:2' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' />"; | ||
985 | - } | ||
986 | - var i = $i(obj.id+"_imagem"); | ||
987 | - if(!i){ | ||
988 | - obj.innerHTML = "<img id='"+obj.id+"_imagem' style='display:block;z-index:2' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' />"; | ||
989 | - } | ||
990 | - else{ | ||
991 | - if(i.style.display == "block"){ | ||
992 | - i.style.display = "none"; | ||
993 | - } | ||
994 | - else{ | ||
995 | - i.style.display = "block"; | ||
996 | - } | ||
997 | - } | ||
998 | - } | ||
999 | - }, | ||
1000 | - editor: { | ||
1001 | - inicia: function(){ | ||
1002 | - YAHOO.namespace("admin.container"); | ||
1003 | - if(typeof(i3GEOF.metaestat.dicionario1) === 'undefined'){ | ||
1004 | - i3GEO.util.scriptTag( | ||
1005 | - i3GEO.configura.locaplic+"/ferramentas/metaestat/dicionario1.js", | ||
1006 | - "i3GEOF.metaestat.editor.dependenciasjs0()", | ||
1007 | - "i3GEOF.metaestat.dicionario1_script" | ||
1008 | - ); | ||
1009 | - } | ||
1010 | - else{ | ||
1011 | - i3GEOF.metaestat.editor.dependenciasjs0(); | ||
1012 | - } | ||
1013 | - }, | ||
1014 | - //carrega os javascripts do sistema de administracao e que tbm sao usados aqui | ||
1015 | - dependenciasjs0: function(){ | ||
1016 | - i3GEO.util.scriptTag( | ||
1017 | - i3GEO.configura.locaplic+"/admin/js/core.js", | ||
1018 | - "i3GEOF.metaestat.editor.dependenciasjs1()", | ||
1019 | - "i3GEOF.metaestat.dependenciasjs0_script" | ||
1020 | - ); | ||
1021 | - }, | ||
1022 | - dependenciasjs1: function(){ | ||
1023 | - i3GEO.util.scriptTag( | ||
1024 | - i3GEO.configura.locaplic+"/admin/js/estat_variavel.js", | ||
1025 | - "i3GEOF.metaestat.editor.ativa()", | ||
1026 | - "i3GEOF.metaestat.dependenciasjs1_script" | ||
1027 | - ); | ||
1028 | - }, | ||
1029 | - ativa: function(iddiv){ | ||
1030 | - var loginok = function(){ | ||
1031 | - i3GEOadmin.variaveis.inicia(); | ||
1032 | - if(!iddiv){ | ||
1033 | - iddiv = "i3geoCartoEditor_corpo"; | ||
1034 | - } | ||
1035 | - if(i3GEOF.metaestat.INTERFACE == "flutuante"){ | ||
1036 | - i3GEOF.metaestat.editor.abreJanela(); | ||
1037 | - } | ||
1038 | - $i(iddiv).innerHTML = i3GEOF.metaestat.editor.html(); | ||
1039 | - i3GEOF.metaestat.editor.t0(); | ||
1040 | - }, | ||
1041 | - loginNok = function(){ | ||
1042 | - i3GEO.janela.tempoMsg("Você precisa fazer login para usar essa opção"); | ||
1043 | - i3GEO.login.dialogo.abreLogin(); | ||
1044 | - }; | ||
1045 | - //verifica login | ||
1046 | - i3GEO.login.verificaOperacao("admin/metaestat/geral",i3GEO.configura.locaplic, loginok, "sessao",loginNok); | ||
1047 | - }, | ||
1048 | - abreJanela: function(){ | ||
1049 | - var cabecalho,minimiza,imagemxy,janela; | ||
1050 | - if (!$i("i3geoCartoEditor")){ | ||
1051 | - cabecalho = function(){}; | ||
1052 | - minimiza = function(){ | ||
1053 | - i3GEO.janela.minimiza("i3geoCartoEditor"); | ||
1054 | - }; | ||
1055 | - janela = i3GEO.janela.cria( | ||
1056 | - "400px", | ||
1057 | - "320px", | ||
1058 | - "", | ||
1059 | - "", | ||
1060 | - "", | ||
1061 | - $trad(1,i3GEOF.metaestat.dicionario1), | ||
1062 | - "i3geoCartoEditor", | ||
1063 | - false, | ||
1064 | - "hd", | ||
1065 | - cabecalho, | ||
1066 | - minimiza | ||
1067 | - ); | ||
1068 | - janela = janela[0]; | ||
1069 | - YAHOO.i3GEO.janela.manager.register(janela); | ||
1070 | - janela.render(); | ||
1071 | - } | ||
1072 | - else{ | ||
1073 | - janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoEditor"); | ||
1074 | - } | ||
1075 | - janela.show(); | ||
1076 | - imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); | ||
1077 | - janela.moveTo(imagemxy[0]+i3GEOF.metaestat.LEFT+i3GEOF.metaestat.LARGURA+20,i3GEOF.metaestat.TOP+20); | ||
1078 | - }, | ||
1079 | - html: function(){ | ||
1080 | - var ins = ''; | ||
1081 | - ins += '<div style="background-color:#F2F2F2;top:0px;left:0px;display:block;width:98%;margin-left:5px;" id="i3GEOFmetaestatEditor" >'; | ||
1082 | - ins += '</div>'; | ||
1083 | - return ins; | ||
1084 | - }, | ||
1085 | - criaVariavel: function(){ | ||
1086 | - i3GEOadmin.variaveis.aposGravar = function(){ | ||
1087 | - core_carregando("desativa"); | ||
1088 | - //refaz o conteudo para mostrar a nova adicao | ||
1089 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t1"); | ||
1090 | - // Enome e o id do input onde o usuario escolheu o nome da nova variavel | ||
1091 | - i3GEOF.metaestat.editor.t1(true,$i("Enome").value); | ||
1092 | - i3GEOF.metaestat.principal.inicia(); | ||
1093 | - }; | ||
1094 | - i3GEOadmin.variaveis.editar("variavel",""); | ||
1095 | - }, | ||
1096 | - editaVariavel: function(){ | ||
1097 | - i3GEOadmin.variaveis.aposGravar = function(){ | ||
1098 | - core_carregando("desativa"); | ||
1099 | - //refaz o conteudo para mostrar a nova adicao | ||
1100 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t1"); | ||
1101 | - // Enome e o id do input onde o usuario escolheu o nome da nova variavel | ||
1102 | - i3GEOF.metaestat.editor.t1(true,$i("Enome").value); | ||
1103 | - i3GEOF.metaestat.principal.inicia(); | ||
1104 | - }; | ||
1105 | - var codigo_variavel = $i("i3geoCartoComboVariavelEditor").value; | ||
1106 | - if(codigo_variavel !== ""){ | ||
1107 | - i3GEOadmin.variaveis.editar("variavel",codigo_variavel); | ||
1108 | - } | ||
1109 | - }, | ||
1110 | - criaMedidaVariavel: function(){ | ||
1111 | - i3GEOadmin.variaveis.aposGravar = function(){ | ||
1112 | - core_carregando("desativa"); | ||
1113 | - //refaz o conteudo para mostrar a nova adicao | ||
1114 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t2"); | ||
1115 | - // Enome e o id do input onde o usuario escolheu o nome da nova variavel | ||
1116 | - i3GEOF.metaestat.editor.t2(true,$i("Enomemedida").value); | ||
1117 | - i3GEOF.metaestat.principal.inicia(); | ||
1118 | - }; | ||
1119 | - i3GEOadmin.variaveis.editar("medidaVariavel",""); | ||
1120 | - //passa o codigo da variavel | ||
1121 | - $i("Ecodigo_variavel").value = $i("i3geoCartoComboVariavelEditor").value; | ||
1122 | - //define os valores que sao padrao | ||
1123 | - //a conexao e com o default | ||
1124 | - $i("Ecodigo_estat_conexao").value = i3GEOF.metaestat.CONEXAODEFAULT; | ||
1125 | - //o esquema e o public | ||
1126 | - $i("Eesquemadb").value = "i3geo_metaestat"; | ||
1127 | - //a tabela onde ficarao os dados | ||
1128 | - $i("Etabela").value = "indicadores_bairro"; | ||
1129 | - //coluna com os valores | ||
1130 | - $i("Ecolunavalor").value = "valor_num"; | ||
1131 | - //id que liga com o geo | ||
1132 | - $i("Ecolunaidgeo").value = "codigoregiao"; | ||
1133 | - //id unico | ||
1134 | - $i("Ecolunaidunico").value = "gid"; | ||
1135 | - //unidade de medida | ||
1136 | - $i("Ecodigo_unidade_medida").value = 1; | ||
1137 | - //periodo | ||
1138 | - $i("Ecodigo_tipo_periodo").value = 0; | ||
1139 | - //impede a alteracao do filtro | ||
1140 | - $i("Efiltro").disabled = "disabled"; | ||
1141 | - //altera a tabela quando escolher | ||
1142 | - $i("Ecodigo_tipo_regiao").onchange = function(){ | ||
1143 | - alert("Escolha uma tabela compatível com essa região"); | ||
1144 | - $i("Etabela").value = ""; | ||
1145 | - }; | ||
1146 | - }, | ||
1147 | - editaMedidaVariavel: function(){ | ||
1148 | - i3GEOadmin.variaveis.aposGravar = function(){ | ||
1149 | - core_carregando("desativa"); | ||
1150 | - //refaz o conteudo para mostrar a nova adicao | ||
1151 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t2"); | ||
1152 | - // Enome e o id do input onde o usuario escolheu o nome da nova variavel | ||
1153 | - i3GEOF.metaestat.editor.t2(true,$i("Enomemedida").value); | ||
1154 | - i3GEOF.metaestat.principal.inicia(); | ||
1155 | - }; | ||
1156 | - var id_medida_variavel = $i("i3geoCartoComboMedidaVariavelEditor").value; | ||
1157 | - if(id_medida_variavel !== ""){ | ||
1158 | - i3GEOadmin.variaveis.editar("medidaVariavel",id_medida_variavel); | ||
1159 | - } | ||
1160 | - }, | ||
1161 | - criaClassificacao: function(){ | ||
1162 | - i3GEOadmin.variaveis.aposGravar = function(){ | ||
1163 | - core_carregando("desativa"); | ||
1164 | - //refaz o conteudo para mostrar a nova adicao | ||
1165 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t3"); | ||
1166 | - // Enome e o id do input onde o usuario escolheu o nome da nova variavel | ||
1167 | - i3GEOF.metaestat.editor.t3(true,$i("Enome").value); | ||
1168 | - }; | ||
1169 | - i3GEOadmin.variaveis.editar("classificacaoMedida",""); | ||
1170 | - $i("Eid_medida_variavel").value = $i("i3geoCartoComboMedidaVariavelEditor").value; | ||
1171 | - }, | ||
1172 | - editaClassificacao: function(){ | ||
1173 | - i3GEOadmin.variaveis.aposGravar = function(){ | ||
1174 | - core_carregando("desativa"); | ||
1175 | - //refaz o conteudo para mostrar a nova adicao | ||
1176 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t3"); | ||
1177 | - // Enome e o id do input onde o usuario escolheu o nome da nova variavel | ||
1178 | - i3GEOF.metaestat.editor.t3(true,$i("Enome").value); | ||
1179 | - }; | ||
1180 | - var id_classificacao = $i("i3geoCartoComboClassificacoesEditor").value; | ||
1181 | - if(id_classificacao !== ""){ | ||
1182 | - i3GEOadmin.variaveis.editar("classificacaoMedida",id_classificacao); | ||
1183 | - } | ||
1184 | - }, | ||
1185 | - removeEl:function(id){ | ||
1186 | - var no = $i(id); | ||
1187 | - if(no){ | ||
1188 | - no.parentNode.removeChild(no); | ||
1189 | - } | ||
1190 | - }, | ||
1191 | - selComboPorTexto: function(idcombo,texto){ | ||
1192 | - var c = $i(idcombo),n,i; | ||
1193 | - if(c){ | ||
1194 | - n = c.options.length; | ||
1195 | - for(i=0;i<n;i++){ | ||
1196 | - if(c.options[i].label === texto){ | ||
1197 | - c.options[i].selected = true; | ||
1198 | - return; | ||
1199 | - } | ||
1200 | - } | ||
1201 | - } | ||
1202 | - }, | ||
1203 | - /** | ||
1204 | - * Obtem um parametro da medida variavel escolhida. Os parametros sao obtidos da chamada em ajax que pega a lista de medidas de uma variavel | ||
1205 | - */ | ||
1206 | - dadoMedidaSelecionada: function(parametro){ | ||
1207 | - var c = $i("i3geoCartoComboMedidaVariavelEditor"),n,i; | ||
1208 | - if(c){ | ||
1209 | - n = c.options.length; | ||
1210 | - for(i=0;i<n;i++){ | ||
1211 | - if(c.options[i].selected === true){ | ||
1212 | - if(i3GEOF.metaestat.DADOSMEDIDASVARIAVEL[i-1]){ | ||
1213 | - return i3GEOF.metaestat.DADOSMEDIDASVARIAVEL[i-1][parametro]; | ||
1214 | - } | ||
1215 | - else{ | ||
1216 | - return ""; | ||
1217 | - } | ||
1218 | - } | ||
1219 | - } | ||
1220 | - } | ||
1221 | - else{ | ||
1222 | - return ""; | ||
1223 | - } | ||
1224 | - }, | ||
1225 | - comboVariaveisOnchange: function(){ | ||
1226 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t2"); | ||
1227 | - }, | ||
1228 | - comboMedidaVariavelOnchange: function(combo){ | ||
1229 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t3"); | ||
1230 | - }, | ||
1231 | - quartis: function(){ | ||
1232 | - var id_medida_variavel = $i("i3geoCartoComboMedidaVariavelEditor").value, | ||
1233 | - id_classificacao = $i("i3geoCartoComboClassificacoesEditor").value, | ||
1234 | - cores = $i("listaColourRampEditor").value, | ||
1235 | - p = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=calculaClassificacao&tipo=quartil&cores="+cores+"&id_classificacao="+id_classificacao+"&id_medida_variavel="+id_medida_variavel+"&g_sid="+i3GEO.configura.sid, | ||
1236 | - temp = function(retorno){ | ||
1237 | - core_carregando("desativa"); | ||
1238 | - //fecha o editor | ||
1239 | - if(retorno == "erro"){ | ||
1240 | - alert("Não foi possível gerar as classes. Verifique se já existem dados para essa medida"); | ||
1241 | - } | ||
1242 | - else{ | ||
1243 | - YAHOO.i3GEO.janela.manager.find("i3geoCartoEditor").destroy(); | ||
1244 | - } | ||
1245 | - }; | ||
1246 | - if(cores == ""){ | ||
1247 | - i3GEO.janela.tempoMsg("Escolha as cores primeiro. Depois acione a opção de classificação novamente"); | ||
1248 | - $i("listaColourRampEditor").onchange = function(){i3GEOF.metaestat.editor.quartis();}; | ||
1249 | - i3GEO.util.abreColourRamp("","listaColourRampEditor",5); | ||
1250 | - return; | ||
1251 | - } | ||
1252 | - core_carregando("ativa"); | ||
1253 | - i3GEO.util.ajaxGet(p,temp); | ||
1254 | - }, | ||
1255 | - intervalosIguaisMM: function(){ | ||
1256 | - var id_medida_variavel = $i("i3geoCartoComboMedidaVariavelEditor").value, | ||
1257 | - id_classificacao = $i("i3geoCartoComboClassificacoesEditor").value, | ||
1258 | - cores = $i("listaColourRampEditor").value, | ||
1259 | - p = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=calculaClassificacao&tipo=intiguais5mm" + | ||
1260 | - "&cores="+cores+"&id_classificacao="+id_classificacao+"&id_medida_variavel="+id_medida_variavel+ | ||
1261 | - "&min="+$i("i3GEOFmetaestatEditorVmin").value + | ||
1262 | - "&max="+$i("i3GEOFmetaestatEditorVmax").value + | ||
1263 | - "&g_sid="+i3GEO.configura.sid, | ||
1264 | - temp = function(retorno){ | ||
1265 | - core_carregando("desativa"); | ||
1266 | - YAHOO.i3GEO.janela.manager.find("i3geoCartoEditor").destroy(); | ||
1267 | - }; | ||
1268 | - if(cores == ""){ | ||
1269 | - alert("Escolha as cores primeiro"); | ||
1270 | - $i("listaColourRampEditor").onchange = function(){i3GEOF.metaestat.editor.intervalosIguaisMM();}; | ||
1271 | - i3GEO.util.abreColourRamp("","listaColourRampEditor",5); | ||
1272 | - return; | ||
1273 | - } | ||
1274 | - core_carregando("ativa"); | ||
1275 | - i3GEO.util.ajaxGet(p,temp); | ||
1276 | - }, | ||
1277 | - intervalosIguais: function(){ | ||
1278 | - var id_medida_variavel = $i("i3geoCartoComboMedidaVariavelEditor").value, | ||
1279 | - id_classificacao = $i("i3geoCartoComboClassificacoesEditor").value, | ||
1280 | - cores = $i("listaColourRampEditor").value, | ||
1281 | - p = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=calculaClassificacao&tipo=intiguais5&cores="+cores+"&id_classificacao="+id_classificacao+"&id_medida_variavel="+id_medida_variavel+"&g_sid="+i3GEO.configura.sid, | ||
1282 | - temp = function(retorno){ | ||
1283 | - core_carregando("desativa"); | ||
1284 | - if(retorno == "erro"){ | ||
1285 | - alert("Não foi possível gerar as classes. Verifique se já existem dados para essa medida"); | ||
1286 | - } | ||
1287 | - else{ | ||
1288 | - YAHOO.i3GEO.janela.manager.find("i3geoCartoEditor").destroy(); | ||
1289 | - } | ||
1290 | - }; | ||
1291 | - if(cores == ""){ | ||
1292 | - alert("Escolha as cores primeiro"); | ||
1293 | - $i("listaColourRampEditor").onchange = function(){i3GEOF.metaestat.editor.intervalosIguais();}; | ||
1294 | - i3GEO.util.abreColourRamp("","listaColourRampEditor",5); | ||
1295 | - return; | ||
1296 | - } | ||
1297 | - core_carregando("ativa"); | ||
1298 | - i3GEO.util.ajaxGet(p,temp); | ||
1299 | - }, | ||
1300 | - /** | ||
1301 | - * Botao de upload | ||
1302 | - */ | ||
1303 | - botaoUpload: function(id){ | ||
1304 | - new YAHOO.widget.Button( | ||
1305 | - id, | ||
1306 | - {onclick:{fn: function(){ | ||
1307 | - var cabecalho,minimiza,janela; | ||
1308 | - if (!$i("i3geoCartoUpload")){ | ||
1309 | - cabecalho = function(){ | ||
1310 | - }; | ||
1311 | - minimiza = function(){ | ||
1312 | - i3GEO.janela.minimiza("i3geoCartoUpload"); | ||
1313 | - }; | ||
1314 | - janela = i3GEO.janela.cria( | ||
1315 | - "500px", | ||
1316 | - "450px", | ||
1317 | - i3GEO.configura.locaplic+"/ferramentas/metaestat/upload.html", | ||
1318 | - "", | ||
1319 | - "", | ||
1320 | - "Upload", | ||
1321 | - "i3geoCartoUpload", | ||
1322 | - false, | ||
1323 | - "hd", | ||
1324 | - cabecalho, | ||
1325 | - minimiza | ||
1326 | - ); | ||
1327 | - janela = janela[0]; | ||
1328 | - YAHOO.i3GEO.janela.manager.register(janela); | ||
1329 | - janela.render(); | ||
1330 | - } | ||
1331 | - else{ | ||
1332 | - janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoUpload"); | ||
1333 | - } | ||
1334 | - janela.show(); | ||
1335 | - }}} | ||
1336 | - ); | ||
1337 | - }, | ||
1338 | - /** | ||
1339 | - * Abertura do ajudante | ||
1340 | - * | ||
1341 | - **/ | ||
1342 | - t0: function(){ | ||
1343 | - var ins = "<p class='paragrafo' >" + $trad(2,i3GEOF.metaestat.dicionario1) + | ||
1344 | - "<br><br><p><input id=i3GEOFmetaestatEditorBotaot01 type='button' value='"+$trad(3,i3GEOF.metaestat.dicionario1)+"' />" + | ||
1345 | - " <input id=i3GEOFmetaestatEditorBotaot02 type='button' value='"+$trad(4,i3GEOF.metaestat.dicionario1)+"' />" + | ||
1346 | - " <input id=i3GEOFmetaestatEditorBotaot03 type='button' value='Upload CSV' />"; | ||
1347 | - i3GEO.util.proximoAnterior("","i3GEOF.metaestat.editor.t1()",ins,"i3GEOF.metaestat.editor.t0","i3GEOFmetaestatEditor"); | ||
1348 | - new YAHOO.widget.Button( | ||
1349 | - "i3GEOFmetaestatEditorBotaot01", | ||
1350 | - {onclick:{fn: function(){window.open(i3GEO.configura.locaplic+"/admin/html/estat_variavel.html");}}} | ||
1351 | - ); | ||
1352 | - new YAHOO.widget.Button( | ||
1353 | - "i3GEOFmetaestatEditorBotaot02", | ||
1354 | - {onclick:{fn: function(){ | ||
1355 | - i3GEO.janela.tempoMsg($trad(15,i3GEOF.metaestat.dicionario1)); | ||
1356 | - window.open(i3GEO.configura.locaplic+"/ferramentas/metaestat/editorlimites.php"); | ||
1357 | - }}} | ||
1358 | - ); | ||
1359 | - i3GEOF.metaestat.editor.botaoUpload("i3GEOFmetaestatEditorBotaot03"); | ||
1360 | - }, | ||
1361 | - /** | ||
1362 | - * Edicao da variavel | ||
1363 | - */ | ||
1364 | - t1: function(remove,textoSelecionado){ | ||
1365 | - if(remove == true){ | ||
1366 | - //remove o conteudo anteriormente construido | ||
1367 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t1"); | ||
1368 | - } | ||
1369 | - var temp = function(dados){ | ||
1370 | - var ins = "<p class='paragrafo' >" + $trad(1,i3GEOF.metaestat.dicionario) + "<br><br>" + | ||
1371 | - "<span>" + i3GEOF.metaestat.principal.comboVariaveis(dados,"i3geoCartoComboVariavelEditor","i3GEOF.metaestat.editor.comboVariaveisOnchange(this)","","nao") + "</span>" + | ||
1372 | - "<br><br><p><input id=i3GEOFmetaestatEditorBotao3 type='button' value='"+$trad(8,i3GEOF.metaestat.dicionario1)+"' />" + | ||
1373 | - " <input id=i3GEOFmetaestatEditorBotao3a type='button' value='"+$trad(5,i3GEOF.metaestat.dicionario1)+"' /><br>"; | ||
1374 | - i3GEO.util.proximoAnterior("i3GEOF.metaestat.editor.t0()","i3GEOF.metaestat.editor.t2()",ins,"i3GEOF.metaestat.editor.t1","i3GEOFmetaestatEditor",true); | ||
1375 | - new YAHOO.widget.Button( | ||
1376 | - "i3GEOFmetaestatEditorBotao3", | ||
1377 | - {onclick:{fn: i3GEOF.metaestat.editor.editaVariavel}} | ||
1378 | - ); | ||
1379 | - $i("i3GEOFmetaestatEditorBotao3-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1380 | - new YAHOO.widget.Button( | ||
1381 | - "i3GEOFmetaestatEditorBotao3a", | ||
1382 | - {onclick:{fn: i3GEOF.metaestat.editor.criaVariavel}} | ||
1383 | - ); | ||
1384 | - $i("i3GEOFmetaestatEditorBotao3a-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1385 | - if(textoSelecionado){ | ||
1386 | - i3GEOF.metaestat.editor.selComboPorTexto("i3geoCartoComboVariavelEditor",textoSelecionado); | ||
1387 | - } | ||
1388 | - }; | ||
1389 | - i3GEO.php.listaVariavel(temp); | ||
1390 | - }, | ||
1391 | - /** | ||
1392 | - * Edicao da medida da variavel | ||
1393 | - * | ||
1394 | - */ | ||
1395 | - t2: function(remove,textoSelecionado){ | ||
1396 | - if(remove == true){ | ||
1397 | - //remove o conteudo anteriormente construido | ||
1398 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t2"); | ||
1399 | - } | ||
1400 | - if($i("i3geoCartoComboVariavelEditor").value === ""){ | ||
1401 | - i3GEO.janela.tempoMsg($trad(4,i3GEOF.metaestat.dicionario)); | ||
1402 | - i3GEOF.metaestat.editor.t1(false); | ||
1403 | - } | ||
1404 | - else{ | ||
1405 | - var temp = function(dados){ | ||
1406 | - //guarda os dados | ||
1407 | - var ins = "<p class='paragrafo' >" + $trad(2,i3GEOF.metaestat.dicionario) + "<br><br>" + | ||
1408 | - "<span>" + i3GEOF.metaestat.principal.comboMedidasVariavel(dados,"i3geoCartoComboMedidaVariavelEditor","i3GEOF.metaestat.editor.comboMedidaVariavelOnchange(this)","","nao") + "</span>" + | ||
1409 | - "<br><br><p><input id=i3GEOFmetaestatEditorBotao4 type='button' value='"+$trad(8,i3GEOF.metaestat.dicionario1)+"' />" + | ||
1410 | - " <input id=i3GEOFmetaestatEditorBotao4a type='button' value='"+$trad(5,i3GEOF.metaestat.dicionario1)+"' /><br>"; | ||
1411 | - i3GEO.util.proximoAnterior("i3GEOF.metaestat.editor.t1()","i3GEOF.metaestat.editor.t3a()",ins,"i3GEOF.metaestat.editor.t2","i3GEOFmetaestatEditor",true); | ||
1412 | - new YAHOO.widget.Button( | ||
1413 | - "i3GEOFmetaestatEditorBotao4", | ||
1414 | - {onclick:{fn: i3GEOF.metaestat.editor.editaMedidaVariavel}} | ||
1415 | - ); | ||
1416 | - $i("i3GEOFmetaestatEditorBotao4-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1417 | - new YAHOO.widget.Button( | ||
1418 | - "i3GEOFmetaestatEditorBotao4a", | ||
1419 | - {onclick:{fn: i3GEOF.metaestat.editor.criaMedidaVariavel}} | ||
1420 | - ); | ||
1421 | - $i("i3GEOFmetaestatEditorBotao4a-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1422 | - if(textoSelecionado){ | ||
1423 | - i3GEOF.metaestat.editor.selComboPorTexto("i3geoCartoComboMedidaVariavelEditor",textoSelecionado); | ||
1424 | - } | ||
1425 | - }, | ||
1426 | - codigo_variavel = $i("i3geoCartoComboVariavelEditor").value; | ||
1427 | - if(codigo_variavel == ""){ | ||
1428 | - i3GEO.janela.tempoMsg($trad(4,i3GEOF.metaestat.dicionario)); | ||
1429 | - i3GEOF.metaestat.editor.t1(false); | ||
1430 | - return; | ||
1431 | - } | ||
1432 | - i3GEO.php.listaMedidaVariavel(codigo_variavel,temp); | ||
1433 | - } | ||
1434 | - }, | ||
1435 | - /** | ||
1436 | - * Opcao de upload | ||
1437 | - */ | ||
1438 | - t3a: function(remove,textoSelecionado){ | ||
1439 | - if(remove == true){ | ||
1440 | - //remove o conteudo anteriormente construido | ||
1441 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t3a"); | ||
1442 | - } | ||
1443 | - if($i("i3geoCartoComboMedidaVariavelEditor").value === ""){ | ||
1444 | - i3GEO.janela.tempoMsg($trad(2,i3GEOF.metaestat.dicionario)); | ||
1445 | - i3GEOF.metaestat.editor.t2(false); | ||
1446 | - } | ||
1447 | - else{ | ||
1448 | - var ins = "<p class='paragrafo' >" + $trad(20,i3GEOF.metaestat.dicionario1) + | ||
1449 | - "<br><br><p><input id=i3GEOFmetaestatEditorBotaot3a type='button' value='Upload CSV' />"; | ||
1450 | - i3GEO.util.proximoAnterior("i3GEOF.metaestat.editor.t2()","i3GEOF.metaestat.editor.t3()",ins,"i3GEOF.metaestat.editor.t3a","i3GEOFmetaestatEditor",true); | ||
1451 | - i3GEOF.metaestat.editor.botaoUpload("i3GEOFmetaestatEditorBotaot3a"); | ||
1452 | - $i("i3GEOFmetaestatEditorBotaot3a-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1453 | - } | ||
1454 | - }, | ||
1455 | - /** | ||
1456 | - * Edicao da classificacao | ||
1457 | - */ | ||
1458 | - t3: function(remove,textoSelecionado){ | ||
1459 | - if(remove == true){ | ||
1460 | - //remove o conteudo anteriormente construido | ||
1461 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t3"); | ||
1462 | - } | ||
1463 | - if($i("i3geoCartoComboMedidaVariavelEditor").value === ""){ | ||
1464 | - i3GEO.janela.tempoMsg($trad(2,i3GEOF.metaestat.dicionario)); | ||
1465 | - i3GEOF.metaestat.editor.t2(false); | ||
1466 | - } | ||
1467 | - else{ | ||
1468 | - var temp = function(dados){ | ||
1469 | - var ins = "<p class='paragrafo' >" + $trad(7,i3GEOF.metaestat.dicionario1) + "<br><br>" + | ||
1470 | - "<span>" + i3GEOF.metaestat.principal.comboClassificacoesMedidaVariavel(dados,"i3geoCartoComboClassificacoesEditor","") + "</span>" + | ||
1471 | - "<br><br>"+$trad(14,i3GEOF.metaestat.dicionario1)+": " + i3GEOF.metaestat.editor.dadoMedidaSelecionada("unidade_medida") + | ||
1472 | - "<br><br><p><input id=i3GEOFmetaestatEditorBotao5 type='button' value='"+$trad(8,i3GEOF.metaestat.dicionario1)+"' />" + | ||
1473 | - " <input id=i3GEOFmetaestatEditorBotao5a type='button' value='"+$trad(5,i3GEOF.metaestat.dicionario1)+"' /><br>"; | ||
1474 | - i3GEO.util.proximoAnterior("i3GEOF.metaestat.editor.t3a()","i3GEOF.metaestat.editor.t4()",ins,"i3GEOF.metaestat.editor.t3","i3GEOFmetaestatEditor",true); | ||
1475 | - | ||
1476 | - new YAHOO.widget.Button( | ||
1477 | - "i3GEOFmetaestatEditorBotao5", | ||
1478 | - {onclick:{fn: i3GEOF.metaestat.editor.editaClassificacao}} | ||
1479 | - ); | ||
1480 | - $i("i3GEOFmetaestatEditorBotao5-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1481 | - new YAHOO.widget.Button( | ||
1482 | - "i3GEOFmetaestatEditorBotao5a", | ||
1483 | - {onclick:{fn: i3GEOF.metaestat.editor.criaClassificacao}} | ||
1484 | - ); | ||
1485 | - $i("i3GEOFmetaestatEditorBotao5a-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1486 | - if(textoSelecionado){ | ||
1487 | - i3GEOF.metaestat.editor.selComboPorTexto("i3geoCartoComboClassificacoesEditor",textoSelecionado); | ||
1488 | - } | ||
1489 | - | ||
1490 | - }; | ||
1491 | - i3GEO.php.listaClassificacaoMedida($i("i3geoCartoComboMedidaVariavelEditor").value,temp); | ||
1492 | - } | ||
1493 | - }, | ||
1494 | - /** | ||
1495 | - * Edicao das classes | ||
1496 | - */ | ||
1497 | - t4: function(){ | ||
1498 | - //remove o conteudo anteriormente construido | ||
1499 | - i3GEOF.metaestat.editor.removeEl("i3GEOF.metaestat.editor.t4"); | ||
1500 | - if($i("i3geoCartoComboMedidaVariavelEditor").value === ""){ | ||
1501 | - i3GEO.janela.tempoMsg($trad(9,i3GEOF.metaestat.dicionario)); | ||
1502 | - i3GEOF.metaestat.editor.t3(false); | ||
1503 | - } | ||
1504 | - else{ | ||
1505 | - //formulario semelhante existe em i3geo/admin/js/estat_variavel.js (classesAuto) | ||
1506 | - var temp = function(dados){ | ||
1507 | - var soma = i3GEOF.metaestat.editor.dadoMedidaSelecionada("permitesoma"), | ||
1508 | - media = i3GEOF.metaestat.editor.dadoMedidaSelecionada("permitemedia"), | ||
1509 | - ins = "<p class='paragrafo' >" + $trad(16,i3GEOF.metaestat.dicionario1) + "</p>"+ | ||
1510 | - " <input id=i3GEOFmetaestatEditorBotao8 type='button' value='"+$trad(13,i3GEOF.metaestat.dicionario1)+"' />" + | ||
1511 | - "<br><p class='paragrafo' >" + $trad(10,i3GEOF.metaestat.dicionario1) + "</p>"; | ||
1512 | - if(soma == 1 || media == 1){ | ||
1513 | - ins += " <input id=i3GEOFmetaestatEditorBotao6 type='button' value='"+$trad(11,i3GEOF.metaestat.dicionario1)+"' />" + | ||
1514 | - " <input id=i3GEOFmetaestatEditorBotao7 type='button' value='"+$trad(12,i3GEOF.metaestat.dicionario1)+"' />"; | ||
1515 | - } | ||
1516 | - ins += '<input type=hidden value="" id="listaColourRampEditor" />' + //utilizado pelo seletor de colourramp; | ||
1517 | - "<br><p class='paragrafo' >" + $trad(17,i3GEOF.metaestat.dicionario1) + "</p>" + | ||
1518 | - "<p class='paragrafo' >" + $trad(18,i3GEOF.metaestat.dicionario1) + | ||
1519 | - " <input type=text class=digitar size=5 value=0 id=i3GEOFmetaestatEditorVmin /> " + | ||
1520 | - $trad(19,i3GEOF.metaestat.dicionario1) + | ||
1521 | - " <input type=text class=digitar size=5 value=100 id=i3GEOFmetaestatEditorVmax /></p>" + | ||
1522 | - "<input id='i3GEOFmetaestatEditorBotao9' type='button' value='"+$trad(12,i3GEOF.metaestat.dicionario1)+"' />"; | ||
1523 | - | ||
1524 | - i3GEO.util.proximoAnterior("i3GEOF.metaestat.editor.t3()","",ins,"i3GEOF.metaestat.editor.t4","i3GEOFmetaestatEditor",true); | ||
1525 | - new YAHOO.widget.Button( | ||
1526 | - "i3GEOFmetaestatEditorBotao8", | ||
1527 | - {onclick:{fn: function(){ | ||
1528 | - i3GEO.util.abreColourRamp("","listaColourRampEditor",5); | ||
1529 | - }}} | ||
1530 | - ); | ||
1531 | - $i("i3GEOFmetaestatEditorBotao8-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1532 | - if($i("i3GEOFmetaestatEditorBotao6")){ | ||
1533 | - new YAHOO.widget.Button( | ||
1534 | - "i3GEOFmetaestatEditorBotao6", | ||
1535 | - {onclick:{fn: i3GEOF.metaestat.editor.quartis}} | ||
1536 | - ); | ||
1537 | - $i("i3GEOFmetaestatEditorBotao6-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1538 | - | ||
1539 | - new YAHOO.widget.Button( | ||
1540 | - "i3GEOFmetaestatEditorBotao7", | ||
1541 | - {onclick:{fn: i3GEOF.metaestat.editor.intervalosIguais}} | ||
1542 | - ); | ||
1543 | - $i("i3GEOFmetaestatEditorBotao7-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1544 | - | ||
1545 | - new YAHOO.widget.Button( | ||
1546 | - "i3GEOFmetaestatEditorBotao9", | ||
1547 | - {onclick:{fn: i3GEOF.metaestat.editor.intervalosIguaisMM}} | ||
1548 | - ); | ||
1549 | - $i("i3GEOFmetaestatEditorBotao9-button").style.width = (i3GEOF.metaestat.LARGURA / 2) + "px"; | ||
1550 | - } | ||
1551 | - }; | ||
1552 | - i3GEO.php.listaClasseClassificacao($i("i3geoCartoComboClassificacoesEditor").value,temp); | ||
1553 | - } | ||
1554 | - } | ||
1555 | - }, | ||
1556 | - parametros: { | ||
1557 | - //guarda a lista de parametros | ||
1558 | - dados: [], | ||
1559 | - //obtem a lista com os parametros da medida | ||
1560 | - //cria os combos para os parametros que sao pai de todos | ||
1561 | - lista: function(id_medida_variavel){ | ||
1562 | - i3GEOF.metaestat.comum.aguarde($i("i3geoCartoParametrosMedidasVariavel")); | ||
1563 | - var temp = function(dados){ | ||
1564 | - i3GEOF.metaestat.parametros.dados = dados; | ||
1565 | - i3GEOF.metaestat.parametros.combos("0"); | ||
1566 | - i3GEOF.metaestat.comum.aguarde($i("i3geoCartoParametrosMedidasVariavel")); | ||
1567 | - }; | ||
1568 | - i3GEO.php.listaParametrosMedidaVariavel(id_medida_variavel,temp); | ||
1569 | - }, | ||
1570 | - //cria um combo para escolher os valores de um parametro | ||
1571 | - combos: function(nivel){ | ||
1572 | - var dados = i3GEOF.metaestat.parametros.dados, | ||
1573 | - n = dados.length, | ||
1574 | - onde = $i("i3geoCartoParametrosMedidasVariavel"), | ||
1575 | - idpar,idcombo,i,novoel,teste; | ||
1576 | - //cria o combo para o parametro cujo id_pai for do nivel escolhido | ||
1577 | - for(i=0;i<n;i++){ | ||
1578 | - if(dados[i].id_pai == nivel){ | ||
1579 | - idpar = "parametro_"+dados[i].id_parametro_medida; | ||
1580 | - idcombo = "parametro_"+dados[i].id_parametro_medida+"_"+nivel; | ||
1581 | - teste = i3GEOF.metaestat.parametros.retornaIdPai(dados[i].id_parametro_medida); | ||
1582 | - if(teste != false){ | ||
1583 | - idpar = "parametro_"+teste; | ||
1584 | - } | ||
1585 | - if(!$i(idpar)){ | ||
1586 | - novoel = document.createElement("div"); | ||
1587 | - novoel.id = idpar; | ||
1588 | - novoel.className = "paragrafo"; | ||
1589 | - onde.appendChild(novoel); | ||
1590 | - onde = novoel; | ||
1591 | - } | ||
1592 | - onde = $i(idpar); | ||
1593 | - if(!$i(idcombo)){ | ||
1594 | - i3GEOF.metaestat.comum.aguarde(onde); | ||
1595 | - novoel = document.createElement("div"); | ||
1596 | - novoel.id = idcombo; | ||
1597 | - novoel.className = "paragrafo"; | ||
1598 | - onde.appendChild(novoel); | ||
1599 | - i3GEOF.metaestat.parametros.valoresCombo(dados[i].id_parametro_medida,dados[i].nome,nivel,onde,idcombo); | ||
1600 | - } | ||
1601 | - } | ||
1602 | - } | ||
1603 | - }, | ||
1604 | - valoresCombo: function(id_parametro_medida,titulo,nivel,onde,idcombo){ | ||
1605 | - var temp = function(dados){ | ||
1606 | - var n = dados.length, | ||
1607 | - ins = "", | ||
1608 | - oc = "'i3GEOF.metaestat.parametros.antesCombo();i3GEOF.metaestat.parametros.combos(\""+id_parametro_medida+"\")'", | ||
1609 | - filho = i3GEOF.metaestat.parametros.retornaIdFilho(id_parametro_medida), | ||
1610 | - i,novoel; | ||
1611 | - if(filho == false){ | ||
1612 | - oc = ""; | ||
1613 | - } | ||
1614 | - ins = "<p class=paragrafo >"+titulo+"</p>"; | ||
1615 | - ins += "<select id='combo"+idcombo+"' style='background:beige;width:"+(i3GEOF.metaestat.LARGURA - 20)+"px' onchange="+oc+" ><option value=''>---</option>"; | ||
1616 | - for(i=0;i<n;i++){ | ||
1617 | - ins += "<option value='"+dados[i]+"'>"+dados[i]+"</option>"; | ||
1618 | - } | ||
1619 | - ins += "</select>"; | ||
1620 | - novoel = document.createElement("div"); | ||
1621 | - novoel.className = "paragrafo"; | ||
1622 | - novoel.innerHTML = ins; | ||
1623 | - i3GEOF.metaestat.comum.aguarde(onde); | ||
1624 | - onde.appendChild(novoel); | ||
1625 | - }; | ||
1626 | - i3GEO.php.listaValoresParametroMedidaVariavel(id_parametro_medida,temp); | ||
1627 | - }, | ||
1628 | - antesCombo: function(){ | ||
1629 | - if(!$i("i3geoCartoClasses_corpo")){ | ||
1630 | - i3GEOF.metaestat.classes.inicia(); | ||
1631 | - } | ||
1632 | - }, | ||
1633 | - //retorna o id do parametro que e filho de um outro parametro | ||
1634 | - retornaIdFilho:function(pai){ | ||
1635 | - var dados = i3GEOF.metaestat.parametros.dados, | ||
1636 | - n = dados.length, | ||
1637 | - i; | ||
1638 | - for(i=0;i<n;i++){ | ||
1639 | - if(dados[i].id_pai == pai){ | ||
1640 | - return dados[i].id_parametro_medida; | ||
1641 | - } | ||
1642 | - } | ||
1643 | - return false; | ||
1644 | - }, | ||
1645 | - //retorna o id do parametro que e pai de um outro parametro | ||
1646 | - retornaIdPai:function(filho){ | ||
1647 | - var dados = i3GEOF.metaestat.parametros.dados, | ||
1648 | - n = dados.length, | ||
1649 | - i; | ||
1650 | - for(i=0;i<n;i++){ | ||
1651 | - if(dados[i].id_parametro_medida == filho){ | ||
1652 | - return dados[i].id_pai; | ||
1653 | - } | ||
1654 | - } | ||
1655 | - return false; | ||
1656 | - } | ||
1657 | - }, | ||
1658 | - principal: { | ||
1659 | - inicia: function(iddiv){ | ||
1660 | - if(!iddiv || !$i(iddiv)){ | ||
1661 | - iddiv = "i3geoCartoParametros_corpo"; | ||
1662 | - } | ||
1663 | - //interface default | ||
1664 | - if(i3GEOF.metaestat.INTERFACE == "flutuante"){ | ||
1665 | - i3GEOF.metaestat.principal.abreJanela(); | ||
1666 | - $i(iddiv).innerHTML = i3GEOF.metaestat.principal.html(); | ||
1667 | - i3GEOF.metaestat.principal.opcoesVariaveis(); | ||
1668 | - } | ||
1669 | - //interface qd a medida da variavel ja tiver sido definida. Utilizada ao adicionar uma camada via catalogo de temas | ||
1670 | - if(i3GEOF.metaestat.INTERFACE == "flutuanteSimples"){ | ||
1671 | - i3GEOF.metaestat.principal.abreJanela(); | ||
1672 | - $i(iddiv).innerHTML = i3GEOF.metaestat.principal.html(); | ||
1673 | - //i3GEOF.metaestat.principal.opcoesVariaveis(); | ||
1674 | - $i("i3geoCartoVariaveis").innerHTML = "Aguarde..."; | ||
1675 | - $i("i3geoCartoVariaveis").innerHTML = '' + | ||
1676 | - "<input type=hidden value='"+i3GEOF.metaestat.ID_MEDIDA_VARIAVEL+"' id='i3geoCartoComboMedidasVariavel' />" + | ||
1677 | - "<input type=hidden value='0' id='i3geoCartoComboVariavel' />" + | ||
1678 | - "<input type=hidden value='0' id='i3geoCartoComboTipoRep' />" + | ||
1679 | - "<div id='i3geoCartoRegioesMedidasVariavel'></div>" + | ||
1680 | - "<br><div id='i3geoCartoTipoClassificacao'></div>" + | ||
1681 | - "<br><div id='i3geoCartoParametrosMedidasVariavel'></div>" + | ||
1682 | - "<p class=paragrafo >"+$trad(17,i3GEOF.metaestat.dicionario) + "</p>"; | ||
1683 | - | ||
1684 | - i3GEOF.metaestat.principal.botaoAdicionaCamada(); | ||
1685 | - i3GEOF.metaestat.classes.comboRegiao(i3GEOF.metaestat.ID_MEDIDA_VARIAVEL); | ||
1686 | - i3GEOF.metaestat.classes.comboTipoClassificacao(); | ||
1687 | - i3GEOF.metaestat.parametros.lista(i3GEOF.metaestat.ID_MEDIDA_VARIAVEL); | ||
1688 | - } | ||
1689 | - }, | ||
1690 | - atualiza:function(){ | ||
1691 | - $i("i3geoCartoVariaveis").innerHTML = ""; | ||
1692 | - $i("i3geoCartoMedidasVariavel").innerHTML = ""; | ||
1693 | - $i("i3geoCartoParametrosMedidasVariavel").innerHTML = ""; | ||
1694 | - YAHOO.i3GEO.janela.manager.find("i3geoCartoParametros").setFooter(""); | ||
1695 | - i3GEOF.metaestat.principal.opcoesVariaveis(); | ||
1696 | - }, | ||
1697 | - abreJanela: function(){ | ||
1698 | - var cabecalho,minimiza,imagemxy,janela,modal = false; | ||
1699 | - if (!$i("i3geoCartoParametros")){ | ||
1700 | - cabecalho = function(){ | ||
1701 | - }; | ||
1702 | - minimiza = function(){ | ||
1703 | - i3GEO.janela.minimiza("i3geoCartoParametros"); | ||
1704 | - }; | ||
1705 | - if(i3GEOF.metaestat.INTERFACE == "flutuanteSimples"){ | ||
1706 | - modal = true; | ||
1707 | - } | ||
1708 | - janela = i3GEO.janela.cria( | ||
1709 | - i3GEOF.metaestat.LARGURA+10+"px", | ||
1710 | - i3GEOF.metaestat.ALTURA+"px", | ||
1711 | - "", | ||
1712 | - "", | ||
1713 | - "", | ||
1714 | - $trad("x57"), | ||
1715 | - "i3geoCartoParametros", | ||
1716 | - modal, | ||
1717 | - "hd", | ||
1718 | - cabecalho, | ||
1719 | - minimiza | ||
1720 | - ); | ||
1721 | - janela = janela[0]; | ||
1722 | - if(!YAHOO.i3GEO.janela.manager.find("i3geoCartoParametros")){ | ||
1723 | - YAHOO.i3GEO.janela.manager.register(janela); | ||
1724 | - } | ||
1725 | - janela.render(); | ||
1726 | - } | ||
1727 | - else{ | ||
1728 | - janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoParametros"); | ||
1729 | - } | ||
1730 | - janela.show(); | ||
1731 | - imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); | ||
1732 | - janela.moveTo(imagemxy[0]+i3GEOF.metaestat.LEFT,i3GEOF.metaestat.TOP); | ||
1733 | - return janela; | ||
1734 | - }, | ||
1735 | - html: function(){ | ||
1736 | - var ins = '<div id="i3geoCartoVariaveisContainer" style="margin-left:5px;">' + | ||
1737 | - '<div class="paragrafo" id="i3geoCartoVariaveis" >' + | ||
1738 | - '</div>' + | ||
1739 | - '<div class="paragrafo" id="i3geoCartoMedidasVariavel" >' + | ||
1740 | - '</div>' + | ||
1741 | - '<div class="paragrafo" id="i3geoCartoParametrosMedidasVariavel" >' + | ||
1742 | - '</div>' + | ||
1743 | - '</div>'; | ||
1744 | - return ins; | ||
1745 | - }, | ||
1746 | - maisInfo: function(){ | ||
1747 | - var temp = "", | ||
1748 | - v = $i("i3geoCartoComboVariavel"); | ||
1749 | - if(!v || v.value === ""){ | ||
1750 | - i3GEO.janela.tempoMsg($trad(4,i3GEOF.metaestat.dicionario)); | ||
1751 | - } | ||
1752 | - else{ | ||
1753 | - var cabecalho,minimiza,janela; | ||
1754 | - if (!$i("i3geoCartoMaisInfo")){ | ||
1755 | - cabecalho = function(){ | ||
1756 | - }; | ||
1757 | - minimiza = function(){ | ||
1758 | - i3GEO.janela.minimiza("i3geoCartoMaisInfo"); | ||
1759 | - }; | ||
1760 | - janela = i3GEO.janela.cria( | ||
1761 | - "400px", | ||
1762 | - "300px", | ||
1763 | - "", | ||
1764 | - "", | ||
1765 | - "", | ||
1766 | - $trad(5,i3GEOF.metaestat.dicionario), | ||
1767 | - "i3geoCartoMaisInfo", | ||
1768 | - false, | ||
1769 | - "hd", | ||
1770 | - cabecalho, | ||
1771 | - minimiza | ||
1772 | - ); | ||
1773 | - janela = janela[0]; | ||
1774 | - YAHOO.i3GEO.janela.manager.register(janela); | ||
1775 | - janela.render(); | ||
1776 | - //YAHOO.util.Event.addListener(janela.close, "click", i3GEOF.metaestat.fechaJanelaParametros); | ||
1777 | - } | ||
1778 | - else{ | ||
1779 | - janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoMaisInfo"); | ||
1780 | - } | ||
1781 | - janela.setBody(i3GEOF.metaestat.comum.aguarde()); | ||
1782 | - temp = function(retorno){ | ||
1783 | - janela.setBody(retorno); | ||
1784 | - janela.show(); | ||
1785 | - //imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); | ||
1786 | - //janela.moveTo(imagemxy[0]+i3GEOF.metaestat.LEFT,imagemxy[1]+i3GEOF.metaestat.TOP); | ||
1787 | - }; | ||
1788 | - i3GEO.php.relatorioVariavel(v.value,temp); | ||
1789 | - } | ||
1790 | - }, | ||
1791 | - comboVariaveis: function(dados,idcombo,stronchange,largura,mostraIconeinfo){ | ||
1792 | - var ins,i,n = dados.length,selecionado = ""; | ||
1793 | - if(!largura || largura === ""){ | ||
1794 | - largura = i3GEOF.metaestat.LARGURA - 40; | ||
1795 | - } | ||
1796 | - if(!mostraIconeinfo || mostraIconeinfo === ""){ | ||
1797 | - mostraIconeinfo = "sim"; | ||
1798 | - } | ||
1799 | - ins = "<select id='"+idcombo+"' style='box-shadow:0 1px 5px gray;width:"+largura+"px' onchange='"+stronchange+"'><option value=''>---</option>"; | ||
1800 | - for(i=0;i<n;i++){ | ||
1801 | - if(dados[i].codigo_variavel === i3GEOF.metaestat.CODIGO_VARIAVEL){ | ||
1802 | - selecionado = "SELECTED"; | ||
1803 | - } | ||
1804 | - else{ | ||
1805 | - selecionado = ""; | ||
1806 | - } | ||
1807 | - ins += "<option "+selecionado+" title='"+dados[i].descricao+"' value='"+dados[i].codigo_variavel+"'>"+dados[i].nome+"</option>"; | ||
1808 | - } | ||
1809 | - ins += "</select>"; | ||
1810 | - if(mostraIconeinfo == "sim"){ | ||
1811 | - ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/ic_identifica.png' style='position:relative;cursor:pointer;left:5px;top:4px;' onclick='i3GEOF.metaestat.principal.maisInfo()' title='"+$trad(3,i3GEOF.metaestat.dicionario)+"'/>"; | ||
1812 | - } | ||
1813 | - return ins; | ||
1814 | - }, | ||
1815 | - botaoInfo: function(){ | ||
1816 | - new YAHOO.widget.Button( | ||
1817 | - "i3GEOcartoBotaoInfo", | ||
1818 | - {onclick:{fn: i3GEOF.metaestat.principal.maisInfo}} | ||
1819 | - ); | ||
1820 | - $i("i3GEOcartoBotaoInfo-button").style.width = (i3GEOF.metaestat.LARGURA / 2) - 15 + "px"; | ||
1821 | - }, | ||
1822 | - botaoJanelaEditor: function(){ | ||
1823 | - new YAHOO.widget.Button( | ||
1824 | - "i3GEOcartoBotaoEditor", | ||
1825 | - {onclick:{fn: i3GEOF.metaestat.editor.inicia}} | ||
1826 | - ); | ||
1827 | - $i("i3GEOcartoBotaoEditor-button").style.width = (i3GEOF.metaestat.LARGURA / 2) - 15 + "px"; | ||
1828 | - }, | ||
1829 | - botaoAdicionaCamada: function(largura){ | ||
1830 | - if(!largura){ | ||
1831 | - largura = i3GEOF.metaestat.LARGURA - 15; | ||
1832 | - } | ||
1833 | - var b = $i("i3GEOcartoBotaoAdicionaCamada"); | ||
1834 | - if(!b){ | ||
1835 | - YAHOO.i3GEO.janela.manager.find("i3geoCartoParametros").setFooter('<input type="button" id="i3GEOcartoBotaoAdicionaCamada" value="'+$trad(7,i3GEOF.metaestat.dicionario)+'" class="paragrafo" style="width:200px;cursor:pointer;color:blue" />'); | ||
1836 | - } | ||
1837 | - if(!$i("i3GEOcartoBotaoAdicionaCamada-button")){ | ||
1838 | - new YAHOO.widget.Button( | ||
1839 | - "i3GEOcartoBotaoAdicionaCamada", | ||
1840 | - {onclick:{fn: i3GEOF.metaestat.comum.adicionaCamada}} | ||
1841 | - ); | ||
1842 | - $i("i3GEOcartoBotaoAdicionaCamada-button").style.width = largura + "px"; | ||
1843 | - } | ||
1844 | - }, | ||
1845 | - botaoJanelaAnalise: function(){ | ||
1846 | - new YAHOO.widget.Button( | ||
1847 | - "i3GEOcartoBotaoAnalise", | ||
1848 | - {onclick:{fn: i3GEOF.metaestat.analise.inicia}} | ||
1849 | - ); | ||
1850 | - $i("i3GEOcartoBotaoAnalise-button").style.width = (i3GEOF.metaestat.LARGURA / 2) - 15 + "px"; | ||
1851 | - }, | ||
1852 | - opcoesVariaveis: function(){ | ||
1853 | - var onde = $i("i3geoCartoVariaveis"), | ||
1854 | - temp = function(dados){ | ||
1855 | - var ins = ''; | ||
1856 | - //botao para obter mais info | ||
1857 | - ins = '<p style="text-align:left;">' + | ||
1858 | - '<input type="button" id="i3GEOcartoBotaoEditor" value="'+$trad(12,i3GEOF.metaestat.dicionario)+'"class="paragrafo" style="width:200px;cursor:pointer;color:blue" /> ' + | ||
1859 | - '<input type="button" id="i3GEOcartoBotaoAnalise" value="'+$trad(11,i3GEOF.metaestat.dicionario)+'"class="paragrafo" style="width:200px;cursor:pointer;color:blue" /></p>' + | ||
1860 | - '<br><p class="paragrafo" >'+$trad(1,i3GEOF.metaestat.dicionario) + | ||
1861 | - '<img title="Atualiza listas" onclick="i3GEOF.metaestat.principal.atualiza()" style="left:5px;top:3px;position:relative;cursor:pointer;text-align:left" src="'+i3GEO.configura.locaplic+'/imagens/oxygen/16x16/folder-sync.png" /></p>'; | ||
1862 | - ins += i3GEOF.metaestat.principal.comboVariaveis(dados,"i3geoCartoComboVariavel","i3GEOF.metaestat.principal.comboVariaveisOnchange(this)"); | ||
1863 | - if(onde){ | ||
1864 | - onde.innerHTML = ins; | ||
1865 | - //i3GEOF.metaestat.principal.botaoInfo(); | ||
1866 | - i3GEOF.metaestat.principal.botaoJanelaEditor(); | ||
1867 | - //i3GEOF.metaestat.principal.botaoJanelaClasses(); | ||
1868 | - i3GEOF.metaestat.principal.botaoJanelaAnalise(); | ||
1869 | - } | ||
1870 | - return ins; | ||
1871 | - }; | ||
1872 | - i3GEOF.metaestat.comum.aguarde(onde); | ||
1873 | - i3GEO.php.listaVariavel(temp); | ||
1874 | - }, | ||
1875 | - comboVariaveisOnchange: function(combo){ | ||
1876 | -<<<<<<< .mine | ||
1877 | - i3GEOF.metaestat.CODIGO_VARIAVEL = combo.value; | ||
1878 | -======= | ||
1879 | - if($i("i3geoCartoParametrosMedidasVariavel")){ | ||
1880 | - $i("i3geoCartoParametrosMedidasVariavel").innerHTML = ""; | ||
1881 | - } | ||
1882 | ->>>>>>> .r3543 | ||
1883 | - if(combo.value != ""){ | ||
1884 | - i3GEOF.metaestat.principal.opcoesMedidasVariavel(combo.value); | ||
1885 | - } | ||
1886 | - else{ | ||
1887 | - $i("i3geoCartoMedidasVariavel").innerHTML = ""; | ||
1888 | - } | ||
1889 | - i3GEOF.metaestat.classes.zeraParametros(); | ||
1890 | - }, | ||
1891 | - comboMedidasVariavel: function(dados,idcombo,stronchange,filtroesquema,largura,mostraIconeprop,mostraIconedown){ | ||
1892 | - i3GEOF.metaestat.DADOSMEDIDASVARIAVEL = dados; | ||
1893 | - var n = dados.length, | ||
1894 | - selecionado = "", | ||
1895 | - ins = '', | ||
1896 | - i; | ||
1897 | - if(!largura || largura === ""){ | ||
1898 | - largura = i3GEOF.metaestat.LARGURA - 20; | ||
1899 | - } | ||
1900 | - if(!mostraIconeprop || mostraIconeprop === ""){ | ||
1901 | - mostraIconeprop = "sim"; | ||
1902 | - } | ||
1903 | - if(!mostraIconedown || mostraIconedown === ""){ | ||
1904 | - mostraIconedown = "sim"; | ||
1905 | - } | ||
1906 | - if(mostraIconeprop == "sim"){ | ||
1907 | - largura = largura - 19; | ||
1908 | - } | ||
1909 | - if(mostraIconedown == "sim"){ | ||
1910 | - largura = largura - 19; | ||
1911 | - } | ||
1912 | - ins += "<select id='"+idcombo+"' style='box-shadow:0 1px 5px gray;width:"+largura+"px' onchange='"+stronchange+"'><option value=''>---</option>"; | ||
1913 | - for(i=0;i<n;i++){ | ||
1914 | - if(!filtroesquema || (filtroesquema != "" && dados[i].esquemadb != filtroesquema)){ | ||
1915 | - if(i3GEOF.metaestat.ID_MEDIDA_VARIAVEL === dados[i].id_medida_variavel){ | ||
1916 | - selecionado = "selected"; | ||
1917 | - } | ||
1918 | - else{ | ||
1919 | - selecionado = ""; | ||
1920 | - } | ||
1921 | - ins += "<option "+selecionado+" value='"+dados[i].id_medida_variavel+"'>"+dados[i].nomemedida+"</option>"; | ||
1922 | - } | ||
1923 | - } | ||
1924 | - ins += "</select>"; | ||
1925 | - if(mostraIconeprop == "sim"){ | ||
1926 | - ins += "<img class='ticPropriedades2' src='"+i3GEO.configura.locaplic+"/imagens/visual/default/branco.gif' style='height:14px;position:relative;cursor:pointer;left:5px;top:4px;' onclick='i3GEOF.metaestat.classes.inicia()' title='"+$trad(18,i3GEOF.metaestat.dicionario)+"'/>"; | ||
1927 | - } | ||
1928 | - if(mostraIconedown == "sim"){ | ||
1929 | - ins += "<img class='ticDownload' src='"+i3GEO.configura.locaplic+"/imagens/visual/default/branco.gif' style='position:relative;cursor:pointer;left:8px;top:5px;' onclick='i3GEOF.metaestat.principal.downloadMedida()' title='"+$trad("a3")+"'/>"; | ||
1930 | - } | ||
1931 | - return ins; | ||
1932 | - }, | ||
1933 | - opcoesMedidasVariavel: function(codigo_variavel){ | ||
1934 | - var onde = $i("i3geoCartoMedidasVariavel"), | ||
1935 | - temp = function(dados){ | ||
1936 | - var ins = '<p class="paragrafo" >'+$trad(2,i3GEOF.metaestat.dicionario)+'</p>'; | ||
1937 | - ins += i3GEOF.metaestat.principal.comboMedidasVariavel(dados,"i3geoCartoComboMedidasVariavel","i3GEOF.metaestat.principal.comboMedidaVariavelOnchange(this)"); | ||
1938 | - if(onde){ | ||
1939 | - onde.innerHTML = ins; | ||
1940 | - } | ||
1941 | - return ins; | ||
1942 | - }; | ||
1943 | - i3GEOF.metaestat.comum.aguarde(onde); | ||
1944 | - i3GEO.php.listaMedidaVariavel(codigo_variavel,temp); | ||
1945 | - }, | ||
1946 | - comboMedidaVariavelOnchange: function(combo){ | ||
1947 | -<<<<<<< .mine | ||
1948 | - i3GEOF.metaestat.ID_MEDIDA_VARIAVEL = combo.value; | ||
1949 | -======= | ||
1950 | - if($i("i3geoCartoParametrosMedidasVariavel")){ | ||
1951 | - $i("i3geoCartoParametrosMedidasVariavel").innerHTML = ""; | ||
1952 | - } | ||
1953 | ->>>>>>> .r3543 | ||
1954 | - if(combo.value != ""){ | ||
1955 | - //i3GEOF.metaestat.classes.inicia(); | ||
1956 | - i3GEOF.metaestat.parametros.lista(combo.value); | ||
1957 | - i3GEOF.metaestat.principal.botaoAdicionaCamada(); | ||
1958 | - } | ||
1959 | - i3GEOF.metaestat.classes.zeraParametros(); | ||
1960 | - }, | ||
1961 | - comboClassificacoesMedidaVariavel: function(dados,idcombo){ | ||
1962 | - var ins,i,n = dados.length; | ||
1963 | - ins = "<select id='"+idcombo+"' style='box-shadow:0 1px 5px gray;width:"+(i3GEOF.metaestat.LARGURA - 20)+"px' onchange='i3GEOF.metaestat.principal.comboClassificacoesMedidaVariavelOnchange(this)'><option value=''>---</option>"; | ||
1964 | - for(i=0;i<n;i++){ | ||
1965 | - ins += "<option title='"+dados[i].observacao+"' value='"+dados[i].id_classificacao+"'>"+dados[i].nome+"</option>"; | ||
1966 | - } | ||
1967 | - ins += "</select>"; | ||
1968 | - return ins; | ||
1969 | - }, | ||
1970 | - comboClassificacoesMedidaVariavelOnchange: function(combo){ | ||
1971 | - | ||
1972 | - }, | ||
1973 | - downloadMedida: function(){ | ||
1974 | - if(!$i("i3geoCartoComboMedidasVariavel")){ | ||
1975 | - i3GEO.janela.tempoMsg("erro: i3geoCartoComboMedidasVariavel???"); | ||
1976 | - return; | ||
1977 | - } | ||
1978 | - if(window.confirm("Confirma o download dos dados")){ | ||
1979 | - var p = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=dadosMedidaVariavel" + | ||
1980 | - "&todasascolunas=1&formato=csv&id_medida_variavel="+$i("i3geoCartoComboMedidasVariavel").value; | ||
1981 | - window.open(p); | ||
1982 | - } | ||
1983 | - } | ||
1984 | - }, | ||
1985 | - //funcoes utilizadas quando o mapa esta cadastrado e e utilizado um template para publicar o mapa | ||
1986 | - publicador: { | ||
1987 | - IDMAPA: "", | ||
1988 | - montaGrupos: function(onde){ | ||
1989 | - var grupos = function(dados){ | ||
1990 | - var n = dados.length, | ||
1991 | - ins = '<input type=hidden id=i3geoCartoComboMedidasVariavel value=""/>', | ||
1992 | - i; | ||
1993 | - for(i=0;i<n;i++){ | ||
1994 | - ins += '<p class="paragrafo" >'+dados[i].titulo+'</p>'; | ||
1995 | - ins += '<div id="comboTemasMapa_'+dados[i].id_mapa_grupo+'"></div>'; | ||
1996 | - } | ||
1997 | - $i(onde).innerHTML = ins; | ||
1998 | - for(i=0;i<n;i++){ | ||
1999 | - i3GEOF.metaestat.publicador.comboTemas(dados[i].id_mapa_grupo,"comboTemasMapa_"+dados[i].id_mapa_grupo); | ||
2000 | - } | ||
2001 | - }; | ||
2002 | - i3GEO.php.listaGruposMapaMetaestat(grupos,i3GEOF.metaestat.publicador.IDMAPA); | ||
2003 | - }, | ||
2004 | - comboTemas: function(id_mapa_grupo,onde){ | ||
2005 | - temas = function(dados){ | ||
2006 | - var n = dados.length, | ||
2007 | - ins = '', | ||
2008 | - i; | ||
2009 | - | ||
2010 | - ins = "<select style='width:"+(i3GEOF.metaestat.LARGURA - 60)+"px' onchange='i3GEOF.metaestat.publicador.comboMedidaVariavelOnchange(this)'><option value=''>---</option>"; | ||
2011 | - for(i=0;i<n;i++){ | ||
2012 | - ins += "<option value='"+dados[i].id_mapa_tema+"'>"+dados[i].titulo+"</option>"; | ||
2013 | - } | ||
2014 | - ins += "</select>"; | ||
2015 | - ins += "<img class='ticPropriedades2' src='"+i3GEO.configura.locaplic+"/imagens/visual/default/branco.gif' style='height:14px;position:relative;cursor:pointer;left:5px;top:4px;' onclick='i3GEOF.metaestat.classes.inicia()' title='"+$trad(18,i3GEOF.metaestat.dicionario)+"'/>"; | ||
2016 | - ins += "<img class='ticDownload' src='"+i3GEO.configura.locaplic+"/imagens/visual/default/branco.gif' style='position:relative;cursor:pointer;left:8px;top:5px;' onclick='i3GEOF.metaestat.principal.downloadMedida()' title='"+$trad("a3")+"'/>"; | ||
2017 | - | ||
2018 | - $i(onde).innerHTML = ins; | ||
2019 | - }; | ||
2020 | - i3GEO.php.listaTemasMapaMetaestat(temas,id_mapa_grupo); | ||
2021 | - }, | ||
2022 | - comboMedidaVariavelOnchange: function(obj){ | ||
2023 | - //contorna o problema da funcao de definicao do titulo da camada tentar obter um objeto select | ||
2024 | - $i("i3geoCartoComboMedidasVariavel").value = obj.value; | ||
2025 | - $i("i3geoCartoComboMedidasVariavel").options = [{"label":""}]; | ||
2026 | - $i("i3geoCartoComboMedidasVariavel").selectedIndex = 0; | ||
2027 | - i3GEOF.metaestat.classes.zeraParametros(); | ||
2028 | - i3GEOF.metaestat.principal.comboMedidaVariavelOnchange(obj); | ||
2029 | - } | ||
2030 | - } | ||
2031 | -}; | ||
2032 | \ No newline at end of file | 0 | \ No newline at end of file |