Stuff
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kekskurse 2022-01-16 12:46:43 +01:00
parent 8f6ed84ee0
commit 775e65ad68
Signed by: kekskurse
GPG key ID: 728ACCB59341E7E4
2 changed files with 5 additions and 0 deletions

View file

@ -44,6 +44,7 @@ func main() {
data["lat"] = lastData["lat"] data["lat"] = lastData["lat"]
data["lon"] = lastData["lon"] data["lon"] = lastData["lon"]
data["tst"] = lastData["tst"] data["tst"] = lastData["tst"]
data["acc"] = lastData["acc"]
r, err := json.Marshal(data) r, err := json.Marshal(data)
if err != nil { if err != nil {

View file

@ -20,11 +20,15 @@
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map); }).addTo(map);
circle = L.circle([50.5, 30.5], {radius: 200}).addTo(map);
function update() { function update() {
fetch('/json') fetch('/json')
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
map.setView([data["lat"], data["lon"]], 13); map.setView([data["lat"], data["lon"]], 13);
circle.setLatLng([data["lat"], data["lon"]])
circle.setRadius(data["acc"])
}); });
} }
update() update()