Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

* Resolved consistency issue between thumbnails and main map image * Modified all date instances to use UTC instead of local time * Date defaults to current timestamp in UTC * Added util function to retrieve a JS Date Object given an ISO8601 String

Tilak Joshi331e70176fcc
diff --git a/js/dateSpan.js b/js/dateSpan.js
index f2e23ab2d..9036f4f4f 100644
--- a/js/dateSpan.js
+++ b/js/dateSpan.js
@@ -58,7 +58,6 @@ SOTE.widget.DateSpan = function(containerId, config){
if(config.endDate === undefined){
config.endDate = new Date();
- config.endDate = new Date(eval(config.endDate.getMonth()+1)+"/"+config.endDate.getDate()+"/"+config.endDate.getFullYear());
}
else{
config.endDate = new Date(config.endDate);
@@ -131,9 +130,14 @@ SOTE.widget.DateSpan.prototype.init = function(){
mapDiv.setAttribute('id','mapdiv'+i);
mapDiv.setAttribute('class','dateitem');
spanContainer.appendChild(mapDiv);
- var time = new Date(startDate.getTime() + i*24*60*60*1000);
+ var time = new Date(startDate.getTime() + (i+1)*24*60*60*1000);
//var time = new Date(this.endDate.getTime() - i*24*60*60*1000);
- var timeString = time.getFullYear() + "-" + eval(time.getMonth()+1) + "-" + time.getDate();
+ //var timeString = time.getUTCFullYear() + "-" + eval(time.getUTCMonth()+1) + "-" + time.getUTCDate();
+ //timeString += "T"+
+ var timeString = time.getUTCFullYear() + "-" + SOTE.util.zeroPad(eval(time.getUTCMonth()+1),2) + "-" +
+ SOTE.util.zeroPad(time.getUTCDate(),2);
+ timeString += "T" + SOTE.util.zeroPad(time.getUTCHours(),2) + ":" +
+ SOTE.util.zeroPad(time.getUTCMinutes(),2) + ":" + SOTE.util.zeroPad(time.getUTCSeconds(),2);
this.maps.push(new SOTE.widget.Map('mapdiv'+i,{baseLayer:"Terra_MODIS",time:timeString,hasControls:false}));
}
@@ -201,10 +205,10 @@ SOTE.widget.DateSpan.prototype.setValue = function(value){
};
SOTE.widget.DateSpan.prototype.setVisualDate = function(){
- this.spanDate.innerHTML = this.value.getFullYear() + "-" + SOTE.util.zeroPad(eval(this.value.getMonth()+1),2) + "-" +
- SOTE.util.zeroPad(this.value.getDate(),2);
- this.spanTime.innerHTML = SOTE.util.zeroPad(this.value.getHours(),2) + ":" +
- SOTE.util.zeroPad(this.value.getMinutes(),2) + ":" + SOTE.util.zeroPad(this.value.getSeconds(),2);
+ this.spanDate.innerHTML = this.value.getUTCFullYear() + "-" + SOTE.util.zeroPad(eval(this.value.getUTCMonth()+1),2) + "-" +
+ SOTE.util.zeroPad(this.value.getUTCDate(),2);
+ this.spanTime.innerHTML = SOTE.util.zeroPad(this.value.getUTCHours(),2) + ":" +
+ SOTE.util.zeroPad(this.value.getUTCMinutes(),2) + ":" + SOTE.util.zeroPad(this.value.getUTCSeconds(),2);
};
/**
@@ -215,9 +219,9 @@ SOTE.widget.DateSpan.prototype.setVisualDate = function(){
*
*/
SOTE.widget.DateSpan.prototype.getValue = function(){
- var timeString = this.value.getFullYear() + "-" + SOTE.util.zeroPad(eval(this.value.getMonth()+1),2) + "-" +
- SOTE.util.zeroPad(this.value.getDate(),2) + "T" + SOTE.util.zeroPad(this.value.getHours(),2) + ":" +
- SOTE.util.zeroPad(this.value.getMinutes(),2) + ":" + SOTE.util.zeroPad(this.value.getSeconds(),2);
+ var timeString = this.value.getUTCFullYear() + "-" + SOTE.util.zeroPad(eval(this.value.getUTCMonth()+1),2) + "-" +
+ SOTE.util.zeroPad(this.value.getUTCDate(),2) + "T" + SOTE.util.zeroPad(this.value.getUTCHours(),2) + ":" +
+ SOTE.util.zeroPad(this.value.getUTCMinutes(),2) + ":" + SOTE.util.zeroPad(this.value.getUTCSeconds(),2);
return ""+this.id +"="+timeString+"&transition=standard";
};
@@ -236,9 +240,11 @@ SOTE.widget.DateSpan.prototype.updateComponent = function(qs){
var numOfDays = this.range/24/60/60/1000;
var startDate = new Date(this.endDate.getTime() - this.range);
for(var i=0; i<numOfDays; i++){
- var time = new Date(startDate.getTime() + i*24*60*60*1000);
- var timeString = time.getFullYear() + "-" + SOTE.util.zeroPad(eval(time.getMonth()+1),2) + "-" +
- SOTE.util.zeroPad(time.getDate(),2);
+ var time = new Date(startDate.getTime() + (i+1)*24*60*60*1000);
+ var timeString = time.getUTCFullYear() + "-" + SOTE.util.zeroPad(eval(time.getUTCMonth()+1),2) + "-" +
+ SOTE.util.zeroPad(time.getUTCDate(),2);
+ timeString += "T" + SOTE.util.zeroPad(time.getUTCHours(),2) + ":" +
+ SOTE.util.zeroPad(time.getUTCMinutes(),2) + ":" + SOTE.util.zeroPad(time.getUTCSeconds(),2);
this.maps[i].activateLayersDisableTheRest(activeLayers,timeString);
this.maps[i].setValue(bbox);
}
diff --git a/js/map.js b/js/map.js
index 3ff861dd2..da567dac9 100644
--- a/js/map.js
+++ b/js/map.js
@@ -69,7 +69,10 @@ SOTE.widget.Map = function(containerId, config){
if (config.time === undefined)
{
- config.time = null;
+ config.time = new Date();
+ config.time = config.time.getUTCFullYear() + "-" + SOTE.util.zeroPad(eval(config.time.getUTCMonth()+1),2) + "-" +
+ SOTE.util.zeroPad(config.time.getUTCDate(),2) + "T" + SOTE.util.zeroPad(config.time.getUTCHours(),2) + ":" +
+ SOTE.util.zeroPad(config.time.getUTCMinutes(),2) + ":" + SOTE.util.zeroPad(config.time.getUTCSeconds(),2);
}
if (config.baselayer === undefined)
@@ -128,7 +131,7 @@ SOTE.widget.Map.prototype.handleMapChange = function(evt){
new OpenLayers.Projection("EPSG:4326")).toString();
this.setValue(latLon);
- this.fire();
+ this.fire();
};
@@ -137,7 +140,8 @@ SOTE.widget.Map.prototype.activateLayerDisableTheRest = function(layerName, time
// Enable layers of selected Date, disable the rest
var allLayers = this.getAllLayers();
var nLayers = allLayers.length;
-
+ var myDate = SOTE.util.UTCDateFromISO8601String(time);
+ time = myDate.getUTCFullYear() + "-" + eval(myDate.getUTCMonth()+1) + "-" + myDate.getUTCDate();
// Loop through all loaded OpenLayers layers
for (var i=0; i<nLayers; i++)
{
@@ -161,7 +165,8 @@ SOTE.widget.Map.prototype.activateLayersDisableTheRest = function(activeLayerNam
// Enable layers of selected Date, disable the rest
var allLayers = this.getAllLayers();
var nLayers = allLayers.length;
-
+ var myDate = SOTE.util.UTCDateFromISO8601String(time);
+ time = myDate.getUTCFullYear() + "-" + eval(myDate.getUTCMonth()+1) + "-" + myDate.getUTCDate();
// Loop through all loaded OpenLayers layers
for (var i=0; i<nLayers; i++)
{
@@ -724,9 +729,15 @@ SOTE.widget.Map.prototype.updateComponent = function(qs){
this.soteMapData =
[
// {displayName: "Terra_MODIS_latest", wmsProductName: "TERRA_MODIS", time:"", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
- // {displayName: "Aqua_MODIS_latest", wmsProductName: "AQUA_MODIS", time:"", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ // {displayName: "Aqua_MODIS_latest", wmsProductName: "AQUA_MODIS", time:"", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "population", wmsProductName: "population", time:"", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "cartographic:esri-administrative-boundaries_level-1", wmsProductName: "cartographic:esri-administrative-boundaries_level-1", time:"", urls:["http://sedac.ciesin.columbia.edu/geoserver/wms?"], layers:"cartographic:esri-administrative-boundaries_level-1", transparent:true, projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-26", wmsProductName: "AQUA_MODIS", time:"2011-12-26", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-25", wmsProductName: "AQUA_MODIS", time:"2011-12-25", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-24", wmsProductName: "AQUA_MODIS", time:"2011-12-24", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-23", wmsProductName: "AQUA_MODIS", time:"2011-12-23", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-22", wmsProductName: "AQUA_MODIS", time:"2011-12-22", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-21", wmsProductName: "AQUA_MODIS", time:"2011-12-21", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-20", wmsProductName: "AQUA_MODIS", time:"2011-12-20", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-19", wmsProductName: "AQUA_MODIS", time:"2011-12-19", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-18", wmsProductName: "AQUA_MODIS", time:"2011-12-18", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
@@ -747,6 +758,12 @@ SOTE.widget.Map.prototype.updateComponent = function(qs){
{displayName: "Aqua_MODIS__2011-12-03", wmsProductName: "AQUA_MODIS", time:"2011-12-03", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-02", wmsProductName: "AQUA_MODIS", time:"2011-12-02", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-01", wmsProductName: "AQUA_MODIS", time:"2011-12-01", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-26", wmsProductName: "TERRA_MODIS", time:"2011-12-26", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-25", wmsProductName: "TERRA_MODIS", time:"2011-12-25", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-24", wmsProductName: "TERRA_MODIS", time:"2011-12-24", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-23", wmsProductName: "TERRA_MODIS", time:"2011-12-23", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-22", wmsProductName: "TERRA_MODIS", time:"2011-12-22", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-21", wmsProductName: "TERRA_MODIS", time:"2011-12-21", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-20", wmsProductName: "TERRA_MODIS", time:"2011-12-20", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-19", wmsProductName: "TERRA_MODIS", time:"2011-12-19", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-18", wmsProductName: "TERRA_MODIS", time:"2011-12-18", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
@@ -767,6 +784,12 @@ SOTE.widget.Map.prototype.updateComponent = function(qs){
{displayName: "Terra_MODIS__2011-12-03", wmsProductName: "TERRA_MODIS", time:"2011-12-03", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-02", wmsProductName: "TERRA_MODIS", time:"2011-12-02", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-01", wmsProductName: "TERRA_MODIS", time:"2011-12-01", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-26", wmsProductName: "AIRS_Dust", time:"2011-12-26", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-25", wmsProductName: "AIRS_Dust", time:"2011-12-25", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-24", wmsProductName: "AIRS_Dust", time:"2011-12-24", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-23", wmsProductName: "AIRS_Dust", time:"2011-12-23", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-22", wmsProductName: "AIRS_Dust", time:"2011-12-22", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-21", wmsProductName: "AIRS_Dust", time:"2011-12-21", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "AIRS_Dust__2011-12-20", wmsProductName: "AIRS_Dust", time:"2011-12-20", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "AIRS_Dust__2011-12-19", wmsProductName: "AIRS_Dust", time:"2011-12-19", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "AIRS_Dust__2011-12-18", wmsProductName: "AIRS_Dust", time:"2011-12-18", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
@@ -787,7 +810,7 @@ SOTE.widget.Map.prototype.updateComponent = function(qs){
{displayName: "AIRS_Dust__2011-12-03", wmsProductName: "AIRS_Dust", time:"2011-12-03", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "AIRS_Dust__2011-12-02", wmsProductName: "AIRS_Dust", time:"2011-12-02", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "AIRS_Dust__2011-12-01", wmsProductName: "AIRS_Dust", time:"2011-12-01", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 }
- ];
+ ];
// Load into map
this.addLayers(this.soteMapData);
diff --git a/js/mapSote.js b/js/mapSote.js
index cec09dce3..20d403a34 100644
--- a/js/mapSote.js
+++ b/js/mapSote.js
@@ -38,7 +38,7 @@ SOTE.widget.MapSote = function(containerId, config)
this.map.events.register("movestart", this, this.handleMapMoveStart);
// test
- this.updateComponent("?products=Terra_MODIS.SEDAC_PopulationDensity.SEDAC_AdminBoundaries&time=2011-11-30T00:00:00&transition=standard");
+ //this.updateComponent("?products=Terra_MODIS.SEDAC_PopulationDensity.SEDAC_AdminBoundaries&time=2011-11-30T00:00:00&transition=standard");
};
@@ -92,7 +92,7 @@ SOTE.widget.MapSote.prototype.handleMapMoveStart = function(evt)
* @returns {boolean} true or false depending on if the component still validates with the new criteria
*
*/
-SOTE.widget.Map.prototype.updateComponent = function(querystring)
+SOTE.widget.MapSote.prototype.updateComponent = function(querystring)
{
// Load SOTE-specific map data if not already cached
if (!this.isSoteMapDataCached)
@@ -103,6 +103,12 @@ SOTE.widget.Map.prototype.updateComponent = function(querystring)
// {displayName: "Aqua_MODIS_latest", wmsProductName: "AQUA_MODIS", time:"", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "population", wmsProductName: "population", time:"", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "cartographic:esri-administrative-boundaries_level-1", wmsProductName: "cartographic:esri-administrative-boundaries_level-1", time:"", urls:["http://sedac.ciesin.columbia.edu/geoserver/wms?"], layers:"cartographic:esri-administrative-boundaries_level-1", transparent:true, projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-26", wmsProductName: "AQUA_MODIS", time:"2011-12-26", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-25", wmsProductName: "AQUA_MODIS", time:"2011-12-25", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-24", wmsProductName: "AQUA_MODIS", time:"2011-12-24", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-23", wmsProductName: "AQUA_MODIS", time:"2011-12-23", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-22", wmsProductName: "AQUA_MODIS", time:"2011-12-22", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Aqua_MODIS__2011-12-21", wmsProductName: "AQUA_MODIS", time:"2011-12-21", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-20", wmsProductName: "AQUA_MODIS", time:"2011-12-20", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-19", wmsProductName: "AQUA_MODIS", time:"2011-12-19", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-18", wmsProductName: "AQUA_MODIS", time:"2011-12-18", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
@@ -123,6 +129,12 @@ SOTE.widget.Map.prototype.updateComponent = function(querystring)
{displayName: "Aqua_MODIS__2011-12-03", wmsProductName: "AQUA_MODIS", time:"2011-12-03", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-02", wmsProductName: "AQUA_MODIS", time:"2011-12-02", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Aqua_MODIS__2011-12-01", wmsProductName: "AQUA_MODIS", time:"2011-12-01", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-26", wmsProductName: "TERRA_MODIS", time:"2011-12-26", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-25", wmsProductName: "TERRA_MODIS", time:"2011-12-25", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-24", wmsProductName: "TERRA_MODIS", time:"2011-12-24", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-23", wmsProductName: "TERRA_MODIS", time:"2011-12-23", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-22", wmsProductName: "TERRA_MODIS", time:"2011-12-22", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "Terra_MODIS__2011-12-21", wmsProductName: "TERRA_MODIS", time:"2011-12-21", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-20", wmsProductName: "TERRA_MODIS", time:"2011-12-20", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-19", wmsProductName: "TERRA_MODIS", time:"2011-12-19", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-18", wmsProductName: "TERRA_MODIS", time:"2011-12-18", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
@@ -143,6 +155,12 @@ SOTE.widget.Map.prototype.updateComponent = function(querystring)
{displayName: "Terra_MODIS__2011-12-03", wmsProductName: "TERRA_MODIS", time:"2011-12-03", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-02", wmsProductName: "TERRA_MODIS", time:"2011-12-02", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "Terra_MODIS__2011-12-01", wmsProductName: "TERRA_MODIS", time:"2011-12-01", format: "image/jpeg", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-26", wmsProductName: "AIRS_Dust", time:"2011-12-26", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-25", wmsProductName: "AIRS_Dust", time:"2011-12-25", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-24", wmsProductName: "AIRS_Dust", time:"2011-12-24", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-23", wmsProductName: "AIRS_Dust", time:"2011-12-23", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-22", wmsProductName: "AIRS_Dust", time:"2011-12-22", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
+ {displayName: "AIRS_Dust__2011-12-21", wmsProductName: "AIRS_Dust", time:"2011-12-21", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "AIRS_Dust__2011-12-20", wmsProductName: "AIRS_Dust", time:"2011-12-20", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "AIRS_Dust__2011-12-19", wmsProductName: "AIRS_Dust", time:"2011-12-19", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
{displayName: "AIRS_Dust__2011-12-18", wmsProductName: "AIRS_Dust", time:"2011-12-18", format: "image/png", urls:["http://map1.vis.earthdata.nasa.gov/data/wms.cgi"], tileSize:[512,512], projection:"EPSG:4326", numZoomLevels:9, maxExtent:[-180,-1350,180,90], maxResolution:0.5625 },
@@ -255,10 +273,10 @@ SOTE.widget.Map.prototype.updateComponent = function(querystring)
{
// Don't do any fancy opacity adjustments, just show the date that's closest to time slider position
var selectedDate = null;
- if (fracTimeOfDay < 0.50)
+// if (fracTimeOfDay < 0.50)
selectedDate = new String(t0);
- else
- selectedDate = new String(t1);
+// else
+// selectedDate = new String(t1);
// Enable layers of selected Date, disable the rest
var allLayers = this.getAllLayers();
diff --git a/js/sote.js b/js/sote.js
index 3dc74ce61..5972b9497 100644
--- a/js/sote.js
+++ b/js/sote.js
@@ -1,10 +1,10 @@
window.onload = function(){// Initialize "static" vars
// Create map
- var m = new SOTE.widget.MapSote("map",{baseLayer:"Aqua_MODIS",time:"2011-12-06"});
+ var m = new SOTE.widget.MapSote("map",{baseLayer:"Terra_MODIS"});
var a = new SOTE.widget.AccordionPicker("products",{dataSourceUrl:"data/ap.json"});
var h = new SOTE.widget.MenuPicker("hazard",{dataSourceUrl:"data/mp_hazard.json"});
//var tr = new SOTE.widget.MenuPicker("transition",{dataSourceUrl:"data/mp_transition.json",selected:"sta"});
- var map = new SOTE.widget.DateSpan("time",{endDate:"12/06/2011"});
+ var map = new SOTE.widget.DateSpan("time");
}
diff --git a/js/util.js b/js/util.js
index d8a886d90..2a2c673db 100644
--- a/js/util.js
+++ b/js/util.js
@@ -51,3 +51,29 @@ SOTE.util.zeroPad = function(num, places) {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
}
+
+
+/**
+ * Returns a JS Date Object given an ISO8601 formatted UTC datetime string
+ *
+ * @param {String} dateAsString is the UTC datetime string in ISO8601 format
+ *
+ * @returns {Date} New date instantiated from string
+ */
+SOTE.util.UTCDateFromISO8601String = function( dateAsString )
+{
+ var dateTimeArr = dateAsString.split(/T/);
+
+ var yyyymmdd = dateTimeArr[0];
+ var hhmmss = dateTimeArr[1];
+
+ // Parse elements of date and time
+ var year = yyyymmdd.split("-")[0];
+ var month = eval(yyyymmdd.split("-")[1]-1);
+ var day = yyyymmdd.split("-")[2];
+ var hour = hhmmss.split(":")[0];
+ var minute = hhmmss.split(":")[1];
+ var second = hhmmss.split(":")[2];
+
+ return new Date( Date.UTC( year,month,day,hour,minute,second ));
+}