Commit 9c4f59c437996ad58a5e2b48dc5869bab6aed66d

Authored by Edmar Moretti
1 parent 33e4ac6f

--no commit message

ferramentas/mostraexten/exemplo.htm 0 → 100644
... ... @@ -0,0 +1,24 @@
  1 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +<script type="text/javascript" src="../../classesjs/i3geo.js"></script>
  5 +</head>
  6 +<body name="ancora" id="i3geo" class=yui-skin-sam >
  7 +<script type="text/javascript">
  8 +i3GEO.configura.locaplic = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";
  9 +var g_localimg = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo/imagens";
  10 +var l = i3GEO.barraDeBotoes.LISTABOTOES;
  11 +var b = l.length-1;
  12 +do{
  13 + if (l[b].iddiv == "exten"){
  14 + if(l[b].conteudo)
  15 + {eval('$i("teste").innerHTML = "'+l[b].conteudo+'"');}
  16 + if(l[b].funcaoonclick){
  17 + l[b].funcaoonclick.call();
  18 + }
  19 + }
  20 +}
  21 +while (b--);
  22 +</script>
  23 +</body>
  24 +</html>
0 25 \ No newline at end of file
... ...
ferramentas/mostraexten/index.js.php 0 → 100644
... ... @@ -0,0 +1,175 @@
  1 +<?php if(extension_loaded('zlib')){ob_start('ob_gzhandler');} header("Content-type: text/javascript"); ?>
  2 +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */
  3 +
  4 +/*
  5 +About: Licença
  6 +
  7 +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
  8 +
  9 +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
  10 +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br
  11 +
  12 +Este programa é software livre; você pode redistribuí-lo
  13 +e/ou modificá-lo sob os termos da Licença Pública Geral
  14 +GNU conforme publicada pela Free Software Foundation;
  15 +tanto a versão 2 da Licença.
  16 +Este programa é distribuído na expectativa de que seja útil,
  17 +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita
  18 +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA.
  19 +Consulte a Licença Pública Geral do GNU para mais detalhes.
  20 +Você deve ter recebido uma cópia da Licença Pública Geral do
  21 +GNU junto com este programa; se não, escreva para a
  22 +Free Software Foundation, Inc., no endereço
  23 +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  24 +*/
  25 +if(typeof(i3GEOF) === 'undefined'){
  26 + i3GEOF = [];
  27 +}
  28 +/*
  29 +Class: i3GEOF.mostraExten
  30 +
  31 +Mostra a extensão geográfica atual do mapa
  32 +*/
  33 +i3GEOF.mostraExten = {
  34 + /*
  35 + Variavel: aguarde
  36 +
  37 + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela.
  38 + */
  39 + aguarde: "",
  40 + /*
  41 + Function: inicia
  42 +
  43 + Inicia a ferramenta. É chamado por criaJanelaFlutuante
  44 +
  45 + Parametro:
  46 +
  47 + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta
  48 + */
  49 + inicia: function(iddiv){
  50 + try{
  51 + $i(iddiv).innerHTML += i3GEOF.mostraExten.html();
  52 + new YAHOO.widget.Button(
  53 + "i3GEOmostraExtenbotao1",
  54 + {onclick:{fn: i3GEOF.mostraExten.executa}}
  55 + );
  56 + i3GEOF.mostraExten.ativaFoco();
  57 + }
  58 + catch(erro){alert(erro);}
  59 + },
  60 + /*
  61 + Function: html
  62 +
  63 + Gera o código html para apresentação das opções da ferramenta
  64 +
  65 + Retorno:
  66 +
  67 + String com o código html
  68 + */
  69 + html:function(){
  70 + var ins = '<p class="paragrafo" >Extens&atilde;o geográfica atual, em d&eacute;cimos de grau. As coordenadas correspondem a menor longitude, menor latitude, maior longitude e maior latitude:</p>' +
  71 + '<textarea id=i3GEOmostraExtenatual rows=3 cols=50 onclick="javascript:this.select();"></textarea>' +
  72 + '<p class="paragrafo" > Digite as coordenadas referentes a nova extensão geográfica desejada para o mapa. Utilize coordenadas (graus) negativos para indicar a longitude como oeste e latitude como sul:</p>' +
  73 + ' <table class=lista3 >' +
  74 + ' <tr><td>Menor longitude (oeste):</td>' +
  75 + ' <td>' +
  76 + $inputText("","","i3GEOmostraExtenxg","",3,"-00") +
  77 + $inputText("","","i3GEOmostraExtenxm","",3,"00") +
  78 + $inputText("","","i3GEOmostraExtenxs","",3,"0.0") +
  79 + ' </td></tr>' +
  80 + ' <tr><td>Menor latitude (sul):</td>' +
  81 + ' <td>' +
  82 + $inputText("","","i3GEOmostraExtenyg","",3,"-00") +
  83 + $inputText("","","i3GEOmostraExtenym","",3,"00") +
  84 + $inputText("","","i3GEOmostraExtenys","",3,"0.0") +
  85 + ' </td></tr>' +
  86 + ' <tr><td>Maior longitude (leste):</td>' +
  87 + ' <td>' +
  88 + $inputText("","","i3GEOmostraExtenxxg","",3,"-00") +
  89 + $inputText("","","i3GEOmostraExtenxxm","",3,"00") +
  90 + $inputText("","","i3GEOmostraExtenxxs","",3,"0.0") +
  91 + ' </td></tr>' +
  92 + ' <tr><td>Maior latitude (norte):</td>' +
  93 + ' <td>' +
  94 + $inputText("","","i3GEOmostraExtenyyg","",3,"-00") +
  95 + $inputText("","","i3GEOmostraExtenyym","",3,"00") +
  96 + $inputText("","","i3GEOmostraExtenyys","",3,"0.0") +
  97 + ' </td></tr></table>' +
  98 + '<br><p class="paragrafo" ><input id=i3GEOmostraExtenbotao1 type="button" size=14 value="Aplicar a nova extensão" /></p>';
  99 + return ins;
  100 + },
  101 + /*
  102 + Function: criaJanelaFlutuante
  103 +
  104 + Cria a janela flutuante para controle da ferramenta.
  105 + */
  106 + criaJanelaFlutuante: function(){
  107 + var janela,divid,temp,titulo,cabecalho,minimiza;
  108 + //cria a janela flutuante
  109 + cabecalho = function(){
  110 + i3GEOF.mostraExten.ativaFoco();
  111 + };
  112 + minimiza = function(){
  113 + var temp = $i("i3GEOF.mostraExten_corpo");
  114 + if(temp){
  115 + if(temp.style.display === "block")
  116 + {temp.style.display = "none";}
  117 + else
  118 + {temp.style.display = "block";}
  119 + }
  120 + };
  121 + titulo = "Extensão geográfica <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=7&idajuda=55' >&nbsp;&nbsp;&nbsp;</a>";
  122 + janela = i3GEO.janela.cria(
  123 + "370px",
  124 + "320px",
  125 + "",
  126 + "",
  127 + "",
  128 + titulo,
  129 + "i3GEOF.mostraExten",
  130 + false,
  131 + "hd",
  132 + cabecalho,
  133 + minimiza
  134 + );
  135 + divid = janela[2].id;
  136 + $i("i3GEOF.mostraExten_corpo").style.backgroundColor = "white";
  137 + $i("i3GEOF.mostraExten_corpo").style.textAlign = "left";
  138 + i3GEOF.mostraExten.aguarde = $i("i3GEOF.mostraExten_imagemCabecalho").style;
  139 + i3GEOF.mostraExten.inicia(divid);
  140 + if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEOF.mostraExten.ativaFoco()") < 0)
  141 + {i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.mostraExten.ativaFoco()");}
  142 + temp = function(){
  143 + i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.mostraExten.ativaFoco()");
  144 + };
  145 + YAHOO.util.Event.addListener(janela[0].close, "click", temp);
  146 + },
  147 + /*
  148 + Function: ativaFoco
  149 +
  150 + Função que é disparada quando o usuário clica no cabeçalho da ferramenta
  151 + */
  152 + ativaFoco: function(){
  153 + $i("i3GEOmostraExtenatual").innerHTML = i3GEO.parametros.mapexten;
  154 + },
  155 + /*
  156 + Function: executa
  157 +
  158 + Altera a legenda
  159 + */
  160 + executa: function(){
  161 + try{
  162 + var x = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxg").value,$i("i3GEOmostraExtenxm").value,$i("i3GEOmostraExtenxs").value);
  163 + var xx = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxxg").value,$i("i3GEOmostraExtenxxm").value,$i("i3GEOmostraExtenxxs").value);
  164 + var y = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyg").value,$i("i3GEOmostraExtenym").value,$i("i3GEOmostraExtenys").value);
  165 + var yy = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyyg").value,$i("i3GEOmostraExtenyym").value,$i("i3GEOmostraExtenyys").value);
  166 + if ((x == xx) || (y == yy))
  167 + {alert("Digite coordenadas válidas");return;}
  168 + if ((x > xx) || (y > yy))
  169 + {alert("Digite coordenadas válidas");return;}
  170 + i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,window.parent.i3GEO.parametros.tipoimagem,(x+" "+y+" "+xx+" "+yy))
  171 + }
  172 + catch(e){alert(e+" Erro. Digite coordenadas válidas");}
  173 + }
  174 +};
  175 +<?php if(extension_loaded('zlib')){ob_end_flush();}?>
0 176 \ No newline at end of file
... ...