geojson.io
geojson.io copied to clipboard
Data layers visible when user switches styles while editing
Steps to reproduce:
- Draw a polygon
- Enter edit mode
- Move the polygon
- Switch styles
The layer that displays the polygon is hidden when entering edit mode. When changing styles, the sources and layers for the current data are added on style.load
.
To fix:
- on
style.load
check if user is editing. If so, set visibility to none in eachaddLayer()
- similarly, pass
isEditing
intoaddMarkers
, and set each marker's element style to display: none before adding to the map. - when the user exits edit mode, existing code will toggle the visibility of these layers and markers back to visible