#79 Added timestamp to in-browser location setting

master
Keith Irwin 2017-05-07 03:18:38 -04:00
parent 29657d95ad
commit 3521c10a49
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,7 @@ $(function(){
// Success callback
function(pos){
var newloc = {
ts: Date.now(),
tok: token,
usr: userid,
lat: pos.coords.latitude,
@ -54,6 +55,7 @@ $(function(){
// Success callback
function(pos) {
newloc = {
ts: Date.now(),
tok: token,
usr: userid,
lat: pos.coords.latitude,
@ -96,13 +98,14 @@ $(function(){
else {
// Stop tracking
if (wpid) {
$('#track-loc').html('<i class="fa fa-crosshairs"></i>&emsp;Track');
$('#track-loc').html('<i class="fa fa-crosshairs"></i>Track');
navigator.geolocation.clearWatch(wpid);
wpid = undefined;
}
// Clear location
newloc = {
ts: Date.now(),
tok: token,
usr: userid,
lat:0, lon:0, spd:0