diff options
Diffstat (limited to 'content/static/main.js')
| -rw-r--r-- | content/static/main.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/content/static/main.js b/content/static/main.js index bd91690..216cbea 100644 --- a/content/static/main.js +++ b/content/static/main.js | |||
| @@ -132,12 +132,14 @@ function lib_add_location_logs_to_map(map, locations) { | |||
| 132 | for (const location of locations) { | 132 | for (const location of locations) { |
| 133 | const len = 0.0002; | 133 | const len = 0.0002; |
| 134 | const lat = Math.sin((location.heading + 90) * 2 * Math.PI / 360) * len; | 134 | const lat = Math.sin((location.heading + 90) * 2 * Math.PI / 360) * len; |
| 135 | const lon = Math.cos((location.heading + 90) * 2 * Math.PI / 360) * len; | 135 | const lon = Math.cos((location.heading - 90) * 2 * Math.PI / 360) * len; |
| 136 | const line_coords = [ | 136 | const line_coords = [ |
| 137 | [location.latitude, location.longitude], | 137 | [location.latitude, location.longitude], |
| 138 | [location.latitude + lat, location.longitude + lon], | 138 | [location.latitude + lat, location.longitude + lon], |
| 139 | ]; | 139 | ]; |
| 140 | L.circle([location.latitude, location.longitude], { radius: location.accuracy }).addTo(map); | 140 | L.circle([location.latitude, location.longitude], { radius: location.accuracy }) |
| 141 | .bindPopup(`${location.heading}`) | ||
| 142 | .addTo(map); | ||
| 141 | L.polyline(line_coords, { color: 'blue' }).addTo(map) | 143 | L.polyline(line_coords, { color: 'blue' }).addTo(map) |
| 142 | } | 144 | } |
| 143 | } | 145 | } |
