diff options
author | Struan Donald <struan@exo.org.uk> | 2013-03-07 12:42:52 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-03-07 12:42:52 +0000 |
commit | 4a7649ce96d1427d4fe883593dcf524480fd108d (patch) | |
tree | 8955b531b1a833640da393e9726b93f9dba9e2a7 /www/js | |
parent | 08b980b7237ee3e8d8fad4975036d57051e25b5b (diff) |
display location accuracy while geolocating
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/views/around.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js index 25fa2c0..a8a7def 100644 --- a/www/js/views/around.js +++ b/www/js/views/around.js @@ -15,16 +15,23 @@ }, locate: function() { + $('#locating').show(); var that = this; var l = new Locate(); _.extend(l, Backbone.Events); l.on('located', this.showMap, this ); l.on('failed', this.noMap, this ); + l.on('locating', this.locationUpdate, this); - l.geolocate(); + l.geolocate(100); + }, + + locationUpdate: function( accuracy ) { + $('#accuracy').text(parseInt(myLocation.coords.accuracy, 10) + 'm'); }, showMap: function( info ) { + $('#locating').hide(); var coords = info.coordinates; fixmystreet.latitude = coords.latitude; fixmystreet.longitude = coords.longitude; @@ -41,6 +48,7 @@ }, noMap: function( details ) { + $('#locating').hide(); $('#ajaxOverlay').hide(); if ( details.msg ) { this.displayError( details.msg ); |