Interactive interface for browsing global, full-resolution satellite imagery
WV-2298: Hide lines and text if not in geographic projection (#3969)
Jason Kent733df6b1657e
diff --git a/web/js/components/dateline/datelines.js b/web/js/components/dateline/datelines.jsindex 4932285aa..bde62a2e1 100644--- a/web/js/components/dateline/datelines.js+++ b/web/js/components/dateline/datelines.js@@ -52,15 +52,23 @@ function DateLines(props) {setHideLines(false);};+ useEffect(() => {+ if (!proj.selected.crs === 'EPSG:4326') {+ setHideLines(true);+ }+ }, [proj]);+useEffect(() => {if (proj.id !== 'geographic' || !mapIsRendered) {return;}- map.on('movestart', () => { setHideLines(true); });+ map.on('movestart', () => {+ setHideLines(true);+ });map.on('moveend', updatePosition);return () => {- map.off('movestart', updatePosition);- map.off('moveend', updatePosition);+ map.un('movestart', updatePosition);+ map.un('moveend', updatePosition);};}, [mapIsRendered]);@@ -103,13 +111,14 @@ const mapStateToProps = (state) => {proj, map, compare, settings, modal,} = state;const isImageDownload = modal.id === 'TOOLBAR_SNAPSHOT' && modal.isOpen;+ const isGeographic = proj.selected.crs === 'EPSG:4326';return {proj,map: map.ui.selected,date: getSelectedDate(state),isCompareActive: compare.active,mapIsRendered: map.rendered,- hideText: isImageDownload,+ hideText: isImageDownload || !isGeographic,alwaysShow: isImageDownload || settings.alwaysShowDatelines,};};