-
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
Jun 23, 2024
1 parent
45fb4eb
commit 08b5a36
Showing
4 changed files
with
80 additions
and
4 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,36 @@ | ||
# Shiny Express App | ||
|
||
import json | ||
|
||
from maplibre import Map, MapOptions, render_maplibregl | ||
from maplibre.basemaps import Carto | ||
from maplibre.controls import NavigationControl | ||
from maplibre.ui import use_mapboxgl_draw | ||
|
||
# from shiny import reactive | ||
from shiny.express import input, render, ui | ||
|
||
m = Map( | ||
MapOptions( | ||
style=Carto.POSITRON, | ||
center=(-122.4, 37.74), | ||
zoom=12, | ||
hash=True, | ||
pitch=40, | ||
) | ||
) | ||
m.add_control(NavigationControl()) | ||
|
||
|
||
# Shiny Express | ||
use_mapboxgl_draw() | ||
|
||
|
||
@render_maplibregl | ||
def render_map(): | ||
return m | ||
|
||
|
||
if __name__ == "__main__": | ||
with open("docs/examples/mapbox_draw_plugin/app.html", "w") as f: | ||
f.write(m.to_html()) |
Oops, something went wrong.