Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

* Click functionality for date thumbnails * Slider snaps to date * Slider no longer aligns top-left to mouse but instead aligns center with mouse * Modified permalink text styling

Tilak Joshi40ddeb7edbec
diff --git a/css/dateSpan.css b/css/dateSpan.css
index a540f2839..c56fb67de 100644
--- a/css/dateSpan.css
+++ b/css/dateSpan.css
@@ -3,12 +3,12 @@
.spanContainerLabelDay{font-size:.16em;}
.spanContainer { float:right; min-height:100%; width:97%; margin-top:10px; margin-bottom:10px;}
.dateSpan {width:100%;}
-.datespan div.olMap {width:11.6%; height:100px;
+.datespan div.olMap {width:11.78%; height:100px;
float:left;
-/*-moz-box-shadow: 0 0 5px 5px #111;
+-moz-box-shadow: 0 0 5px 5px #111;
-webkit-box-shadow: 0 0 5px 5px #111;
-box-shadow: 0 0 5px 5px #111;*/
-border:#fff 1px solid;
+box-shadow: 0 0 5px 5px #111;
+/*border:#fff 1px solid;*/
margin:20px 0 0 2.5% !important;
position:relative; left:-1.25%;
display:block;
@@ -17,12 +17,12 @@ a.ecbutton { display:block; width:24px; height:24px; float:right; margin-right:5
a.collapse {background-image: url("../images/collapseDown.png"); }
a.expand {background-image: url("../images/expandUp.png");}
.dateSpanSlider {visibility:hidden;}
-div.ui-slider{height:0px; width:85.5%; border:red 0px solid; z-index:1002; float:left; margin:0 0 0 1.25%;}
+div.ui-slider{height:0px; width:85.5%; border:red 0px solid; z-index:1002; float:left; margin:0 0 0 7.24%;}
div.ui-slider-switch {display:none}
-a.ui-slider-handle{height:130px; display:block; width:14%; background:rgba(228,108,10,.2); border:#E46C0A 2px solid; z-index:1004; position:relative; top:-142px; margin: 10px 0 0 0 !important; padding: 5px 0 5px 0; }
+a.ui-slider-handle{height:130px; display:block; width:14%; background:rgba(228,108,10,.2); border:#E46C0A 2px solid; z-index:1004; position:relative; top:-142px; margin: 10px 0 0 -7% !important; padding: 5px 0 5px 0; }
span.sliderText {font: 14px/14px "Gill Sans", sans-serif, serif; font-weight:500; color:#fff; text-shadow:none; z-index:1005;}
a.ui-btn {margin:0;}
a.ui-shadow {box-shadow:none;}
-a.ui-btn-up-c {box-shadow:none;}
+a.ui-btn-up-c {box-shadow:none;}
#mapdiv {margin:0; padding:0; left:0px;}
\ No newline at end of file
diff --git a/js/dateSpan.js b/js/dateSpan.js
index 652cddec6..c9738bf11 100644
--- a/js/dateSpan.js
+++ b/js/dateSpan.js
@@ -158,6 +158,7 @@ SOTE.widget.DateSpan.prototype.init = function(){
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:"MODIS_Terra_CorrectedReflectance_TrueColor",time:timeString,hasControls:false}));
+ $('#mapdiv'+i).bind("click",{self:this,time:time.clone()},SOTE.widget.DateSpan.snapToTime);
}
@@ -168,6 +169,7 @@ SOTE.widget.DateSpan.prototype.init = function(){
$('#'+this.id+'slider').slider();
$('#'+this.id+'slider').bind("change",{self:this},SOTE.widget.DateSpan.handleSlide);
+ $('#'+this.id+'slider').siblings('.ui-slider').bind("vmouseup",{self:this},SOTE.widget.DateSpan.snap);
$('.ecbutton').bind("click",{self:this},SOTE.widget.DateSpan.toggle);
@@ -264,6 +266,35 @@ SOTE.widget.DateSpan.toggle = function(e,ui){
}
};
+SOTE.widget.DateSpan.snap = function(e,ui){
+ var self = e.data.self;
+ var value = $("#"+self.id+"slider").val();
+ var x = (self.range - (24*60*60*1000)) * (100-value)/100;
+ var time = new Date(self.endDate.getTime() - x);
+ time.setHours(12);
+ time.setMinutes(0);
+ time.setSeconds(0);
+ time = new Date(time.getTime() - time.getTimezoneOffset()*60000);
+ 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);
+ self.setValue(timeString);
+};
+
+SOTE.widget.DateSpan.snapToTime = function(e,ui){
+ var self = e.data.self;
+ var time = e.data.time;
+ time = new Date(time.getTime() - time.getTimezoneOffset()*60000);
+
+ 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);
+
+ self.setValue(timeString);
+};
+
SOTE.widget.DateSpan.prototype.hideMaps = function(){
for(var i=0; i<this.maps.length; ++i){
$("#"+this.maps[i].id).css('display','none');
diff --git a/js/sote.js b/js/sote.js
index 0732a106c..007df932d 100644
--- a/js/sote.js
+++ b/js/sote.js
@@ -60,9 +60,9 @@ function showPermalink(){
this.permOverlay = new YAHOO.widget.Panel("panel_perm", {width:"300px", zIndex:1020, visible:false } );
var item = "<div id='permpanel' >"+
"<!-- <h3>Permalink:</h3> -->"+
- "<span style='font-weight:400; font-size:12px; line-spacing:24px; '><i>Copy and paste the following link to share this view:</i></span>" +
+ "<span style='font-weight:400; font-size:12px; line-spacing:24px; '>Copy and paste the following link to share this view:</span>" +
"<input type='text' value='' name='permalink_content' id='permalink_content' />" +
- "<p><br />Note: Worldview contains only the most recent 7 days of data, this link will expire after the currently selected time is older than 7 days.</p>" +
+ "<p><br /><i>Note: Worldview contains only the most recent 7 days of data, this link will expire after the currently selected time is older than 7 days.</i></p>" +
"</div>";
this.permOverlay.setHeader('&nbsp;&nbsp;&nbsp;&nbsp;Permalink');
this.permOverlay.setBody(item);