Buttons that animate a lonboard Map to
preset locations, driving lonboard’s fly_to from the browser.
Each preset is a dict with a label and deck.gl camera keys (longitude, latitude,
zoom, and optionally pitch / bearing). Clicking a button flies the map there —
no kernel required, so it behaves the same live and in static export.
Import¶
from manywidgets.lonboard import MapFlyerExample¶
from lonboard import Map, ScatterplotLayer
from manywidgets.lonboard import MapFlyer
layer = ScatterplotLayer.from_geopandas(gdf)
m = Map(layer, basemap=None)
flyer = MapFlyer(m, locations=[
{"label": "New York", "longitude": -74.0, "latitude": 40.7, "zoom": 10},
{"label": "London", "longitude": -0.12, "latitude": 51.5, "zoom": 9},
], duration=3000)
# show the control and the map together (see the Layout widgets)
from manywidgets import Column
Column(flyer, m)API¶
| Trait | Type | Default | Description |
|---|---|---|---|
map | Instance | — | The lonboard Map to reposition. |
locations | List | — | Presets; each a dict with ‘label’ plus camera keys (longitude, latitude, zoom, optionally pitch/bearing). |
duration | Int | 4000 | Fly-to animation duration in milliseconds. |
label | Unicode | '' | Optional heading above the buttons. |
widget_id | Unicode | '' | Stable unique id used for cross-widget linking (auto-assigned). |