aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/index.html4
-rw-r--r--www/js/mobile.js11
2 files changed, 12 insertions, 3 deletions
diff --git a/www/index.html b/www/index.html
index 302a1e9..dfa1775 100644
--- a/www/index.html
+++ b/www/index.html
@@ -54,13 +54,15 @@ p $meta_data;
<body id="container" class="frontpage fullwidthpage">
<div class="wrapper" id="front-page" data-role="page">
<div data-id="locate" id="index-header" data-role="header" data-position="fixed">
+ <a href="frontpage-form.html" class="ui-btn-left">Search</a>
<h1>Locate</h1>
</div>
<div class="table-cell">
<div class="container">
<div class="content" role="main">
<div class="tablewrapper" style="text-align: center; padding-top: 50%">
- Determining location
+ Determining location<br>
+ <span id="accuracy"></span>
</div>
</div>
</div>
diff --git a/www/js/mobile.js b/www/js/mobile.js
index bd9ac8f..b58f5da 100644
--- a/www/js/mobile.js
+++ b/www/js/mobile.js
@@ -142,6 +142,7 @@ 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 );
@@ -172,7 +173,7 @@ function getPosition() {
}
if ( !watch_id ) {
watch_count = 0;
- watch_id = navigator.geolocation.watchPosition(foundLocation, notFoundLocation, { timeout: 60000, enableHighAccuracy: true } );
+ watch_id = navigator.geolocation.watchPosition(foundLocation, notFoundLocation, { timeout: 7000, enableHighAccuracy: true } );
} else {
alert('currently locating');
}
@@ -209,7 +210,7 @@ function check_for_gps() {
}
if ( !watch_id ) {
watch_count = 0;
- watch_id = navigator.geolocation.watchPosition(have_gps, do_not_have_gps, { timeout: 60000, enableHighAccuracy: true } );
+ watch_id = navigator.geolocation.watchPosition(have_gps, do_not_have_gps, { timeout: 7000, enableHighAccuracy: true } );
} else {
alert('currently locating');
}
@@ -724,6 +725,12 @@ function decide_front_page() {
}
function locate_page_display() {
+ if ( watch_id ) {
+ $.mobile.loading( 'hide' );
+ navigator.geolocation.clearWatch(watch_id);
+ watch_id = null;
+ }
+
if ( location_error_str !== '' ) {
location_error( location_error_str );
location_error_str = '';