This commit is contained in:
parent
ebc27882a9
commit
17e873a22f
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,9 @@
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
circle = L.circle([50.5, 30.5], {radius: 200}).addTo(map);
|
circle = L.circle([50.5, 30.5], {radius: 200}).addTo(map);
|
||||||
|
marker = L.marker([51.5, -0.09]).addTo(map)
|
||||||
|
.bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
|
||||||
|
.openPopup();
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
fetch('/json')
|
fetch('/json')
|
||||||
|
@ -28,6 +31,8 @@
|
||||||
.then(data => {
|
.then(data => {
|
||||||
map.setView([data["lat"], data["lon"]], 18);
|
map.setView([data["lat"], data["lon"]], 18);
|
||||||
circle.setLatLng([data["lat"], data["lon"]])
|
circle.setLatLng([data["lat"], data["lon"]])
|
||||||
|
marker.setLatLng([data["lat"], data["lon"]])
|
||||||
|
marker.bindPopup(data["tst"])
|
||||||
circle.setRadius(data["acc"])
|
circle.setRadius(data["acc"])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue