Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

merge fix

Ed Plato360176487296
diff --cc web/js/app.js
index d2aa7e1bb,78a2974d1..7709af8ee
--- a/web/js/app.js
+++ b/web/js/app.js
@@@ -194,12 -199,12 +200,12 @@@ function mapStateToProps(state, ownProp
models: ownProps.models,
mapMouseEvents: ownProps.mapMouseEvents,
locationKey: state.location.key,
- modalId: state.modal.id
+ modalId: state.modal.id,
};
}
- const mapDispatchToProps = dispatch => ({
+ const mapDispatchToProps = (dispatch) => ({
- keyPressAction: (keyCode) => {
- dispatch(keyPress(keyCode));
+ keyPressAction: (keyCode, shiftKey, ctrlOrCmdKey) => {
+ dispatch(keyPress(keyCode, shiftKey, ctrlOrCmdKey));
},
screenResize: (width, height) => {
dispatch(calculateResponsiveState(window));
diff --cc web/js/components/map/coordinates.js
index db808083e,5bc068d87..a48d24aa1
--- a/web/js/components/map/coordinates.js
+++ b/web/js/components/map/coordinates.js
@@@ -6,10 -6,10 +6,10 @@@ import util from '../../util/util'
const formatOrder = {
'latlon-dd': 'latlon-dm',
'latlon-dm': 'latlon-dms',
- 'latlon-dms': 'latlon-dd'
+ 'latlon-dms': 'latlon-dd',
};
-class Coordinates extends React.Component {
+export class Coordinates extends React.Component {
constructor(props) {
super(props);
this.changeFormat = this.changeFormat.bind(this);
diff --cc web/js/components/map/ol-coordinates.js
index b5b2cd248,757f5c6ce..40d5d39fb
--- a/web/js/components/map/ol-coordinates.js
+++ b/web/js/components/map/ol-coordinates.js
@@@ -1,10 -1,10 +1,10 @@@
import React from 'react';
import PropTypes from 'prop-types';
+ import { transform } from 'ol/proj';
import Coordinates from './coordinates';
import util from '../../util/util';
- import { transform } from 'ol/proj';
-class OlCoordinates extends React.Component {
+export class OlCoordinates extends React.Component {
constructor(props) {
super(props);
this.state = {
@@@ -103,5 -98,7 +103,5 @@@
}
OlCoordinates.propTypes = {
- mouseEvents: PropTypes.object.isRequired
+ mouseEvents: PropTypes.object.isRequired,
};
-
-export default OlCoordinates;
diff --cc web/js/components/map/ol-coordinates.test.js
index 3cb67ed9d,1b445f46f..f4aaf4ac9
--- a/web/js/components/map/ol-coordinates.test.js
+++ b/web/js/components/map/ol-coordinates.test.js
@@@ -11,14 -11,10 +11,14 @@@ let map
beforeEach(() => {
registerProjections();
events = util.events();
- component = renderer.create(<OlCoordinates mouseEvents={events} />);
+ component = renderer.create(
+ <OlCoordinates
+ mouseEvents={events}
+ />
+ );
map = {
getEventPixel: jest.fn(),
- getCoordinateFromPixel: () => [0, 0]
+ getCoordinateFromPixel: () => [0, 0],
};
});
diff --cc web/js/components/measure-tool/measure-button.js
index 430e4765a,038321bd0..e2885575d
--- a/web/js/components/measure-tool/measure-button.js
+++ b/web/js/components/measure-tool/measure-button.js
@@@ -55,23 -56,23 +56,26 @@@ class MeasureButton extends React.Compo
}
render() {
- const showAlert = this.props.isActive && this.state.showAlert;
- const message = this.state.isTouchDevice ? mobileHelpMsg : helpMsg;
+ const { isActive, isDistractionFreeModeActive } = this.props;
- const showAlert = isActive && this.state.showAlert;
- const message = this.state.isTouchDevice ? mobileHelpMsg : helpMsg;
++ const { showAlert, isTouchDevice } = this.state;
++ const shouldShowAlert = isActive && showAlert;
++ const message = isTouchDevice ? mobileHelpMsg : helpMsg;
return (
<>
- {showAlert && <AlertUtil
- id={'measurement-alert'}
- isOpen={true}
- iconClassName='faRuler'
- title='Measure Tool'
- {showAlert && (
++ {shouldShowAlert && (
+ <AlertUtil
+ id="measurement-alert"
+ isOpen
+ iconClassName="faRuler"
+ title="Measure Tool"
message={message}
onDismiss={this.dismissAlert}
- />}
+ />
+ )}
<Button
+ style={{ display: isDistractionFreeModeActive ? 'none' : 'block' }}
id="wv-measure-button"
className="wv-measure-button wv-toolbar-button"
title="Measure distances &amp; areas"
@@@ -85,16 -86,13 +89,14 @@@
}
}
- const mapStateToProps = (state, ownProps) => {
- return {
- isActive: state.measure.isActive,
- isDistractionFreeModeActive: state.ui.isDistractionFreeModeActive
- };
- };
- const mapDispatchToProps = dispatch => ({
+ const mapStateToProps = (state, ownProps) => ({
+ isActive: state.measure.isActive,
++ isDistractionFreeModeActive: state.ui.isDistractionFreeModeActive,
+ });
+ const mapDispatchToProps = (dispatch) => ({
openModal: (key, customParams) => {
dispatch(openCustomContent(key, customParams));
- }
+ },
});
export default connect(
@@@ -104,6 -102,5 +106,6 @@@
MeasureButton.propTypes = {
isActive: PropTypes.bool,
+ isDistractionFreeModeActive: PropTypes.bool,
- openModal: PropTypes.func
+ openModal: PropTypes.func,
};
diff --cc web/js/components/sidebar/collapsed-button.js
index baea8939e,1726e2a0b..b5fd779e8
--- a/web/js/components/sidebar/collapsed-button.js
+++ b/web/js/components/sidebar/collapsed-button.js
@@@ -1,55 -1,52 +1,56 @@@
--import React from 'react';
++import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faLayerGroup } from '@fortawesome/free-solid-svg-icons';
- class CollapsedButton extends React.Component {
-const CollapsedButton = (props) => {
- const {
- isMobile,
- isCollapsed,
- numberOfLayers,
- onclick,
- } = props;
++class CollapsedButton extends PureComponent {
+ render() {
+ const {
+ isMobile,
+ isDistractionFreeModeActive,
+ isCollapsed,
+ numberOfLayers,
- onclick
++ onclick,
+ } = this.props;
- return (
- <div
- id="productsHoldertoggleButtonHolder"
- className="toggleButtonHolder"
- style={!isCollapsed ? { display: 'none' } : {}}
- >
- <a
- id="accordionTogglerButton"
- className="accordionToggler dateHolder staticLayers"
- title="Show Layer Selector"
- onClick={onclick}
+ return (
+ <div
+ id="productsHoldertoggleButtonHolder"
+ className="toggleButtonHolder"
+ style={!isCollapsed || isDistractionFreeModeActive ? { display: 'none' } : {}}
>
- <FontAwesomeIcon icon={faLayerGroup} />
- {isMobile
- ? (
- <span className="layer-count mobile">
- {numberOfLayers.toString()}
- </span>
- )
- : (
- <span className="layer-count ">
- {numberOfLayers.toString()}
- {' '}
- Layers
- </span>
- )}
- </a>
- </div>
- );
-};
+ <a
+ id="accordionTogglerButton"
+ className="accordionToggler dateHolder staticLayers"
+ title="Show Layer Selector"
+ onClick={onclick}
+ >
+ <FontAwesomeIcon icon={faLayerGroup} />
+ {isMobile
+ ? (
- <span className='layer-count mobile'>
++ <span className="layer-count mobile">
+ {numberOfLayers.toString()}
+ </span>
+ )
+ : (
- <span className='layer-count '>
- {numberOfLayers.toString()} Layers
++ <span className="layer-count ">
++ {numberOfLayers.toString()}
++ {' '}
++ Layers
+ </span>
- )
- }
++ )}
+ </a>
+ </div>
+ );
+ }
+}
CollapsedButton.propTypes = {
isCollapsed: PropTypes.bool,
+ isDistractionFreeModeActive: PropTypes.bool,
isMobile: PropTypes.bool,
numberOfLayers: PropTypes.number,
- onclick: PropTypes.func
+ onclick: PropTypes.func,
};
export default CollapsedButton;
diff --cc web/js/containers/info.js
index e86324ce0,4c1fe96a7..827bc383c
--- a/web/js/containers/info.js
+++ b/web/js/containers/info.js
@@@ -5,9 -6,8 +6,9 @@@ import googleTagManager from 'googleTag
import {
requestTemplate,
renderTemplate,
- openCustomContent
+ openCustomContent,
} from '../modules/modal/actions';
+import { toggleDistractionFreeMode } from '../modules/ui/actions';
import { ABOUT_PAGE_REQUEST } from '../modules/modal/constants';
import IconList from '../components/util/list';
import { onClickFeedback } from '../modules/feedback/util';
@@@ -48,92 -48,74 +49,91 @@@ class InfoList extends Component
notifications,
config,
startTour,
+ isDistractionFreeModeActive,
isTourActive,
isMobile,
- toggleDistractionFreeMode
++ toggleDistractionFreeMode,
} = this.props;
- const feedbackAction = isMobile
- ? { href: 'mailto:@MAIL@?subject=Feedback for @LONG_NAME@ tool' }
- : {
- onClick: () => {
- sendFeedback(feedbackIsInitiated);
- },
- };
- const arr = [
- {
- text: 'Send feedback',
- iconClass: 'ui-icon',
- iconName: 'faEnvelope',
- id: 'send_feedback_info_item',
- ...feedbackAction,
- },
- {
- text: 'Source Code',
- iconClass: 'ui-icon',
- iconName: 'faCode',
- id: 'source_code_info_item',
- href: 'https://github.com/nasa-gibs/worldview',
- },
- {
- text: 'What\'s new',
- iconClass: 'ui-icon',
- iconName: 'faFlag',
- id: 'whats_new_info_item',
- href: 'https://wiki.earthdata.nasa.gov/pages/viewrecentblogposts.action?key=GIBS',
+ const distractionFreeObj = {
+ text: isDistractionFreeModeActive ? 'Exit Distraction Free' : 'Distraction Free',
+ iconClass: 'ui-icon',
+ iconName: 'faEye',
+ id: 'distraction_free_info_item',
+ onClick: () => {
+ toggleDistractionFreeMode();
- }
+ },
- {
- text: 'About',
- iconClass: 'ui-icon',
- iconName: 'faFile',
- id: 'about_info_item',
- onClick: () => {
- aboutClick();
+ };
+ if (!isDistractionFreeModeActive) {
+ const feedbackAction = isMobile
+ ? { href: 'mailto:@MAIL@?subject=Feedback for @LONG_NAME@ tool' }
+ : {
+ onClick: () => {
+ sendFeedback(feedbackIsInitiated);
- }
++ },
+ };
+ const arr = [
+ {
+ text: 'Send feedback',
+ iconClass: 'ui-icon',
+ iconName: 'faEnvelope',
+ id: 'send_feedback_info_item',
- ...feedbackAction
++ ...feedbackAction,
},
- },
- ];
- if (
- config.features.tour
- && config.stories
- && config.storyOrder
- && window.innerWidth >= 740
- && window.innerHeight >= 615
- ) {
- const exploreWorlviewObj = {
- text: 'Explore Worldview',
- iconClass: 'ui-icon',
- iconName: 'faTruck',
- id: 'start_tour_info_item',
- onClick: () => {
- startTour(isTourActive);
- googleTagManager.pushEvent({
- event: 'tour_start_button',
- });
+ {
+ text: 'Source Code',
+ iconClass: 'ui-icon',
+ iconName: 'faCode',
+ id: 'source_code_info_item',
- href: 'https://github.com/nasa-gibs/worldview'
++ href: 'https://github.com/nasa-gibs/worldview',
},
- };
- arr.splice(1, 0, exploreWorlviewObj);
- }
- if (notifications.isActive) {
- const obj = this.getNotificationListItem();
- arr.splice(4, 0, obj);
+ {
+ text: 'What\'s new',
+ iconClass: 'ui-icon',
+ iconName: 'faFlag',
+ id: 'whats_new_info_item',
- href: 'https://wiki.earthdata.nasa.gov/pages/viewrecentblogposts.action?key=GIBS'
++ href: 'https://wiki.earthdata.nasa.gov/pages/viewrecentblogposts.action?key=GIBS',
+ },
+ {
+ text: 'About',
+ iconClass: 'ui-icon',
+ iconName: 'faFile',
+ id: 'about_info_item',
+ onClick: () => {
+ aboutClick();
- }
- }
++ },
++ },
+ ];
+
+ // limit explore and distraction free for larger device displays
- if (window.innerWidth >= 740 &&
- window.innerHeight >= 615) {
++ if (window.innerWidth >= 740
++ && window.innerHeight >= 615) {
+ if (
- config.features.tour &&
- config.stories &&
- config.storyOrder) {
++ config.features.tour
++ && config.stories
++ && config.storyOrder) {
+ const exploreWorlviewObj = {
+ text: 'Explore Worldview',
+ iconClass: 'ui-icon',
+ iconName: 'faTruck',
+ id: 'start_tour_info_item',
+ onClick: () => {
+ startTour(isTourActive);
+ googleTagManager.pushEvent({
- event: 'tour_start_button'
++ event: 'tour_start_button',
+ });
- }
++ },
+ };
+ arr.splice(1, 0, exploreWorlviewObj);
+ }
+ arr.push(distractionFreeObj);
+ }
+ if (notifications.isActive) {
+ const obj = this.getNotificationListItem();
+ arr.splice(4, 0, obj);
+ }
+ return arr;
- } else {
- return [distractionFreeObj];
}
- return arr;
++ return [distractionFreeObj];
}
render() {
@@@ -152,14 -133,11 +152,14 @@@ function mapStateToProps(state)
notifications: state.notifications,
config: state.config,
models: state.models,
- isMobile: state.browser.lessThan.medium
+ isMobile: state.browser.lessThan.medium,
};
}
- const mapDispatchToProps = dispatch => ({
+ const mapDispatchToProps = (dispatch) => ({
+ toggleDistractionFreeMode: () => {
+ dispatch(toggleDistractionFreeMode());
+ },
- sendFeedback: isInitiated => {
+ sendFeedback: (isInitiated) => {
onClickFeedback(isInitiated);
if (!isInitiated) {
dispatch(initFeedback());
@@@ -222,5 -199,4 +222,5 @@@ InfoList.propTypes =
notifications: PropTypes.object,
sendFeedback: PropTypes.func,
startTour: PropTypes.func,
- toggleDistractionFreeMode: PropTypes.func
++ toggleDistractionFreeMode: PropTypes.func,
};
diff --cc web/js/containers/map-interactions.js
index 30eb7ed79,e84829cca..992faaf97
--- a/web/js/containers/map-interactions.js
+++ b/web/js/containers/map-interactions.js
@@@ -1,7 -1,8 +1,8 @@@
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
+ import { groupBy as lodashGroupBy, debounce as lodashDebounce, get as lodashGet } from 'lodash';
-import OlCoordinates from '../components/map/ol-coordinates';
+import { OlCoordinates } from '../components/map/ol-coordinates';
import vectorDialog from './vector-dialog';
import { onMapClickGetVectorFeatures } from '../modules/vector-styles/util';
import { openCustomContent, onClose } from '../modules/modal/actions';
@@@ -73,26 -77,14 +77,27 @@@ export class MapInteractions extends Re
}
render() {
- const { isShowingClick, mouseEvents } = this.props;
- const mapClasses = isShowingClick ? 'wv-map cursor-pointer' : 'wv-map';
+ const {
+ isDistractionFreeModeActive,
+ isShowingClick,
- mouseEvents
++ mouseEvents,
+ } = this.props;
+ let mapClasses = isShowingClick
- ? 'wv-map' + ' cursor-pointer'
++ ? 'wv-map cursor-pointer'
+ : 'wv-map';
+ mapClasses = isDistractionFreeModeActive
- ? mapClasses + ' distraction-free-active'
++ ? `${mapClasses} distraction-free-active`
+ : mapClasses;
return (
- <React.Fragment>
+ <>
<div id="wv-map" className={mapClasses} />
- {!isDistractionFreeModeActive && <OlCoordinates
- <OlCoordinates mouseEvents={mouseEvents} />
++ {!isDistractionFreeModeActive && (
++ <OlCoordinates
+ mouseEvents={mouseEvents}
+ />
- }
- </React.Fragment>
++ )}
+ </>
);
}
}
@@@ -133,13 -125,14 +138,14 @@@ const mapDispatchToProps = (dispatch) =
setTimeout(() => {
dispatch(selectVectorFeatures({}));
}, 1);
- }
- }
- ));
- }
+ },
+ }));
+ },
});
function mapStateToProps(state) {
- const { modal, map, measure, vectorStyles, browser, compare, proj, ui } = state;
+ const {
- modal, map, measure, vectorStyles, browser, compare, proj,
++ modal, map, measure, vectorStyles, browser, compare, proj, ui,
+ } = state;
let swipeOffset;
if (compare.active && compare.mode === 'swipe') {
const percentOffset = state.compare.value || 50;
diff --cc web/js/containers/sidebar/sidebar.js
index 3901b4f8a,d93d92955..7d6d20c06
--- a/web/js/containers/sidebar/sidebar.js
+++ b/web/js/containers/sidebar/sidebar.js
@@@ -31,17 -32,16 +32,16 @@@ const getActiveTabs = function(config)
return {
download: features.dataDownload,
layers: true,
- events: features.naturalEvents
+ events: features.naturalEvents,
};
};
-const resetWorldview = function(e) {
+const resetWorldview = function(e, isDistractionFreeModeActive) {
e.preventDefault();
- if (window.location.search === '') return; // Nothing to reset
+ if (!isDistractionFreeModeActive && window.location.search === '') return; // Nothing to reset
- var msg =
- 'Do you want to reset Worldview to its defaults? You will lose your current state.';
+ const msg = 'Do you want to reset Worldview to its defaults? You will lose your current state.';
- if (window.confirm(msg)) {
+ if (confirm(msg)) {
googleTagManager.pushEvent({
- event: 'logo_page_reset'
+ event: 'logo_page_reset',
});
document.location.href = '/';
}
@@@ -190,9 -189,8 +190,9 @@@ class Sidebar extends React.Component
<CollapsedButton
isMobile={isMobile}
isCollapsed={isCollapsed}
- onclick={this.toggleSidebar.bind(this)}
+ onclick={this.toggleSidebar}
numberOfLayers={numberOfLayers}
+ isDistractionFreeModeActive={isDistractionFreeModeActive}
/>
<div
id="productsHolder"
@@@ -265,10 -267,8 +269,10 @@@ function mapStateToProps(state)
measure,
animation,
events,
- ui
++ ui,
} = state;
const { screenHeight } = browser;
- const isDistractionFreeModeActive = ui.isDistractionFreeModeActive;
++ const { isDistractionFreeModeActive } = ui;
const { activeTab, isCollapsed, mobileCollapsed } = sidebar;
const { activeString } = compare;
const numberOfLayers = getLayers(layers[activeString], {}, state).length;
@@@ -286,14 -286,13 +290,14 @@@
activeString,
numberOfLayers,
isDataDisabled: events.isAnimatingToEvent,
- isCollapsed: isMobile ? mobileCollapsed : (isCollapsed || shouldBeCollapsed),
+ isCollapsed: isMobile ? mobileCollapsed : isCollapsed || shouldBeCollapsed,
tabTypes,
config,
- isDistractionFreeModeActive
++ isDistractionFreeModeActive,
};
}
- const mapDispatchToProps = dispatch => ({
- changeTab: str => {
+ const mapDispatchToProps = (dispatch) => ({
+ changeTab: (str) => {
dispatch(changeTab(str));
},
onTabClick: (str, activeStr) => {
diff --cc web/js/containers/timeline/timeline.js
index 8a8cc23fb,9c52c5e70..243fb2a72
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@@ -21,16 -28,9 +28,11 @@@ import AnimationButton from '../../comp
import AxisTimeScaleChange from '../../components/timeline/timeline-controls/axis-timescale-change';
import TimelineRangeSelector from '../../components/range-selection/range-selection';
+import DistractionFreeTimeUI from '../../components/timeline/distraction-free-time';
+
- import {
- debounce as lodashDebounce,
- throttle as lodashThrottle,
- get as lodashGet
- } from 'lodash';
import {
getIsBetween,
- getISODateFormatted
+ getISODateFormatted,
} from '../../components/timeline/date-util';
import {
hasSubDaily,
@@@ -990,31 -979,14 +990,42 @@@ class Timeline extends React.Component
? '65px'
: '10px';
return (
++<<<<<<< HEAD
+ <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>
+ {isSmallScreen
+ /* Mobile Timeline Size */
+ ? <div id="timeline-header" className="timeline-header-mobile">
++=======
+ <div className="timeline-container">
+ {initialLoadComplete
+ && (
+ <ErrorBoundary>
+ {isSmallScreen
+ /* Mobile Timeline Size */
+ ? (
+ <div id="timeline-header" className="timeline-header-mobile">
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
<div id="date-selector-main">
<MobileDatePicker
date={selectedDate}
@@@ -1024,10 -996,11 +1035,18 @@@
hasSubdailyLayers={hasSubdailyLayers}
/>
</div>
++<<<<<<< HEAD
+ <div className="mobile-date-change-arrows-btn"
+ style={{
+ left: mobileLeft,
+ bottom: mobileBottom
++=======
+ <div
+ className="mobile-date-change-arrows-btn"
+ style={{
+ left: mobileLeft,
+ bottom: mobileBottom,
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
}}
>
<div id="zoom-buttons-group">
@@@ -1042,16 -1015,19 +1061,29 @@@
</div>
</div>
</div>
++<<<<<<< HEAD
+ /* Normal Timeline Size */
+ : <section id="timeline" className="timeline-inner clearfix">
+ <div id="timeline-header"
++=======
+ )
+ /* Normal Timeline Size */
+ : (
+ <section id="timeline" className="timeline-inner clearfix">
+ <div
+ id="timeline-header"
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
className={`timeline-header-desktop ${hasSubdailyLayers ? 'subdaily' : ''}`}
>
{/* Date Selector, Interval, Arrow Controls */}
<div id="date-selector-main">
<DateSelector
id={draggerSelected}
++<<<<<<< HEAD
+ idSuffix={'timeline'}
++=======
+ idSuffix="timeline"
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
date={new Date(selectedDate)}
onDateChange={this.onDateChange}
maxDate={new Date(timelineEndDateLimit)}
@@@ -1082,23 -1058,24 +1114,43 @@@
clickAnimationButton={this.clickAnimationButton}
disabled={animationDisabled}
title={
++<<<<<<< HEAD
+ isCompareModeActive
+ ? 'Animation feature is deactivated when Compare feature is active'
+ : isDataDownload
+ ? 'Animation feature is deactivated when Data Download feature is active'
+ : ''
+ }
+ />
+ </div>
+
+ <div id="timeline-footer"
+ style={{
+ display:
+ isTimelineHidden ? 'none' : 'block'
+ }}
+ >
+ {/* Axis */}
+ <TimelineAxis
++=======
+ isCompareModeActive
+ ? 'Animation feature is deactivated when Compare feature is active'
+ : isDataDownload
+ ? 'Animation feature is deactivated when Data Download feature is active'
+ : ''
+ }
+ />
+ </div>
+
+ <div
+ id="timeline-footer"
+ style={{
+ display:
+ isTimelineHidden ? 'none' : 'block',
+ }}
+ >
+ {/* Axis */}
+ <TimelineAxis
axisWidth={axisWidth}
parentOffset={parentOffset}
leftOffset={leftOffset}
@@@ -1150,72 -1127,76 +1202,166 @@@
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}
+ />
+ )}
+
+ {frontDate
+ && (
+ <DraggerContainer
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
+ 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}
- setDraggerVisibility={this.setDraggerVisibility}
- toggleShowDraggerTime={this.toggleShowDraggerTime}
- onChangeSelectedDragger={toggleActiveCompareState}
++ 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}
- isDraggerDragging={isDraggerDragging}
+ isAnimationPlaying={isAnimationPlaying}
++<<<<<<< HEAD
++ isTourActive={isTourActive}
++ isAnimationDraggerDragging={isAnimationDraggerDragging}
++ isDraggerDragging={isDraggerDragging}
++ isTimelineDragging={isTimelineDragging}
++ hasMoved={hasMoved}
++ />
++
++ <AxisHoverLine
++=======
+ />
+ ) }
+
+ {!isTimelineDragging
+ && (
+ <DateToolTip
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
+ axisWidth={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}
+ />
++<<<<<<< HEAD
++
+ {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}
+ />
+ }
+
+ {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}
+ /> }
+
+ {!isTimelineDragging &&
+ <DateToolTip
+ axisWidth={axisWidth}
+ leftOffset={leftOffset}
+ hoverTime={hoverTime}
+ draggerSelected={draggerSelected}
+ draggerTimeState={draggerTimeState}
+ draggerTimeStateB={draggerTimeStateB}
+ draggerPosition={draggerPosition}
+ draggerPositionB={draggerPositionB}
+ hasSubdailyLayers={hasSubdailyLayers}
+ showDraggerTime={showDraggerTime}
+ showHoverLine={showHoverLine}
+ />
+ }
+ </div>
+
++=======
+ )}
+ </div>
+
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
{/* Custom Interval Selector Widget */}
<CustomIntervalSelectorWidget
customDelta={customIntervalValue}
@@@ -1237,15 -1218,14 +1383,26 @@@
{/* Open/Close Chevron */}
<div id="timeline-hide" onClick={this.toggleHideTimeline}>
<div
++<<<<<<< HEAD
+ className={'wv-timeline-hide wv-timeline-hide-double-chevron-' + chevronDirection}
+ />
+ </div>
+ </section>
+ }
+ </ErrorBoundary>
+ }
+ </div>
+ </React.Fragment>
++=======
+ className={`wv-timeline-hide wv-timeline-hide-double-chevron-${chevronDirection}`}
+ />
+ </div>
+ </section>
+ )}
+ </ErrorBoundary>
+ )}
+ </div>
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
);
}
}
@@@ -1262,7 -1242,6 +1419,10 @@@ function mapStateToProps(state)
sidebar,
modal,
tour,
++<<<<<<< HEAD
+ ui
++=======
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
} = state;
let {
customSelected,
@@@ -1371,7 -1349,6 +1531,10 @@@
isAnimationPlaying: animation.isPlaying,
isGifActive: animation.gifActive,
timelineCustomModalOpen,
++<<<<<<< HEAD
+ isDistractionFreeModeActive
++=======
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
};
}
diff --cc web/js/containers/toolbar.js
index d855e58de,36cdbb996..da1932717
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@@ -2,8 -2,17 +2,18 @@@ import React, { Component } from 'react
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { ButtonToolbar, Button } from 'reactstrap';
+ import {
+ get as lodashGet,
+ find as lodashFind,
+ cloneDeep as lodashCloneDeep,
+ } from 'lodash';
+ import Promise from 'bluebird';
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+ import {
+ faShareSquare, faGlobeAsia, faCamera, faInfoCircle,
+ } from '@fortawesome/free-solid-svg-icons';
import { openCustomContent, onToggle } from '../modules/modal/actions';
+import { toggleDistractionFreeMode } from '../modules/ui/actions';
import ImageDownload from './image-download';
import Projection from './projection';
import InfoList from './info';
@@@ -136,82 -149,67 +150,135 @@@ class toolbarContainer extends Componen
notificationType,
notificationContentNumber,
config,
+ isDistractionFreeModeActive,
isImageDownloadActive,
- isCompareActive
+ isCompareActive,
} = this.props;
const notificationClass = notificationType
- ? ' wv-status-' + notificationType
+ ? ` wv-status-${notificationType}`
: ' wv-status-hide';
return (
<ErrorBoundary>
++<<<<<<< HEAD
+ <ButtonToolbar
+ id="wv-toolbar"
+ className={'wv-toolbar'}
+ >
+ { !isDistractionFreeModeActive && (
+ <React.Fragment>
+ <Button
+ id="wv-link-button"
+ className="wv-toolbar-button"
+ title="Share this map"
+ onClick={() =>
+ openModal(
+ 'TOOLBAR_SHARE_LINK',
+ CUSTOM_MODAL_PROPS.TOOLBAR_SHARE_LINK
+ )
+ }
+ >
+ <FontAwesomeIcon icon={faShareSquare} size='2x' />
+ </Button>
+ {config.ui && config.ui.projections ? (
+ <Button
+ id="wv-proj-button"
+ className="wv-toolbar-button"
+ title="Switch projection"
+ onClick={() =>
+ openModal(
+ 'TOOLBAR_PROJECTION',
+ CUSTOM_MODAL_PROPS.TOOLBAR_PROJECTION
+ )
+ }
+ >
+ <FontAwesomeIcon icon={faGlobeAsia} size='2x' />
+ </Button>
+ ) : (
+ ''
+ )}
+ <Button
+ id="wv-image-button"
+ className={
+ isImageDownloadActive
+ ? 'wv-toolbar-button'
+ : 'wv-toolbar-button disabled'
+ }
+ disabled={!isImageDownloadActive}
+ title={
+ isCompareActive
+ ? 'You must exit comparison mode to use the snapshot feature'
+ : !isImageDownloadActive
+ ? 'You must exit data download mode to use the snapshot feature'
+ : 'Take a snapshot'
+ }
+ onClick={this.openImageDownload}
+ >
+ <FontAwesomeIcon icon={faCamera} size='2x' />
+ </Button>
+ </React.Fragment>
+ )}
+ <Button
+ id="wv-info-button"
+ title="Information"
+ className={`wv-toolbar-button${notificationClass} ${isDistractionFreeModeActive ? 'wv-info-button-distraction-free-mode' : ''}`}
+ onClick={() =>
+ openModal('TOOLBAR_INFO', CUSTOM_MODAL_PROPS.TOOLBAR_INFO)
+ }
++=======
+ <ButtonToolbar id="wv-toolbar" className="wv-toolbar">
+ <Button
+ id="wv-link-button"
+ className="wv-toolbar-button"
+ title="Share this map"
+ onClick={() => openModal(
+ 'TOOLBAR_SHARE_LINK',
+ CUSTOM_MODAL_PROPS.TOOLBAR_SHARE_LINK,
+ )}
+ >
+ <FontAwesomeIcon icon={faShareSquare} size="2x" />
+ </Button>
+ {config.ui && config.ui.projections ? (
+ <Button
+ id="wv-proj-button"
+ className="wv-toolbar-button"
+ title="Switch projection"
+ onClick={() => openModal(
+ 'TOOLBAR_PROJECTION',
+ CUSTOM_MODAL_PROPS.TOOLBAR_PROJECTION,
+ )}
+ >
+ <FontAwesomeIcon icon={faGlobeAsia} size="2x" />
+ </Button>
+ )
+ : ''}
+ <Button
+ id="wv-image-button"
+ className={
+ isImageDownloadActive
+ ? 'wv-toolbar-button'
+ : 'wv-toolbar-button disabled'
+ }
+ disabled={!isImageDownloadActive}
+ title={
+ isCompareActive
+ ? 'You must exit comparison mode to use the snapshot feature'
+ : !isImageDownloadActive
+ ? 'You must exit data download mode to use the snapshot feature'
+ : 'Take a snapshot'
+ }
+ onClick={this.openImageDownload}
+ >
+ <FontAwesomeIcon icon={faCamera} size="2x" />
+ </Button>
+ <Button
+ id="wv-info-button"
+ title="Information"
+ className={`wv-toolbar-button${notificationClass}`}
+ onClick={() => openModal('TOOLBAR_INFO', CUSTOM_MODAL_PROPS.TOOLBAR_INFO)}
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
data-content={notificationContentNumber}
>
- <FontAwesomeIcon icon={faInfoCircle} size='2x' />
+ <FontAwesomeIcon icon={faInfoCircle} size="2x" />
</Button>
</ButtonToolbar>
</ErrorBoundary>
@@@ -219,10 -217,11 +286,16 @@@
}
}
function mapStateToProps(state) {
++<<<<<<< HEAD
+ const { notifications, palettes, compare, map, layers, proj, data, ui } = state;
+ const isDistractionFreeModeActive = ui.isDistractionFreeModeActive;
++=======
+ const {
+ notifications, palettes, compare, map, layers, proj, data,
+ } = state;
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
const { number, type } = notifications;
- const activeString = compare.activeString;
+ const { activeString } = compare;
const activeLayersForProj = getLayers(
layers[activeString],
{ proj: proj.id },
@@@ -252,16 -251,12 +325,25 @@@
hasGraticule: Boolean(
lodashGet(
lodashFind(layers[activeString], { id: 'Graticule' }) || {},
++<<<<<<< HEAD
+ 'visible'
+ )
+ ),
+ isDistractionFreeModeActive
+ };
+}
+const mapDispatchToProps = dispatch => ({
+ toggleDistractionFreeMode: () => {
+ dispatch(toggleDistractionFreeMode());
+ },
++=======
+ 'visible',
+ ),
+ ),
+ };
+ }
+ const mapDispatchToProps = (dispatch) => ({
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
refreshStateAfterImageDownload: (activePalettes, rotation, isGraticule) => {
if (activePalettes) {
dispatch(refreshPalettes(activePalettes));
@@@ -336,5 -328,4 +416,8 @@@ toolbarContainer.propTypes =
refreshStateAfterImageDownload: PropTypes.func,
requestNotifications: PropTypes.func,
rotation: PropTypes.number,
++<<<<<<< HEAD
+ toggleDistractionFreeMode: PropTypes.func
++=======
++>>>>>>> a94779070df9f8b28d733b972df975bc3cc49edd
};
diff --cc web/js/modules/combine-reducers.js
index 1c6d538ab,5a704db65..0f9c2eaa2
--- a/web/js/modules/combine-reducers.js
+++ b/web/js/modules/combine-reducers.js
@@@ -132,11 -129,10 +131,11 @@@ const reducers =
modalAboutPage,
shortLink,
notificationsRequest,
- lastAction: lastAction,
+ lastAction,
location: locationReducer,
measure: measureReducer,
+ ui: uiReducers,
- productPicker: productPickerReducer
+ productPicker: productPickerReducer,
};
const appReducer = combineReducers(reducers);
/**
diff --cc web/js/modules/key-press/actions.js
index 8b37e19d6,78dc16f78..88f88b272
--- a/web/js/modules/key-press/actions.js
+++ b/web/js/modules/key-press/actions.js
@@@ -25,17 -20,8 +25,17 @@@ export function keyPress(keyCode, shift
}
if (tour.active && keyCode === 27) {
dispatch({
- type: TOUR_KEY_PRESS_CLOSE
+ type: TOUR_KEY_PRESS_CLOSE,
});
}
+ if (!ctrlOrCmdKey && shiftKey && keyCode === 68) {
+ dispatch({ type: TOGGLE_DISTRACTION_FREE_MODE });
+ if (!isDistractionFreeModeActive && modalIsOpen) {
+ dispatch({ type: CLOSE_MODAL });
+ }
+ }
+ if (isDistractionFreeModeActive && keyCode === 27) {
+ dispatch({ type: TOGGLE_DISTRACTION_FREE_MODE });
+ }
};
}