Commit 85ac8255a517e17c9f5b17a09155836e4ce2262b
1 parent
5ba61dcf
Exists in
master
and in
7 other branches
Inclusao da ferramenta heatmap
Showing
4 changed files
with
379 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,58 @@ |
| 1 | +//+$trad(1,i3GEOF.buffer.dicionario)+ | |
| 2 | +i3GEOF.buffer.dicionario = { | |
| 3 | +1: [{ | |
| 4 | +pt:"O entorno, ou buffer, é um polígono que circunda um elemento geográfico em uma distância fixa.", | |
| 5 | +en:"", | |
| 6 | +es:"" | |
| 7 | +}], | |
| 8 | +2: [{ | |
| 9 | +pt:"Para gerar o entorno, você precisa selecionar alguns elementos de um tema. Utilize para isso a opção de seleção ou a tabela de atributos do tema desejado.", | |
| 10 | +en:"", | |
| 11 | +es:"" | |
| 12 | +}], | |
| 13 | +3: [{ | |
| 14 | +pt:"Tema, com seleção, que será utilizado", | |
| 15 | +en:"", | |
| 16 | +es:"" | |
| 17 | +}], | |
| 18 | +4: [{ | |
| 19 | +pt:"Distância do entorno em metros:", | |
| 20 | +en:"", | |
| 21 | +es:"" | |
| 22 | +}], | |
| 23 | +5: [{ | |
| 24 | +pt:"Considerar os elementos selecionados como se fossem um só?", | |
| 25 | +en:"", | |
| 26 | +es:"" | |
| 27 | +}], | |
| 28 | +6: [{ | |
| 29 | +pt:"O tema com o entorno será adicionado ao mapa atual", | |
| 30 | +en:"", | |
| 31 | +es:"" | |
| 32 | +}], | |
| 33 | +7: [{ | |
| 34 | +pt:"Criar entorno", | |
| 35 | +en:"", | |
| 36 | +es:"" | |
| 37 | +}], | |
| 38 | +8: [{ | |
| 39 | +pt:"Erro. A operação demorou muito", | |
| 40 | +en:"", | |
| 41 | +es:"" | |
| 42 | +}], | |
| 43 | +9: [{ | |
| 44 | +pt:"Distancia invalida", | |
| 45 | +en:"", | |
| 46 | +es:"" | |
| 47 | +}], | |
| 48 | +10: [{ | |
| 49 | +pt:"Ou um item da tabela de atributos que contém as distâncias:", | |
| 50 | +en:"", | |
| 51 | +es:"" | |
| 52 | +}], | |
| 53 | +11: [{ | |
| 54 | +pt:"Multiplicar por:", | |
| 55 | +en:"", | |
| 56 | +es:"" | |
| 57 | +}] | |
| 58 | +}; | |
| 0 | 59 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | +<?php | |
| 2 | +include_once(dirname(__FILE__)."/../inicia.php"); | |
| 3 | +// | |
| 4 | +//faz a busca da função que deve ser executada | |
| 5 | +// | |
| 6 | +$retorno = ""; //string que será retornada ao browser via JSON | |
| 7 | +switch (strtoupper($funcao)) | |
| 8 | +{ | |
| 9 | +/* | |
| 10 | +Valor: CRIABUFFER | |
| 11 | + | |
| 12 | +Gera entorno (buffer) nos elementos selecionados de um tema. | |
| 13 | + | |
| 14 | +Salva o mapa acrescentando um novo layer com o buffer. | |
| 15 | + | |
| 16 | +<Analise->criaBuffer> | |
| 17 | +*/ | |
| 18 | + case "CRIABUFFER": | |
| 19 | + include_once(dirname(__FILE__)."/../../classesphp/classe_analise.php"); | |
| 20 | + copiaSeguranca($map_file); | |
| 21 | + $m = new Analise($map_file,$tema,$locaplic,$ext); | |
| 22 | + $retorno = $m->criaBuffer($distancia,$locaplic,$unir,$wkt,$multiplicar,$itemdistancia); | |
| 23 | + $m->salva(); | |
| 24 | + $_SESSION["contadorsalva"]++; | |
| 25 | + //limpa selecao | |
| 26 | + $qyfile = str_replace(".map",".qy",$map_file); | |
| 27 | + if (file_exists($qyfile)) | |
| 28 | + {unlink ($qyfile);} | |
| 29 | + break; | |
| 30 | +} | |
| 31 | +if (!connection_aborted()){ | |
| 32 | + if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
| 33 | + restauraCon($map_file,$postgis_mapa); | |
| 34 | + cpjson($retorno); | |
| 35 | +} | |
| 36 | +else | |
| 37 | +{exit();} | |
| 38 | +?> | |
| 0 | 39 | \ No newline at end of file | ... | ... |
6.46 KB
| ... | ... | @@ -0,0 +1,283 @@ |
| 1 | + | |
| 2 | +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ | |
| 3 | + | |
| 4 | +/* | |
| 5 | +Title: Buffer | |
| 6 | + | |
| 7 | +Realiza o cálculo de "buffer" (região de entorno) dos elementos selecionados de um tema e adiciona uma nova | |
| 8 | +camada ao mapa. | |
| 9 | +Utiliza a função buffer do Mapserver. | |
| 10 | + | |
| 11 | +Veja: | |
| 12 | + | |
| 13 | +<i3GEO.analise.dialogo.buffer> | |
| 14 | + | |
| 15 | +Arquivo: | |
| 16 | + | |
| 17 | +i3geo/ferramentas/buffer/index.js.php | |
| 18 | + | |
| 19 | +Licenca: | |
| 20 | + | |
| 21 | +GPL2 | |
| 22 | + | |
| 23 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 24 | + | |
| 25 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 26 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | |
| 27 | + | |
| 28 | +Este programa é software livre; você pode redistribuí-lo | |
| 29 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 30 | +GNU conforme publicada pela Free Software Foundation; | |
| 31 | + | |
| 32 | +Este programa é distribuído na expectativa de que seja útil, | |
| 33 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 34 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 35 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 36 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 37 | +GNU junto com este programa; se não, escreva para a | |
| 38 | +Free Software Foundation, Inc., no endereço | |
| 39 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 40 | +*/ | |
| 41 | +if(typeof(i3GEOF) === 'undefined'){ | |
| 42 | + var i3GEOF = {}; | |
| 43 | +} | |
| 44 | +/* | |
| 45 | +Class: i3GEOF.buffer | |
| 46 | +*/ | |
| 47 | +i3GEOF.buffer = { | |
| 48 | + /* | |
| 49 | + Variavel: aguarde | |
| 50 | + | |
| 51 | + Objeto DOM com a imagem de aguarde existente no cabeçalho da janela. | |
| 52 | + */ | |
| 53 | + aguarde: "", | |
| 54 | + /* | |
| 55 | + Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | |
| 56 | + */ | |
| 57 | + criaJanelaFlutuante: function(){ | |
| 58 | + i3GEOF.buffer.iniciaDicionario(); | |
| 59 | + }, | |
| 60 | + /* | |
| 61 | + Function: iniciaDicionario | |
| 62 | + | |
| 63 | + Carrega o dicionário e chama a função que inicia a ferramenta | |
| 64 | + | |
| 65 | + O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | |
| 66 | + */ | |
| 67 | + iniciaDicionario: function(){ | |
| 68 | + if(typeof(i3GEOF.buffer.dicionario) === 'undefined'){ | |
| 69 | + i3GEO.util.scriptTag( | |
| 70 | + i3GEO.configura.locaplic+"/ferramentas/buffer/dicionario.js", | |
| 71 | + "i3GEOF.buffer.iniciaJanelaFlutuante()", | |
| 72 | + "i3GEOF.buffer.dicionario_script" | |
| 73 | + ); | |
| 74 | + } | |
| 75 | + else{ | |
| 76 | + i3GEOF.buffer.iniciaJanelaFlutuante(); | |
| 77 | + } | |
| 78 | + }, | |
| 79 | + /* | |
| 80 | + Function: inicia | |
| 81 | + | |
| 82 | + Inicia a ferramenta. É chamado por criaJanelaFlutuante | |
| 83 | + | |
| 84 | + Parametro: | |
| 85 | + | |
| 86 | + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | |
| 87 | + */ | |
| 88 | + inicia: function(iddiv){ | |
| 89 | + try{ | |
| 90 | + $i(iddiv).innerHTML += i3GEOF.buffer.html(); | |
| 91 | + i3GEOF.buffer.t0(); | |
| 92 | + } | |
| 93 | + catch(erro){i3GEO.janela.tempoMsg(erro);} | |
| 94 | + }, | |
| 95 | + /* | |
| 96 | + Function: html | |
| 97 | + | |
| 98 | + Gera o código html para apresentação das opções da ferramenta | |
| 99 | + | |
| 100 | + Retorno: | |
| 101 | + | |
| 102 | + String com o código html | |
| 103 | + */ | |
| 104 | + html:function(){ | |
| 105 | + var ins = ''; | |
| 106 | + ins += '<div style="background-color:#F2F2F2;top:0px;left:0px;display:block;width:98%;" id="i3GEObufferresultado" >'; | |
| 107 | + ins += '</div>'; | |
| 108 | + ins += '<div style="top:10px;left:0px;display:block;width:98%;color:red" id="i3GEObufferfim" >'; | |
| 109 | + ins += '</div>'; | |
| 110 | + return ins; | |
| 111 | + }, | |
| 112 | + /* | |
| 113 | + Function: iniciaJanelaFlutuante | |
| 114 | + | |
| 115 | + Cria a janela flutuante para controle da ferramenta. | |
| 116 | + */ | |
| 117 | + iniciaJanelaFlutuante: function(){ | |
| 118 | + var janela,divid,temp,titulo; | |
| 119 | + //cria a janela flutuante | |
| 120 | + titulo = $trad("u10")+" <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=24' > </a>"; | |
| 121 | + cabecalho = function(){}; | |
| 122 | + janela = i3GEO.janela.cria( | |
| 123 | + "400px", | |
| 124 | + "200px", | |
| 125 | + "", | |
| 126 | + "", | |
| 127 | + "", | |
| 128 | + titulo, | |
| 129 | + "i3GEOF.buffer", | |
| 130 | + false, | |
| 131 | + "hd", | |
| 132 | + function(){}, | |
| 133 | + function(){ | |
| 134 | + i3GEO.janela.minimiza("i3GEOF.buffer"); | |
| 135 | + }, | |
| 136 | + "", | |
| 137 | + false, | |
| 138 | + i3GEO.configura.locaplic+"/imagens/oxygen/16x16/accessories-calculator.png" | |
| 139 | + ); | |
| 140 | + divid = janela[2].id; | |
| 141 | + janela[0].setFooter("<div id=i3GEOF.buffer_rodape style=background-color:#F2F2F2; ></div>"); | |
| 142 | + i3GEOF.buffer.aguarde = $i("i3GEOF.buffer_imagemCabecalho").style; | |
| 143 | + i3GEOF.buffer.inicia(divid); | |
| 144 | + temp = function(){ | |
| 145 | + //i3GEO.janela.tempoMsg("oi"); | |
| 146 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.buffer.t0()") > 0) | |
| 147 | + {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.buffer.t0()");} | |
| 148 | + }; | |
| 149 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
| 150 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.buffer.t0()") < 0) | |
| 151 | + {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEOF.buffer.t0()");} | |
| 152 | + }, | |
| 153 | + t0: function() | |
| 154 | + { | |
| 155 | + var ins = "<img class=i3GeoExemploImg src='"+i3GEO.configura.locaplic+"/ferramentas/buffer/exemplo.png' />" + | |
| 156 | + "<p class='paragrafo' >"+$trad(1,i3GEOF.buffer.dicionario) + | |
| 157 | + "<p class='paragrafo' >"+$trad(2,i3GEOF.buffer.dicionario); | |
| 158 | + i3GEO.util.proximoAnterior("","i3GEOF.buffer.t1()",ins,"i3GEOFgradeDePontost0","i3GEObufferresultado",true,"i3GEOF.buffer_rodape"); | |
| 159 | + }, | |
| 160 | + t1: function(){ | |
| 161 | + var ins = "<p class='paragrafo'>"+$trad(3,i3GEOF.buffer.dicionario)+":"; | |
| 162 | + ins += "<div id='i3GEObufferSelTemas' style='text-align:left;font-size:11px'></div>"; | |
| 163 | + i3GEO.util.proximoAnterior("i3GEOF.buffer.t0()","i3GEOF.buffer.t2()",ins,"i3GEOF.buffer.t1","i3GEObufferresultado",true,"i3GEOF.buffer_rodape"); | |
| 164 | + i3GEOF.buffer.comboTemasSel(); | |
| 165 | + }, | |
| 166 | + t2: function(){ | |
| 167 | + var ins = "<p class='paragrafo'>"+$trad(4,i3GEOF.buffer.dicionario); | |
| 168 | + ins += "<br></p><input onclick='javascript:this.select();' class=digitar id='i3GEObufferd' type=text size=10 value='0'/>"; | |
| 169 | + | |
| 170 | + ins += "<br><br><p class='paragrafo' >"+$trad(10,i3GEOF.buffer.dicionario); | |
| 171 | + ins += "<br></p><div id=i3GEObufferondeItens style='text-align:left;display:block' ></div> "; | |
| 172 | + | |
| 173 | + ins += "<br><p class='paragrafo'>"+$trad(5,i3GEOF.buffer.dicionario); | |
| 174 | + ins += "<br></p><select id=i3GEObufferunir ><option value=nao selected >"+$trad("x15")+"</option><option value=sim >"+$trad("x14")+"</option></select>"; | |
| 175 | + i3GEO.util.proximoAnterior("i3GEOF.buffer.t1()","i3GEOF.buffer.t3()",ins,"i3GEOF.buffer.t2","i3GEObufferresultado",true,"i3GEOF.buffer_rodape"); | |
| 176 | + i3GEOF.buffer.comboItens(); | |
| 177 | + }, | |
| 178 | + t3: function(){ | |
| 179 | + var ins = "<p class='paragrafo'>"+$trad(6,i3GEOF.buffer.dicionario); | |
| 180 | + ins += "<br><br><input id=i3GEObufferbotao1 type='button' value='"+$trad(7,i3GEOF.buffer.dicionario)+"' />"; | |
| 181 | + i3GEO.util.proximoAnterior("i3GEOF.buffer.t2()","",ins,"i3GEOF.buffer.t3","i3GEObufferresultado",true,"i3GEOF.buffer_rodape"); | |
| 182 | + new YAHOO.widget.Button( | |
| 183 | + "i3GEObufferbotao1", | |
| 184 | + {onclick:{fn: i3GEOF.buffer.criaBuffer}} | |
| 185 | + ); | |
| 186 | + }, | |
| 187 | + /* | |
| 188 | + Function: criaBuffer | |
| 189 | + | |
| 190 | + Executa a operação de geração do buffer | |
| 191 | + | |
| 192 | + Veja: | |
| 193 | + | |
| 194 | + <CRIABUFFER> | |
| 195 | + */ | |
| 196 | + criaBuffer: function(){ | |
| 197 | + try{ | |
| 198 | + if(i3GEOF.buffer.aguarde.visibility === "visible") | |
| 199 | + {return;} | |
| 200 | + var distancia = $i("i3GEObufferd").value, | |
| 201 | + tema = $i("i3GEObuffertemasComSel").value, | |
| 202 | + multiplicar = $i("i3GEObufferdfator").value*1, | |
| 203 | + itemdistancia = $i("i3GEObuffertemasItem").value, | |
| 204 | + p, | |
| 205 | + fim, | |
| 206 | + cp; | |
| 207 | + if (distancia*1 !== 0 || itemdistancia != ""){ | |
| 208 | + i3GEOF.buffer.aguarde.visibility = "visible"; | |
| 209 | + fim = function(retorno){ | |
| 210 | + i3GEOF.buffer.aguarde.visibility = "hidden"; | |
| 211 | + if (retorno.data === undefined ) | |
| 212 | + {$i("i3GEObufferfim").innerHTML = $trad(8,i3GEOF.buffer.dicionario);} | |
| 213 | + else | |
| 214 | + {i3GEO.atualiza();} | |
| 215 | + }; | |
| 216 | + p = i3GEO.configura.locaplic+"/ferramentas/buffer/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=criabuffer&tema="+tema+"&unir="+$i("i3GEObufferunir").value; | |
| 217 | + if(itemdistancia != ""){ | |
| 218 | + p += "&distancia=0&itemdistancia="+itemdistancia+"&multiplicar="+multiplicar; | |
| 219 | + }else{ | |
| 220 | + p += "&distancia=" + distancia*1 + "&itemdistancia=&multiplicar=1"; | |
| 221 | + } | |
| 222 | + cp = new cpaint(); | |
| 223 | + cp.set_response_type("JSON"); | |
| 224 | + cp.call(p,"criaBuffer",fim); | |
| 225 | + } | |
| 226 | + else | |
| 227 | + {i3GEO.janela.tempoMsg($trad(9,i3GEOF.buffer.dicionario));} | |
| 228 | + } | |
| 229 | + catch(e){$i("i3GEObufferfim").innerHTML = "<p class='paragrafo' >Erro. "+e;i3GEO.janela.fechaAguarde();i3GEOF.buffer.aguarde.visibility = "hidden";} | |
| 230 | + }, | |
| 231 | + /* | |
| 232 | + Function: comboTemasSel | |
| 233 | + | |
| 234 | + Cria um combo com a lista de temas com elementos selecionados | |
| 235 | + | |
| 236 | + Veja: | |
| 237 | + | |
| 238 | + <i3GEO.util.comboTemas> | |
| 239 | + */ | |
| 240 | + comboTemasSel: function(){ | |
| 241 | + i3GEO.util.comboTemas( | |
| 242 | + "i3GEObuffertemasComSel", | |
| 243 | + function(retorno){ | |
| 244 | + $i("i3GEObufferSelTemas").innerHTML = retorno.dados; | |
| 245 | + $i("i3GEObufferSelTemas").style.display = "block"; | |
| 246 | + if ($i("i3GEObuffertemasComSel")){ | |
| 247 | + $i("i3GEObuffertemasComSel").onchange = function(){ | |
| 248 | + i3GEO.mapa.ativaTema($i("i3GEObuffertemasComSel").value); | |
| 249 | + }; | |
| 250 | + } | |
| 251 | + if(i3GEO.temaAtivo !== ""){ | |
| 252 | + $i("i3GEObuffertemasComSel").value = i3GEO.temaAtivo; | |
| 253 | + $i("i3GEObuffertemasComSel").onchange.call(); | |
| 254 | + } | |
| 255 | + }, | |
| 256 | + "i3GEObufferSelTemas", | |
| 257 | + "", | |
| 258 | + false, | |
| 259 | + "selecionados" | |
| 260 | + ); | |
| 261 | + }, | |
| 262 | + /* | |
| 263 | + Function: comboItens | |
| 264 | + | |
| 265 | + Cria um combo para escolha de um item do tema | |
| 266 | + | |
| 267 | + Veja: | |
| 268 | + | |
| 269 | + <i3GEO.util.comboItens> | |
| 270 | + | |
| 271 | + */ | |
| 272 | + comboItens: function(){ | |
| 273 | + i3GEO.util.comboItens( | |
| 274 | + "i3GEObuffertemasItem", | |
| 275 | + $i("i3GEObuffertemasComSel").value, | |
| 276 | + function(retorno){ | |
| 277 | + $i("i3GEObufferondeItens").innerHTML = retorno.dados + " " + $trad(11,i3GEOF.buffer.dicionario)+" <input onclick='javascript:this.select();' class=digitar id='i3GEObufferdfator' type=text size=10 value='1'/>"; | |
| 278 | + $i("i3GEObufferondeItens").style.display = "block"; | |
| 279 | + }, | |
| 280 | + "i3GEObufferondeItens" | |
| 281 | + ); | |
| 282 | + } | |
| 283 | +}; | |
| 0 | 284 | \ No newline at end of file | ... | ... |