Default Map features reset every new Rapid Instance
Description
Whenever a new Rapid instance is opened, say from MapRoulette, the image background selection remains consistent with the previous session, but the selected Map features resets every time. Would it be possible for the map features to likewise remain consistent across instances?
Version
2.0.1
What browser are you seeing the problem on? What version are you running?
Firefox v111.0
The OS you're using
win
Steps to reproduce
Open task in MapRoulette, Turn off map feature (e.g. Landcover) Upload and commit edits Open next MapRoulette challenge Observe the Map features you previously turned off are now back on.
The browser URL at the time you encountered the bug
https://mapwith.ai/rapid#background=Maxar-Premium&datasets=fbRoads,msBuildings&map=16.68/10.08845/15.37601
The auto-detected useragent string for your browser (leave blank if you're manually filling this form out)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Yes this makes sense to me.. We should be restoring the user's feature filtering preferences from localStorage if the url hash doesn't specify what features to filter.
Cross-linking https://github.com/maproulette/maproulette3/issues/2181 which is a feature request posted on the MapRoulette repo for exactly the functionality that's described above.
In that issue the user mentioned disabled features specifically, but also suggested that it'd be nice if other types of editor state were remembered. I did some quick testing, here's what I found.
Settings that are remembered across sessions:
- background imagery selection
- imagery brightness
- no/partial/full fill setting
- everything in the "Issues" panel
- everything in the "Preferences" panel
Settings that are not remembered across sessions:
- enabled/disabled map features, as mentioned above
- minimap / 3D map / backgound / location panels
- overlays (locator, openrailway, TIGER, etc)
- imagery contrast, saturation, and sharpness
- imagery offset
- history panel, measurement panel
- data layers (notes, Osmose, GeoScribble, etc)
- photo overlays (Bing Streetside, Mapillary, etc)
I'm not trying to increase the scope of this particular issue, just wanted to document what I found in case it's helpful to someone working on implementing this. Probably not all of these need to be remembered across sessions, but a few of them seem like it'd be nice if they were. I'm happy to open other issues if it's easier for you (maintainers) to track these separately.
Notably, the locator overlay is force enabled during initialization. In trying to work around the lack of preference persistence I tried explicitly passing in overlays via the overlays qs param. These ultimately get used by enableOverlayLayers and should reset to only the specified overlay ids, but the locator layer has special handling and is always shown. Thus, even if the active set of user selected overlay layers is persisted and restored, additional handling would be needed for the locator layer.
https://github.com/facebook/Rapid/blob/2e92385cc6a395a288929ab026c7c98ebf8d0901/modules/core/ImagerySystem.js#L518