hackseoul / main.py
debisoft's picture
added setTimeout
82da301
raw
history blame
695 Bytes
from fasthtml.common import *
app = FastHTML()
rt = app.route
style="""
#map { height: 180px; }
"""
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: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
}
setTimeout(load, 5000);
"""
@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()