Commit 8b4de5fa78db758112f8d8617623c0646684c23a
1 parent
0c26a84a
Exists in
master
and in
7 other branches
Inclusão da opção para geração de cartograma no GoogleEarth para o sistema metaestat
Showing
4 changed files
with
47 additions
and
8 deletions
Show diff stats
admin/admin.db
No preview for this file type
ferramentas/metaestat/analise.php
@@ -74,6 +74,9 @@ switch (strtoupper($funcao)){ | @@ -74,6 +74,9 @@ switch (strtoupper($funcao)){ | ||
74 | break; | 74 | break; |
75 | case "LISTAFILTROTEMPO": | 75 | case "LISTAFILTROTEMPO": |
76 | $retorno = listaFiltroTempoRaiz($map_file,$nivel); | 76 | $retorno = listaFiltroTempoRaiz($map_file,$nivel); |
77 | + break; | ||
78 | + case "PEGADADOSTME": | ||
79 | + $retorno = pegaDadosTME($map_file,$tema); | ||
77 | break; | 80 | break; |
78 | } | 81 | } |
79 | if (!connection_aborted()){ | 82 | if (!connection_aborted()){ |
@@ -81,6 +84,21 @@ if (!connection_aborted()){ | @@ -81,6 +84,21 @@ if (!connection_aborted()){ | ||
81 | } | 84 | } |
82 | else | 85 | else |
83 | {exit();} | 86 | {exit();} |
87 | +function pegaDadosTME($map_file,$tema){ | ||
88 | + $retorno = array("itemNomeRegioes"=>"","itemDados"=>""); | ||
89 | + $mapa = ms_newMapObj($map_file); | ||
90 | + $layer = $mapa->getlayerbyname($tema); | ||
91 | + $id_medida_variavel = $layer->getmetadata("ID_MEDIDA_VARIAVEL"); | ||
92 | + $m = new Metaestat(); | ||
93 | + | ||
94 | + if($id_medida_variavel != ""){ | ||
95 | + $variavel = $m->listaMedidaVariavel("",$id_medida_variavel); | ||
96 | + $codigo_tipo_regiao = $variavel["codigo_tipo_regiao"]; | ||
97 | + $regioes = $m->listaTipoRegiao($codigo_tipo_regiao); | ||
98 | + $retorno = array("itemNomeRegioes"=>$regioes["colunanomeregiao"],"itemDados"=>$variavel["colunavalor"]); | ||
99 | + } | ||
100 | + return $retorno; | ||
101 | +} | ||
84 | function listaFiltroTempoRaiz($map_file,$nivel){ | 102 | function listaFiltroTempoRaiz($map_file,$nivel){ |
85 | $mapa = ms_newMapObj($map_file); | 103 | $mapa = ms_newMapObj($map_file); |
86 | $layers = analise_listaLayersMetaestat($mapa); | 104 | $layers = analise_listaLayersMetaestat($mapa); |
ferramentas/metaestat/index.js
@@ -126,15 +126,32 @@ i3GEOF.metaestat = { | @@ -126,15 +126,32 @@ i3GEOF.metaestat = { | ||
126 | ' <button title="Alterar legenda" onclick="i3GEOF.metaestat.analise.alteraLegenda()"><img src="'+i3GEO.configura.locaplic+'/imagens/gisicons/calculator.png" /></button>' + | 126 | ' <button title="Alterar legenda" onclick="i3GEOF.metaestat.analise.alteraLegenda()"><img src="'+i3GEO.configura.locaplic+'/imagens/gisicons/calculator.png" /></button>' + |
127 | ' <button title="Alterar cores" onclick="i3GEOF.metaestat.analise.alteraCores()"><img src="'+i3GEO.configura.locaplic+'/imagens/gisicons/24-to-8-bits.png" /></button>' + | 127 | ' <button title="Alterar cores" onclick="i3GEOF.metaestat.analise.alteraCores()"><img src="'+i3GEO.configura.locaplic+'/imagens/gisicons/24-to-8-bits.png" /></button>' + |
128 | ' <button title="'+$trad("t42")+'" onclick="i3GEO.tema.dialogo.cortina()"><img src="'+i3GEO.configura.locaplic+'/imagens/gisicons/mapset.png" /></button>' + | 128 | ' <button title="'+$trad("t42")+'" onclick="i3GEO.tema.dialogo.cortina()"><img src="'+i3GEO.configura.locaplic+'/imagens/gisicons/mapset.png" /></button>' + |
129 | - ' <button title="'+$trad("t49")+'" onclick="i3GEOF.metaestat.analise.ativaTme()()"><img src="'+i3GEO.configura.locaplic+'/imagens/gisicons/3d-light.png" /></button>' + | 129 | + ' <button title="'+$trad("t49")+'" onclick="i3GEOF.metaestat.analise.ativaTme()"><img src="'+i3GEO.configura.locaplic+'/imagens/gisicons/3d-light.png" /></button>' + |
130 | '</div>' + | 130 | '</div>' + |
131 | '<input type=hidden value="" id="listaColourRampAnaliseMetaestat" onchange="i3GEOF.metaestat.analise.aplicaColourRamp()" />'; //utilizado pelo seletor de colourramp | 131 | '<input type=hidden value="" id="listaColourRampAnaliseMetaestat" onchange="i3GEOF.metaestat.analise.aplicaColourRamp()" />'; //utilizado pelo seletor de colourramp |
132 | return ins; | 132 | return ins; |
133 | }, | 133 | }, |
134 | ativaTme: function(){ | 134 | ativaTme: function(){ |
135 | - i3GEO.tema.dialogo.tme(); | 135 | + if(i3GEO.temaAtivo != ""){ |
136 | + //faz a carga do javascript e depois executa abreTme para definir os parametros | ||
137 | + i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.tme()","tme","tme","index.js","i3GEOF.metaestat.analise.abreTme()"); | ||
138 | + } | ||
139 | + else{ | ||
140 | + i3GEO.tema.dialogo.tme(); | ||
141 | + } | ||
142 | + }, | ||
143 | + abreTme: function(){ | ||
136 | //i3GEOF.tme.ITEMNOMEREGIOES | 144 | //i3GEOF.tme.ITEMNOMEREGIOES |
137 | - | 145 | + var p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?g_sid="+i3GEO.configura.sid + |
146 | + "&funcao=pegaDadosTME&tema="+i3GEO.temaAtivo, | ||
147 | + temp = function(retorno){ | ||
148 | + i3GEO.janela.fechaAguarde("aguardeBuscaDados"); | ||
149 | + i3GEOF.tme.ITEMNOMEREGIOES = retorno.data.itemNomeRegioes; | ||
150 | + i3GEOF.tme.ITEMDADOS = retorno.data.itemDados; | ||
151 | + i3GEOF.tme.iniciaJanelaFlutuante(); | ||
152 | + }; | ||
153 | + i3GEO.janela.abreAguarde("aguardeBuscaDados","Aguarde..."); | ||
154 | + i3GEO.util.ajaxGet(p,temp); | ||
138 | }, | 155 | }, |
139 | ativaAnimacao: function(){ | 156 | ativaAnimacao: function(){ |
140 | i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.animacao()","animacao","animacao","index.js","i3GEOF.metaestat.analise.listaCamadasAnimacao()"); | 157 | i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.animacao()","animacao","animacao","index.js","i3GEOF.metaestat.analise.listaCamadasAnimacao()"); |
@@ -187,7 +204,7 @@ i3GEOF.metaestat = { | @@ -187,7 +204,7 @@ i3GEOF.metaestat = { | ||
187 | "&tema="+i3GEO.temaAtivo + | 204 | "&tema="+i3GEO.temaAtivo + |
188 | "&cores=" + cores; | 205 | "&cores=" + cores; |
189 | i3GEO.janela.AGUARDEMODAL = true; | 206 | i3GEO.janela.AGUARDEMODAL = true; |
190 | - i3GEO.janela.abreAguarde("Aplicando...","aguardeAplicaCores"); | 207 | + i3GEO.janela.abreAguarde("aguardeAplicaCores","Aplicando..."); |
191 | i3GEO.janela.AGUARDEMODAL = false; | 208 | i3GEO.janela.AGUARDEMODAL = false; |
192 | i3GEO.util.ajaxGet(p,temp); | 209 | i3GEO.util.ajaxGet(p,temp); |
193 | } | 210 | } |
ferramentas/tme/index.js
@@ -42,9 +42,12 @@ if(typeof(i3GEOF) === 'undefined'){ | @@ -42,9 +42,12 @@ if(typeof(i3GEOF) === 'undefined'){ | ||
42 | Classe: i3GEOF.tme | 42 | Classe: i3GEOF.tme |
43 | */ | 43 | */ |
44 | i3GEOF.tme = { | 44 | i3GEOF.tme = { |
45 | - //oopcional - nome do item da tabela de atributos que contem os nomes dos elementos | 45 | + //opcional - nome do item da tabela de atributos que contem os nomes dos elementos |
46 | //utilizado para definir o valor do combo i3GEOTMEregioes | 46 | //utilizado para definir o valor do combo i3GEOTMEregioes |
47 | ITEMNOMEREGIOES: "", | 47 | ITEMNOMEREGIOES: "", |
48 | + //opcional - nome do item da tabela de atributos que contem os dados dos elementos | ||
49 | + //utilizado para definir item que iniciará marcado na lista de itens que indica a coluna que contem os dados | ||
50 | + ITEMDADOS: "", | ||
48 | /* | 51 | /* |
49 | Variavel: tema | 52 | Variavel: tema |
50 | 53 | ||
@@ -146,7 +149,7 @@ i3GEOF.tme = { | @@ -146,7 +149,7 @@ i3GEOF.tme = { | ||
146 | '<br><br>Coluna que contém os nomes das regiões (exemplo: nomes dos Estados ou nomes dos municípios):' + | 149 | '<br><br>Coluna que contém os nomes das regiões (exemplo: nomes dos Estados ou nomes dos municípios):' + |
147 | '<div id="i3GEOTMEregioeslista" style="text-align:left;" ></div>' + | 150 | '<div id="i3GEOTMEregioeslista" style="text-align:left;" ></div>' + |
148 | '<p class="paragrafo" >' + | 151 | '<p class="paragrafo" >' + |
149 | - '<br>Escolha uma ou mais colunas que contém os dados estatísticos que serão representados:' + | 152 | + '<br>Escolha uma ou mais colunas com os dados estatísticos que serão representados:' + |
150 | '<div id=i3GEOtmelistai class=digitar style="text-align:left;left:0px;top:0px;330px;height:80px;overflow:auto;display:block;"></div>' + | 153 | '<div id=i3GEOtmelistai class=digitar style="text-align:left;left:0px;top:0px;330px;height:80px;overflow:auto;display:block;"></div>' + |
151 | '<br>' + | 154 | '<br>' + |
152 | '<input id=i3GEOtmebotao1 size=35 type=button value="Aplicar" />' + | 155 | '<input id=i3GEOtmebotao1 size=35 type=button value="Aplicar" />' + |
@@ -212,8 +215,6 @@ i3GEOF.tme = { | @@ -212,8 +215,6 @@ i3GEOF.tme = { | ||
212 | Monta a lista de itens que poderão ser escolhidos para compor o mapa. | 215 | Monta a lista de itens que poderão ser escolhidos para compor o mapa. |
213 | 216 | ||
214 | A lista é inserida no elemento html com id "i3GEOtmelistai" | 217 | A lista é inserida no elemento html com id "i3GEOtmelistai" |
215 | - | ||
216 | - TODO marcar os itens existentes | ||
217 | */ | 218 | */ |
218 | montaListaItens: function(retorno){ | 219 | montaListaItens: function(retorno){ |
219 | var ins,i,n,item; | 220 | var ins,i,n,item; |
@@ -228,6 +229,9 @@ i3GEOF.tme = { | @@ -228,6 +229,9 @@ i3GEOF.tme = { | ||
228 | } | 229 | } |
229 | $i("i3GEOtmelistai").innerHTML = ins.join(""); | 230 | $i("i3GEOtmelistai").innerHTML = ins.join(""); |
230 | ins.push("</table>"); | 231 | ins.push("</table>"); |
232 | + if(i3GEOF.tme.ITEMDADOS != "" && $i("i3GEOtme"+i3GEOF.tme.ITEMDADOS)){ | ||
233 | + $i("i3GEOtme"+i3GEOF.tme.ITEMDADOS).checked = true; | ||
234 | + } | ||
231 | } | 235 | } |
232 | catch(e) | 236 | catch(e) |
233 | {$i("i3GEOtmelistai").innerHTML = "<p style=color:red >Ocorreu um erro<br>"+e;} | 237 | {$i("i3GEOtmelistai").innerHTML = "<p style=color:red >Ocorreu um erro<br>"+e;} |