From 9c57978092e3603973cf92549e7495f672c7ec9d Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Fri, 17 Jul 2015 15:52:13 +0100 Subject: Define PositionError object as navigator.geoLocation doesn't define it --- www/js/locate.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/js/locate.js b/www/js/locate.js index 9d631f6..97beece 100644 --- a/www/js/locate.js +++ b/www/js/locate.js @@ -1,4 +1,12 @@ (function(FMS, Backbone, _) { + // The Geolocation docs refer to PositionError but it's not made clear + // where it's actually defined, if anywhere. + // So let's define it ourselves if it doesn't already exist. + var PositionError = window.PositionError || {}; + PositionError.PERMISSION_DENIED = PositionError.PERMISSION_DENIED || 1; + PositionError.POSITION_UNAVAILABLE = PositionError.POSITION_UNAVAILABLE || 2; + PositionError.TIMEOUT = PositionError.TIMEOUT || 3; + _.extend( FMS, { Locate: function() { return { locating: 0, -- cgit v1.2.3