|
from fasthtml.common import * |
|
|
|
app = FastHTML() |
|
rt = app.route |
|
|
|
style=""" |
|
#map { height: 180px; } |
|
""" |
|
|
|
js = """ |
|
var map = L.map('mapid').setView([51.505, -0.09], 13); |
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { |
|
maxZoom: 19, |
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' |
|
}).addTo(map); |
|
""" |
|
|
|
@rt('/') |
|
def get(): |
|
return Titled("MinorityMap", |
|
Link(rel="stylesheet", href="https://unpkg.com/[email protected]/dist/leaflet.css"), |
|
Style(style), |
|
Script(src="https://unpkg.com/[email protected]/dist/leaflet.js"), Div(id='mapid'), |
|
Script(js) |
|
) |
|
|
|
serve() |
|
|