This commit is contained in:
parent
a25f720fad
commit
66de945087
1 changed files with 3 additions and 4 deletions
|
@ -7,12 +7,13 @@
|
||||||
crossorigin=""></script>
|
crossorigin=""></script>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map { height: 100%; }
|
#map { height: 80%; }
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
|
Last Update: <span id="update"></span>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var map = L.map('map').setView([51.505, -0.09], 18);
|
var map = L.map('map').setView([51.505, -0.09], 18);
|
||||||
|
@ -22,8 +23,6 @@
|
||||||
|
|
||||||
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)
|
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')
|
||||||
|
@ -32,7 +31,7 @@
|
||||||
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.setLatLng([data["lat"], data["lon"]])
|
||||||
marker.bindPopup(data["tst"]).openPopup();
|
document.getElementById("update").innerHTML = data["tst"]
|
||||||
circle.setRadius(data["acc"])
|
circle.setRadius(data["acc"])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue