-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefan Kuethe
committed
Dec 16, 2024
1 parent
81928d7
commit 42c1a4f
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |