geojson.io icon indicating copy to clipboard operation
geojson.io copied to clipboard

Data layers visible when user switches styles while editing

Open chriswhong opened this issue 2 years ago • 1 comments

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 each addLayer()
  • similarly, pass isEditing into addMarkers, 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

chriswhong avatar Oct 20 '22 04:10 chriswhong