Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix interval vs delta mixup, clean up timescale select

Edward Platoee3eff595f1e
diff --git a/web/js/components/timeline/timeline-controls/axis-timescale-change.js b/web/js/components/timeline/timeline-controls/axis-timescale-change.js
index 5c1b0f2a1..3717b9783 100644
--- a/web/js/components/timeline/timeline-controls/axis-timescale-change.js
+++ b/web/js/components/timeline/timeline-controls/axis-timescale-change.js
@@ -69,23 +69,31 @@ class AxisTimeScaleChange extends PureComponent {
}
render() {
- let { timeScale, hasSubdailyLayers, changeTimeScale } = this.props;
+ let { timeScale, timelineHidden, hasSubdailyLayers, changeTimeScale } = this.props;
return (
- timeScale ?
<div
- onMouseEnter={() => this.toggleTooltipHover(true)}
- onMouseLeave={() => this.toggleTooltipHover(false)}>
- <AxisTimeScaleChangeControls
- timeScale={timeScale}
- hasSubdailyLayers={hasSubdailyLayers}
- toolTipHovered={this.state.toolTipHovered}
- changeTimeScale={changeTimeScale}
- incrementTimeScale={this.incrementTimeScale}
- decrementTimeScale={this.decrementTimeScale}
- />
+ className="zoom-level-change"
+ style={{
+ display: timelineHidden ? 'none' : 'block'
+ }}
+ >
+ { timeScale ?
+ <div
+ onMouseEnter={() => this.toggleTooltipHover(true)}
+ onMouseLeave={() => this.toggleTooltipHover(false)}>
+ <AxisTimeScaleChangeControls
+ timeScale={timeScale}
+ hasSubdailyLayers={hasSubdailyLayers}
+ toolTipHovered={this.state.toolTipHovered}
+ changeTimeScale={changeTimeScale}
+ incrementTimeScale={this.incrementTimeScale}
+ decrementTimeScale={this.decrementTimeScale}
+ />
+ </div>
+ :
+ <div></div>
+ }
</div>
- :
- <div></div>
);
}
}
diff --git a/web/js/components/timeline/timeline-controls/interval-timescale-change.js b/web/js/components/timeline/timeline-controls/interval-timescale-change.js
index 97be1e189..a6c787e9c 100644
--- a/web/js/components/timeline/timeline-controls/interval-timescale-change.js
+++ b/web/js/components/timeline/timeline-controls/interval-timescale-change.js
@@ -18,7 +18,6 @@ class TimeScaleIntervalChange extends Component {
}
handleClickZoom = (intervalSelected, openDialog) => {
- console.log(intervalSelected)
// close tooltip
// send props function to change timescale zoom level throughout app
this.setState({
@@ -56,6 +55,7 @@ class TimeScaleIntervalChange extends Component {
return (
<React.Fragment>
<div id="zoom-btn-container"
+ className="noselect"
onMouseEnter={() => this.toggleTooltipHover(true)}
onMouseLeave={() => this.toggleTooltipHover(false)}
>
diff --git a/web/js/components/timeline/timeline.css b/web/js/components/timeline/timeline.css
index 3e8181546..4c00619c7 100644
--- a/web/js/components/timeline/timeline.css
+++ b/web/js/components/timeline/timeline.css
@@ -97,6 +97,10 @@ line {
display: block;
}
+.zoom-level-change {
+ width: 75px;
+}
+
.zoom-level-change-arrows {
user-select: none;
background: transparent;
@@ -105,7 +109,6 @@ line {
box-sizing: border-box;
-webkit-box-sizing: border-box;
width: 55px;
- /* padding-top: 7px; */
}
.interval-input {
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index 93371f023..f29c19cee 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -116,7 +116,6 @@ class Timeline extends React.Component {
// handle SELECT of LEFT/RIGHT interval selection
setTimeScaleIntervalChangeUnit = (intervalSelected, customIntervalModalOpen) => {
- console.log(intervalSelected)
let delta;
let customSelected = intervalSelected === 'custom';
if (customSelected) {
@@ -126,6 +125,7 @@ class Timeline extends React.Component {
intervalSelected = Number(timeScaleToNumberKey[intervalSelected]);
delta = 1;
}
+ console.log(delta, intervalSelected, customSelected)
this.props.selectInterval(delta, intervalSelected, customSelected);
if (customIntervalModalOpen) {
this.setState({
@@ -136,7 +136,6 @@ class Timeline extends React.Component {
// left/right arrows increment date
incrementDate = (multiplier) => {
- console.log(this.props.customSelected)
let delta = this.props.customSelected ? this.props.intervalChangeAmt : 1;
this.animateByIncrement(
Number(delta * multiplier),
@@ -268,19 +267,12 @@ class Timeline extends React.Component {
</div>
{/* Zoom Level Change */}
- <div
- className="zoom-level-change"
- style={{
- width: '75px',
- display: this.state.timelineHidden ? 'none' : 'block'
- }}
- >
- <AxisTimeScaleChange
- timeScale={this.props.timeScale}
- changeTimeScale={this.changeTimeScale}
- hasSubdailyLayers={this.props.hasSubdailyLayers}
- />
- </div>
+ <AxisTimeScaleChange
+ timelineHidden={this.state.timelineHidden}
+ timeScale={this.props.timeScale}
+ changeTimeScale={this.changeTimeScale}
+ hasSubdailyLayers={this.props.hasSubdailyLayers}
+ />
{/* πŸ” Open/Close Chevron πŸ” */}
<div id="timeline-hide" onClick={this.toggleHideTimeline}>
@@ -344,7 +336,7 @@ function mapStateToProps(state) {
timeScaleChangeUnit,
timelineEndDateLimit
);
-console.log(animation.isActive, animation)
+
return {
draggerSelected: isCompareA ? 'selected' : 'selectedB', // ! will work for dragger?
hasSubdailyLayers,
@@ -364,7 +356,7 @@ console.log(animation.isActive, animation)
timeScaleChangeUnit: timeScaleChangeUnit,
customIntervalValue: customDelta,
customIntervalZoomLevel: customInterval,
- intervalChangeAmt: interval,
+ intervalChangeAmt: deltaChangeAmt,
parentOffset: dimensionsAndOffsetValues.parentOffset,
timelineEndDateLimit,
leftArrowDisabled,