-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: add support to zoom into a specific layer #544
Comments
All layers already have bounding box and weighted centroid attributes that are inferred from the input data. Lines 75 to 76 in 5560ead
Currently it's on the Lines 445 to 447 in 5560ead
lonboard/lonboard/_viewport.py Lines 58 to 79 in 5560ead
I think possibly the cleanest API here is to add a Then you'd be able to do layer = ScatterplotLayer(...)
layer2 = PolygonLayer(...)
map = Map([layer, layer2], view_state=layer.view_state) That would also let you e.g. override only the zoom, by setting new_view_state = layer.view_state
new_view_state["zoom"] = 4
map.view_state = new_view_state I don't have a lot of spare time right now; would you be interested in making a PR? |
I'll take a look, but at the moment I'm a bit swamped, but I saw you'll be at Scipy next month, it might be a good place to pair on it and chat also about Ibis + duckdb + lonboard. |
When plotting a Map with multiple layers, I'd like to have an option to zoom in into a specific layer. For example, in this blog https://ibis-project.org/posts/ibis-duckdb-geospatial/ I have some code that plots a point, two lines (over some roads), and the NYC streets, that looks like this
However, without specifying the
view_state
the map displays like this, and the first two layers get completely lost unless I manually zoom in. It would be great if I could zoom in a box around let's say the first two layers or one of them, without having to find what is the lat, lon and specific zoom value.The text was updated successfully, but these errors were encountered: