Commit 0f9e85f2dedae9009d413f88318046f9102a62cc
1 parent
e65e32d2
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
99 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,99 @@ |
| 1 | +/* | |
| 2 | +About: Licença | |
| 3 | + | |
| 4 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 5 | + | |
| 6 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 7 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 8 | + | |
| 9 | +Este programa é software livre; você pode redistribuí-lo | |
| 10 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 11 | +GNU conforme publicada pela Free Software Foundation; | |
| 12 | +tanto a versão 2 da Licença. | |
| 13 | +Este programa é distribuído na expectativa de que seja útil, | |
| 14 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 15 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 16 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 17 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 18 | +GNU junto com este programa; se não, escreva para a | |
| 19 | +Free Software Foundation, Inc., no endereço | |
| 20 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 21 | +*/ | |
| 22 | +//inicializa | |
| 23 | +parametrosURL() | |
| 24 | +ins = "" | |
| 25 | +tema = "" | |
| 26 | +// | |
| 27 | +//detecta iframe id | |
| 28 | +// | |
| 29 | +/* | |
| 30 | +var frs = window.parent.document.getElementsByTagName("iframe") | |
| 31 | +var nframes = frs.length; | |
| 32 | + | |
| 33 | +for(f=0;f<nframes;f++){ | |
| 34 | + if(frs[f].src == window.location.href){ | |
| 35 | + alert(frs[f].parentNode.parentNode.id) | |
| 36 | + } | |
| 37 | +} | |
| 38 | +*/ | |
| 39 | +comboTemasSel("temasComSel",function(retorno){comboTemas = retorno.dados;t0()}) | |
| 40 | + | |
| 41 | + | |
| 42 | +function t0() | |
| 43 | +{ | |
| 44 | + ins = "<p>O entorno, ou buffer, é um polígono que circunda um elemento geográfico em uma distância fixa." | |
| 45 | + ins += "<p>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." | |
| 46 | + mostraOpcao("","t1()",ins,"t0") | |
| 47 | +} | |
| 48 | +function t1() | |
| 49 | +{ | |
| 50 | + ins = "Tema que será utilizado:<br><br>" | |
| 51 | + ins += comboTemas | |
| 52 | + mostraOpcao("t0()","t2()",ins,"t1") | |
| 53 | +} | |
| 54 | +function t2() | |
| 55 | +{ | |
| 56 | + ins = "Distância do entorno em metros" | |
| 57 | + ins += "<br><input onclick='javascript:this.select();' class=digitar id='d' type=text size=10 value='0'/><br><br>" | |
| 58 | + ins += "Considerar os elementos selecionados como se fossem um só?"; | |
| 59 | + ins += "<br><select id=unir ><option value=nao selected >não</option><option value=sim >sim</option></select>" | |
| 60 | + mostraOpcao("t1()","t3()",ins,"t2") | |
| 61 | +} | |
| 62 | +function t3() | |
| 63 | +{ | |
| 64 | + ins = "O tema com o entorno será adicionado ao mapa atual." | |
| 65 | + ins += "<br><br><div onclick='criarbuffer()' style='text-align:left;left:0px'><input id=botao1 size=18 class=executar type='buttom' value='Criar entorno' /></div>" | |
| 66 | + mostraOpcao("t2()","",ins,"t3") | |
| 67 | + YAHOO.example.init = function () | |
| 68 | + { | |
| 69 | + function onPushButtonsMarkupReady() | |
| 70 | + {new YAHOO.widget.Button("botao1");} | |
| 71 | + YAHOO.util.Event.onContentReady("botao1", onPushButtonsMarkupReady); | |
| 72 | + }() | |
| 73 | +} | |
| 74 | +function criarbuffer() | |
| 75 | +{ | |
| 76 | + $i("fim").innerHTML =""; | |
| 77 | + var distancia = $i("d").value | |
| 78 | + tema = $i("temasComSel").value | |
| 79 | + if (distancia*1 != 0) | |
| 80 | + { | |
| 81 | + aguarde("block") | |
| 82 | + var fim = function(retorno) | |
| 83 | + { | |
| 84 | + aguarde("none"); | |
| 85 | + if (retorno.data==undefined ) | |
| 86 | + {$i("fim").innerHTML = "Erro. A operação demorou muito.";} | |
| 87 | + else | |
| 88 | + {window.parent.i3GEO.atualiza("");} | |
| 89 | + } | |
| 90 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=criabuffer&tema="+tema+"&distancia="+distancia+"&unir="+$i("unir").value | |
| 91 | + var cp = new cpaint(); | |
| 92 | + //cp.set_debug(2); | |
| 93 | + cp.set_response_type("JSON"); | |
| 94 | + //cp.set_persistent_connection(true); | |
| 95 | + cp.call(p,"criaBuffer",fim); | |
| 96 | + } | |
| 97 | + else | |
| 98 | + {alert("Distancia invalida")} | |
| 99 | +} | ... | ... |