diff options
author | Struan Donald <struan@exo.org.uk> | 2013-03-21 17:45:06 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-03-21 17:45:06 +0000 |
commit | f20e72af2fb4800cfb405eb7ec660bd110abb42d (patch) | |
tree | 8ed04bfaf656b1360a71f82cbbd938b13d772a4c | |
parent | b1db44e8d7af1efaac3fce0d08ce2f15443adcf6 (diff) |
if we have shown the map we alway want to listen for position updates
-rw-r--r-- | www/js/views/around.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js index 983a2ad..01e99ec 100644 --- a/www/js/views/around.js +++ b/www/js/views/around.js @@ -16,11 +16,9 @@ if ( FMS.currentLocation ) { var info = { coordinates: FMS.currentLocation }; FMS.currentLocation = null; - this.listenTo(FMS.locator, 'gps_current_position', this.positionUpdate); this.showMap(info); } else if ( this.model && this.model.get('lat') ) { var modelInfo = { coordinates: { latitude: this.model.get('lat'), longitude: this.model.get('lon') } }; - this.listenTo(FMS.locator, 'gps_current_position', this.positionUpdate); this.showMap(modelInfo); } else { this.locate(); @@ -32,7 +30,6 @@ this.listenTo(FMS.locator, 'gps_located', this.showMap); this.listenTo(FMS.locator, 'gps_failed', this.noMap ); this.listenTo(FMS.locator, 'gps_locating', this.locationUpdate); - this.listenTo(FMS.locator, 'gps_current_position', this.positionUpdate); FMS.locator.geolocate(100); this.startLocateProgress(); @@ -71,6 +68,9 @@ this.stopListening(FMS.locator, 'gps_locating'); this.stopListening(FMS.locator, 'gps_located'); this.stopListening(FMS.locator, 'gps_failed'); + + this.listenTo(FMS.locator, 'gps_current_position', this.positionUpdate); + this.locateCount = 21; $('#ajaxOverlay').hide(); $('#locating').hide(); |