This commit is contained in:
parent
c825ccbb0e
commit
6de086824b
1 changed files with 3 additions and 5 deletions
|
@ -15,7 +15,7 @@
|
||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
Last Update: <span id="update"></span>
|
Last Update: <span id="update"></span>
|
||||||
|
|
||||||
<a href="/activate">Es gibt einen Notfall, zeige mir den standort an, eine sms mit einer benachrichtung wird gesendet</a>
|
<a href="/activate">Es gibt einen Notfall, zeige mir den Standort, eine SMS wird verschickt</a>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var map = L.map('map').setView([52.0, 13.0], 1);
|
var map = L.map('map').setView([52.0, 13.0], 1);
|
||||||
|
@ -27,11 +27,9 @@ Last Update: <span id="update"></span>
|
||||||
marker = L.marker([52.0, 13.0]).addTo(map)
|
marker = L.marker([52.0, 13.0]).addTo(map)
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
fetch('/json')
|
|
||||||
.then(response => {
|
|
||||||
response.json()
|
|
||||||
setTimeout("update()", 5000)
|
setTimeout("update()", 5000)
|
||||||
})
|
fetch('/json')
|
||||||
|
.then(response => response.json())
|
||||||
.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"]])
|
||||||
|
|
Loading…
Reference in a new issue