Open tomalrussell opened 4 months ago
Currently implemented:
Example URL, with infrastructure, hazards, and buildings visible: https://jamaica.infrastructureresilience.org/exposure?lat=17.87511&lon=-77.24007&zoom=12.78&assets=true&hazards=true&buildings=true®ions=false&terrestrial=false&marine=false
A couple more PRs:
Map sidebar state is shareable now, but the URLs are ~5k characters.
Some work on shortening URLs by removing redundant query parameters (mostly optimising tree state by writing a list of visible asset layer IDs to the URL.)
I've run into a weird problem where urlSyncEffect
works fine in local development, then doesn't work at all in a production build. It can be worked around by adding a Recoil state effect that updates the window history, but that's annoying.
I'm wondering if this is a side effect of the update to React 18. Recoil seems to be abandoned now, so it wouldn't surprise me if it has bugs with the latest React.
Also nice-to-have to port over:
See https://github.com/nismod/irv-frontend/pull/20