Skip to content

Commit

Permalink
Merge pull request #4863 from nasa-gibs/release
Browse files Browse the repository at this point in the history
Release to Main v4.21.1
  • Loading branch information
christof-wittreich authored Dec 8, 2023
2 parents 6bb1714 + 419c90b commit 54d5419
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 8 additions & 5 deletions web/js/mapUI/components/update-projection/updateProjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@ function UpdateProjection(props) {
*
* @returns {void}
*/
const clearLayers = function() {
const clearLayers = function(saveCache) {
const activeLayersUI = ui.selected
.getLayers()
.getArray()
.slice(0);
lodashEach(activeLayersUI, (mapLayer) => {
ui.selected.removeLayer(mapLayer);
});

if (saveCache) return;
ui.cache.clear();
};

/**
Expand Down Expand Up @@ -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;

Expand All @@ -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);
Expand All @@ -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));
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 54d5419

Please sign in to comment.