eodaGmbH / py-maplibregl

Python bindings for MapLibre GL JS
https://eodagmbh.github.io/py-maplibregl/
MIT License
27 stars 2 forks source link

Get map center, zoom level, and bounds programmatically #57

Closed giswqs closed 2 weeks ago

giswqs commented 2 weeks ago

It would be great to add support for getting the map center, zoom level, and bounds programmatically. For now, we can only get the mouse clicked location. Getting map center and bounds would be very useful for some computing workflows.

Ideally, we want to use the draw control to draw some shapes and return the drawn geometries programmatically.

crazycapivara commented 2 weeks ago

Do you want to get this values on the mouse clicked event or by calling a separate function that triggers the values to be returned?

giswqs commented 2 weeks ago

Can we make them as the map attributes, similar to ipyleaflet?

image

crazycapivara commented 2 weeks ago

Yes, this is how I will make it available. The question just was, when to update these values, but I think it will be on_zoom and on_map_move :-)