diff --git a/main.go b/main.go index c06d759..4181f81 100644 --- a/main.go +++ b/main.go @@ -44,6 +44,7 @@ func main() { data["lat"] = lastData["lat"] data["lon"] = lastData["lon"] data["tst"] = lastData["tst"] + data["acc"] = lastData["acc"] r, err := json.Marshal(data) if err != nil { diff --git a/notfall.tmpl b/notfall.tmpl index 246a151..4ee21a9 100644 --- a/notfall.tmpl +++ b/notfall.tmpl @@ -20,11 +20,15 @@ attribution: '© OpenStreetMap contributors' }).addTo(map); + circle = L.circle([50.5, 30.5], {radius: 200}).addTo(map); + function update() { fetch('/json') .then(response => response.json()) .then(data => { map.setView([data["lat"], data["lon"]], 13); + circle.setLatLng([data["lat"], data["lon"]]) + circle.setRadius(data["acc"]) }); } update()