ipyleaflet icon indicating copy to clipboard operation
ipyleaflet copied to clipboard

Get selected object from GeomanDrawControl

Open giswqs opened this issue 1 year ago • 3 comments

The geoman javascript demo allows selecting and highlighting draw features. Is it possible to do the same thing using the ipyleaflet GeomanDrawControl? How do we access the selected object, similar to the DrawControl.last_draw_feature attribute? The goal is to select draw features and add/edit their properties programtically.

https://geoman.io/demo/leaflet Peek 2024-11-13 22-30

giswqs avatar Nov 14 '24 03:11 giswqs

I am looking for python counterpart of the JS Draw.getActiveShape()

https://geoman.io/docs/leaflet/modes/draw-mode image

giswqs avatar Nov 14 '24 04:11 giswqs

Any luck ? @giswqs Interested too.

simonprovost avatar Jan 17 '25 17:01 simonprovost

FYI I've been looking into this and it seems its a bit of a limitation of the current ipyleaflet design, there isn't really a "catalogue" of layers on the javascript side than can be easily matched with the layer widget objects created on the Python side, when a layer is interacted with via Geoman.

I think this would required adding some kind of unique ID parameter to each layer so that the same layer can be identified both in python and javascript.

mangecoeur avatar Apr 21 '25 10:04 mangecoeur