Interactive interface for browsing global, full-resolution satellite imagery
Wv 2742 investigate bbox coordinate (#4535)
Patrick Moulden14d256173d2b
diff --git a/web/js/components/image-download/lat-long-inputs.js b/web/js/components/image-download/lat-long-inputs.jsindex 77d639d19..462e44b50 100644--- a/web/js/components/image-download/lat-long-inputs.js+++ b/web/js/components/image-download/lat-long-inputs.js@@ -1,9 +1,6 @@import React, { useState, useEffect } from 'react';-import * as olProj from 'ol/proj';-import {- clone as lodashClone,-} from 'lodash';import { containsExtent, isEmpty } from 'ol/extent';+import { fromExtent } from 'ol/geom/Polygon';import PropTypes from 'prop-types';import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';import { CRS } from '../../modules/map/constants';@@ -27,9 +24,11 @@ function Input({const update = () => {try {const newInputValue = Number(inputValue);- const newArray = lodashClone(boundingBoxArray);+ const newArray = structuredClone(boundingBoxArray);newArray[index] = newInputValue;- const crsCorrectedExtent = olProj.transformExtent(newArray, CRS.GEOGRAPHIC, crs);+ const extentPolygon = fromExtent(newArray);+ const crsCorrectedExtentPolygon = extentPolygon.transform(CRS.GEOGRAPHIC, crs);+ const crsCorrectedExtent = crsCorrectedExtentPolygon.getExtent();if (containsExtent(viewExtent, crsCorrectedExtent)&& isValidExtent(newArray)