nasa-gibs / worldview

Interactive interface for browsing global, full-resolution satellite imagery
https://worldview.earthdata.nasa.gov/
Other
691 stars 183 forks source link

WV-2974 optimize map rendering #5261

Closed PatchesMaps closed 2 months ago

PatchesMaps commented 2 months ago

Description

As it currently stands, when you toggle the visibility of a layer, the map re-requests / reloads all visible layers. This can slow down the app's interactivity, especially when dynamically generated layers are visible since they take longer to load.

On a related note, it appears that layers are loaded serially rather than in parallel. This is also particularly noticeable when dynamically generated layers are involved since they can block the loading of the much faster GIBS-based layers.

This PR prevents layer creation errors and tile load errors from blocking map updates.

How To Test

  1. git checkout WV-2974-optimize-map-rendering
  2. npm run watch
  3. Go to this link
  4. The Coastlines layer should be visible and the loading spinner should go away.
  5. Go to this link
  6. Toggle the layers visibility's on and off and observe that the layers do not reload when visibility is toggled.

PR Submission Checklist

This is simply a reminder of what we are going to look for before merging your code.

Merging

Please use the squash and merge commit method unless each commit in your branch is vital to the commit history of main.

@nasa-gibs/worldview