update Di 28. Apr 11:31:01 CEST 2020

This commit is contained in:
Robert Richter 2020-04-28 11:31:01 +02:00
parent f064c37a80
commit f728d96f25
2 changed files with 16 additions and 6 deletions

View File

@ -216,6 +216,7 @@ var redIcon = new L.Icon({
var marker = L.marker(new L.LatLng(0, 0), {
icon: redIcon
}).addTo(map);
var geojson = L.geoJSON().addTo(map);
/* ########################### */
/* ######## SOCKET.IO ######## */
@ -396,12 +397,23 @@ socket.on('io.neuerEinsatz', function(data) {
};
$('#em_weitere').html(tmp);
};
// Karte setzen
// Karte setzen
map.removeLayer(marker);
marker = L.marker(new L.LatLng(data.wgs84_x, data.wgs84_y), {
icon: redIcon
}).addTo(map);
map.setView(new L.LatLng(data.wgs84_x, data.wgs84_y), 15);
map.removeLayer(geojson);
if (data.wgs84_x && data.wgs84_y) {
marker = L.marker(new L.LatLng(data.wgs84_x, data.wgs84_y), {
icon: redIcon
}).addTo(map);
map.setView(new L.LatLng(data.wgs84_x, data.wgs84_y), 15);
} else {
geojson = L.geoJSON(JSON.parse(data.wgs84_area));
geojson.addTo(map);
map.fitBounds(geojson.getBounds());
};
// Hilfsfrist setzen
start_counter(data.zeitstempel, data.ablaufzeit);
// Uhr ausblenden

View File

@ -7,8 +7,6 @@ block content
include includes/modal_info
.container-fluid
include includes/master_dashboard
//script.
var einsatzdaten_obj = !{JSON.stringify(einsatzdaten).replace(/<\//g, '<\\/')}
script(src='/socket.io/socket.io.js')
script(src='/js/leaflet.js')
script(src='/js/client_dbrd.js')