File size: 618 Bytes
46cb2c1
03605b7
6c1b1ab
 
03605b7
11f3d81
 
 
 
 
 
 
 
 
 
 
 
6c1b1ab
 
11f3d81
 
 
 
70fd8f1
11f3d81
329c810
eb922b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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: '&copy; <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()