File size: 721 Bytes
46cb2c1 03605b7 6c1b1ab 03605b7 11f3d81 ac5a5f0 11f3d81 3a5876b ac5a5f0 3a5876b ac5a5f0 11f3d81 6c1b1ab 11f3d81 3a5876b 82da301 1b463e4 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 29 30 31 32 33 34 35 |
from fasthtml.common import *
app = FastHTML()
rt = app.route
style="""
#mapid { height: 480px; }
"""
js = """
function load()
{
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);
//alert('loading...');
}
setTimeout(load, 1000);
"""
@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"),
#Body(onload='load()'),
Div(id='mapid'),
Script(js)
)
serve()
|