Stuff
continuous-integration/drone/push Build is passing Details

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["lon"] = lastData["lon"]
data["tst"] = lastData["tst"]
data["acc"] = lastData["acc"]
r, err := json.Marshal(data)
if err != nil {

View File

@ -20,11 +20,15 @@
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> 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()