shiny-leafmap / app.py
giswqs's picture
Update app.py
58c100e verified
raw
history blame contribute delete
576 Bytes
import leafmap
from shiny import reactive
from shiny.express import input, ui
from shinywidgets import output_widget, render_widget
from faicons import icon_svg
import ipyleaflet
city_centers = {
"London": (51.5074, 0.1278),
"Paris": (48.8566, 2.3522),
"New York": (40.7128, -74.0060)
}
ui.input_select("center", "Center", choices=list(city_centers.keys()))
@render_widget
def map():
m = ipyleaflet.Map(zoom=4, scroll_wheel_zoom=True)
m.layout.height = "800px"
return m
@reactive.effect
def _():
map.widget.center = city_centers[input.center()]