diff options
author | Dave Arter <davea@mysociety.org> | 2015-07-17 15:52:13 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2015-08-28 14:27:15 +0100 |
commit | 9c57978092e3603973cf92549e7495f672c7ec9d (patch) | |
tree | fc4d44bfbe311935dc72a51dd96f842e6259345c | |
parent | af7c5ce2233eb14a5ba57cc581948ffa9658ecc2 (diff) |
Define PositionError object as navigator.geoLocation doesn't define it
-rw-r--r-- | www/js/locate.js | 8 |
1 files changed, 8 insertions, 0 deletions
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, |