diff --git a/hosts/containers/sdrweb/adsb.html b/hosts/containers/sdrweb/adsb.html index 6c765473..2d31fcda 100644 --- a/hosts/containers/sdrweb/adsb.html +++ b/hosts/containers/sdrweb/adsb.html @@ -68,8 +68,8 @@ } else { selhtml = ''; } - he = ''; - var icon = L.divIcon({html: he, className: 'plane-icon'}); + he = ''; + var icon = L.divIcon({html: he, className: 'plane-icon', iconSize: [b*64,b*64], iconAnchor: [b*32,b*32]}); return icon; } @@ -126,9 +126,11 @@ if (Planes[plane.hex]) { var myplane = Planes[plane.hex]; marker = myplane.marker; - if (plane.lat && plane.lon) - marker.setLatLng([plane.lat,plane.lon]); marker.setIcon(getIconForPlane(plane)); + if (plane.lat && plane.lon) { + marker.setLatLng([plane.lat,plane.lon]); + myplane.trail.addLatLng([plane.lat,plane.lon]); + } myplane.altitude = plane.altitude; myplane.speed = plane.speed; myplane.lat = plane.lat; @@ -139,10 +141,18 @@ refreshSelectedInfo(); } else if (plane.lat && plane.lon) { var icon = getIconForPlane(plane); - var marker = L.marker([plane.lat, plane.lon], {icon: icon}).addTo(Map); + var marker = L.marker( + [plane.lat, plane.lon], + {icon: icon} + ).addTo(Map); + var trail = L.polyline( + [[plane.lat, plane.lon]], + { color: "#0000FF", weight: 5, opacity: 0.4 } + ).addTo(Map); var hex = plane.hex; marker.on('click',selectPlaneCallback(plane.hex)); plane.marker = marker; + plane.trail = trail; marker.planehex = plane.hex; Planes[plane.hex] = plane; } @@ -153,6 +163,7 @@ for (var p in Planes) { if (!stillhere[p]) { Map.removeLayer(Planes[p].marker); + /* Map.removeLayer(Planes[p].trail); */ delete Planes[p]; } } @@ -160,9 +171,7 @@ refreshGeneralInfo(); }).always(function() { - setTimeout(function() { - window.requestAnimationFrame(fetchData); - }, 500); + setTimeout(fetchData, 500); }); } diff --git a/hosts/containers/sdrweb/airplane.svg b/hosts/containers/sdrweb/airplane.svg index 30b7e196..98d1aef7 100644 --- a/hosts/containers/sdrweb/airplane.svg +++ b/hosts/containers/sdrweb/airplane.svg @@ -1 +1,2 @@ -Created by egi enggryawanfrom the Noun Project \ No newline at end of file + +