mirror of https://github.com/espruino/BangleApps
Merge pull request #2218 from halemmerich/gpstrek
Gpstrek - Fix waypoint menu always selecting the last waypointpull/2220/head
commit
5374b1af30
|
@ -4,3 +4,5 @@
|
|||
Use custom UI with swipes instead of leftright
|
||||
0.04: Fix compass heading
|
||||
0.05: Added adjustment for Bangle.js magnetometer heading fix
|
||||
0.06: Fix waypoint menu always selecting last waypoint
|
||||
Fix widget adding listeners more than once
|
||||
|
|
|
@ -477,10 +477,9 @@ function showRouteSelector (){
|
|||
}
|
||||
};
|
||||
|
||||
for (let c of STORAGE.list((/\.trf$/))){
|
||||
let file = c;
|
||||
menu[file] = ()=>{handleLoading(file);};
|
||||
}
|
||||
STORAGE.list(/\.trf$/).forEach((file)=>{
|
||||
menu[file] = ()=>{handleLoading(file);};
|
||||
});
|
||||
|
||||
E.showMenu(menu);
|
||||
}
|
||||
|
@ -543,14 +542,14 @@ function showWaypointSelector(){
|
|||
}
|
||||
};
|
||||
|
||||
for (let c in waypoints){
|
||||
waypoints.forEach((wp,c)=>{
|
||||
menu[waypoints[c].name] = function (){
|
||||
state.waypoint = waypoints[c];
|
||||
state.waypointIndex = c;
|
||||
state.route = null;
|
||||
removeMenu();
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
E.showMenu(menu);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "gpstrek",
|
||||
"name": "GPS Trekking",
|
||||
"version": "0.05",
|
||||
"version": "0.06",
|
||||
"description": "Helper for tracking the status/progress during hiking. Do NOT depend on this for navigation!",
|
||||
"icon": "icon.png",
|
||||
"screenshots": [{"url":"screen1.png"},{"url":"screen2.png"},{"url":"screen3.png"},{"url":"screen4.png"}],
|
||||
|
|
|
@ -74,6 +74,12 @@ function onAcc (e){
|
|||
}
|
||||
|
||||
function start(bg){
|
||||
Bangle.removeListener('GPS', onGPS);
|
||||
Bangle.removeListener("HRM", onPulse);
|
||||
Bangle.removeListener("mag", onMag);
|
||||
Bangle.removeListener("step", onStep);
|
||||
Bangle.removeListener("pressure", onPressure);
|
||||
Bangle.removeListener('accel', onAcc);
|
||||
Bangle.on('GPS', onGPS);
|
||||
Bangle.on("HRM", onPulse);
|
||||
Bangle.on("mag", onMag);
|
||||
|
|
Loading…
Reference in New Issue