Skip to content

Commit

Permalink
Add shiny express example
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Dec 16, 2024
1 parent 81928d7 commit 42c1a4f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/examples/getting_started/shiny_express.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import json

from shiny.express import input, render, ui

from maplibre import Map, MapOptions, render_maplibregl

ui.h1("My awesome MapLibre map")


@render_maplibregl
def mapgl():
return Map(MapOptions(zoom=3, pitch=40))


ui.div("Click on map to show coords.")


@render.code
def coords():
return str(input.mapgl_clicked())


ui.div("Move map to change view state.")


@render.code
def views_tate():
return json.dumps(input.mapgl_view_state(), indent=2)

0 comments on commit 42c1a4f

Please sign in to comment.