Skip to content

Commit

Permalink
Add custom call to example
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Jan 18, 2024
1 parent 39e81cc commit 54580da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/examples/getting_started/basic_usage_shiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

app_ui = ui.page_fluid(
output_maplibregl("maplibre", height=600),
ui.div("Click on map to set a marker"),
)


Expand All @@ -18,7 +19,10 @@ def maplibre():
async def coords():
async with MapContext("maplibre") as m:
print(input.maplibre())
m.add_marker(Marker(lng_lat=input.maplibre()["coords"].values()))
lng_lat = tuple(input.maplibre()["coords"].values())
marker = Marker(lng_lat=lng_lat)
m.add_marker(marker)
m.add_call("flyTo", {"center": lng_lat})


app = App(app_ui, server)
Expand Down

0 comments on commit 54580da

Please sign in to comment.