Interactive interface for browsing global, full-resolution satellite imagery
make geostationary modal scroll, use more width when available to avoid scrolling, don't set up or talk about animation on mobile devices
Jason Kenta9f094c531a7
diff --git a/web/js/components/feature-alert/alert.js b/web/js/components/feature-alert/alert.jsindex 277d97fcb..deb7b3ba5 100644--- a/web/js/components/feature-alert/alert.js+++ b/web/js/components/feature-alert/alert.js@@ -45,10 +45,11 @@ const mapDispatchToProps = (dispatch) => ({openCustomContent('geostationary_info', {headerText: 'New: Geostationary Layers',backdrop: false,- size: 'md',- wrapClassName: 'clickable-behind-modal',+ size: 'lg',+ wrapClassName: '',clickableBehindModal: true,- bodyComponent: GeostationaryModalBody+ bodyComponent: GeostationaryModalBody,+ scrollable: true}));}diff --git a/web/js/components/feature-alert/geostationary-modal.js b/web/js/components/feature-alert/geostationary-modal.jsindex c1c0cc966..004d7c37b 100644--- a/web/js/components/feature-alert/geostationary-modal.js+++ b/web/js/components/feature-alert/geostationary-modal.js@@ -4,42 +4,56 @@ import PropTypes from 'prop-types';import { history } from '../../main';import update from 'immutability-helper';import {- Button+ Button,+ Row,+ Col} from 'reactstrap';class GeostationaryModalBody extends React.Component {tryIt() {- this.props.prepareAnimate();- this.props.closeModal();+ const { isMobile, prepareAnimate, closeModal } = this.props;+ prepareAnimate(isMobile);+ closeModal();}render() {+ const { isMobile } = this.props;+return (- <div className="geostationary-modal">- <img src="images/geostationary.gif"/>- <p>- Our latest release includes new layers from geostationary satellites –- GOES East, GOES West and Himawari-8. Find these new layers in the new- “Featured” tab of the “Add Layers” menu.- </p>- <p>- These geostationary layers have a much higher temporal frequency than other- imagery in Worldview - A new image is available every 10 minutes!- </p>- <p>- To take full advantage of this, the time (and timescale) of the timeline- can now be set down to the hour and minute whenever any geostationary products- are in the current list of overlays.- </p>- <p>- For an optimal experience, set the time increment in the custom- interval selector to 10 minute.- </p>- <p>- The animation tool has also been updated to allow adjustments down to- the hour and minute. Click below to set up an animation to see- geostationary in action!- </p>+ <Row className="geostationary-modal">+ <Col lg="6" md="12">+ {!isMobile && <img src="images/geostationary.gif" className="img-fluid"/>}+ </Col>+ <Col lg="6" md="12">+ <p>+ Our latest release includes new layers from geostationary satellites –+ GOES East, GOES West and Himawari-8. Find these new layers in the new+ “Featured” tab of the “Add Layers” menu.+ </p>+ <p>+ These geostationary layers have a much higher temporal frequency than other+ imagery in Worldview - A new image is available every 10 minutes!+ </p>+ <p>+ To take full advantage of this, the time (and timescale) of the timeline+ can now be set down to the hour and minute whenever any geostationary products+ are in the current list of overlays.+ </p>+ <p>+ For an optimal experience, set the time increment in the custom+ interval selector to 10 minute.+ </p>++ {isMobile+ ? <p> Click below to see geostationary in action! </p>+ : <p>+ The animation tool has also been updated to allow adjustments down to+ the hour and minute. Click below to set up an animation to see+ geostationary in action!+ </p>+ }++ </Col><ButtonclassName="btn btn-lg"@@ -47,13 +61,31 @@ class GeostationaryModalBody extends React.Component {Try it!</Button>- </div>+ </Row>);}}-const getLocation = (search) => {- search = search.split('/?').pop();+const mapStateToProps = (state, ownProps) => {+ return {+ isMobile: state.browser.lessThan.medium+ };+};++const getLocation = (isMobile) => {+ const paramArr = [+ 'p=geographic&',+ 'l=Reference_Labels,Reference_Features(hidden),Coastlines(hidden),GOES-East_ABI_Band2_Red_Visible,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor(hidden)&',+ 't=2019-09-01-T16%3A00%3A00Z&',+ 'v=-84.25409131402579,21.881949559541848,-69.48846631402579,30.213980809541848&',+ 'z=4&ics=true&ici=5&icd=10'+ ];++ if (!isMobile) {+ paramArr.push('&ab=on&as=2019-09-01-T16%3A00%3A00Z&ae=2019-09-01-T17%3A40%3A00Z&al=true');+ }+ const urlParams = paramArr.reduce((prev, curr) => prev + curr, '');+ const search = urlParams.split('/?').pop();const location = update(history.location, {search: { $set: search }});@@ -61,29 +93,21 @@ const getLocation = (search) => {};const mapDispatchToProps = (dispatch) => ({- prepareAnimate: () => {- const paramArr = [- 'p=geographic&',- 'l=Reference_Labels,Reference_Features(hidden),Coastlines(hidden),GOES-East_ABI_Band2_Red_Visible,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor(hidden)&',- 't=2019-09-01-T16%3A00%3A00Z&',- 'v=-84.25409131402579,21.881949559541848,-69.48846631402579,30.213980809541848&',- 'z=4&ics=true&ici=5&icd=10&',- 'ab=on&as=2019-09-01-T16%3A00%3A00Z&ae=2019-09-01-T17%3A40%3A00Z&al=true'- ];- const urlParams = paramArr.reduce((prev, curr) => prev + curr, '');+ prepareAnimate: (isMobile) => {dispatch({type: 'REDUX-LOCATION-POP-ACTION',- payload: getLocation(urlParams)+ payload: getLocation(isMobile)});}});export default connect(- null,+ mapStateToProps,mapDispatchToProps)(GeostationaryModalBody);GeostationaryModalBody.propTypes = {closeModal: PropTypes.func,+ isMobile: PropTypes.bool,prepareAnimate: PropTypes.func};