projects
/
lantea.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of linz:/srv/git/lantea
[lantea.git]
/
js
/
map.js
diff --git
a/js/map.js
b/js/map.js
index dcb40a3a17bc9f8c55c9e00ac2c1c4983bc12b00..d1f6b03c93cc7e4164f4cc671c7702fa9617d415 100644
(file)
--- a/
js/map.js
+++ b/
js/map.js
@@
-88,7
+88,7
@@
var gMapPrefsLoaded = false;
var gDragging = false;
var gDragTouchID, gPinchStartWidth;
var gDragging = false;
var gDragTouchID, gPinchStartWidth;
-var gGeoWatchID;
+var gGeoWatchID
, gGPSWakeLock
;
var gTrack = [];
var gLastTrackPoint, gLastDrawnPoint;
var gCenterPosition = true;
var gTrack = [];
var gLastTrackPoint, gLastDrawnPoint;
var gCenterPosition = true;
@@
-1132,6
+1132,9
@@
function startTracking() {
if (gGeolocation) {
gActionLabel.textContent = "Establishing Position";
gAction.style.display = "block";
if (gGeolocation) {
gActionLabel.textContent = "Establishing Position";
gAction.style.display = "block";
+ if (navigator.requestWakeLock) {
+ gGPSWakeLock = navigator.requestWakeLock("gps");
+ }
gGeoWatchID = gGeolocation.watchPosition(
function(position) {
if (gActionLabel.textContent) {
gGeoWatchID = gGeolocation.watchPosition(
function(position) {
if (gActionLabel.textContent) {
@@
-1187,6
+1190,10
@@
function endTracking() {
gActionLabel.textContent = "";
gAction.style.display = "none";
}
gActionLabel.textContent = "";
gAction.style.display = "none";
}
+ if (navigator.requestWakeLock && gGPSWakeLock) {
+ console.log("releasing WakeLock");
+ gGPSWakeLock.unlock();
+ }
if (gGeoWatchID) {
gGeolocation.clearWatch(gGeoWatchID);
}
if (gGeoWatchID) {
gGeolocation.clearWatch(gGeoWatchID);
}