diff --git a/classesphp/classe_mapa.php b/classesphp/classe_mapa.php index a09ad00..a36f725 100755 --- a/classesphp/classe_mapa.php +++ b/classesphp/classe_mapa.php @@ -1663,7 +1663,6 @@ class Mapa $c = $layer->offsite; $c->setrgb(255,255,255); $of = $this->mapa->outputformat; - //$of->set("imagemode",MS_IMAGEMODE_RGB); $this->salva(); } /* diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index 031d213..eac7fe8 100755 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -839,15 +839,11 @@ switch (strtoupper($funcao)) include_once("classe_mapa.php"); copiaSeguranca($map_file); $m = new Mapa($map_file); + $m->adicionatemawms($_pg["tema"],$_pg["servico"],$_pg["nome"],$_pg["proj"],$_pg["formato"],$locaplic,$_pg["tipo"],$_pg["versao"],$_pg["nomecamada"],$dir_tmp,$imgdir,$imgurl,$_pg["tiporep"],$_pg["suportasld"],$_pg["formatosinfo"],$_pg["time"],$_pg["tile"]); - $teste = "ok";//testaMapa($map_file,$postgis_mapa); - if ($teste == "ok") - { - $retorno = "ok";$_SESSION["contadorsalva"]++; - } - else - {$retorno = array("erro"=>"A camada nao pode ser adicionada. ".$teste); - } + + $_SESSION["contadorsalva"]++; + redesenhaMapa(); break; /* Valor: REFERENCIA diff --git a/css/default.css b/css/default.css index 540f2b7..09f9af5 100755 --- a/css/default.css +++ b/css/default.css @@ -137,6 +137,10 @@ span.affix { a, a:focus, a:hover { color: #008579; } +.alert.alert-info { + background-color: #03a9f4; + color: #002733; +} .alert.alert-warning { background-color: #de3601; } diff --git a/ferramentas/conectarservicos/index.js b/ferramentas/conectarservicos/index.js index e16bf8f..21a2588 100755 --- a/ferramentas/conectarservicos/index.js +++ b/ferramentas/conectarservicos/index.js @@ -58,22 +58,10 @@ i3GEOF.conectarservicos = "i3GEOF.conectargeorss_script"); }, wmst: function(){ - i3GEO.janela.cria( - "600px", - "400px", - i3GEO.configura.locaplic + "/ferramentas/wmstime/index.htm", - "", - "", - $trad("x46") - + "  ", - "i3GEO.conectarwmst", - false, - "hd", - "", - "", - "", - true - ); + i3GEO.util.scriptTag(i3GEO.configura.locaplic + + "/ferramentas/wmstime/dependencias.php", + "i3GEOF.wmstime.iniciaJanelaFlutuante()", + "i3GEOF.wmstime_script"); }, wms: function(){ i3GEO.util.scriptTag(i3GEO.configura.locaplic diff --git a/ferramentas/inserexy2/index.js b/ferramentas/inserexy2/index.js index c824789..dcd0441 100755 --- a/ferramentas/inserexy2/index.js +++ b/ferramentas/inserexy2/index.js @@ -32,35 +32,35 @@ Você deve ter recebido uma cópia da Licença Pública G GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. -*/ + */ if(typeof(i3GEOF) === 'undefined'){ - var i3GEOF = {}; + var i3GEOF = {}; } /* Classe: i3GEOF.inserexy -*/ + */ i3GEOF.inserexy = { - /* + /* Variavel: aguarde Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. - */ - aguarde: "", - /** - * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php - */ - MUSTACHE : "", - /** - * Susbtitutos para o template - */ - mustacheHash : function() { - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.inserexy.dicionario); - dicionario["locaplic"] = i3GEO.configura.locaplic; - return dicionario; - }, - /* + */ + aguarde: "", + /** + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php + */ + MUSTACHE : "", + /** + * Susbtitutos para o template + */ + mustacheHash : function() { + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.inserexy.dicionario); + dicionario["locaplic"] = i3GEO.configura.locaplic; + return dicionario; + }, + /* Function: inicia Inicia a ferramenta. É chamado por criaJanelaFlutuante @@ -68,53 +68,53 @@ i3GEOF.inserexy = { Parametro: iddiv {String} - id do div que receberá o conteudo HTML da ferramenta - */ - inicia: function(iddiv){ - if(i3GEOF.inserexy.MUSTACHE == ""){ - $.get(i3GEO.configura.locaplic + "/ferramentas/inserexy2/template_mst.html", function(template) { - i3GEOF.inserexy.MUSTACHE = template; - i3GEOF.inserexy.inicia(iddiv); - }); - return; - } - - var b; - $i(iddiv).innerHTML = i3GEOF.inserexy.html(); - i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia1","i3GEOinserexyguia"); - //eventos das guias - $i("i3GEOinserexyguia0").onclick = function(){ - i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia0","i3GEOinserexyguia"); - }; - $i("i3GEOinserexyguia1").onclick = function(){ - i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia1","i3GEOinserexyguia"); - }; - $i("i3GEOinserexyguia2").onclick = function(){ - i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia2","i3GEOinserexyguia"); - }; - $i("i3GEOinserexyguia3").onclick = function(){ - i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia3","i3GEOinserexyguia"); - }; - $i("i3GEOinserexyguia4").onclick = function() - {i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia4","i3GEOinserexyguia");}; - $i("i3GEOinserexyguia5").onclick = function(){ - i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia5","i3GEOinserexyguia"); - }; - $i("i3GEOinserexyguia6").onclick = function(){ - i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia6","i3GEOinserexyguia"); - }; - - i3GEOF.inserexy.ativaFoco(); - i3GEOF.inserexy.montaComboLocal(); - i3GEO.util.radioEpsg( - function(retorno){ - $i("i3GEOinserexylistaepsg").innerHTML = retorno.dados; - }, - "i3GEOinserexylistaepsg", - "i3GEOinserexy" - ); - - }, - /* + */ + inicia: function(iddiv){ + if(i3GEOF.inserexy.MUSTACHE == ""){ + $.get(i3GEO.configura.locaplic + "/ferramentas/inserexy2/template_mst.html", function(template) { + i3GEOF.inserexy.MUSTACHE = template; + i3GEOF.inserexy.inicia(iddiv); + }); + return; + } + + var b; + $i(iddiv).innerHTML = i3GEOF.inserexy.html(); + i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia1","i3GEOinserexyguia"); + //eventos das guias + $i("i3GEOinserexyguia0").onclick = function(){ + i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia0","i3GEOinserexyguia"); + }; + $i("i3GEOinserexyguia1").onclick = function(){ + i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia1","i3GEOinserexyguia"); + }; + $i("i3GEOinserexyguia2").onclick = function(){ + i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia2","i3GEOinserexyguia"); + }; + $i("i3GEOinserexyguia3").onclick = function(){ + i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia3","i3GEOinserexyguia"); + }; + $i("i3GEOinserexyguia4").onclick = function() + {i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia4","i3GEOinserexyguia");}; + $i("i3GEOinserexyguia5").onclick = function(){ + i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia5","i3GEOinserexyguia"); + }; + $i("i3GEOinserexyguia6").onclick = function(){ + i3GEO.guias.mostraGuiaFerramenta("i3GEOinserexyguia6","i3GEOinserexyguia"); + }; + + i3GEOF.inserexy.ativaFoco(); + i3GEOF.inserexy.montaComboLocal(); + i3GEO.util.radioEpsg( + function(retorno){ + $i("i3GEOinserexylistaepsg").innerHTML = retorno.dados; + }, + "i3GEOinserexylistaepsg", + "i3GEOinserexy" + ); + + }, + /* Function: html Gera o código html para apresentação das opções da ferramenta @@ -122,72 +122,72 @@ i3GEOF.inserexy = { Retorno: String com o código html - */ - html:function() { - var ins = Mustache.render(i3GEOF.inserexy.MUSTACHE, i3GEOF.inserexy.mustacheHash()); - return ins; - }, - /* + */ + html:function() { + var ins = Mustache.render(i3GEOF.inserexy.MUSTACHE, i3GEOF.inserexy.mustacheHash()); + return ins; + }, + /* Function: iniciaJanelaFlutuante Cria a janela flutuante para controle da ferramenta. - */ - iniciaJanelaFlutuante: function(){ - i3GEO.janela.tempoMsg("
" + $trad("ajuda",i3GEOF.inserexy.dicionario) + "
"); - var minimiza,cabecalho,janela,divid,temp,titulo; - if ($i("i3GEOF.inserexy")) { - return; - } - //cria a janela flutuante - cabecalho = function(){ - i3GEOF.inserexy.ativaFoco(); - }; - minimiza = function(){ - i3GEO.janela.minimiza("i3GEOF.inserexy",200); - }; - titulo = "" + $trad("d22t") + ""; - janela = i3GEO.janela.cria( - "520px", - "310px", - "", - "", - "", - titulo, - "i3GEOF.inserexy", - false, - "hd", - cabecalho, - minimiza, - "", - true, - "", - "", - "", - "", - "83" - ); - divid = janela[2].id; - i3GEOF.inserexy.aguarde = $i("i3GEOF.inserexy_imagemCabecalho").style; - $i("i3GEOF.inserexy_corpo").style.backgroundColor = "white"; - i3GEOF.inserexy.inicia(divid); - - i3GEO.eventos.adicionaEventos("MOUSECLIQUE",["i3GEOF.inserexy.adicionaClique()"]); - i3GEO.eventos.cliquePerm.desativa(); - temp = function(){ - i3GEO.eventos.cliquePerm.ativa(); - i3GEO.eventos.removeEventos("MOUSECLIQUE",["i3GEOF.inserexy.adicionaClique()"]); - }; - YAHOO.util.Event.addListener(janela[0].close, "click", temp); - }, - /* + */ + iniciaJanelaFlutuante: function(){ + i3GEO.janela.tempoMsg("
" + $trad("ajuda",i3GEOF.inserexy.dicionario) + "
"); + var minimiza,cabecalho,janela,divid,temp,titulo; + if ($i("i3GEOF.inserexy")) { + return; + } + //cria a janela flutuante + cabecalho = function(){ + i3GEOF.inserexy.ativaFoco(); + }; + minimiza = function(){ + i3GEO.janela.minimiza("i3GEOF.inserexy",200); + }; + titulo = "" + $trad("d22t") + ""; + janela = i3GEO.janela.cria( + "520px", + "310px", + "", + "", + "", + titulo, + "i3GEOF.inserexy", + false, + "hd", + cabecalho, + minimiza, + "", + true, + "", + "", + "", + "", + "83" + ); + divid = janela[2].id; + i3GEOF.inserexy.aguarde = $i("i3GEOF.inserexy_imagemCabecalho").style; + $i("i3GEOF.inserexy_corpo").style.backgroundColor = "white"; + i3GEOF.inserexy.inicia(divid); + + i3GEO.eventos.adicionaEventos("MOUSECLIQUE",["i3GEOF.inserexy.adicionaClique()"]); + i3GEO.eventos.cliquePerm.desativa(); + temp = function(){ + i3GEO.eventos.cliquePerm.ativa(); + i3GEO.eventos.removeEventos("MOUSECLIQUE",["i3GEOF.inserexy.adicionaClique()"]); + }; + YAHOO.util.Event.addListener(janela[0].close, "click", temp); + }, + /* Function: ativaFoco Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado - */ - ativaFoco: function(){ - i3GEO.eventos.cliquePerm.desativa(); - }, - /* + */ + ativaFoco: function(){ + i3GEO.eventos.cliquePerm.desativa(); + }, + /* Function: montaComboLocal Monta o combo com a lista de temas que podem ser editados (temas armazenados no diretório temporário do i3Geo) @@ -195,38 +195,38 @@ i3GEOF.inserexy = { Veja: - */ - montaComboLocal: function(){ - i3GEO.util.comboTemas( - "i3GEOinserexytemasLocais", - function(retorno){ - $i("i3GEOinserexyshapefile").innerHTML = retorno.dados + 'playlist_add_check'; - if ($i("i3GEOinserexytemasLocais")){ - $i("i3GEOinserexytemasLocais").onchange = function(){ - i3GEO.mapa.ativaTema($i("i3GEOinserexytemasLocais").value); - i3GEOF.inserexy.listaItens(); - i3GEOF.inserexy.listaPontos(); - }; - } - if(i3GEO.temaAtivo !== ""){ - var temp = $i("i3GEOinserexytemasLocais"); - if(temp){ - temp.value = i3GEO.temaAtivo; - temp.onchange.call(); - } - } - }, - "i3GEOinserexyshapefile", - "", - false, - "locais", - "", - false, - true, - "form-control comboTema" - ); - }, - /* + */ + montaComboLocal: function(){ + i3GEO.util.comboTemas( + "i3GEOinserexytemasLocais", + function(retorno){ + $i("i3GEOinserexyshapefile").innerHTML = retorno.dados + 'playlist_add_check'; + if ($i("i3GEOinserexytemasLocais")){ + $i("i3GEOinserexytemasLocais").onchange = function(){ + i3GEO.mapa.ativaTema($i("i3GEOinserexytemasLocais").value); + i3GEOF.inserexy.listaItens(); + i3GEOF.inserexy.listaPontos(); + }; + } + if(i3GEO.temaAtivo !== ""){ + var temp = $i("i3GEOinserexytemasLocais"); + if(temp){ + temp.value = i3GEO.temaAtivo; + temp.onchange.call(); + } + } + }, + "i3GEOinserexyshapefile", + "", + false, + "locais", + "", + false, + true, + "form-control comboTema" + ); + }, + /* Function: criatemaeditavel Cria um novo tema local para receber os pontos @@ -234,36 +234,36 @@ i3GEOF.inserexy = { Veja: - */ - criatemaeditavel: function(){ - if(i3GEOF.inserexy.aguarde.visibility === "visible") - {return;} - var funcaoOK = function(){ - try{ - var tituloTema,cp,p; - tituloTema = $i("i3GEOjanelaprompt").value; - if(tituloTema === "") - {tituloTema = "Pontos inseridos "+Math.random();} - i3GEOF.inserexy.aguarde.visibility = "visible"; - temp = function(retorno){ - i3GEOF.inserexy.aguarde.visibility = "hidden"; - i3GEO.temaAtivo = retorno.data; - i3GEO.atualiza(); - i3GEOF.inserexy.montaComboLocal(); - }; - cp = new cpaint(); - cp.set_response_type("JSON"); - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=criashpvazio&tituloTema="+tituloTema; - cp.call(p,"criaSHPvazio",temp); - } - catch(e){ - i3GEO.janela.tempoMsg("Erro: "+e); - i3GEOF.inserexy.aguarde.visibility = "hidden"; - } - }; - i3GEO.janela.prompt($trad('tituloNovoTema',i3GEOF.inserexy.dicionario),funcaoOK,$trad('pontosInseridos',i3GEOF.inserexy.dicionario)+parseInt((Math.random() * 100),10)); - }, - /* + */ + criatemaeditavel: function(){ + if(i3GEOF.inserexy.aguarde.visibility === "visible") + {return;} + var funcaoOK = function(){ + try{ + var tituloTema,cp,p; + tituloTema = $i("i3GEOjanelaprompt").value; + if(tituloTema === "") + {tituloTema = "Pontos inseridos "+Math.random();} + i3GEOF.inserexy.aguarde.visibility = "visible"; + temp = function(retorno){ + i3GEOF.inserexy.aguarde.visibility = "hidden"; + i3GEO.temaAtivo = retorno.data; + i3GEO.atualiza(); + i3GEOF.inserexy.montaComboLocal(); + }; + cp = new cpaint(); + cp.set_response_type("JSON"); + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=criashpvazio&tituloTema="+tituloTema; + cp.call(p,"criaSHPvazio",temp); + } + catch(e){ + i3GEO.janela.tempoMsg("Erro: "+e); + i3GEOF.inserexy.aguarde.visibility = "hidden"; + } + }; + i3GEO.janela.prompt($trad('tituloNovoTema',i3GEOF.inserexy.dicionario),funcaoOK,$trad('pontosInseridos',i3GEOF.inserexy.dicionario)+parseInt((Math.random() * 100),10)); + }, + /* Function: listaPontos Lista os pontos existentes no tema escolhido @@ -271,25 +271,25 @@ i3GEOF.inserexy = { Veja: - */ - listaPontos: function(){ - var cp,p,temp; - temp = function(retorno){ - if (retorno.data != undefined){ - var ins = [],i; - for (i=0;i"+retorno.data[i].x+" "+retorno.data[i].y+"
");} - $i("i3GEOinserexyguia6obj").innerHTML = ins.join(""); - } - else - {$i("i3GEOinserexyguia6obj").innerHTML = "

Erro
";} - }; - cp = new cpaint(); - cp.set_response_type("JSON"); - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=listaPontosShape&tema="+$i("i3GEOinserexytemasLocais").value; - cp.call(p,"listaPontosShape",temp); - }, - /* + */ + listaPontos: function(){ + var cp,p,temp; + temp = function(retorno){ + if (retorno.data != undefined){ + var ins = [],i; + for (i=0;i"+retorno.data[i].x+" "+retorno.data[i].y+"
");} + $i("i3GEOinserexyguia6obj").innerHTML = ins.join(""); + } + else + {$i("i3GEOinserexyguia6obj").innerHTML = "

Erro
";} + }; + cp = new cpaint(); + cp.set_response_type("JSON"); + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=listaPontosShape&tema="+$i("i3GEOinserexytemasLocais").value; + cp.call(p,"listaPontosShape",temp); + }, + /* Function: listaItens Lista os itens do tema escolhido para receber os pontos @@ -297,147 +297,147 @@ i3GEOF.inserexy = { Veja: - */ - listaItens: function(){ - i3GEO.util.comboItens( - "i3GEOinserexyItem", - $i("i3GEOinserexytemasLocais").value, - function(retorno){ - $i("i3GEOinserexyshapefileitem").innerHTML = retorno.dados; - $i("i3GEOinserexyopcitens").style.display = "block"; - }, - "i3GEOinserexyshapefileitem", - "display:block", - "", - "", - "form-control" - ); - }, - /* + */ + listaItens: function(){ + i3GEO.util.comboItens( + "i3GEOinserexyItem", + $i("i3GEOinserexytemasLocais").value, + function(retorno){ + $i("i3GEOinserexyshapefileitem").innerHTML = retorno.dados; + $i("i3GEOinserexyopcitens").style.display = "block"; + }, + "i3GEOinserexyshapefileitem", + "display:block", + "", + "", + "form-control" + ); + }, + /* Function: adicionaClique Adiciona um ponto no mapa no local onde o usuário clicar com o mouse As coordenadas são obtidas do objeto objposicaocursor - */ - adicionaClique: function(){ - i3GEOF.inserexy.adiciona(objposicaocursor.ddx+" "+objposicaocursor.ddy,"cliqueMapa"); - }, - /* + */ + adicionaClique: function(){ + i3GEOF.inserexy.adiciona(objposicaocursor.ddx+" "+objposicaocursor.ddy,"cliqueMapa"); + }, + /* Function: inserirdd Insere um ponto com base na direção e distancia - */ - inserirdd: function(){ - try{ - var regv,xgv,xmv,xsv,direcao,divs,x,y,xy; - regv = new RegExp(",", "g"); - xgv = $i("i3GEOinserexyxgdd").value; - xmv = $i("i3GEOinserexyxmdd").value; - xsv = $i("i3GEOinserexyxsdd").value; - xsv = xsv.replace(regv,"."); - direcao = i3GEO.calculo.dms2dd(xgv,xmv,xsv); - //pega o último ponto - divs = $i("i3GEOinserexyguia6obj").getElementsByClassName("i3GEOinserexyguia6obj"); - divs = divs[divs.length - 1]; - divs = divs.innerHTML.split(" "); - x = divs[0]; - y = divs[1]; - xy = i3GEO.calculo.destinoDD(x,y,$i("i3GEOinserexydistdd").value,direcao); - i3GEOF.inserexy.adiciona(xy[0]+" "+xy[1]); - }catch(e){i3GEO.janela.tempoMsg("Erro: "+e);} - }, - /* + */ + inserirdd: function(){ + try{ + var regv,xgv,xmv,xsv,direcao,divs,x,y,xy; + regv = new RegExp(",", "g"); + xgv = $i("i3GEOinserexyxgdd").value; + xmv = $i("i3GEOinserexyxmdd").value; + xsv = $i("i3GEOinserexyxsdd").value; + xsv = xsv.replace(regv,"."); + direcao = i3GEO.calculo.dms2dd(xgv,xmv,xsv); + //pega o último ponto + divs = $i("i3GEOinserexyguia6obj").getElementsByClassName("i3GEOinserexyguia6obj"); + divs = divs[divs.length - 1]; + divs = divs.innerHTML.split(" "); + x = divs[0]; + y = divs[1]; + xy = i3GEO.calculo.destinoDD(x,y,$i("i3GEOinserexydistdd").value,direcao); + i3GEOF.inserexy.adiciona(xy[0]+" "+xy[1]); + }catch(e){i3GEO.janela.tempoMsg("Erro: "+e);} + }, + /* Function: inserir Insere pontos digitando-se as coordenadas - */ - inserir: function(){ - try{ - var reg = new RegExp("w|W|l|L|o|O|'|G|r", "g"), - regv = new RegExp(",", "g"), - v,xgv = 0,xmv = 0,xsv = 0,vv,ygv = 0,ymv = 0,ysv = 0,x,y; - if($i("i3GEOinserexytipodigcampo").checked){ - if (!$i("i3GEOinserexylongitude").value == ""){ - v = $i("i3GEOinserexylongitude").value + " 0" + " 0"; - v = v.replace(reg,""); - v = v.replace(regv,"."); - v = v.split(" "); - xgv = v[0]; - xmv = v[1]; - xsv = v[2]; - xsv = xsv.replace(",","."); - } - if (!$i("i3GEOinserexylatitude").value == ""){ - vv = $i("i3GEOinserexylatitude").value + " 0" + " 0"; - vv = vv.replace(reg,""); - vv = vv.replace(regv,"."); - vv = vv.split(" "); - ygv = vv[0]; - ymv = vv[1]; - ysv = vv[2]; - ysv = ysv.replace(regv,"."); - } - } - if($i("i3GEOinserexytipodigmascara").checked){ - xgv = $i("i3GEOinserexyxg").value; - xmv = $i("i3GEOinserexyxm").value; - xsv = $i("i3GEOinserexyxs").value; - xsv = xsv.replace(regv,"."); - ygv = $i("i3GEOinserexyyg").value; - ymv = $i("i3GEOinserexyym").value; - ysv = $i("i3GEOinserexyys").value; - ysv = ysv.replace(regv,"."); - } - x = i3GEO.calculo.dms2dd(xgv,xmv,xsv); - y = i3GEO.calculo.dms2dd(ygv,ymv,ysv); - i3GEOF.inserexy.adiciona(x+" "+y); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+e);} - }, - /* + */ + inserir: function(){ + try{ + var reg = new RegExp("w|W|l|L|o|O|'|G|r", "g"), + regv = new RegExp(",", "g"), + v,xgv = 0,xmv = 0,xsv = 0,vv,ygv = 0,ymv = 0,ysv = 0,x,y; + if($i("i3GEOinserexytipodigcampo").checked){ + if (!$i("i3GEOinserexylongitude").value == ""){ + v = $i("i3GEOinserexylongitude").value + " 0" + " 0"; + v = v.replace(reg,""); + v = v.replace(regv,"."); + v = v.split(" "); + xgv = v[0]; + xmv = v[1]; + xsv = v[2]; + xsv = xsv.replace(",","."); + } + if (!$i("i3GEOinserexylatitude").value == ""){ + vv = $i("i3GEOinserexylatitude").value + " 0" + " 0"; + vv = vv.replace(reg,""); + vv = vv.replace(regv,"."); + vv = vv.split(" "); + ygv = vv[0]; + ymv = vv[1]; + ysv = vv[2]; + ysv = ysv.replace(regv,"."); + } + } + if($i("i3GEOinserexytipodigmascara").checked){ + xgv = $i("i3GEOinserexyxg").value; + xmv = $i("i3GEOinserexyxm").value; + xsv = $i("i3GEOinserexyxs").value; + xsv = xsv.replace(regv,"."); + ygv = $i("i3GEOinserexyyg").value; + ymv = $i("i3GEOinserexyym").value; + ysv = $i("i3GEOinserexyys").value; + ysv = ysv.replace(regv,"."); + } + x = i3GEO.calculo.dms2dd(xgv,xmv,xsv); + y = i3GEO.calculo.dms2dd(ygv,ymv,ysv); + i3GEOF.inserexy.adiciona(x+" "+y); + } + catch(e){i3GEO.janela.tempoMsg("Erro: "+e);} + }, + /* Functin: colar Captura as coordenadas coladas pelo usuário e insere os pontos - */ - colar: function(){ - var regv = new RegExp(",", "g"), - valores = $i("i3GEOinserexycolar").value; - valores = valores.replace(regv,"."); - i3GEOF.inserexy.adiciona(valores); - }, - /* + */ + colar: function(){ + var regv = new RegExp(",", "g"), + valores = $i("i3GEOinserexycolar").value; + valores = valores.replace(regv,"."); + i3GEOF.inserexy.adiciona(valores); + }, + /* Function: escolhedig Define o tipo de entrada de coordenadas (dms ou dd) - */ - escolhedig: function(q){ - if(q === 0){ - q = "i3GEOinserexydigmascara"; - } - else{ - q = "i3GEOinserexydigcampo"; - } - $i("i3GEOinserexydigmascara").style.display="none"; - $i("i3GEOinserexydigcampo").style.display="none"; - $i(q).style.display="block"; - }, - /* + */ + escolhedig: function(q){ + if(q === 0){ + q = "i3GEOinserexydigmascara"; + } + else{ + q = "i3GEOinserexydigcampo"; + } + $i("i3GEOinserexydigmascara").style.display="none"; + $i("i3GEOinserexydigcampo").style.display="none"; + $i(q).style.display="block"; + }, + /* Function: pegaProjecao Obtém o código da projeção escolhida - */ - pegaProjecao: function(){ - var inputs = $i("i3GEOinserexylistaepsg").getElementsByTagName("input"), - i, - projecao = ""; - for (i=0;i - */ - adiciona: function(xy,fonte){ - if(i3GEOF.inserexy.aguarde.visibility === "visible"){ - return; - } - var tema, - item = "", - valoritem = "", - temp, - n, - i, - xyn, - projecao = i3GEOF.inserexy.pegaProjecao(); - if(!$i("i3GEOinserexytemasLocais")){ - tema = ""; - }else{ - tema = $i("i3GEOinserexytemasLocais").value; - } - xyn = xy.split(" "); - n = xyn.length; - temp = ""; - for(i=0;i
"; - } - $i("i3GEOinserexyguia6obj").innerHTML += temp; - if($i("i3GEOinserexyItem") && $i("i3GEOinserexyvalorItem")){ - item = $i("i3GEOinserexyItem").value; - valoritem = $i("i3GEOinserexyvalorItem").value; - } - if (tema === ""){ - i3GEO.janela.tempoMsg($trad('msgNenhumTemaDefinido',i3GEOF.inserexy.dicionario)); - } - else{ - temp = function(retorno){ - if(i3GEO.Interface.ATUAL === "padrao") - {i3GEO.atualiza();} - i3GEO.Interface.atualizaTema(retorno,tema); - i3GEOF.inserexy.aguarde.visibility = "hidden"; - }; - if(fonte !== undefined){ - projecao = ""; - } - i3GEOF.inserexy.aguarde.visibility = "visible"; - i3GEO.php.insereSHP(temp,tema,item,valoritem,xy,projecao); - } - }, - /* + */ + adiciona: function(xy,fonte){ + if(i3GEOF.inserexy.aguarde.visibility === "visible"){ + return; + } + var tema, + item = "", + valoritem = "", + temp, + n, + i, + xyn, + projecao = i3GEOF.inserexy.pegaProjecao(); + if(!$i("i3GEOinserexytemasLocais")){ + tema = ""; + }else{ + tema = $i("i3GEOinserexytemasLocais").value; + } + xyn = xy.split(" "); + n = xyn.length; + temp = ""; + for(i=0;i
"; + } + $i("i3GEOinserexyguia6obj").innerHTML += temp; + if($i("i3GEOinserexyItem") && $i("i3GEOinserexyvalorItem")){ + item = $i("i3GEOinserexyItem").value; + valoritem = $i("i3GEOinserexyvalorItem").value; + } + if (tema === ""){ + i3GEO.janela.tempoMsg($trad('msgNenhumTemaDefinido',i3GEOF.inserexy.dicionario)); + } + else{ + temp = function(retorno){ + if(i3GEO.Interface.ATUAL === "padrao") + {i3GEO.atualiza();} + i3GEO.Interface.atualizaTema(retorno,tema); + i3GEOF.inserexy.aguarde.visibility = "hidden"; + }; + if(fonte !== undefined){ + projecao = ""; + } + i3GEOF.inserexy.aguarde.visibility = "visible"; + i3GEO.php.insereSHP(temp,tema,item,valoritem,xy,projecao); + } + }, + /* Function: criaLin Converte os pontos de um tema em linhas @@ -505,21 +505,21 @@ i3GEOF.inserexy = { Veja: - */ - criaLin: function(){ - if(i3GEOF.inserexy.aguarde.visibility === "visible") - {return;} - i3GEOF.inserexy.aguarde.visibility = "visible"; - var cp = new cpaint(), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=sphPT2shp¶=linha&tema="+$i("i3GEOinserexytemasLocais").value+"&ext="+i3GEO.parametros.mapexten, - temp = function(){ - i3GEOF.inserexy.aguarde.visibility = "hidden"; - i3GEO.atualiza(); - }; - cp.set_response_type("JSON"); - cp.call(p,"sphPT2shp",temp); - }, - /* + */ + criaLin: function(){ + if(i3GEOF.inserexy.aguarde.visibility === "visible") + {return;} + i3GEOF.inserexy.aguarde.visibility = "visible"; + var cp = new cpaint(), + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=sphPT2shp¶=linha&tema="+$i("i3GEOinserexytemasLocais").value+"&ext="+i3GEO.parametros.mapexten, + temp = function(){ + i3GEOF.inserexy.aguarde.visibility = "hidden"; + i3GEO.atualiza(); + }; + cp.set_response_type("JSON"); + cp.call(p,"sphPT2shp",temp); + }, + /* Function: criaPol Converte os pontos de um tema em poligonos @@ -527,21 +527,21 @@ i3GEOF.inserexy = { Veja: - */ - criaPol: function(){ - if(i3GEOF.inserexy.aguarde.visibility === "visible") - {return;} - i3GEOF.inserexy.aguarde.visibility = "visible"; - var cp = new cpaint(), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=sphPT2shp¶=poligono&tema="+$i("i3GEOinserexytemasLocais").value+"&ext="+i3GEO.parametros.mapexten, - temp = function(){ - i3GEOF.inserexy.aguarde.visibility = "hidden"; - i3GEO.atualiza(); - }; - cp.set_response_type("JSON"); - cp.call(p,"sphPT2shp",temp); - }, - /* + */ + criaPol: function(){ + if(i3GEOF.inserexy.aguarde.visibility === "visible") + {return;} + i3GEOF.inserexy.aguarde.visibility = "visible"; + var cp = new cpaint(), + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=sphPT2shp¶=poligono&tema="+$i("i3GEOinserexytemasLocais").value+"&ext="+i3GEO.parametros.mapexten, + temp = function(){ + i3GEOF.inserexy.aguarde.visibility = "hidden"; + i3GEO.atualiza(); + }; + cp.set_response_type("JSON"); + cp.call(p,"sphPT2shp",temp); + }, + /* Function: wkt Converte os pontos em WKT @@ -549,62 +549,62 @@ i3GEOF.inserexy = { Veja: - */ - wkt: function(){ - if(i3GEOF.inserexy.aguarde.visibility === "visible") - {return;} - i3GEOF.inserexy.aguarde.visibility = "visible"; - try{ - var divs = $i("i3GEOinserexyguia6obj").getElementsByClassName("pontosInseridos"), - n = divs.length, - xy = [], - cp = new cpaint(), - i, - mostra = function(retorno){ - i3GEOF.inserexy.aguarde.visibility = "hidden"; - if (retorno.data !== undefined){ - var ins = "
"; - ins += "
"; - ins += "
"; - $i("i3GEOinserexywktres").innerHTML = "

"+ins+"

"; - } - else - {$i("i3GEOinserexywktres").innerHTML = "

Erro
";} - }; - for (i=0;i
"; + ins += "
"; + ins += "
"; + $i("i3GEOinserexywktres").innerHTML = "

"+ins+"

"; + } + else + {$i("i3GEOinserexywktres").innerHTML = "

Erro
";} + }; + for (i=0;i ou com a funcao scripttag do i3Geo + * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel + * javascript i3GEOF.inserexy.MUSTACHE + * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta + */ +if(extension_loaded('zlib')){ + ob_start('ob_gzhandler'); +} +header("Content-type: text/javascript"); +include("index.js"); +include("dicionario.js"); +echo "\n"; + +if(extension_loaded('zlib')){ + ob_end_flush(); +} +?> \ No newline at end of file diff --git a/ferramentas/wmstime/dicionario.js b/ferramentas/wmstime/dicionario.js index 90b4557..cba4a01 100755 --- a/ferramentas/wmstime/dicionario.js +++ b/ferramentas/wmstime/dicionario.js @@ -1,5 +1,4 @@ //+$trad(1,i3GEOF.wmstime.dicionario)+ -i3GEOF.wmstime = {}; i3GEOF.wmstime.dicionario = { 1 : [ { pt : "Escolha o serviço de fornecimento de dados (WMS-T)", @@ -80,5 +79,10 @@ i3GEOF.wmstime.dicionario = { pt : "clique para adicionar ao mapa", en : "", es : "" - } ] + } ], + 17 : [ { + pt : "Imagens", + en : "", + es : "" + } ] }; diff --git a/ferramentas/wmstime/index.htm b/ferramentas/wmstime/index.htm deleted file mode 100755 index d1209db..0000000 --- a/ferramentas/wmstime/index.htm +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - -

- -
- - - - - diff --git a/ferramentas/wmstime/index.js b/ferramentas/wmstime/index.js index 4b7b9bd..b306225 100755 --- a/ferramentas/wmstime/index.js +++ b/ferramentas/wmstime/index.js @@ -1,246 +1,243 @@ -/* -Title: WMS Time - -Acessa um serviço WMS-T, baseado em uma lista pré-definida, e monta as imagens em uma sequência temporal. -As imagens podem ser apresentadas em sequência, simulando uma animação. - -Veja: - - - -Arquivo: - -i3geo/ferramentas/wmstime/index.js.php - -Licenca: - -GPL2 - -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet - -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com - -Este programa é software livre; você pode redistribuí-lo -e/ou modificá-lo sob os termos da Licença Pública Geral -GNU conforme publicada pela Free Software Foundation; - -Este programa é distribuído na expectativa de que seja útil, -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. -Consulte a Licença Pública Geral do GNU para mais detalhes. -Você deve ter recebido uma cópia da Licença Pública Geral do -GNU junto com este programa; se não, escreva para a -Free Software Foundation, Inc., no endereço -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. -*/ -//parametrosURL(); -//tipo = 1 anual, 2 mensal, 3 diario -wms_configura = { - "1": { - titulo: "Active Fires (1 month - Terra/MODIS)", - servico:"http://neowms.sci.gsfc.nasa.gov/wms/wms?", - layers:"MOD14A1_M_FIRE", - styles:"rgb", - srs:"EPSG:4326", - format:"image/jpeg", - descricao:"Dados acumulados de um mês março de 2000 a março de 2009. Fire is a recurring part of nature. Wildfires can be caused by lightning striking a forest canopy or, in a few isolated cases, by lava or hot rocks ejected from erupting volcanoes. Most fires worldwide are started by humans, sometimes accidentally and sometimes on purpose. Not all fires are bad. Fire clears away dead and dying underbrush, which can help restore forest ecosystems to good health. Humans use fire as a tool in slash-and-burn agriculture to speed up the process of breaking down unwanted vegetation into the soil. Humans also use fire to clear away old-growth forests to make room for living spaces, roads, and fields for raising crops and cattle. But not all fires are good. Wildfires can destroy natural resources and human structures. Globally, fire plays a major role in Earth's carbon cycle by releasing carbon into the air, and by consuming trees that would otherwise absorb carbon from the air during photosynthesis. These maps show the locations of actively burning fires around the world, detected by instruments aboard NASA satellites.", - anoInicio: 2006, - mesInicio: 1, - diaInicio: 1, - anoFim: 2006, - mesFim: 12, - diaFim: 1, - tipo: 2 - } -}; -ins = "

"+$trad(1,i3GEOF.wmstime.dicionario)+":

"; -ins += "
"; -ins += "
"; -ins += "

"; - -ins += ""; -ins += ""; -ins += ""; - -ins += ""; -ins += ""; - -ins += ""; -ins += ""; - -ins += "
"+$trad(2,i3GEOF.wmstime.dicionario)+"
"+$trad(3,i3GEOF.wmstime.dicionario)+"
"+$trad(4,i3GEOF.wmstime.dicionario)+"
"+$trad(5,i3GEOF.wmstime.dicionario)+"
"+$trad(6,i3GEOF.wmstime.dicionario)+"
"+$trad(7,i3GEOF.wmstime.dicionario)+"
"; -//ins += "
" -ins += "

" + $trad(8,i3GEOF.wmstime.dicionario); -ins += "

"; - -ins += "
"; -ins += "
"; - -$i("parametros").innerHTML = ins; -idServicoEscolhido = ""; -emPausa = true; -b = new YAHOO.widget.Button( - "botao1", - {onclick:{fn: iniciaImagens}} -); -b.addClass("rodar150"); - -b = new YAHOO.widget.Button( - "voltar", - { - onclick: function(){ - $i('quadroAnima').style.display='none'; - $i('parametros').style.display='block'; - } - } -); -b.addClass("rodar150"); - -/* -Function: escolheuServico +i3GEOF.wmstime = { + configura: { + "1": { + titulo: "Active Fires (1 month - Terra/MODIS)", + servico:"http://neowms.sci.gsfc.nasa.gov/wms/wms?", + layers:"MOD14A1_M_FIRE", + styles:"rgb", + srs:"EPSG:4326", + format:"image/jpeg", + descricao:"Dados acumulados de um mês março de 2000 a março de 2009. Fire is a recurring part of nature. Wildfires can be caused by lightning striking a forest canopy or, in a few isolated cases, by lava or hot rocks ejected from erupting volcanoes. Most fires worldwide are started by humans, sometimes accidentally and sometimes on purpose. Not all fires are bad. Fire clears away dead and dying underbrush, which can help restore forest ecosystems to good health. Humans use fire as a tool in slash-and-burn agriculture to speed up the process of breaking down unwanted vegetation into the soil. Humans also use fire to clear away old-growth forests to make room for living spaces, roads, and fields for raising crops and cattle. But not all fires are good. Wildfires can destroy natural resources and human structures. Globally, fire plays a major role in Earth's carbon cycle by releasing carbon into the air, and by consuming trees that would otherwise absorb carbon from the air during photosynthesis. These maps show the locations of actively burning fires around the world, detected by instruments aboard NASA satellites.", + anoInicio: 2006, + mesInicio: 1, + diaInicio: 1, + anoFim: 2006, + mesFim: 12, + diaFim: 1, + tipo: 2 + } + }, + quadroAtual: 0, + idServicoEscolhido: "", + emPausa: true, + MUSTACHE : "", + mustacheHash : function() { + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.wmstime.dicionario); + dicionario["locaplic"] = i3GEO.configura.locaplic; + return dicionario; + }, + inicia: function(iddiv){ + var ins,key = ""; + if(i3GEOF.wmstime.MUSTACHE == ""){ + $.get(i3GEO.configura.locaplic + "/ferramentas/wmstime/template_mst.html", function(template) { + i3GEOF.wmstime.MUSTACHE = template; + i3GEOF.wmstime.inicia(iddiv); + }); + return; + } + $i(iddiv).innerHTML = i3GEOF.wmstime.html(); + + ins = ""; + $i("i3GEOFwmstimelistaDeServicos").innerHTML = ins; + i3GEO.guias.mostraGuiaFerramenta("i3GEOwmstimeguia1","i3GEOwmstimeguia"); + $i("i3GEOwmstimeguia1").onclick = function(){ + i3GEO.guias.mostraGuiaFerramenta("i3GEOwmstimeguia1","i3GEOwmstimeguia"); + }; + $i("i3GEOwmstimeguia2").onclick = function(){ + if(i3GEOF.wmstime.idServicoEscolhido != ""){ + i3GEO.guias.mostraGuiaFerramenta("i3GEOwmstimeguia2","i3GEOwmstimeguia"); + } + }; + }, + html:function() { + var ins = Mustache.render(i3GEOF.wmstime.MUSTACHE, i3GEOF.wmstime.mustacheHash()); + return ins; + }, + iniciaJanelaFlutuante: function(){ + var minimiza,cabecalho,janela,divid,temp,titulo; + if ($i("i3GEOF.wmstime")) { + return; + } + //cria a janela flutuante + cabecalho = function(){ + + }; + minimiza = function(){ + i3GEO.janela.minimiza("i3GEOF.wmstime",200); + }; + titulo = "WMS Time"; + janela = i3GEO.janela.cria( + "600px", + "400px", + "", + "", + "", + titulo, + "i3GEOF.wmstime", + false, + "hd", + cabecalho, + minimiza, + "", + true, + "", + "", + "", + "", + "76" + ); + divid = janela[2].id; + i3GEOF.wmstime.aguarde = $i("i3GEOF.wmstime_imagemCabecalho").style; + i3GEOF.wmstime.inicia(divid); + }, + /* +Function: i3GEOF.wmstime.escolheuServico Monta a tela de parametros após um serviço ter sido escolhido Parametro: idWMS {String} - id do serviço escolhido -*/ -function escolheuServico(idWMS){ - idServicoEscolhido = idWMS; - tipoServico = wms_configura[idWMS].tipo; - servico = wms_configura[idWMS].servico+"&VERSION=1.1.1&REQUEST=GetMap&layers="+wms_configura[idWMS].layers+"&styles="+wms_configura[idWMS].styles+"&srs="+wms_configura[idWMS].srs+"&format="+wms_configura[idWMS].format; - $i("iServico").value = servico; - $i("WMS_descricao").value = wms_configura[idWMS].descricao; - - $i("WMS_anoinicio").value = wms_configura[idWMS].anoInicio; - //if(tipoServico > 1) - $i("WMS_mesinicio").value = wms_configura[idWMS].mesInicio; - //if(tipoServico > 2) - $i("WMS_diainicio").value = wms_configura[idWMS].diaInicio; - $i("WMS_anofim").value = wms_configura[idWMS].anoFim; - //if(tipoServico > 1) - $i("WMS_mesfim").value = wms_configura[idWMS].mesFim; - //if(tipoServico > 2) - $i("WMS_diafim").value = wms_configura[idWMS].diaFim; - - var ins = ""; - } - if(tipoServico == 2){ - ins += ""; - ins += ""; - } - if(tipoServico == 3){ - ins += ""; - ins += ""; - ins += ""; - } - $i("divumaImagemPor").innerHTML = ins; -} -/* -Function: iniciaImagens + */ + escolheuServico: function(idWMS){ + i3GEOF.wmstime.idServicoEscolhido = idWMS; + tipoServico = i3GEOF.wmstime.configura[idWMS].tipo; + servico = i3GEOF.wmstime.configura[idWMS].servico+"&VERSION=1.1.1&REQUEST=GetMap&layers="+i3GEOF.wmstime.configura[idWMS].layers+"&styles="+i3GEOF.wmstime.configura[idWMS].styles+"&srs="+i3GEOF.wmstime.configura[idWMS].srs+"&format="+i3GEOF.wmstime.configura[idWMS].format; + $i("i3GEOFwmstimeiServico").value = servico; + $i("WMS_descricao").innerHTML = i3GEOF.wmstime.configura[idWMS].descricao; + + $i("WMS_anoinicio").value = i3GEOF.wmstime.configura[idWMS].anoInicio; + //if(tipoServico > 1) + $i("WMS_mesinicio").value = i3GEOF.wmstime.configura[idWMS].mesInicio; + //if(tipoServico > 2) + $i("WMS_diainicio").value = i3GEOF.wmstime.configura[idWMS].diaInicio; + $i("WMS_anofim").value = i3GEOF.wmstime.configura[idWMS].anoFim; + //if(tipoServico > 1) + $i("WMS_mesfim").value = i3GEOF.wmstime.configura[idWMS].mesFim; + //if(tipoServico > 2) + $i("WMS_diafim").value = i3GEOF.wmstime.configura[idWMS].diaFim; + + var ins = ""; + } + if(tipoServico == 2){ + ins += ""; + ins += ""; + } + if(tipoServico == 3){ + ins += ""; + ins += ""; + ins += ""; + } + $i("divumaImagemPor").innerHTML = ins; + }, + /* +Function: i3GEOF.wmstime.iniciaImagens Inicia a tela de apresentação das imagens -*/ -function iniciaImagens(){ - $i("imagens").innerHTML = ""; - $i("imagensLidas").innerHTML = ""; - $i("marcaTempo").innerHTML = ""; - $i("parametros").style.display="none"; - $i("quadroAnima").style.display="block"; - if(window.parent.i3GEO.parametros.mapexten){ - bbox = window.parent.i3GEO.parametros.mapexten.split(" "); - bbox = bbox.toString(); - } - else - bbox = "-51.0347433181,-25.2688559441,-43.4155582517,-21.1417973665"; - //var time = "2008-01-01" - w = window.parent.i3GEO.parametros.w; //985 - h = window.parent.i3GEO.parametros.h; - dw = 540; - dh = 245; - - anoInicio = $i("WMS_anoinicio").value; - mesInicio = $i("WMS_mesinicio").value; - diaInicio = $i("WMS_diainicio").value; - - anoFim = $i("WMS_anofim").value; - mesFim = $i("WMS_mesfim").value; - diaFim = $i("WMS_diafim").value; - - intervalo = 1; - id = 1; - - ids = new Array(); - quantasLidas = 0; - onde = $i("imagens"); - ondeContador = $i("imagensLidas"); - ondeContador.style.display="block"; - ondeControle = $i("controle"); - idsValidos = new Array(); - idsTempo = new Array(); - parouQuantas = 0; - ondeMarcaTempo = $i("marcaTempo"); - ondeData = $i("marcaData"); - tempoAnima = 500; - - if($i("umaImagemPor").value == "mes"){ - dataFixa = diaInicio; - if(dataFixa < 10){dataFixa = "0"+dataFixa;} - var anoAtual = anoInicio; - var mesAtual = mesInicio; - while (anoAtual <= anoFim){ - while (mesAtual < 13){ - var mes = mesAtual; - if(mes < 10){mes = "0"+mes;} - criaImg(anoAtual+"-"+mes+"-"+dataFixa,id); - criaImgStatus(anoAtual+"-"+mes+"-"+dataFixa,id); - ids.push(id); - idsTempo.push(anoAtual+"-"+mes+"-"+dataFixa); - id++; - mesAtual++; - if(anoAtual == anoFim && mesAtual > mesFim){mesAtual = 13;} - } - mesAtual = 1; - anoAtual++; - } - } - if($i("umaImagemPor").value == "dia"){ - var anoAtual = anoInicio; - var mesAtual = mesInicio; - var diaAtual = diaInicio; - while (anoAtual <= anoFim){ - while (mesAtual < 13){ - var mes = mesAtual; - if(mes < 10){mes = "0"+mes;} - while (diaAtual < 31){ - var dia = diaAtual; - if(diaAtual < 10){dia = "0"+dia;} - criaImg(anoAtual+"-"+mes+"-"+dia,id); - criaImgStatus(anoAtual+"-"+mes+"-"+dia,id); - ids.push(id); - idsTempo.push(anoAtual+"-"+mes+"-"+dia); - id++; - diaAtual++; - if(mesAtual == mesFim && diaAtual > diaFim){diaAtual = 32;} - } - mesAtual++; - if(anoAtual == anoFim && mesAtual > mesFim){mesAtual = 13;} - } - mesAtual = 1; - anoAtual++; - } - } -} -/* -function: criaImg + */ + iniciaImagens: function(){ + if(i3GEOF.wmstime.idServicoEscolhido == ""){ + return; + } + i3GEO.guias.mostraGuiaFerramenta("i3GEOwmstimeguia2","i3GEOwmstimeguia"); + $i("i3GEOFwmstimeimagens").innerHTML = ""; + $i("i3GEOFwmstimeimagensLidas").innerHTML = ""; + $i("i3GEOFwmstimemarcaTempo").innerHTML = ""; + if(i3GEO.parametros.mapexten){ + bbox = i3GEO.parametros.mapexten.split(" "); + bbox = bbox.toString(); + } + else { + bbox = "-51.0347433181,-25.2688559441,-43.4155582517,-21.1417973665"; + } + //var time = "2008-01-01" + w = i3GEO.parametros.w; //985 + h = i3GEO.parametros.h; + dw = 540; + dh = 245; + + anoInicio = $i("WMS_anoinicio").value; + mesInicio = $i("WMS_mesinicio").value; + diaInicio = $i("WMS_diainicio").value; + + anoFim = $i("WMS_anofim").value; + mesFim = $i("WMS_mesfim").value; + diaFim = $i("WMS_diafim").value; + + intervalo = 1; + id = 1; + + ids = new Array(); + quantasLidas = 0; + onde = $i("i3GEOFwmstimeimagens"); + ondeContador = $i("i3GEOFwmstimeimagensLidas"); + ondeContador.style.display="block"; + idsValidos = new Array(); + idsTempo = new Array(); + parouQuantas = 0; + ondeMarcaTempo = $i("i3GEOFwmstimemarcaTempo"); + ondeData = $i("i3GEOFwmstimemarcaData"); + tempoAnima = 500; + + if($i("umaImagemPor").value == "mes"){ + dataFixa = diaInicio; + if(dataFixa < 10){dataFixa = "0"+dataFixa;} + var anoAtual = anoInicio; + var mesAtual = mesInicio; + while (anoAtual <= anoFim){ + while (mesAtual < 13){ + var mes = mesAtual; + if(mes < 10){mes = "0"+mes;} + i3GEOF.wmstime.criaImg(anoAtual+"-"+mes+"-"+dataFixa,id); + i3GEOF.wmstime.criaImgStatus(anoAtual+"-"+mes+"-"+dataFixa,id); + ids.push(id); + idsTempo.push(anoAtual+"-"+mes+"-"+dataFixa); + id++; + mesAtual++; + if(anoAtual == anoFim && mesAtual > mesFim){mesAtual = 13;} + } + mesAtual = 1; + anoAtual++; + } + } + if($i("umaImagemPor").value == "dia"){ + var anoAtual = anoInicio; + var mesAtual = mesInicio; + var diaAtual = diaInicio; + while (anoAtual <= anoFim){ + while (mesAtual < 13){ + var mes = mesAtual; + if(mes < 10){mes = "0"+mes;} + while (diaAtual < 31){ + var dia = diaAtual; + if(diaAtual < 10){dia = "0"+dia;} + i3GEOF.wmstime.criaImg(anoAtual+"-"+mes+"-"+dia,id); + i3GEOF.wmstime.criaImgStatus(anoAtual+"-"+mes+"-"+dia,id); + ids.push(id); + idsTempo.push(anoAtual+"-"+mes+"-"+dia); + id++; + diaAtual++; + if(mesAtual == mesFim && diaAtual > diaFim){diaAtual = 32;} + } + mesAtual++; + if(anoAtual == anoFim && mesAtual > mesFim){mesAtual = 13;} + } + mesAtual = 1; + anoAtual++; + } + } + }, + /* +function: i3GEOF.wmstime.criaImg Cria um elemento do tipo IMG com base no serviço escolhido e nos parametros de tempo @@ -249,34 +246,33 @@ Parametros: tempo {string} - data da imagem que será requisitada id {string} - id que será definido para a imagem -*/ -function criaImg(tempo,id){ - var novoel = document.createElement("img"); - var p = "absolute"; - //if(id==1){var p = "relative"} - novoel.id = id; - novoel.style.position = p; - novoel.style.top = "0px"; - novoel.style.left = "0px"; - novoel.style.width = dw+"px"; - novoel.style.height = dh+"px"; - novoel.style.cursor = "pointer"; - novoel.src = $i("iServico").value+"&width="+dw+"&height="+dh+"&bbox="+bbox+"&time="+tempo; //"../../imagens/atlas1.jpg"; - novoel.title = $trad(13,i3GEOF.wmstime.dicionario); - novoel.onclick = function(){ - adicionaMapa(idServicoEscolhido); - }; - novoel.onload = function(){ - $i("status"+this.id).innerHTML = " OK"; - idsValidos.push(this.id); - parouQuantas++; - if(idsValidos.length == ids.length) - {pararStatus();} - }; - onde.appendChild(novoel); -} -/* -Function: criaImgStatus + */ + criaImg: function(tempo,id){ + var novoel = document.createElement("img"); + var p = "absolute"; + novoel.id = id; + novoel.style.position = p; + novoel.style.top = "0px"; + novoel.style.left = "0px"; + novoel.style.width = dw+"px"; + novoel.style.height = dh+"px"; + novoel.style.cursor = "pointer"; + novoel.src = $i("i3GEOFwmstimeiServico").value+"&width="+dw+"&height="+dh+"&bbox="+bbox+"&time="+tempo; + novoel.title = $trad(13,i3GEOF.wmstime.dicionario); + novoel.onclick = function(){ + i3GEOF.wmstime.adicionaMapa(i3GEOF.wmstime.idServicoEscolhido); + }; + novoel.onload = function(){ + $i("status"+this.id).innerHTML = " OK"; + idsValidos.push(this.id); + parouQuantas++; + if(idsValidos.length == ids.length) + {i3GEOF.wmstime.pararStatus();} + }; + onde.appendChild(novoel); + }, + /* +Function: i3GEOF.wmstime.criaImgStatus Cria um ícone que permite parar a apresentação da animação em uma determinada imagem @@ -285,244 +281,238 @@ Parametros: tempo {string} - data da imagem id {string} - id da imagem -*/ -function criaImgStatus(tempo,id){ - var novoel = document.createElement("div"); - novoel.id = "lida"+id; - novoel.style.width="200px"; - novoel.innerHTML = "Imagem: "+tempo+"...parar"; - ondeContador.appendChild(novoel); -} -/* -Function: pararImagem + */ + criaImgStatus: function(tempo,id){ + var novoel = document.createElement("div"); + novoel.id = "lida"+id; + novoel.style.width="200px"; + novoel.innerHTML = "Imagem: "+tempo+"...parar"; + ondeContador.appendChild(novoel); + }, + /* +Function: i3GEOF.wmstime.pararImagem Parar a apresentação da animação em uma determinada imagem Parametro: id {string} - id da imagem -*/ -function pararImagem(id){ - if($i(id)){ - $i(id).src = ""; - //onde.removeChild(document.getElementById(id)) - idsValidos.push(id); - $i("status"+id).innerHTML = $trad(14,i3GEOF.wmstime.dicionario); - parouQuantas++; - if(parouQuantas == ids.length) - {pararStatus();} - } - else - {i3GEO.janela.tempoMsg($trad(15,i3GEOF.wmstime.dicionario));} -} -/* -Function: pararStatus + */ + pararImagem: function(id){ + if($i(id)){ + $i(id).src = ""; + //onde.removeChild(document.getElementById(id)) + idsValidos.push(id); + $i("status"+id).innerHTML = $trad(14,i3GEOF.wmstime.dicionario); + parouQuantas++; + if(parouQuantas == ids.length) + {i3GEOF.wmstime.pararStatus();} + } + else + {i3GEO.janela.tempoMsg($trad(15,i3GEOF.wmstime.dicionario));} + }, + /* +Function: i3GEOF.wmstime.pararStatus Para o gráfico que mostra o status das imagens -*/ -function pararStatus(){ - ondeContador.style.display = "none"; - ondeControle.style.display="block"; - ondeMarcaTempo.style.display="block"; - ondeMarcaTempo.style.top = "10px"; - ondeControle.style.top = dh + 50 + "px"; - ondeData.style.top = dh + 30 + "px"; - ondeData.style.width = dw+"px"; - desativaQuadros(); - criaMarcadorTempo(); - //ajustaIds() - ativaQuadro(1); -} -function ajustaIds(){ - -} -/* -Function: criaMarcadorTempo + */ + pararStatus: function(){ + ondeContador.style.display = "none"; + ondeMarcaTempo.style.display="block"; + ondeMarcaTempo.style.top = "10px"; + ondeData.style.top = dh + 30 + "px"; + ondeData.style.width = dw+"px"; + i3GEOF.wmstime.desativaQuadros(); + i3GEOF.wmstime.criaMarcadorTempo(); + //i3GEOF.wmstime.ajustaIds() + i3GEOF.wmstime.ativaQuadro(1); + }, + ajustaIds: function(){ + + }, + /* +Function: i3GEOF.wmstime.criaMarcadorTempo Cria o gráfico que mostra as imagens disponíveis. Serve de base para indicar qual imagem está sendo mostrada -*/ -function criaMarcadorTempo(){ - var nmarcas = ids.length; - distanciaMarcas = parseInt(dw / nmarcas); - var ins = ""; - var ini = parseInt((distanciaMarcas*i - (distanciaMarcas/2))); - for(var i=1;i<=nmarcas;i++){ - ins += ""; - } - ins += ""; - ins += ""; - ngranulo = nmarcas; - tgranulo = (parseInt((distanciaMarcas*i - (distanciaMarcas/2))) - ini) / 10; - tempoGranulo = tempoAnima / 10; - ondeMarcaTempo.innerHTML = ins; - marcaVermelha = $i("marcaDeTempo"); - imgGranulo = $i("marcaGranulo"); - pararFilme(); - iniciarFilme(); -} -/* -Function: mostraI + */ + criaMarcadorTempo: function(){ + var nmarcas = ids.length; + distanciaMarcas = parseInt(dw / nmarcas); + var ins = ""; + var ini = parseInt((distanciaMarcas*i - (distanciaMarcas/2))); + for(var i=1;i<=nmarcas;i++){ + ins += ""; + } + ins += ""; + ins += ""; + ngranulo = nmarcas; + tgranulo = (parseInt((distanciaMarcas*i - (distanciaMarcas/2))) - ini) / 10; + tempoGranulo = tempoAnima / 10; + ondeMarcaTempo.innerHTML = ins; + marcaVermelha = $i("marcaDeTempo"); + imgGranulo = $i("marcaGranulo"); + i3GEOF.wmstime.pararFilme(); + i3GEOF.wmstime.iniciarFilme(); + }, + /* +Function: i3GEOF.wmstime.mostraI Mostra uma imagem específica Parametro: obj {dom} - objeto contendo a imagem -*/ -function mostraI(obj){ - $i(obj).style.display="block"; - ondeData.innerHTML = "YYMMDD: "+idsTempo[obj-1]; - if($i(quadroAtual)) - $i(quadroAtual).style.display = "none"; - else - $i("1").style.display = "none"; -} -/* -Function: escondeI + */ + mostraI: function(obj){ + $i(obj).style.display="block"; + ondeData.innerHTML = "YYMMDD: "+idsTempo[obj-1]; + if($i(i3GEOF.wmstime.quadroAtual)) + $i(i3GEOF.wmstime.quadroAtual).style.display = "none"; + else + $i("1").style.display = "none"; + }, + /* +Function: i3GEOF.wmstime.escondeI Esconde uma imagem Parametro: obj {dom} - objeto contendo a imagem -*/ -function escondeI(obj){ - $i(obj).style.display="none"; - ondeData.innerHTML = ""; - if($i(quadroAtual)) - $i(quadroAtual).style.display = "block"; - else - $i("1").style.display = "block"; -} -/* -Function: adicionaMapa + */ + escondeI: function(obj){ + $i(obj).style.display="none"; + ondeData.innerHTML = ""; + if($i(i3GEOF.wmstime.quadroAtual)) + $i(i3GEOF.wmstime.quadroAtual).style.display = "block"; + else + $i("1").style.display = "block"; + }, + /* +Function: i3GEOF.wmstime.adicionaMapa Adiciona uma camada ao mapa baseado na imagem vista na tela -*/ -function adicionaMapa(idMarca){ - //aguarde("block"); - idMarca = parseInt(idMarca,10); - var serv = wms_configura[idServicoEscolhido]; - var fim = function(retorno){ - //aguarde("none"); - if (retorno.data.erro) - {i3GEO.janela.tempoMsg(retorno.data.erro);} - else - {window.parent.i3GEO.atualiza("");} - }; - var p = window.parent.i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+window.parent.i3GEO.configura.sid+"&funcao=adicionatemawms"; - p += "&servico="+serv.servico; - if(serv.styles == "") - p += "&nome="; - else - p += "&nome="+serv.styles; - p += "&tema="+serv.layers; - p += "&proj="+serv.srs; - p += "&formato="+serv.format; - p += "&tipo=estilo"; - p += "&versao=1.1.1"; - p += "&nomecamada="+serv.titulo+" "+idsTempo[idMarca-1]; - p += "&tiporep=&suportasld=nao"; - p += "&formatosinfo=text/plain,application/vnd.ogc.gml"; - p += "&time="+idsTempo[idMarca-1]; - var cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"wmstime",fim); - -} -function desativaQuadros(){ - var n = idsValidos.length; - for(var i=0;i \ No newline at end of file +
+ +
+
+
+ +
+
+
+
+
+ + +
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+ +
+
+
+
+ + +
+
+ + + + + +
+
\ No newline at end of file diff --git a/ferramentas/wmstimeold/dicionario.js b/ferramentas/wmstimeold/dicionario.js new file mode 100755 index 0000000..90b4557 --- /dev/null +++ b/ferramentas/wmstimeold/dicionario.js @@ -0,0 +1,84 @@ +//+$trad(1,i3GEOF.wmstime.dicionario)+ +i3GEOF.wmstime = {}; +i3GEOF.wmstime.dicionario = { + 1 : [ { + pt : "Escolha o serviço de fornecimento de dados (WMS-T)", + en : "", + es : "" + } ], + 2 : [ { + pt : "Ano inicial:", + en : "", + es : "" + } ], + 3 : [ { + pt : "Ano final:", + en : "", + es : "" + } ], + 4 : [ { + pt : "Mês inicial:", + en : "", + es : "" + } ], + 5 : [ { + pt : "Mês final:", + en : "", + es : "" + } ], + 6 : [ { + pt : "Dia inicial:", + en : "", + es : "" + } ], + 7 : [ { + pt : "Dia final:", + en : "", + es : "" + } ], + 8 : [ { + pt : "Obter uma imagem por:", + en : "", + es : "" + } ], + 9 : [ { + pt : "Continuar", + en : "", + es : "" + } ], + 10 : [ { + pt : "Ano", + en : "", + es : "" + } ], + 11 : [ { + pt : "Mês", + en : "", + es : "" + } ], + 12 : [ { + pt : "Dia", + en : "", + es : "" + } ], + 13 : [ { + pt : "clique para adicionar ao mapa", + en : "", + es : "" + } ], + 14 : [ { + pt : "excluído", + en : "", + es : "" + } ], + 15 : [ { + pt : "Imagem excluída", + en : "", + es : "" + } ], + 16 : [ { + pt : "clique para adicionar ao mapa", + en : "", + es : "" + } ] +}; diff --git a/ferramentas/wmstimeold/index.htm b/ferramentas/wmstimeold/index.htm new file mode 100755 index 0000000..d1209db --- /dev/null +++ b/ferramentas/wmstimeold/index.htm @@ -0,0 +1,31 @@ + + + + + + + + +
+ +
+ + + + + diff --git a/ferramentas/wmstimeold/index.js b/ferramentas/wmstimeold/index.js new file mode 100755 index 0000000..4b7b9bd --- /dev/null +++ b/ferramentas/wmstimeold/index.js @@ -0,0 +1,528 @@ +/* +Title: WMS Time + +Acessa um serviço WMS-T, baseado em uma lista pré-definida, e monta as imagens em uma sequência temporal. +As imagens podem ser apresentadas em sequência, simulando uma animação. + +Veja: + + + +Arquivo: + +i3geo/ferramentas/wmstime/index.js.php + +Licenca: + +GPL2 + +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; + +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +//parametrosURL(); +//tipo = 1 anual, 2 mensal, 3 diario +wms_configura = { + "1": { + titulo: "Active Fires (1 month - Terra/MODIS)", + servico:"http://neowms.sci.gsfc.nasa.gov/wms/wms?", + layers:"MOD14A1_M_FIRE", + styles:"rgb", + srs:"EPSG:4326", + format:"image/jpeg", + descricao:"Dados acumulados de um mês março de 2000 a março de 2009. Fire is a recurring part of nature. Wildfires can be caused by lightning striking a forest canopy or, in a few isolated cases, by lava or hot rocks ejected from erupting volcanoes. Most fires worldwide are started by humans, sometimes accidentally and sometimes on purpose. Not all fires are bad. Fire clears away dead and dying underbrush, which can help restore forest ecosystems to good health. Humans use fire as a tool in slash-and-burn agriculture to speed up the process of breaking down unwanted vegetation into the soil. Humans also use fire to clear away old-growth forests to make room for living spaces, roads, and fields for raising crops and cattle. But not all fires are good. Wildfires can destroy natural resources and human structures. Globally, fire plays a major role in Earth's carbon cycle by releasing carbon into the air, and by consuming trees that would otherwise absorb carbon from the air during photosynthesis. These maps show the locations of actively burning fires around the world, detected by instruments aboard NASA satellites.", + anoInicio: 2006, + mesInicio: 1, + diaInicio: 1, + anoFim: 2006, + mesFim: 12, + diaFim: 1, + tipo: 2 + } +}; +ins = "

"+$trad(1,i3GEOF.wmstime.dicionario)+":

"; +ins += "
"; +ins += "
"; +ins += "

"; + +ins += ""; +ins += ""; +ins += ""; + +ins += ""; +ins += ""; + +ins += ""; +ins += ""; + +ins += "
"+$trad(2,i3GEOF.wmstime.dicionario)+"
"+$trad(3,i3GEOF.wmstime.dicionario)+"
"+$trad(4,i3GEOF.wmstime.dicionario)+"
"+$trad(5,i3GEOF.wmstime.dicionario)+"
"+$trad(6,i3GEOF.wmstime.dicionario)+"
"+$trad(7,i3GEOF.wmstime.dicionario)+"
"; +//ins += "
" +ins += "

" + $trad(8,i3GEOF.wmstime.dicionario); +ins += "

"; + +ins += "
"; +ins += "
"; + +$i("parametros").innerHTML = ins; +idServicoEscolhido = ""; +emPausa = true; +b = new YAHOO.widget.Button( + "botao1", + {onclick:{fn: iniciaImagens}} +); +b.addClass("rodar150"); + +b = new YAHOO.widget.Button( + "voltar", + { + onclick: function(){ + $i('quadroAnima').style.display='none'; + $i('parametros').style.display='block'; + } + } +); +b.addClass("rodar150"); + +/* +Function: escolheuServico + +Monta a tela de parametros após um serviço ter sido escolhido + +Parametro: + +idWMS {String} - id do serviço escolhido +*/ +function escolheuServico(idWMS){ + idServicoEscolhido = idWMS; + tipoServico = wms_configura[idWMS].tipo; + servico = wms_configura[idWMS].servico+"&VERSION=1.1.1&REQUEST=GetMap&layers="+wms_configura[idWMS].layers+"&styles="+wms_configura[idWMS].styles+"&srs="+wms_configura[idWMS].srs+"&format="+wms_configura[idWMS].format; + $i("iServico").value = servico; + $i("WMS_descricao").value = wms_configura[idWMS].descricao; + + $i("WMS_anoinicio").value = wms_configura[idWMS].anoInicio; + //if(tipoServico > 1) + $i("WMS_mesinicio").value = wms_configura[idWMS].mesInicio; + //if(tipoServico > 2) + $i("WMS_diainicio").value = wms_configura[idWMS].diaInicio; + $i("WMS_anofim").value = wms_configura[idWMS].anoFim; + //if(tipoServico > 1) + $i("WMS_mesfim").value = wms_configura[idWMS].mesFim; + //if(tipoServico > 2) + $i("WMS_diafim").value = wms_configura[idWMS].diaFim; + + var ins = ""; + } + if(tipoServico == 2){ + ins += ""; + ins += ""; + } + if(tipoServico == 3){ + ins += ""; + ins += ""; + ins += ""; + } + $i("divumaImagemPor").innerHTML = ins; +} +/* +Function: iniciaImagens + +Inicia a tela de apresentação das imagens +*/ +function iniciaImagens(){ + $i("imagens").innerHTML = ""; + $i("imagensLidas").innerHTML = ""; + $i("marcaTempo").innerHTML = ""; + $i("parametros").style.display="none"; + $i("quadroAnima").style.display="block"; + if(window.parent.i3GEO.parametros.mapexten){ + bbox = window.parent.i3GEO.parametros.mapexten.split(" "); + bbox = bbox.toString(); + } + else + bbox = "-51.0347433181,-25.2688559441,-43.4155582517,-21.1417973665"; + //var time = "2008-01-01" + w = window.parent.i3GEO.parametros.w; //985 + h = window.parent.i3GEO.parametros.h; + dw = 540; + dh = 245; + + anoInicio = $i("WMS_anoinicio").value; + mesInicio = $i("WMS_mesinicio").value; + diaInicio = $i("WMS_diainicio").value; + + anoFim = $i("WMS_anofim").value; + mesFim = $i("WMS_mesfim").value; + diaFim = $i("WMS_diafim").value; + + intervalo = 1; + id = 1; + + ids = new Array(); + quantasLidas = 0; + onde = $i("imagens"); + ondeContador = $i("imagensLidas"); + ondeContador.style.display="block"; + ondeControle = $i("controle"); + idsValidos = new Array(); + idsTempo = new Array(); + parouQuantas = 0; + ondeMarcaTempo = $i("marcaTempo"); + ondeData = $i("marcaData"); + tempoAnima = 500; + + if($i("umaImagemPor").value == "mes"){ + dataFixa = diaInicio; + if(dataFixa < 10){dataFixa = "0"+dataFixa;} + var anoAtual = anoInicio; + var mesAtual = mesInicio; + while (anoAtual <= anoFim){ + while (mesAtual < 13){ + var mes = mesAtual; + if(mes < 10){mes = "0"+mes;} + criaImg(anoAtual+"-"+mes+"-"+dataFixa,id); + criaImgStatus(anoAtual+"-"+mes+"-"+dataFixa,id); + ids.push(id); + idsTempo.push(anoAtual+"-"+mes+"-"+dataFixa); + id++; + mesAtual++; + if(anoAtual == anoFim && mesAtual > mesFim){mesAtual = 13;} + } + mesAtual = 1; + anoAtual++; + } + } + if($i("umaImagemPor").value == "dia"){ + var anoAtual = anoInicio; + var mesAtual = mesInicio; + var diaAtual = diaInicio; + while (anoAtual <= anoFim){ + while (mesAtual < 13){ + var mes = mesAtual; + if(mes < 10){mes = "0"+mes;} + while (diaAtual < 31){ + var dia = diaAtual; + if(diaAtual < 10){dia = "0"+dia;} + criaImg(anoAtual+"-"+mes+"-"+dia,id); + criaImgStatus(anoAtual+"-"+mes+"-"+dia,id); + ids.push(id); + idsTempo.push(anoAtual+"-"+mes+"-"+dia); + id++; + diaAtual++; + if(mesAtual == mesFim && diaAtual > diaFim){diaAtual = 32;} + } + mesAtual++; + if(anoAtual == anoFim && mesAtual > mesFim){mesAtual = 13;} + } + mesAtual = 1; + anoAtual++; + } + } +} +/* +function: criaImg + +Cria um elemento do tipo IMG com base no serviço escolhido e nos parametros de tempo + +Parametros: + +tempo {string} - data da imagem que será requisitada + +id {string} - id que será definido para a imagem +*/ +function criaImg(tempo,id){ + var novoel = document.createElement("img"); + var p = "absolute"; + //if(id==1){var p = "relative"} + novoel.id = id; + novoel.style.position = p; + novoel.style.top = "0px"; + novoel.style.left = "0px"; + novoel.style.width = dw+"px"; + novoel.style.height = dh+"px"; + novoel.style.cursor = "pointer"; + novoel.src = $i("iServico").value+"&width="+dw+"&height="+dh+"&bbox="+bbox+"&time="+tempo; //"../../imagens/atlas1.jpg"; + novoel.title = $trad(13,i3GEOF.wmstime.dicionario); + novoel.onclick = function(){ + adicionaMapa(idServicoEscolhido); + }; + novoel.onload = function(){ + $i("status"+this.id).innerHTML = " OK"; + idsValidos.push(this.id); + parouQuantas++; + if(idsValidos.length == ids.length) + {pararStatus();} + }; + onde.appendChild(novoel); +} +/* +Function: criaImgStatus + +Cria um ícone que permite parar a apresentação da animação em uma determinada imagem + +Parametros: + +tempo {string} - data da imagem + +id {string} - id da imagem +*/ +function criaImgStatus(tempo,id){ + var novoel = document.createElement("div"); + novoel.id = "lida"+id; + novoel.style.width="200px"; + novoel.innerHTML = "Imagem: "+tempo+"...parar"; + ondeContador.appendChild(novoel); +} +/* +Function: pararImagem + +Parar a apresentação da animação em uma determinada imagem + +Parametro: + +id {string} - id da imagem +*/ +function pararImagem(id){ + if($i(id)){ + $i(id).src = ""; + //onde.removeChild(document.getElementById(id)) + idsValidos.push(id); + $i("status"+id).innerHTML = $trad(14,i3GEOF.wmstime.dicionario); + parouQuantas++; + if(parouQuantas == ids.length) + {pararStatus();} + } + else + {i3GEO.janela.tempoMsg($trad(15,i3GEOF.wmstime.dicionario));} +} +/* +Function: pararStatus + +Para o gráfico que mostra o status das imagens +*/ +function pararStatus(){ + ondeContador.style.display = "none"; + ondeControle.style.display="block"; + ondeMarcaTempo.style.display="block"; + ondeMarcaTempo.style.top = "10px"; + ondeControle.style.top = dh + 50 + "px"; + ondeData.style.top = dh + 30 + "px"; + ondeData.style.width = dw+"px"; + desativaQuadros(); + criaMarcadorTempo(); + //ajustaIds() + ativaQuadro(1); +} +function ajustaIds(){ + +} +/* +Function: criaMarcadorTempo + +Cria o gráfico que mostra as imagens disponíveis. Serve de base para indicar qual imagem está sendo mostrada +*/ +function criaMarcadorTempo(){ + var nmarcas = ids.length; + distanciaMarcas = parseInt(dw / nmarcas); + var ins = ""; + var ini = parseInt((distanciaMarcas*i - (distanciaMarcas/2))); + for(var i=1;i<=nmarcas;i++){ + ins += ""; + } + ins += ""; + ins += ""; + ngranulo = nmarcas; + tgranulo = (parseInt((distanciaMarcas*i - (distanciaMarcas/2))) - ini) / 10; + tempoGranulo = tempoAnima / 10; + ondeMarcaTempo.innerHTML = ins; + marcaVermelha = $i("marcaDeTempo"); + imgGranulo = $i("marcaGranulo"); + pararFilme(); + iniciarFilme(); +} +/* +Function: mostraI + +Mostra uma imagem específica + +Parametro: + +obj {dom} - objeto contendo a imagem +*/ +function mostraI(obj){ + $i(obj).style.display="block"; + ondeData.innerHTML = "YYMMDD: "+idsTempo[obj-1]; + if($i(quadroAtual)) + $i(quadroAtual).style.display = "none"; + else + $i("1").style.display = "none"; +} +/* +Function: escondeI + +Esconde uma imagem + +Parametro: + +obj {dom} - objeto contendo a imagem +*/ +function escondeI(obj){ + $i(obj).style.display="none"; + ondeData.innerHTML = ""; + if($i(quadroAtual)) + $i(quadroAtual).style.display = "block"; + else + $i("1").style.display = "block"; +} +/* +Function: adicionaMapa + +Adiciona uma camada ao mapa baseado na imagem vista na tela + +*/ +function adicionaMapa(idMarca){ + //aguarde("block"); + idMarca = parseInt(idMarca,10); + var serv = wms_configura[idServicoEscolhido]; + var fim = function(retorno){ + //aguarde("none"); + if (retorno.data.erro) + {i3GEO.janela.tempoMsg(retorno.data.erro);} + else + {window.parent.i3GEO.atualiza("");} + }; + var p = window.parent.i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+window.parent.i3GEO.configura.sid+"&funcao=adicionatemawms"; + p += "&servico="+serv.servico; + if(serv.styles == "") + p += "&nome="; + else + p += "&nome="+serv.styles; + p += "&tema="+serv.layers; + p += "&proj="+serv.srs; + p += "&formato="+serv.format; + p += "&tipo=estilo"; + p += "&versao=1.1.1"; + p += "&nomecamada="+serv.titulo+" "+idsTempo[idMarca-1]; + p += "&tiporep=&suportasld=nao"; + p += "&formatosinfo=text/plain,application/vnd.ogc.gml"; + p += "&time="+idsTempo[idMarca-1]; + var cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p,"wmstime",fim); + +} +function desativaQuadros(){ + var n = idsValidos.length; + for(var i=0;i \ No newline at end of file -- libgit2 0.21.2