Skip to content

Commit 419c90b

Browse files
Merge pull request #4862 from nasa-gibs/UAT-v4.21.1
UAT-v4.21.1 to Release
2 parents f766353 + 8ac793f commit 419c90b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "worldview",
3-
"version": "4.21.0",
3+
"version": "4.21.1",
44
"description": "Interactive interface for browsing full-resolution, global satellite imagery",
55
"keywords": [
66
"NASA",

web/js/mapUI/components/update-projection/updateProjection.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,17 @@ function UpdateProjection(props) {
6161
*
6262
* @returns {void}
6363
*/
64-
const clearLayers = function() {
64+
const clearLayers = function(saveCache) {
6565
const activeLayersUI = ui.selected
6666
.getLayers()
6767
.getArray()
6868
.slice(0);
6969
lodashEach(activeLayersUI, (mapLayer) => {
7070
ui.selected.removeLayer(mapLayer);
7171
});
72+
73+
if (saveCache) return;
74+
ui.cache.clear();
7275
};
7376

7477
/**
@@ -116,7 +119,7 @@ function UpdateProjection(props) {
116119
* @param {Boolean} id - layer id
117120
* @returns {void}
118121
*/
119-
async function reloadLayers(granuleOptions) {
122+
async function reloadLayers(granuleOptions, saveCache) {
120123
const mapUI = ui.selected;
121124
const { createLayer } = ui;
122125

@@ -125,7 +128,7 @@ function UpdateProjection(props) {
125128
if (compareMapDestroyed) {
126129
compareMapUi.destroy();
127130
}
128-
clearLayers();
131+
clearLayers(saveCache);
129132
const defs = getLayers(layerState, { reverse: true });
130133
const layerPromises = defs.map((def) => {
131134
const options = getGranuleOptions(layerState, def, compare.activeString, granuleOptions);
@@ -138,7 +141,7 @@ function UpdateProjection(props) {
138141
if (compare && !compare.isCompareA && compare.mode === 'spy') {
139142
stateArray.reverse(); // Set Layer order based on active A|B group
140143
}
141-
clearLayers();
144+
clearLayers(saveCache);
142145
const stateArrayGroups = stateArray.map(async (arr) => getCompareLayerGroup(arr, layerState, granuleOptions));
143146
const compareLayerGroups = await Promise.all(stateArrayGroups);
144147
compareLayerGroups.forEach((layerGroup) => mapUI.addLayer(layerGroup));
@@ -222,7 +225,7 @@ function UpdateProjection(props) {
222225

223226
updateMapUI(ui, rotation);
224227

225-
reloadLayers();
228+
reloadLayers(null, !start);
226229

227230
// If the browser was resized, the inactive map was not notified of
228231
// the event. Force the update no matter what and reposition the center

0 commit comments

Comments
 (0)