Closed prl900 closed 2 years ago
Ok, solved this by wrapping each layer in its own Pane.
Here is the code in case it's useful for others running into a similar issue:
lmap = dl.Map(center=[56, 10], zoom=4, children=[dl.Pane(children=[dl.TileLayer()], style={"zIndex": 1}), dl.Pane(children=[red, blue], style={"zIndex": 2}), dl.Pane(children=[dl.FeatureGroup([
dl.EditControl(id="edit_control")])], style={"zIndex": 3})],
style={'width': '100%', 'height': '100vh', 'margin': "auto", "display": "inline-block"}, id="map")
Hi,
I apologise for bringing this question here but I couldn't make it simple enough to work for StackOverflow.
I have come up with a tool to allow users to draw polygons and indicate regions of different categories on a map. Using EditControl and a radio button users can select the category and the polygons are represented using different colours.
To do this, polygons are rendered on top of the EditControl GeoJSON using new GeoJSON layers with specific styles. Everything seems to work fine except the delete functionality in EditControl. The original polygons cannot be clicked as they apparently sit behind the coloured layers.
Does anyone know if there is a simple way of making these polygons clickable? I have tried modifying the order of the layers, Panes and z-indices but I cannot work it out.
Here is a simple example that reproduces this problem -- this could be useful to anyone looking at doing map classification tasks for training machine learning models.
Thanks for your help!