Interactive interface for browsing global, full-resolution satellite imagery
update dateline tooltip on date change #137
Benjamin198cdce6b9a7
diff --git a/web/js/map/wv.map.datelinebuilder.js b/web/js/map/wv.map.datelinebuilder.jsindex 4bffce9ba..b03f5b4d9 100644--- a/web/js/map/wv.map.datelinebuilder.js+++ b/web/js/map/wv.map.datelinebuilder.js@@ -41,6 +41,9 @@ wv.map.datelinebuilder = wv.map.ui || function(models, config) {Parent.events.on('movestart', function() {updateLineVisibility(false);});+ models.date.events.on('select', function() {+ updateDate(models.date.selected)+ });};/*@@ -167,6 +170,20 @@ wv.map.datelinebuilder = wv.map.ui || function(models, config) {var onMouseOut = function(tooltip) {tooltip.setState({active: false});};+ var updateDate = function(date) {+ var leftState, rightState;+ leftState = {+ dateLeft: wv.util.toISOStringDate(wv.util.dateAdd(date, 'day', 1)),+ dateRight: wv.util.toISOStringDate(date)+ };+ rightState = {+ dateLeft: wv.util.toISOStringDate(date),+ dateRight: wv.util.toISOStringDate(wv.util.dateAdd(date, 'day', -1))+ };+ textLeft.setState(leftState);+ textRight.setState(rightState);++ };var position = function(map) {var extent, top, topY, bottomY, bottom, height, startY, topExtent, bottomExtent;diff --git a/web/js/map/wv.map.ui.js b/web/js/map/wv.map.ui.jsindex eaabbfd52..148aaa35d 100644--- a/web/js/map/wv.map.ui.js+++ b/web/js/map/wv.map.ui.js@@ -25,7 +25,7 @@ wv.map.ui = wv.map.ui || function(models, config, components) {var self = {};var rotation = new components.Rotation(self, models);var layerBuilder;- var dateline = components.Dateline();+ var dateline = components.Dateline(models, config);var layerKey;var createLayer;var precache = components.Precache(models, config, cache, self);@@ -350,7 +350,7 @@ wv.map.ui = wv.map.ui || function(models, config, components) {/** Update layers for the correct Date*- * @method updateDate+ * @method updateLookup* @static**