git ssb

0+

Dominic / %oZNumvaRdlZDV/jsRcA…



Commit cfc9bab4fc428e2e8861ef1b092b3170e95c8d4a

e.coords.lat...

Dominic Tarr committed on 7/8/2017, 1:45:49 AM
Parent: dec26f6ec81d00aedd3d88a9967ada91e9749814

Files changed

index.jschanged
index.jsView
@@ -23,15 +23,18 @@
2323 //keep just one minute's worth of locations.
2424 if(e.timestamp < Date.now() - 60e3) // one minute
2525 positions.shift()
2626
27 + var lat = e.coords.latitude, log = e.coords.longitude
2728 var movement = positions.map(function (_e) {
28- _e = _e.coords
29 + var _lat = _e.coords.latitude, _log = _e.coords.longitude
2930 return {
30- distance: GreatCircle.distance(_e.latitude, _e.longitude, e.latitude, e.longitude, 'NM'),
31- heading: GreatCircle.bearing(_e.latitude, _e.longitude, e.latitude, e.longitude)
31 + distance: GreatCircle.distance(_lat, _long, lat, long, 'NM'),
32 + heading: GreatCircle.bearing(_lat, _long, lat, long)
3233 }
3334 })
3435
3536 pre.textContent = JSON.stringify({current: flatten(e), movement: movement}, null, 2)
3637 })
3738
39 +
40 +

Built with git-ssb-web