From e397cde86c1e35b1898b64d34f249993a6d29c50 Mon Sep 17 00:00:00 2001 From: christof-wittreich Date: Fri, 8 Dec 2023 10:44:07 -0600 Subject: [PATCH 1/2] Added cache-clearing for non-tourstory actions (#4852) --- .../update-projection/updateProjection.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/web/js/mapUI/components/update-projection/updateProjection.js b/web/js/mapUI/components/update-projection/updateProjection.js index 0891a342f6..ccc1e22b89 100644 --- a/web/js/mapUI/components/update-projection/updateProjection.js +++ b/web/js/mapUI/components/update-projection/updateProjection.js @@ -61,7 +61,7 @@ function UpdateProjection(props) { * * @returns {void} */ - const clearLayers = function() { + const clearLayers = function(saveCache) { const activeLayersUI = ui.selected .getLayers() .getArray() @@ -69,6 +69,9 @@ function UpdateProjection(props) { lodashEach(activeLayersUI, (mapLayer) => { ui.selected.removeLayer(mapLayer); }); + + if (saveCache) return; + ui.cache.clear(); }; /** @@ -116,7 +119,7 @@ function UpdateProjection(props) { * @param {Boolean} id - layer id * @returns {void} */ - async function reloadLayers(granuleOptions) { + async function reloadLayers(granuleOptions, saveCache) { const mapUI = ui.selected; const { createLayer } = ui; @@ -125,7 +128,7 @@ function UpdateProjection(props) { if (compareMapDestroyed) { compareMapUi.destroy(); } - clearLayers(); + clearLayers(saveCache); const defs = getLayers(layerState, { reverse: true }); const layerPromises = defs.map((def) => { const options = getGranuleOptions(layerState, def, compare.activeString, granuleOptions); @@ -138,7 +141,7 @@ function UpdateProjection(props) { if (compare && !compare.isCompareA && compare.mode === 'spy') { stateArray.reverse(); // Set Layer order based on active A|B group } - clearLayers(); + clearLayers(saveCache); const stateArrayGroups = stateArray.map(async (arr) => getCompareLayerGroup(arr, layerState, granuleOptions)); const compareLayerGroups = await Promise.all(stateArrayGroups); compareLayerGroups.forEach((layerGroup) => mapUI.addLayer(layerGroup)); @@ -222,7 +225,7 @@ function UpdateProjection(props) { updateMapUI(ui, rotation); - reloadLayers(); + reloadLayers(null, !start); // If the browser was resized, the inactive map was not notified of // the event. Force the update no matter what and reposition the center From 8ac793fbdff6550ec9e5748ecf97fc63184e4bde Mon Sep 17 00:00:00 2001 From: christof-wittreich Date: Fri, 8 Dec 2023 12:42:49 -0500 Subject: [PATCH 2/2] v4.21.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ebf2694b8c..a246ccba53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "worldview", - "version": "4.21.0", + "version": "4.21.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "worldview", - "version": "4.21.0", + "version": "4.21.1", "hasInstallScript": true, "license": "NASA-1.3", "dependencies": { diff --git a/package.json b/package.json index 0ea5b812ee..5e66e6a2f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "worldview", - "version": "4.21.0", + "version": "4.21.1", "description": "Interactive interface for browsing full-resolution, global satellite imagery", "keywords": [ "NASA",