aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/mobile.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-11-26 17:19:18 +0000
committerStruan Donald <struan@exo.org.uk>2012-11-26 17:19:18 +0000
commit553f2e6be71e7732038a6847b00104246f7f58d5 (patch)
tree0f2798501c386148b6700dbda5af91a011f206fc /www/js/mobile.js
parenta98e1e414a2b857a750f654838578a742b77e8a3 (diff)
we do not need the watch count as the timeout handles it
Diffstat (limited to 'www/js/mobile.js')
-rw-r--r--www/js/mobile.js8
1 files changed, 0 insertions, 8 deletions
diff --git a/www/js/mobile.js b/www/js/mobile.js
index 15a813b..4c3193d 100644
--- a/www/js/mobile.js
+++ b/www/js/mobile.js
@@ -136,21 +136,15 @@ function locate() {
}
var watch_id = null;
-var watch_count = 0;
function foundLocation(myLocation) {
var lat = myLocation.coords.latitude;
var long = myLocation.coords.longitude;
- watch_count++;
$('#accuracy').text('have position within ' + parseInt(myLocation.coords.accuracy) + ' meters');
if ( myLocation.coords.accuracy < 100 ) {
navigator.geolocation.clearWatch(watch_id);
show_around( lat, long );
watch_id = null;
- } else if ( watch_count > 10 ) {
- navigator.geolocation.clearWatch(watch_id);
- watch_id = null;
- $.mobile.changePage( 'frontpage-form.html' );
}
}
@@ -173,7 +167,6 @@ function getPosition() {
return;
}
if ( !watch_id ) {
- watch_count = 0;
watch_id = navigator.geolocation.watchPosition(foundLocation, notFoundLocation, { timeout: 7000, enableHighAccuracy: true } );
} else {
alert('currently locating');
@@ -210,7 +203,6 @@ function check_for_gps() {
return;
}
if ( !watch_id ) {
- watch_count = 0;
watch_id = navigator.geolocation.watchPosition(have_gps, do_not_have_gps, { timeout: 7000, enableHighAccuracy: true } );
} else {
alert('currently locating');