#79 Added timestamp to in-browser location setting
parent
29657d95ad
commit
3521c10a49
|
@ -15,6 +15,7 @@ $(function(){
|
||||||
// Success callback
|
// Success callback
|
||||||
function(pos){
|
function(pos){
|
||||||
var newloc = {
|
var newloc = {
|
||||||
|
ts: Date.now(),
|
||||||
tok: token,
|
tok: token,
|
||||||
usr: userid,
|
usr: userid,
|
||||||
lat: pos.coords.latitude,
|
lat: pos.coords.latitude,
|
||||||
|
@ -54,6 +55,7 @@ $(function(){
|
||||||
// Success callback
|
// Success callback
|
||||||
function(pos) {
|
function(pos) {
|
||||||
newloc = {
|
newloc = {
|
||||||
|
ts: Date.now(),
|
||||||
tok: token,
|
tok: token,
|
||||||
usr: userid,
|
usr: userid,
|
||||||
lat: pos.coords.latitude,
|
lat: pos.coords.latitude,
|
||||||
|
@ -96,13 +98,14 @@ $(function(){
|
||||||
else {
|
else {
|
||||||
// Stop tracking
|
// Stop tracking
|
||||||
if (wpid) {
|
if (wpid) {
|
||||||
$('#track-loc').html('<i class="fa fa-crosshairs"></i> Track');
|
$('#track-loc').html('<i class="fa fa-crosshairs"></i>Track');
|
||||||
navigator.geolocation.clearWatch(wpid);
|
navigator.geolocation.clearWatch(wpid);
|
||||||
wpid = undefined;
|
wpid = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear location
|
// Clear location
|
||||||
newloc = {
|
newloc = {
|
||||||
|
ts: Date.now(),
|
||||||
tok: token,
|
tok: token,
|
||||||
usr: userid,
|
usr: userid,
|
||||||
lat:0, lon:0, spd:0
|
lat:0, lon:0, spd:0
|
||||||
|
|
Loading…
Reference in New Issue