From a34c193d23048d233088fae336b3f7d26dbc0862 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 4 May 2009 18:20:12 +0000 Subject: [PATCH] Incluída uma nova opção na árvore de adição de temas que permite conectar com WMS-T --- aplicmap/geral.htm | 2 +- classesjs/classe_arvoredetemas.js | 31 ++++++++++++++++++++++++++++++- classesjs/classe_idioma.js | 2 +- classesjs/compactados/classe_arvoredetemas_compacto.js | 2 +- classesjs/compactados/classe_idioma_compacto.js | 2 +- classesjs/compactados/dicionario_ajuda_compacto.js | 2 +- classesjs/compactados/dicionario_compacto.js | 2 +- classesjs/dicionario.js | 7 +++++++ classesjs/dicionario_ajuda.js | 12 +++++++++++- classesjs/i3geo_tudo_compacto.js | 40 ++++++++++++++++++++++++++++++++++++++-- classesjs/i3geo_tudo_compacto.js.php | 40 ++++++++++++++++++++++++++++++++++++++-- classesphp/classe_mapa.php | 5 ++++- classesphp/mapa_controle.php | 2 +- css/botoes.css | 12 ++++++++++++ css/i3geo.css | 12 ++++++++++++ css/i3geo.css.php | 12 ++++++++++++ ferramentas/wmstime/exemplo.htm | 14 ++++++++++++++ ferramentas/wmstime/index.htm | 9 ++++++--- ferramentas/wmstime/index.js | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------- imagens/visual/azul/sprite.png | Bin 25872 -> 0 bytes imagens/visual/azulclaro/sprite.png | Bin 26500 -> 0 bytes imagens/visual/default/sprite.png | Bin 26647 -> 0 bytes imagens/visual/laranja/sprite.png | Bin 26815 -> 0 bytes menutemas/admin.db | Bin 53248 -> 0 bytes 24 files changed, 300 insertions(+), 49 deletions(-) create mode 100644 ferramentas/wmstime/exemplo.htm diff --git a/aplicmap/geral.htm b/aplicmap/geral.htm index a3d0e47..4c5ff72 100644 --- a/aplicmap/geral.htm +++ b/aplicmap/geral.htm @@ -11,7 +11,7 @@ Para depurar o código sem ter de compactá-los, substitua na linha abaixo o arquivo i3geo.js por i3geo.js --> - + + @@ -11,7 +15,7 @@ diff --git a/ferramentas/wmstime/index.js b/ferramentas/wmstime/index.js index 55cad49..e1260bf 100644 --- a/ferramentas/wmstime/index.js +++ b/ferramentas/wmstime/index.js @@ -1,9 +1,13 @@ - +parametrosURL() //tipo = 1 anual, 2 mensal, 3 diario wms_configura = { "1": { titulo: "JPL NASA - Daily planet", - servico:"http://onearth.jpl.nasa.gov/wms.cgi?REQUEST=GetMap&layers=daily_planet&styles=&srs=EPSG:4326&format=image/jpeg", + servico:"http://onearth.jpl.nasa.gov/wms.cgi?", + layers:"daily_planet", + styles:"", + srs:"EPSG:4326", + format:"image/jpeg", descricao:"Dados diários disponíveis desde 12 de janeiro de 2007. A contiunously updating composite of visual images from TERRA MODIS scenes, see http://modis.gsfc.nasa.gov for details about MODIS. This dataset is built local on the OnEarth server, it updates as soon as scenes are available, usually with a 6 to 24 hour delay from real time. Images are produced from MODIS scenes using the HDFLook application. Base resolution is 8 arcseconds per pixel.", anoInicio: 2008, mesInicio: 11, @@ -15,7 +19,11 @@ wms_configura = { }, "2": { titulo: "JPL NASA - Daily afternoon", - servico:"http://onearth.jpl.nasa.gov/wms.cgi?REQUEST=GetMap&layers=daily_afternoon&styles=&srs=EPSG:4326&format=image/jpeg", + servico:"http://onearth.jpl.nasa.gov/wms.cgi?", + layers:"daily_afternoon", + styles:"", + srs:"EPSG:4326", + format:"image/jpeg", descricao:"Dados diários disponíveis desde 12 de janeiro de 2008. A contiunously updating composite of visual images from AQUA MODIS scenes, see http://modis.gsfc.nasa.gov for details about MODIS. This dataset is built local on the OnEarth server, it updates as soon as scenes are available, usually with a 6 to 24 hour delay from real time. Images are produced from MODIS scenes using the HDFLook application. Base resolution is 8 arcseconds per pixel.", anoInicio: 2008, mesInicio: 11, @@ -27,7 +35,11 @@ wms_configura = { }, "3": { titulo: "JPL NASA - Daily terra 721 pseudocolor", - servico:"http://onearth.jpl.nasa.gov/wms.cgi?REQUEST=GetMap&layers=daily_terra_721&styles=&srs=EPSG:4326&format=image/jpeg", + servico:"http://onearth.jpl.nasa.gov/wms.cgi?", + layers:"daily_terra_721", + styles:"", + srs:"EPSG:4326", + format:"image/jpeg", descricao:"Dados diários disponíveis desde 1 de janeiro de 2006 até 12 de março de 2008. This layer is no longer updated. Daily generated mosaic of TERRA images released by the MODIS Rapid Response System, http://rapidfire.gsfc.nasa.gov/. Updates every day, at about 1200Z, with images taken during the previous day. Maximum resolution is 8 arcseconds per pixel", anoInicio: 2006, mesInicio: 1, @@ -39,7 +51,11 @@ wms_configura = { }, "4": { titulo: "JPL NASA - Daily aqua 721 pseudocolor", - servico:"http://onearth.jpl.nasa.gov/wms.cgi?REQUEST=GetMap&layers=daily_aqua_721&styles=&srs=EPSG:4326&format=image/jpeg", + servico:"http://onearth.jpl.nasa.gov/wms.cgi?", + layers:"daily_aqua_721", + styles:"", + srs:"EPSG:4326", + format:"image/jpeg", descricao:"Dados diários disponíveis desde 1 de janeiro de 2006 até 12 de março de 2008. This layer is no longer updated. Daily generated mosaic of AQUA images released by the MODIS Rapid Response System, http://rapidfire.gsfc.nasa.gov/. Updates every day, at about 1200Z, with images taken during the previous day. Maximum resolution is 8 arcseconds per pixel", anoInicio: 2006, mesInicio: 1, @@ -51,7 +67,11 @@ wms_configura = { }, "5": { titulo: "JPL NASA - Terra NDVI", - servico:"http://onearth.jpl.nasa.gov/wms.cgi?REQUEST=GetMap&layers=daily_terra_ndvi&styles=&srs=EPSG:4326&format=image/jpeg", + servico:"http://onearth.jpl.nasa.gov/wms.cgi?", + layers:"daily_terra_ndvi", + styles:"", + srs:"EPSG:4326", + format:"image/jpeg", descricao:"Dados diários disponíveis desde 1 de janeiro de 2006 até 12 de março de 2008. This layer is no longer updated. Daily generated mosaic of TERRA images released by the MODIS Rapid Response System, http://rapidfire.gsfc.nasa.gov/. Updates every day, at about 1200Z, with images taken during the previous day. Maximum resolution is 8 arcseconds per pixel", anoInicio: 2006, mesInicio: 1, @@ -63,7 +83,11 @@ wms_configura = { }, "6": { titulo: "JPL NASA - Aqua NDVI", - servico:"http://onearth.jpl.nasa.gov/wms.cgi?REQUEST=GetMap&layers=daily_aqua_ndvi&styles=&srs=EPSG:4326&format=image/jpeg", + servico:"http://onearth.jpl.nasa.gov/wms.cgi?", + layers:"daily_aqua_ndvi", + styles:"", + srs:"EPSG:4326", + format:"image/jpeg", descricao:"Dados diários disponíveis desde 1 de janeiro de 2006 até 12 de março de 2008. This layer is no longer updated. Daily generated mosaic of AQUA images released by the MODIS Rapid Response System, http://rapidfire.gsfc.nasa.gov/. Updates every day, at about 1200Z, with images taken during the previous day. Maximum resolution is 8 arcseconds per pixel", anoInicio: 2006, mesInicio: 1, @@ -72,16 +96,33 @@ wms_configura = { mesFim: 1, diaFim: 12, tipo: 3 + }, + "7": { + 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 } } var ins = "

