developmentseed / developmentseed/lonboard
feature: add support to zoom into a specific layer
- Dominant language
- Python
- Stars
- 964
- Forks
- 54
- Avg merge
- 5m
- Merged PRs (30d)
- 1
Description
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
```
broad_station_layer = ScatterplotLayer.from_geopandas(
broad_station_gdf, get_fill_color="blue", get_radius=5
)
sts_near_broad_layer = PathLayer.from_geopandas(
sts_near_broad_gdf, get_color="red", opacity=0.4, get_width=2
)
streets_layer = PathLayer.from_geopandas(streets_gdf, get_color="grey", opacity=0.3)
m = Map(
[
broad_station_layer,
sts_near_broad_layer,
streets_layer,
],
view_state={"longitude": -74.01066, "latitude": 40.7069, "zoom": 16} # need this to zoom into desired outcome
)
m
```

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.

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.