diff options
author | Struan Donald <struan@exo.org.uk> | 2013-03-20 14:23:31 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-03-20 14:23:31 +0000 |
commit | b610df47f42d707bfd6fb50a6fda4bb64514ec32 (patch) | |
tree | f7ce2e34ef5fe485d16e524782ecea8425fac7e2 /www/js/locate.js | |
parent | 34947cee57d1ef66daad384f5e5b21f0baa1f20a (diff) |
track when we are updating position and stop updating when we leave the screen
Diffstat (limited to 'www/js/locate.js')
-rw-r--r-- | www/js/locate.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/www/js/locate.js b/www/js/locate.js index 7d4c713..cc92821 100644 --- a/www/js/locate.js +++ b/www/js/locate.js @@ -2,6 +2,7 @@ _.extend( FMS, { Locate: function() { return { locating: 0, + updating: 0, lookup: function(q) { var that = this; @@ -72,6 +73,7 @@ updatePosition: function() { console.log('updatePosition'); + this.updating = 1; var that = this; this.update_watch_id = navigator.geolocation.watchPosition( function(location) { @@ -85,6 +87,7 @@ }, stopUpdating: function() { + this.updating = 0; if ( this.update_watch_id ) { navigator.geolocation.clearupdate_watch( this.watch_id ); delete this.update_watch_id; |