parent
e5ebb03e13
commit
e96ffad55f
|
|
@ -31,3 +31,4 @@
|
||||||
0.24: Allow zooming by clicking the screen
|
0.24: Allow zooming by clicking the screen
|
||||||
0.25: Enable scaled image filtering on 2v19+ firmware
|
0.25: Enable scaled image filtering on 2v19+ firmware
|
||||||
0.26: Ensure that when redrawing, we always cancel any in-progress track draw
|
0.26: Ensure that when redrawing, we always cancel any in-progress track draw
|
||||||
|
0.27: Display message if no map is installed
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,12 @@ function showMap() {
|
||||||
}, btn: () => showMenu() });
|
}, btn: () => showMenu() });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (m.maps.length === 0) {
|
||||||
|
E.showPrompt(/*LANG*/'Please upload a map first.', {buttons : {/*LANG*/"Ok":true}}).then(v => load());
|
||||||
|
} else {
|
||||||
showMap();
|
showMap();
|
||||||
|
}
|
||||||
|
|
||||||
// Write settings on exit via button
|
// Write settings on exit via button
|
||||||
setWatch(() => writeSettings(), BTN, { repeat: true, edge: "rising" });
|
setWatch(() => writeSettings(), BTN, { repeat: true, edge: "rising" });
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "openstmap",
|
"id": "openstmap",
|
||||||
"name": "OpenStreetMap",
|
"name": "OpenStreetMap",
|
||||||
"shortName": "OpenStMap",
|
"shortName": "OpenStMap",
|
||||||
"version": "0.26",
|
"version": "0.27",
|
||||||
"description": "Loads map tiles from OpenStreetMap onto your Bangle.js and displays a map of where you are. Once installed this also adds map functionality to `GPS Recorder` and `Recorder` apps",
|
"description": "Loads map tiles from OpenStreetMap onto your Bangle.js and displays a map of where you are. Once installed this also adds map functionality to `GPS Recorder` and `Recorder` apps",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,11 @@ m.maps = require("Storage").list(/openstmap\.\d+\.json/).map(f=>{
|
||||||
m.maps.sort((a,b) => b.scale-a.scale); // sort by scale so highest resolution is drawn last
|
m.maps.sort((a,b) => b.scale-a.scale); // sort by scale so highest resolution is drawn last
|
||||||
// we base our start position on the middle of the first map
|
// we base our start position on the middle of the first map
|
||||||
m.map = m.maps[0];
|
m.map = m.maps[0];
|
||||||
|
if (m.map) {
|
||||||
m.scale = m.map.scale; // current scale (based on first map)
|
m.scale = m.map.scale; // current scale (based on first map)
|
||||||
m.lat = m.map.lat; // position of middle of screen
|
m.lat = m.map.lat; // position of middle of screen
|
||||||
m.lon = m.map.lon; // position of middle of screen
|
m.lon = m.map.lon; // position of middle of screen
|
||||||
|
}
|
||||||
|
|
||||||
// return number of tiles drawn
|
// return number of tiles drawn
|
||||||
exports.draw = function() {
|
exports.draw = function() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue