Interactive interface for browsing global, full-resolution satellite imagery
merge latest develop
Ed Plato1a4c55271689
diff --cc web/js/components/sidebar/collapsed-button.jsindex 96a1abb07,9f668d71d..2ec509efb--- a/web/js/components/sidebar/collapsed-button.js+++ b/web/js/components/sidebar/collapsed-button.js@@@ -3,7 -3,12 +3,13 @@@ import PropTypes from 'prop-types'class CollapsedButton extends React.Component {render() {- const { isCollapsed, isDistractionFreeModeActive, numberOfLayers, onclick } = this.props;+ const {+ isMobile,++ isDistractionFreeModeActive,+ isCollapsed,+ numberOfLayers,+ onclick+ } = this.props;return (<div@@@ -25,7 -42,7 +43,8 @@@}CollapsedButton.propTypes = {isCollapsed: PropTypes.bool,+ isDistractionFreeModeActive: PropTypes.bool,+ isMobile: PropTypes.bool,numberOfLayers: PropTypes.number,onclick: PropTypes.func};diff --cc web/js/containers/timeline/timeline.jsindex 531817e27,50280ba15..4a84851af--- a/web/js/containers/timeline/timeline.js+++ b/web/js/containers/timeline/timeline.js@@@ -905,90 -964,188 +975,133 @@@ class Timeline extends React.ComponenthasMoved} = this.state;const selectedDate = draggerSelected === 'selected' ? draggerTimeState : draggerTimeStateB;+ // timeline open/closed stylingconst isTimelineHidden = timelineHidden || hideTimeline;const chevronDirection = isTimelineHidden ? 'left' : 'right';+ // handle mobile size styling+ const mobileLeft = hasSubdailyLayers+ ? isScreenWidthLessThan450+ ? '10px'+ : '277px'+ : isScreenWidthLessThan350+ ? '10px'+ : '180px';+ const mobileBottom = (hasSubdailyLayers && isScreenWidthLessThan450) || isScreenWidthLessThan350+ ? '65px'+ : '10px';return (- <div className="timeline-container">- {initialLoadComplete &&- <ErrorBoundary>- {isSmallScreen- /* Mobile Timeline Size */- ? <div id="timeline-header">- <div id="date-selector-main">- <MobileDatePicker- date={selectedDate}- startDateLimit={timelineStartDateLimit}- endDateLimit={timelineEndDateLimit}- onDateChange={this.onDateChange}- hasSubdailyLayers={hasSubdailyLayers}- />- </div>- <div className="mobile-date-change-arrows-btn"- style={{- left: mobileLeft,- bottom: mobileBottom- }}- >- <div id="zoom-buttons-group">- <DateChangeArrows- leftArrowDown={this.throttleDecrementDate}- leftArrowUp={this.stopLeftArrow}- leftArrowDisabled={leftArrowDisabled}- rightArrowDown={this.throttleIncrementDate}- rightArrowUp={this.stopRightArrow}- rightArrowDisabled={rightArrowDisabled}- />- </div>- </div>- </div>- /* Normal Timeline Size */- : <section id="timeline" className="timeline-inner clearfix">- <div id="timeline-header"- className={hasSubdailyLayers ? 'subdaily' : ''}- >- {/* Date Selector, Interval, Arrow Controls */}+ <React.Fragment>+ {isDistractionFreeModeActive+ ? <DistractionFreeTimeUI+ date={selectedDate}+ hasSubdailyLayers={hasSubdailyLayers}+ hoverOverDistractionFreeTimeUI={this.hoverOverDistractionFreeTimeUI}+ isHoverOverDistractionFreeTimeUI={isHoverOverDistractionFreeTimeUI}+ />+ : null+ }+ <div+ className="timeline-container"+ onMouseLeave={+ isDistractionFreeModeActive && !isDraggerDragging && !isTimelineDragging+ ? () => this.hoverOverDistractionFreeTimeUI(false)+ : null+ }+ style={{+ display: isDistractionFreeModeActive && !isHoverOverDistractionFreeTimeUI ? 'none' : 'block'+ }}>- {initialLoadComplete- ? <ErrorBoundary>++ {initialLoadComplete &&++ <ErrorBoundary>+ {isSmallScreen- ? <MobileDatePicker- date={selectedDate}- startDateLimit={timelineStartDateLimit}- endDateLimit={timelineEndDateLimit}- onDateChange={this.onDateChange}- hasSubdailyLayers={hasSubdailyLayers}- />++ /* Mobile Timeline Size */++ ? <div id="timeline-header">+ <div id="date-selector-main">- <DateSelector- id={draggerSelected}- idSuffix={'timeline'}- date={new Date(selectedDate)}++ <MobileDatePicker++ date={selectedDate}++ startDateLimit={timelineStartDateLimit}++ endDateLimit={timelineEndDateLimit}+ onDateChange={this.onDateChange}- maxDate={new Date(timelineEndDateLimit)}- minDate={new Date(timelineStartDateLimit)}- subDailyMode={hasSubdailyLayers}- fontSize={24}- />- </div>- <div id="zoom-buttons-group">- <TimeScaleIntervalChange- setTimeScaleIntervalChangeUnit={this.setTimeScaleIntervalChangeUnit}- customIntervalZoomLevel={timeScaleFromNumberKey[customIntervalZoomLevel]}- customSelected={customSelected}- customDelta={customIntervalValue}- timeScaleChangeUnit={timeScaleChangeUnit}+ hasSubdailyLayers={hasSubdailyLayers}+ />- <DateChangeArrows- leftArrowDown={this.throttleDecrementDate}- leftArrowUp={this.stopLeftArrow}- leftArrowDisabled={leftArrowDisabled}- rightArrowDown={this.throttleIncrementDate}- rightArrowUp={this.stopRightArrow}- rightArrowDisabled={rightArrowDisabled}- />+ </div>- <AnimationButton- clickAnimationButton={this.clickAnimationButton}- disabled={animationDisabled}- title={- isCompareModeActive- ? 'Animation feature is deactivated when Compare feature is active'- : isDataDownload- ? 'Animation feature is deactivated when Data Download feature is active'- : ''- }- />++ <div className="mobile-date-change-arrows-btn"++ style={{++ left: mobileLeft,++ bottom: mobileBottom++ }}++ >++ <div id="zoom-buttons-group">++ <DateChangeArrows++ leftArrowDown={this.throttleDecrementDate}++ leftArrowUp={this.stopLeftArrow}++ leftArrowDisabled={leftArrowDisabled}++ rightArrowDown={this.throttleIncrementDate}++ rightArrowUp={this.stopRightArrow}++ rightArrowDisabled={rightArrowDisabled}++ />++ </div>++ </div>+ </div>-- <div id="timeline-footer"- style={{- display:- isTimelineHidden ? 'none' : 'block'- }}- >- {/* Axis */}- <TimelineAxis- axisWidth={axisWidth}- parentOffset={parentOffset}- leftOffset={leftOffset}- position={position}- transformX={transformX}- timeScale={timeScale}- timelineStartDateLimit={timelineStartDateLimit}- timelineEndDateLimit={timelineEndDateLimit}- frontDate={frontDate}- backDate={backDate}- dateA={dateA}- dateB={dateB}- hoverTime={hoverTime}- draggerSelected={draggerSelected}- draggerTimeState={draggerTimeState}- draggerTimeStateB={draggerTimeStateB}- draggerPosition={draggerPosition}- draggerPositionB={draggerPositionB}- draggerVisible={draggerVisible}- draggerVisibleB={draggerVisibleB}- animationStartLocation={animationStartLocation}- animationEndLocation={animationEndLocation}- animStartLocationDate={animStartLocationDate}- animEndLocationDate={animEndLocationDate}- debounceChangeTimeScaleWheel={this.debounceChangeTimeScaleWheel}- updatePositioning={this.updatePositioning}- updateTimelineMoveAndDrag={this.updateTimelineMoveAndDrag}- updatePositioningOnSimpleDrag={this.updatePositioningOnSimpleDrag}- updatePositioningOnAxisStopDrag={this.updatePositioningOnAxisStopDrag}- updateDraggerDatePosition={this.updateDraggerDatePosition}- showHoverOn={this.showHoverOn}- showHoverOff={this.showHoverOff}- showHover={this.showHover}- hasSubdailyLayers={hasSubdailyLayers}- isCompareModeActive={isCompareModeActive}- isAnimationPlaying={isAnimationPlaying}- isTourActive={isTourActive}- isAnimationDraggerDragging={isAnimationDraggerDragging}- isDraggerDragging={isDraggerDragging}- isTimelineDragging={isTimelineDragging}- hasMoved={hasMoved}- />-- <AxisHoverLine- axisWidth={axisWidth}- hoverLinePosition={hoverLinePosition}- showHoverLine={showHoverLine}- isTimelineDragging={isTimelineDragging}- isAnimationDraggerDragging={isAnimationDraggerDragging}- />-- {isAnimationWidgetOpen &&- !animationDisabled &&- this.state.animationStartLocation &&- this.state.animationStartLocationDate &&- this.state.animationEndLocation &&- this.state.animationEndLocationDate &&- <TimelineRangeSelector- axisWidth={axisWidth}- position={position}- transformX={transformX}- timeScale={timeScale}- timelineStartDateLimit={timelineStartDateLimit}- timelineEndDateLimit={timelineEndDateLimit}- frontDate={frontDate}- startLocation={animationStartLocation}- endLocation={animationEndLocation}- startLocationDate={animationStartLocationDate}- endLocationDate={animationEndLocationDate}- updateAnimationDateAndLocation={this.updateAnimationDateAndLocation}- max={rangeSelectorMax}++ /* Normal Timeline Size */+ : <section id="timeline" className="timeline-inner clearfix">+ <div id="timeline-header"+ className={hasSubdailyLayers ? 'subdaily' : ''}+ >++ {/* Date Selector, Interval, Arrow Controls */}+ <div id="date-selector-main">+ <DateSelector++ id={draggerSelected}++ idSuffix={'timeline'}+ date={new Date(selectedDate)}- draggerSelected={draggerSelected}+ onDateChange={this.onDateChange}+ maxDate={new Date(timelineEndDateLimit)}+ minDate={new Date(timelineStartDateLimit)}+ subDailyMode={hasSubdailyLayers}+ fontSize={24}+ />+ </div>+ <div id="zoom-buttons-group">+ <TimeScaleIntervalChange+ setTimeScaleIntervalChangeUnit={this.setTimeScaleIntervalChangeUnit}+ customIntervalZoomLevel={timeScaleFromNumberKey[customIntervalZoomLevel]}+ customSelected={customSelected}+ customDelta={customIntervalValue}+ timeScaleChangeUnit={timeScaleChangeUnit}+ hasSubdailyLayers={hasSubdailyLayers}+ />+ <DateChangeArrows+ leftArrowDown={this.throttleDecrementDate}+ leftArrowUp={this.stopLeftArrow}+ leftArrowDisabled={leftArrowDisabled}+ rightArrowDown={this.throttleIncrementDate}+ rightArrowUp={this.stopRightArrow}+ rightArrowDisabled={rightArrowDisabled}+ />+ </div>+ <AnimationButton+ clickAnimationButton={this.clickAnimationButton}+ disabled={animationDisabled}- title={isCompareModeActive ? 'Animation feature is deactivated when Compare feature is active' : isDataDownload ? 'Animation feature is deactivated when Data Download feature is active' : ''}++ title={++ isCompareModeActive++ ? 'Animation feature is deactivated when Compare feature is active'++ : isDataDownload++ ? 'Animation feature is deactivated when Data Download feature is active'++ : ''++ }/>- }+ </div>- {frontDate &&- <DraggerContainer+ <div id="timeline-footer"+ style={{+ display:+ isTimelineHidden ? 'none' : 'block'+ }}+ >+ {/* Axis */}+ <TimelineAxisaxisWidth={axisWidth}+ parentOffset={parentOffset}+ leftOffset={leftOffset}position={position}transformX={transformX}timeScale={timeScale}@@@ -1006,137 -1160,61 +1119,133 @@@draggerPositionB={draggerPositionB}draggerVisible={draggerVisible}draggerVisibleB={draggerVisibleB}- setDraggerVisibility={this.setDraggerVisibility}- toggleShowDraggerTime={this.toggleShowDraggerTime}- onChangeSelectedDragger={toggleActiveCompareState}+ animationStartLocation={animationStartLocation}+ animationEndLocation={animationEndLocation}+ animStartLocationDate={animStartLocationDate}+ animEndLocationDate={animEndLocationDate}- changeTimeScale={this.changeTimeScale}++ debounceChangeTimeScaleWheel={this.debounceChangeTimeScaleWheel}+ updatePositioning={this.updatePositioning}+ updateTimelineMoveAndDrag={this.updateTimelineMoveAndDrag}+ updatePositioningOnSimpleDrag={this.updatePositioningOnSimpleDrag}+ updatePositioningOnAxisStopDrag={this.updatePositioningOnAxisStopDrag}updateDraggerDatePosition={this.updateDraggerDatePosition}+ showHoverOn={this.showHoverOn}+ showHoverOff={this.showHoverOff}+ showHover={this.showHover}+ hasSubdailyLayers={hasSubdailyLayers}isCompareModeActive={isCompareModeActive}- isDraggerDragging={isDraggerDragging}isAnimationPlaying={isAnimationPlaying}- /> }+ isTourActive={isTourActive}+ isAnimationDraggerDragging={isAnimationDraggerDragging}+ isDraggerDragging={isDraggerDragging}+ isTimelineDragging={isTimelineDragging}+ hasMoved={hasMoved}+ />- {!isTimelineDragging &&- <DateToolTip+ <AxisHoverLineaxisWidth={axisWidth}- leftOffset={leftOffset}- hoverTime={hoverTime}- draggerSelected={draggerSelected}- draggerTimeState={draggerTimeState}- draggerTimeStateB={draggerTimeStateB}- draggerPosition={draggerPosition}- draggerPositionB={draggerPositionB}- hasSubdailyLayers={hasSubdailyLayers}- showDraggerTime={showDraggerTime}+ hoverLinePosition={hoverLinePosition}showHoverLine={showHoverLine}+ isTimelineDragging={isTimelineDragging}+ isAnimationDraggerDragging={isAnimationDraggerDragging}/>- }- </div>- {/* Custom Interval Selector Widget */}- <CustomIntervalSelectorWidget- customDelta={customIntervalValue}- customIntervalZoomLevel={customIntervalZoomLevel}- changeCustomInterval={this.changeCustomInterval}- customIntervalModalOpen={timelineCustomModalOpen}- hasSubdailyLayers={hasSubdailyLayers}- />-- {/* Zoom Level Change Controls */}- <AxisTimeScaleChange- timeScale={timeScale}- changeTimeScale={this.changeTimeScale}- isDraggerDragging={isDraggerDragging}- hasSubdailyLayers={hasSubdailyLayers}- timelineHidden={isTimelineHidden}- />-- {/* Open/Close Chevron */}- <div id="timeline-hide" onClick={this.toggleHideTimeline}>- <div- className={'wv-timeline-hide wv-timeline-hide-double-chevron-' + chevronDirection}+ {isAnimationWidgetOpen &&+ !animationDisabled &&+ this.state.animationStartLocation &&+ this.state.animationStartLocationDate &&+ this.state.animationEndLocation &&- this.state.animationEndLocationDate- ? <TimelineRangeSelector++ this.state.animationEndLocationDate &&++ <TimelineRangeSelector+ axisWidth={axisWidth}+ position={position}+ transformX={transformX}+ timeScale={timeScale}+ timelineStartDateLimit={timelineStartDateLimit}+ timelineEndDateLimit={timelineEndDateLimit}+ frontDate={frontDate}+ startLocation={animationStartLocation}+ endLocation={animationEndLocation}+ startLocationDate={animationStartLocationDate}+ endLocationDate={animationEndLocationDate}+ updateAnimationDateAndLocation={this.updateAnimationDateAndLocation}+ max={rangeSelectorMax}+ />- : null+ }+- {frontDate- ? <DraggerContainer++ {frontDate &&++ <DraggerContainer+ axisWidth={axisWidth}+ position={position}+ transformX={transformX}+ timeScale={timeScale}+ timelineStartDateLimit={timelineStartDateLimit}+ timelineEndDateLimit={timelineEndDateLimit}+ frontDate={frontDate}+ backDate={backDate}+ draggerSelected={draggerSelected}+ draggerTimeState={draggerTimeState}+ draggerTimeStateB={draggerTimeStateB}+ draggerPosition={draggerPosition}+ draggerPositionB={draggerPositionB}+ draggerVisible={draggerVisible}+ draggerVisibleB={draggerVisibleB}+ setDraggerVisibility={this.setDraggerVisibility}+ toggleShowDraggerTime={this.toggleShowDraggerTime}+ onChangeSelectedDragger={toggleActiveCompareState}+ updateDraggerDatePosition={this.updateDraggerDatePosition}+ isCompareModeActive={isCompareModeActive}+ isDraggerDragging={isDraggerDragging}+ isAnimationPlaying={isAnimationPlaying}- />- : null }++ /> }+- {!isTimelineDragging- ? <DateToolTip++ {!isTimelineDragging &&++ <DateToolTip+ axisWidth={axisWidth}+ leftOffset={leftOffset}+ hoverTime={hoverTime}+ draggerSelected={draggerSelected}+ draggerTimeState={draggerTimeState}+ draggerTimeStateB={draggerTimeStateB}+ draggerPosition={draggerPosition}+ draggerPositionB={draggerPositionB}+ hasSubdailyLayers={hasSubdailyLayers}+ showDraggerTime={showDraggerTime}+ showHoverLine={showHoverLine}+ />- : null+ }+ </div>+- {/* custom interval selector */}++ {/* Custom Interval Selector Widget */}+ <CustomIntervalSelectorWidget+ customDelta={customIntervalValue}+ customIntervalZoomLevel={customIntervalZoomLevel}+ changeCustomInterval={this.changeCustomInterval}+ customIntervalModalOpen={timelineCustomModalOpen}+ hasSubdailyLayers={hasSubdailyLayers}/>- </div>- </section>- }- </ErrorBoundary>- }- </div>+- {/* Zoom Level Change */}++ {/* Zoom Level Change Controls */}+ <AxisTimeScaleChange+ timeScale={timeScale}+ changeTimeScale={this.changeTimeScale}+ isDraggerDragging={isDraggerDragging}+ hasSubdailyLayers={hasSubdailyLayers}+ timelineHidden={isTimelineHidden}+ />++ {/* Open/Close Chevron */}+ <div id="timeline-hide" onClick={this.toggleHideTimeline}>+ <div+ className={'wv-timeline-hide wv-timeline-hide-double-chevron-' + chevronDirection}+ />+ </div>+ </section>+ }+ </ErrorBoundary>- : null+ }+ </div>+ </React.Fragment>);}}@@@ -1170,8 -1247,9 +1279,10 @@@ function mapStateToProps(state)const { screenWidth, lessThan } = browser;const { isCompareA, activeString } = compare;const isCompareModeActive = compare.active;+ const isDistractionFreeModeActive = ui.isDistractionFreeModeActive;const isSmallScreen = lessThan.medium;+ const isScreenWidthLessThan350 = screenWidth < 350;+ const isScreenWidthLessThan450 = screenWidth < 450;let hasSubdailyLayers = hasSubDaily(layers[compare.activeString]);// handle reset of timescale and intervals if not subdaily@@@ -1338,8 -1417,9 +1451,10 @@@ Timeline.propTypes =isAnimationWidgetOpen: PropTypes.bool,isCompareModeActive: PropTypes.bool,isDataDownload: PropTypes.bool,+ isDistractionFreeModeActive: PropTypes.bool,isGifActive: PropTypes.bool,+ isScreenWidthLessThan350: PropTypes.bool,+ isScreenWidthLessThan450: PropTypes.bool,isSmallScreen: PropTypes.bool,isTourActive: PropTypes.bool,leftArrowDisabled: PropTypes.bool,diff --cc web/js/containers/toolbar.jsindex 3d23cf71e,61cdc909a..353fabf9f--- a/web/js/containers/toolbar.js+++ b/web/js/containers/toolbar.js@@@ -250,11 -244,22 +255,25 @@@ function mapStateToProps(state)};}const mapDispatchToProps = dispatch => ({+ toggleDistractionFreeMode: () => {+ dispatch(toggleDistractionFreeMode());+ },- openModal: (key, customParams) => {- dispatch(openCustomContent(key, customParams));+ refreshStateAfterImageDownload: (activePalettes, rotation, isGraticule) => {+ if (activePalettes) {+ dispatch(refreshPalettes(activePalettes));+ }+ if (rotation) {+ dispatch(refreshRotation(rotation));+ }+ if (isGraticule) {+ dispatch(refreshGraticule(isGraticule));+ }+ },+ openModal: (key, customParams, actions) => {+ dispatch(openCustomContent(+ key,+ customParams+ ));},notify: (type, action, title) => {return new Promise((resolve, reject, cancel) => {@@@ -309,6 -314,7 +329,12 @@@ toolbarContainer.propTypes =notificationType: PropTypes.string,notify: PropTypes.func,openModal: PropTypes.func,++<<<<<<< HEAD+ requestNotifications: PropTypes.func,+ toggleDistractionFreeMode: PropTypes.func++=======+ refreshStateAfterImageDownload: PropTypes.func,+ requestNotifications: PropTypes.func,+ rotation: PropTypes.number++>>>>>>> 60e4c9e9df1235501d5b1bc95a31cb0be79969b9};diff --cc web/js/map/ui.jsindex 510fda0cf,b18249438..4d1193e26--- a/web/js/map/ui.js+++ b/web/js/map/ui.js@@@ -36,9 -36,8 +36,9 @@@ import { measure } from './measure/ui'import { CALCULATE_RESPONSIVE_STATE } from 'redux-responsive';import { LOCATION_POP_ACTION } from '../redux-location-state-customs';import { CHANGE_PROJECTION } from '../modules/projection/constants';+import { TOGGLE_DISTRACTION_FREE_MODE } from '../modules/ui/constants';import { SELECT_DATE } from '../modules/date/constants';- import { CHANGE_UNITS, USE_GREAT_CIRCLE } from '../modules/measure/constants';+ import { CHANGE_UNITS } from '../modules/measure/constants';import Cache from 'cachai';import * as layerConstants from '../modules/layers/constants';import * as compareConstants from '../modules/compare/constants';diff --cc web/js/modules/combine-reducers.jsindex 7d1199581,7b4d36805..1c6d538ab--- a/web/js/modules/combine-reducers.js+++ b/web/js/modules/combine-reducers.js@@@ -38,10 -38,12 +38,14 @@@ import dataDownloadReducer from './dataimport { get as lodashGet, assign as lodashAssign } from 'lodash';import { imageDownloadReducer } from './image-download/reducers';import measureReducer from './measure/reducers';+ import {+ productPickerReducer,+ getInitialState as getProductPickerInitialState+ } from './product-picker/reducers';import { LOCATION_POP_ACTION } from '../redux-location-state-customs';+import uiReducers from './ui/reducers';+function lastAction(state = null, action) {return action;}@@@ -130,7 -133,7 +135,8 @@@ const reducers =lastAction: lastAction,location: locationReducer,measure: measureReducer,- ui: uiReducers++ ui: uiReducers,+ productPicker: productPickerReducer};const appReducer = combineReducers(reducers);/**