Interactive interface for browsing global, full-resolution satellite imagery
fix draggerB being ignored if out of compare mode buy active, fix updatescale for animation with B dragger, clean up dead code comments in animation
Edward Plato9f41cdb65f13
diff --git a/web/js/animation/range-select.js b/web/js/animation/range-select.jsindex 53cd684c7..f0cc9470a 100644--- a/web/js/animation/range-select.js+++ b/web/js/animation/range-select.js@@ -147,7 +147,7 @@ export function animationRangeSelect(models, config, ui) {*/self.getLocationFromStringDate = function(date) {// return timeline.x(util.roundTimeTenMinute(date));- return 100;+ return -100;};/*diff --git a/web/js/animation/ui.js b/web/js/animation/ui.jsindex 64043ec22..f0ef5ce9b 100644--- a/web/js/animation/ui.js+++ b/web/js/animation/ui.js@@ -128,7 +128,8 @@ export function animationUi(models, ui) {// util.clearTimeUTC(startDate);// dateModel.selected = zeroDate;// }- currentDate = dateModel.selected;+ let activeDate = dateModel.activeDate; // determine if selected or selectedB+ currentDate = dateModel[activeDate];if (currentDate > startDate && self.nextDate(currentDate) < endDate) {return util.toISOStringSeconds(self.nextDate(currentDate));}@@ -190,9 +191,6 @@ export function animationUi(models, ui) {**/self.getInterval = function () {- // console.log(models.date.selectedZoom, models.date.interval)- // return zooms[models.date.selectedZoom - 1];- // console.log (models.date.interval)return zooms[models.date.interval];};@@ -214,23 +212,16 @@ export function animationUi(models, ui) {let customSelected = models.date.customSelected;let interval;let delta;- // console.log(models.date.customInterval)if (customSelected) {interval = zooms[Number(models.date.customInterval)] || zooms[3];- // console.log(zooms[Number(models.date.customInterval)], interval)if (interval === 'custom') {interval = zooms[models.date.selectedZoom];}delta = models.date.customDelta || 1;} else {interval = self.getInterval();- // console.log(interval)delta = 1;}- // console.log(interval)- // let interval = self.getInterval();- // console.log(models.date.customInterval, date, interval, delta)- // console.log(date,interval,delta)return util.dateAdd(date, interval, delta);};diff --git a/web/js/animation/widget.js b/web/js/animation/widget.jsindex 109685e53..0c229afcd 100644--- a/web/js/animation/widget.js+++ b/web/js/animation/widget.js@@ -18,7 +18,6 @@ export function animationWidget(models, config, ui) {var customText = models.date.customDelta && models.date.customInterval ? `${models.date.customDelta} ${timeScaleFromNumberKey[models.date.customInterval]}` : 'custom';var zooms = [customText, 'yearly', 'monthly', 'daily', 'hourly', 'minutely'];var self = {};- var timeline = ui.timeline;var model = models.anim;var $timelineFooter;var $animateButton;@@ -180,17 +179,13 @@ export function animationWidget(models, config, ui) {**/self.getIncrements = function() {- // if (models.date.maxZoom > 3) {- // debugger;let customText = models.date.customDelta && models.date.customInterval ? `${models.date.customDelta} ${timeScaleFromNumberKey[models.date.customInterval]}` : 'custom';if (models.layers.hasSubDaily()) {zooms = [customText, 'yearly', 'monthly', 'daily', 'hourly', 'minutely'];} else {zooms = [customText, 'yearly', 'monthly', 'daily'];}- // return zooms[models.date.selectedZoom - 1];let interval = models.date.interval ? models.date.interval : models.date.selectedZoom - 1;- console.log(customText, zooms[models.date.interval], models.date.interval, models.date.selectedZoom)return zooms[interval];};@@ -226,11 +221,6 @@ export function animationWidget(models, config, ui) {*/self.onZoomSelect = function(increment) { // ? still want to change zoom level on select???var zoomLevel = lodashIndexOf(zooms, increment);- console.log(zoomLevel, increment)- // models.date.setSelectedZoom(zoomLevel);- // return timeline.config.zoom(zoomLevel + 1);- // models.date.events.trigger('zoom-change');- // models.date.events.trigger('interval-change');models.date.changeIncrement(zoomLevel);models.date.events.trigger('interval-change');};@@ -304,10 +294,8 @@ export function animationWidget(models, config, ui) {var currentDate = new Date(dateModel[dateModel.activeDate]);var interval = ui.anim.ui.getInterval();if (interval === 'custom') {- debugger;interval = zooms[models.date.selectedZoom];}- console.log(interval)if (dateModel.selectedZoom === 4) {intervalStep = 70;} else {@@ -337,13 +325,6 @@ export function animationWidget(models, config, ui) {**/self.onPressPlay = function() {- // debugger;- // let zoomLevel = ui.anim.ui.getInterval();- // console.log(zoomLevel)- // if (zoomLevel !== 'minute' && zoomLevel !== 'hour' && zoomLevel !== 'custom') {- // // zero out start/end date times- // self.setZeroDateTimes();- // }model.rangeState.playing = true;model.events.trigger('play');};@@ -449,12 +430,7 @@ export function animationWidget(models, config, ui) {**/self.onPressGIF = function() {- // let zoomLevel = ui.anim.ui.getInterval();let looping = ui.anim.widget.reactComponent.state.looping;- // if (zoomLevel !== 'minute') {- // // zero out start/end date times- // self.setZeroDateTimes();- // }let increment = self.getIncrements();let frameSpeed = model.rangeState.speed;diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.jsindex fac468732..ed1dc09b3 100644--- a/web/js/components/timeline/timeline-axis/timeline-axis.js+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js@@ -85,7 +85,7 @@ class TimelineAxis extends React.Component {let gridWidth = options.gridWidth;let axisWidth = axisWidthInput ? axisWidthInput : this.props.axisWidth;let leftOffset = leftOffsetFixedCoeff ? axisWidth * leftOffsetFixedCoeff : this.state.leftOffset;-// debugger;+debugger;if (leftOffset === 0) {leftOffset = axisWidth / 2;}@@ -149,17 +149,20 @@ console.log(leftOffset,axisWidth)let frontDate = moment.utc(deque.peekFront().rawDate);let backDate = moment.utc(deque.peekBack().rawDate);// check if dragger date is between front/back dates, null set to ignore granularity (go to ms), [] for inclusive of front/back dates- let isBetween = draggerDateActual.isBetween(frontDate, backDate, null, '[]');+let draggerPosition = 0;let draggerVisible = false;- if (isBetween) {- draggerPosition = Math.abs(frontDate.diff(draggerDateActual, timeScale, true) * gridWidth);- draggerVisible = true;+ if (this.props.compareModeActive || this.props.draggerSelected === 'selected') {+ let isBetween = draggerDateActual.isBetween(frontDate, backDate, null, '[]');+ if (isBetween) {+ draggerPosition = Math.abs(frontDate.diff(draggerDateActual, timeScale, true) * gridWidth);+ draggerVisible = true;+ }}let draggerPositionB = 0;let draggerVisibleB = false;- if (this.props.compareModeActive) {+ if (this.props.compareModeActive || this.props.draggerSelected === 'selectedB') {let isBetweenB = draggerDateActualB.isBetween(frontDate, backDate, null, '[]');if (isBetweenB) {draggerPositionB = Math.abs(frontDate.diff(draggerDateActualB, timeScale, true) * gridWidth);@@ -714,14 +717,11 @@ console.log(leftOffset,axisWidth)if (this.props.draggerSelected === 'selectedB') {let leftOffsetFixedCoeff = newDraggerDate.newDraggerDiff > 5 ? 0.5 : newDraggerDate.newDateInThePast ? 0.25 : 0.75;this.updateScale(this.props.selectedDateB, this.props.timeScale, null, leftOffsetFixedCoeff);+ // this.updateScale(this.props.selectedDateB, this.props.timeScale, null, 0.5);}}}}----}}@@ -831,6 +831,7 @@ console.log(leftOffset,axisWidth)let newDraggerTime = moment.utc(draggerTimeValue + (diffFactor * deltaX)).format();// handle drag timeline+ // TODO: fix drag off current view - doesn't drag/update date of hover properlyif (draggerPosition < -draggerWidth) { // # handle drag timeline towards PAST// console.log('drag off view past', deltaX, (dragSentinelCount + deltaX), -dragSentinelChangeNumber)let position = this.state.position - deltaX;