Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release to Main v4.21.1 #4863

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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