diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/locate.js | 9 | ||||
-rw-r--r-- | www/js/strings.js | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/www/js/locate.js b/www/js/locate.js index 834d4e3..dcc48fc 100644 --- a/www/js/locate.js +++ b/www/js/locate.js @@ -58,12 +58,17 @@ } } }, - function() { + function(err) { if ( that.watch_id === undefined ) { return; } that.locating = 0; navigator.geolocation.clearWatch( that.watch_id ); delete that.watch_id; - that.trigger('gps_failed', { msg: FMS.strings.geolocation_failed } ); + var errorMsg = FMS.strings.geolocation_failed; + + if ( err && err.code == PositionError.PERMISSION_DENIED ) { + errorMsg = FMS.strings.geolocation_denied; + } + that.trigger('gps_failed', { msg: errorMsg } ); }, { timeout: 20000, enableHighAccuracy: true } ); diff --git a/www/js/strings.js b/www/js/strings.js index eef7a4f..f1a1aa2 100644 --- a/www/js/strings.js +++ b/www/js/strings.js @@ -28,6 +28,7 @@ missing_location: 'Please enter a location', location_check_failed: 'Could not check your location', geolocation_failed: 'Could not determine your location', + geolocation_denied: 'Could not access location services. Please check permissions.', select_category: '-- Pick a categoy --', required: 'required', invalid_email: 'Invalid email', |