Skip to content

Commit

Permalink
mapbox draw plugin POC
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Jun 23, 2024
1 parent 45fb4eb commit 08b5a36
Showing 4 changed files with 80 additions and 4 deletions.
36 changes: 36 additions & 0 deletions docs/examples/mapbox_draw_plugin/app.py
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())
Loading

0 comments on commit 08b5a36

Please sign in to comment.