From 31f0fe16d8a1a120551f71c28d58255fc1e3cbe9 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 26 Feb 2012 02:04:30 +0100 Subject: [PATCH] wrap pushing to track store into a try/catch, make coords a plain object --- js/map.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/map.js b/js/map.js index d59d060..4185e0c 100644 --- a/js/map.js +++ b/js/map.js @@ -475,15 +475,21 @@ function startTracking() { return; }; getStoredTrack(); - if (navigator.geolocation) { + if (gGeolocation) { gGeoWatchID = gGeolocation.watchPosition( function(position) { // Coords spec: https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoPositionCoords var tPoint = {time: position.timestamp, - coords: position.coords, + coords: {latitude: position.coords.latitude, + longitude: position.coords.longitude, + altitude: position.coords.altitude, + accuracy: position.coords.accuracy, + altitudeAccuracy: position.coords.altitudeAccuracy, + heading: position.coords.heading, + speed: position.coords.speed}, beginSegment: !gLastTrackPoint}; gTrack.push(tPoint); - gTrackStore.push(tPoint); + try { gTrackStore.push(tPoint); } catch(e) {} drawTrackPoint(position.coords.latitude, position.coords.longitude); if (gCenterPosition) { var posCoord = gps2xy(position.coords.latitude, -- 2.43.0