0

Is there a way to add a known polygon to the Draw interface of a leaflet map ?

I search for the feature_group property with :

print(m.__dict__)

but didn't find anything. I assume I can add one using geojson format I just don't know where.

Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47
  • Would https://ipyleaflet.readthedocs.io/en/latest/api_reference/geo_json.html work for you? – Anatolii Suhanov Dec 01 '20 at 18:15
  • unfortunately no, I want to create a starting geometry on my map that the user can then manipulate. It's answered in [js](https://stackoverflow.com/questions/44036712/add-polygon-programmatically-in-leaflet-l-draw-plugin) but cannot find anything in python – Pierrick Rambaud Dec 01 '20 at 18:33
  • So it's not possible with https://ipyleaflet.readthedocs.io/en/latest/api_reference/draw_control.html? – Anatolii Suhanov Dec 01 '20 at 19:41
  • your link is only showing the customization parameters of the DrawControl. I want to programmatically draw something – Pierrick Rambaud Dec 02 '20 at 10:15
  • Hello @PierrickRambaud, did you find a way to do this? I'm trying to see how the source code of leafmap could help, but I'm unsuccessful for now. Thanks in advance for any update you can provide! – Naptzer Feb 21 '23 at 21:04

0 Answers0