0

I am using React leaflet draw and facing an issue while deleting drawn layer when it is overlapped with another layer of a higher z-index. Is it possible to control the z-index of react-leaflet-draw's FeatureGroup/EditControl to render the drawn layer at the extreme top?

I can delete the layers programmatically like below or by clicking on clear all layers, but I want to be able to click to delete individual layers based on the requirement.

//To programmatically delete:
const mapObject = useMap();
drawnLayers.forEach((layer) => {   //drawnLayers = array storing the layers received in onCreated handler
  mapObject.removeLayer(layer);
});

Issue

Premshankar Tiwari
  • 3,006
  • 3
  • 24
  • 30

0 Answers0