I believe this closes #123 or greatly reduces the issue.
In my investigation I noticed a few things:
we re-join data on each map load which is slow,
we were not removeing mapbox gl instances when leaving the map page, and
the SVGs used for the crop cards are a bit heavy (nearly 250k DOM nodes in total)
we could further improve performance by loading the map once in the background and overlaying pages on top of it rather than continuously removing + reloading the map if you're going back and forth in the app
I tried to address the first two here. In fully removing the SVGs locally (the 3rd point) and testing performance was improved more. If it isn't too hard to convert these to PNGs I'd be curious to see the result but I don't think it's a dealbreaker.
I'll highlight where the first two points are addressed inline below.
I believe this closes #123 or greatly reduces the issue.
In my investigation I noticed a few things:
remove
ing mapbox gl instances when leaving the map page, andI tried to address the first two here. In fully removing the SVGs locally (the 3rd point) and testing performance was improved more. If it isn't too hard to convert these to PNGs I'd be curious to see the result but I don't think it's a dealbreaker.
I'll highlight where the first two points are addressed inline below.