diff --git a/static/admin.html b/static/admin.html index f303f1f..550a40c 100644 --- a/static/admin.html +++ b/static/admin.html @@ -83,7 +83,7 @@ socket = io({rejectUnauthorized: false, auth: {type:"Admin"}}); - setup_socket_common(-1); + setup_socket_common(); ////////////////////////////////////////////////////////////////////////////// // INTERACTION diff --git a/static/tracking/conscrit.html b/static/tracking/conscrit.html index a87c991..64d8127 100644 --- a/static/tracking/conscrit.html +++ b/static/tracking/conscrit.html @@ -45,7 +45,7 @@ id = "%ID"; // %ID will be replaced by the real id. socket = io({rejectUnauthorized: false, auth: {id: id, type:"conscrit"}}); - setup_socket_common(id); + setup_socket_common(); ////////////////////////////////////////////////////////////////////////////// // SETTINGS -- CODE diff --git a/static/tracking/vieux.html b/static/tracking/vieux.html index 239ad16..560e487 100644 --- a/static/tracking/vieux.html +++ b/static/tracking/vieux.html @@ -65,7 +65,7 @@ id = "%ID"; // %ID will be replaced by the real id. socket = io({rejectUnauthorized: false, auth: {id: id, type:"vieux"}}); - setup_socket_common(id); + setup_socket_common(); ////////////////////////////////////////////////////////////////////////////// // SETTINGS -- State diff --git a/static/utils.js b/static/utils.js index 1cfbc15..ed9f11a 100644 --- a/static/utils.js +++ b/static/utils.js @@ -72,13 +72,19 @@ function setup_socket_common(){ socket.on("moving", function(data){ console.log("moving", data); if(!(data.id in markers)){ - markers[data.id] = L.marker(data.position, {"icon": icons[data.color]}).addTo(map); - if(data.id == id) - markers[data.id].setZIndexOffset(10000); + if(data.id == id){ + markers[data.id] = L.marker(data.position, {"icon": self_icons[data.color]}).addTo(map); + markers[data.id].setZIndexOffset(10000); + } + else + markers[data.id] = L.marker(data.position, {"icon": icons[data.color]}).addTo(map); markers[data.id].bindPopup(data.id); } else{ markers[data.id].setLatLng(data.position); - markers[data.id].setIcon(icons[data.color]); + if(data.id == id) + markers[data.id].setIcon(self_icons[data.color]); + else + markers[data.id].setIcon(icons[data.color]); } });