Escolha o serviço de dados

" -ins += "" ins += "" for(var key in wms_configura){ ins += "" } ins += ""; -ins += "

"; +ins += "

" +ins += "

"; ins += "" ins += "" ins += "" @@ -91,30 +132,32 @@ ins += "
Ano inicial:
Mês inicial:
Ano final: 1) + //if(tipoServico > 1) $i("WMS_mesinicio").value = wms_configura[idWMS].mesInicio - if(tipoServico > 2) + //if(tipoServico > 2) $i("WMS_diainicio").value = wms_configura[idWMS].diaInicio $i("WMS_anofim").value = wms_configura[idWMS].anoFim - if(tipoServico > 1) + //if(tipoServico > 1) $i("WMS_mesfim").value = wms_configura[idWMS].mesFim - if(tipoServico > 2) + //if(tipoServico > 2) $i("WMS_diafim").value = wms_configura[idWMS].diaFim if(tipoServico == 1){ @@ -134,13 +177,17 @@ function escolheuServico(idWMS){ function iniciaImagens(){ $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 = 985 - h = 534 - d = w / 500 - dw = 500 - dh = parseInt(h / d) + w = window.parent.i3GEO.parametros.w //985 + h = window.parent.i3GEO.parametros.h + dw = w / 2 + dh = h / 2 anoInicio = $i("WMS_anoinicio").value mesInicio = $i("WMS_mesinicio").value @@ -174,10 +221,10 @@ function iniciaImagens(){ while (mesAtual < 13){ var mes = mesAtual; if(mes < 10){var mes = "0"+mes;} - criaImg(anoAtual+"-"+dataFixa+"-"+mes,id) - criaImgStatus(anoAtual+"-"+dataFixa+"-"+mes,id) + criaImg(anoAtual+"-"+mes+"-"+dataFixa,id) + criaImgStatus(anoAtual+"-"+mes+"-"+dataFixa,id) ids.push(id) - idsTempo.push(anoAtual+"-"+dataFixa+"-"+mes) + idsTempo.push(anoAtual+"-"+mes+"-"+dataFixa) id++ mesAtual++ if(anoAtual == anoFim && mesAtual > mesFim){var mesAtual = 13} @@ -197,10 +244,10 @@ function iniciaImagens(){ while (diaAtual < 31){ var dia = diaAtual; if(diaAtual < 10){var dia = "0"+dia;} - criaImg(anoAtual+"-"+dia+"-"+mes,id) - criaImgStatus(anoAtual+"-"+dia+"-"+mes,id) + criaImg(anoAtual+"-"+mes+"-"+dia,id) + criaImgStatus(anoAtual+"-"+mes+"-"+dia,id) ids.push(id) - idsTempo.push(anoAtual+"-"+dia+"-"+mes) + idsTempo.push(anoAtual+"-"+mes+"-"+dia) id++ diaAtual++ if(mesAtual == mesFim && diaAtual > diaFim){var diaAtual = 32} @@ -223,7 +270,7 @@ function criaImg(tempo,id){ novoel.style.left = "0px" novoel.style.width = dw+"px"; novoel.style.height = dh+"px"; - novoel.src = servico+"&width="+dw+"&height="+dh+"&bbox="+bbox+"&time="+tempo //"../../imagens/atlas1.jpg"; + novoel.src = $i("iServico").value+"&width="+dw+"&height="+dh+"&bbox="+bbox+"&time="+tempo //"../../imagens/atlas1.jpg"; novoel.onload = function(){ $i("status"+this.id).innerHTML = " OK" idsValidos.push(this.id) @@ -275,9 +322,9 @@ function criaMarcadorTempo(){ var ins = "" var ini = parseInt((distanciaMarcas*i - (distanciaMarcas/2))) for(i=1;i<=nmarcas;i++){ - ins += "" + ins += "" } - ins += "" + ins += "" ins += "" ngranulo = nmarcas; tgranulo = (parseInt((distanciaMarcas*i - (distanciaMarcas/2))) - ini) / 10; @@ -286,10 +333,11 @@ function criaMarcadorTempo(){ marcaVermelha = $i("marcaDeTempo"); imgGranulo = $i("marcaGranulo") pararFilme() + iniciarFilme() } function mostraI(obj){ $i(obj).style.display="block"; - ondeData.innerHTML = idsTempo[obj-1] + ondeData.innerHTML = "YYMMDD: "+idsTempo[obj-1] if($i(quadroAtual)) $i(quadroAtual).style.display = "none" else @@ -303,7 +351,36 @@ function escondeI(obj){ else $i("1").style.display = "block" } - +function adicionaMapa(obj){ + aguarde("block") + var serv = wms_configura[obj-1] + var fim = function(retorno){ + aguarde("none") + if (retorno.data.erro) + {alert(retorno.data.erro)} + else + {window.parent.i3GEO.atualiza("");} + } + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_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[obj-1] + p += "&tiporep=&suportasld=nao" + p += "&formatosinfo=text/plain,application/vnd.ogc.gml" + p += "&time="+idsTempo[obj-1] + var cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p,"wmstime",fim); + +} function desativaQuadros(){ var n = idsValidos.length for(i=0;i