Interactive interface for browsing global, full-resolution satellite imagery
EIC mode UI & Performance Improvements (#4424)
Ryan Weilerd7845d3dec78
diff --git a/web/js/components/animation-widget/loading-indicator.js b/web/js/components/animation-widget/loading-indicator.jsindex f1d891842..9e20e6363 100644--- a/web/js/components/animation-widget/loading-indicator.js+++ b/web/js/components/animation-widget/loading-indicator.js@@ -6,7 +6,7 @@ import {export default function LoadingIndicator(props) {const {- onClose, title, bodyMsg, loadedItems, totalItems,+ onClose, title, bodyMsg, loadedItems, totalItems, isKioskModeActive,} = props;const msgStyle = {@@ -31,7 +31,7 @@ export default function LoadingIndicator(props) {</button>);- return (+ return !isKioskModeActive && (<ModalisOpentoggle={onClose}@@ -56,4 +56,5 @@ LoadingIndicator.propTypes = {bodyMsg: PropTypes.string,loadedItems: PropTypes.number,totalItems: PropTypes.number,+ isKioskModeActive: PropTypes.bool,};diff --git a/web/js/components/animation-widget/play-queue.js b/web/js/components/animation-widget/play-queue.jsindex 273e02907..207ad8731 100644--- a/web/js/components/animation-widget/play-queue.js+++ b/web/js/components/animation-widget/play-queue.js@@ -435,7 +435,7 @@ class PlayQueue extends React.Component {render() {const { isAnimating } = this.state;- const { onClose, isMobile } = this.props;+ const { onClose, isMobile, isKioskModeActive } = this.props;const loadedItems = util.objectLength(this.bufferObject);const title = !this.minBufferLength ? 'Determining buffer size...' : 'Preloading buffer...';const mobileProgressStyle = {@@ -459,6 +459,7 @@ class PlayQueue extends React.Component {onClose={onClose}loadedItems={loadedItems}totalItems={this.minBufferLength || 100}+ isKioskModeActive={isKioskModeActive}/>);}@@ -480,6 +481,7 @@ PlayQueue.propTypes = {onClose: PropTypes.func,numberOfFrames: PropTypes.number,snappedCurrentDate: PropTypes.object,+ isKioskModeActive: PropTypes.bool,};export default PlayQueue;diff --git a/web/js/components/map/loading-spinner.js b/web/js/components/map/loading-spinner.jsindex 80acd1fb1..95b98cd47 100644--- a/web/js/components/map/loading-spinner.js+++ b/web/js/components/map/loading-spinner.js@@ -1,9 +1,18 @@import React from 'react';-import { connect } from 'react-redux';-import PropTypes from 'prop-types';import { Spinner } from 'reactstrap';+import { useSelector } from 'react-redux';++function LoadingIndicator() {+ const {+ msg,+ shouldSpinnerShow,+ isMobile,+ } = useSelector((state) => ({+ msg: state.loading.msg,+ shouldSpinnerShow: state.loading.isLoading && !state.ui.isKioskModeActive,+ isMobile: state.screenSize.isMobileDevice,+ }));-function LoadingIndicator({ msg, isLoading, isMobile }) {const spinnerStyle = isMobile ? {position: 'absolute',top: 10,@@ -17,26 +26,12 @@ function LoadingIndicator({ msg, isLoading, isMobile }) {zIndex: 999,};- return isLoading && (+ return shouldSpinnerShow && (<div style={spinnerStyle}><Spinner color="light" size="sm" />{msg}</div>);}-LoadingIndicator.propTypes = {- msg: PropTypes.string,- isLoading: PropTypes.bool,- isMobile: PropTypes.bool,-};-const mapStateToProps = (state) => {- const { screenSize, loading } = state;- const { msg, isLoading } = loading;- return {- isLoading,- isMobile: screenSize.isMobileDevice,- msg,- };-};-export default connect(mapStateToProps)(LoadingIndicator);+export default LoadingIndicator;diff --git a/web/js/containers/animation-widget/animation-widget.js b/web/js/containers/animation-widget/animation-widget.jsindex 510559366..b2fb99934 100644--- a/web/js/containers/animation-widget/animation-widget.js+++ b/web/js/containers/animation-widget/animation-widget.js@@ -246,6 +246,7 @@ function AnimationWidget (props) {startDate={startDate}endDate={endDate}interval={interval}+ isKioskModeActive={isKioskModeActive}delta={delta}speed={speed}selectDate={selectDate}diff --git a/web/js/mapUI/components/kiosk/tile-measurement/utils/date-util.js b/web/js/mapUI/components/kiosk/tile-measurement/utils/date-util.jsindex 9d805e30a..642947e12 100644--- a/web/js/mapUI/components/kiosk/tile-measurement/utils/date-util.js+++ b/web/js/mapUI/components/kiosk/tile-measurement/utils/date-util.js@@ -42,7 +42,11 @@ function getSubdailyDates (selectedDate) {// Get the date as a string in UTCconst utcDateString = selectedDate.toLocaleString('en-US', { timeZone: 'UTC' });// Convert the UTC string back to a Date object- const currentDate = new Date(utcDateString);+ let currentDate = new Date(utcDateString);++ // Subtract 30 minutes to start half an hour before the selectedDate+ // This is a performance improvement for EIC mode since most of the time, no full imagery is found in the first 30 minutes+ currentDate = new Date(currentDate.getTime() - 30 * 60 * 1000);// Round minutes down to nearest ten and seconds and milliseconds to zerocurrentDate.setMinutes(Math.floor(currentDate.getMinutes() / 10) * 10, 0, 0);diff --git a/web/js/modules/map/util.js b/web/js/modules/map/util.jsindex 5cdb23daa..06d8f533a 100644--- a/web/js/modules/map/util.js+++ b/web/js/modules/map/util.js@@ -284,8 +284,8 @@ function promiseLayerGroup(layerGroup, map) {* @return {object} Promise*/export async function promiseImageryForTime(state, date, activeString) {- const { map, ui: { eic } } = state;- if (!map.ui.proj || eic === 'si') return;+ const { map } = state;+ if (!map.ui.proj) return;const {cache, selected, createLayer, layerKey,} = map.ui;