openstmap Update for drag event refactor

master
Gordon Williams 2021-06-24 11:37:30 +01:00
parent 532f1fe6a7
commit fec0aad0eb
3 changed files with 7 additions and 4 deletions

View File

@ -1464,7 +1464,7 @@
"name": "OpenStreetMap",
"shortName":"OpenStMap",
"icon": "app.png",
"version":"0.07",
"version":"0.08",
"description": "[BETA] Loads map tiles from OpenStreetMap onto your Bangle.js and displays a map of where you are",
"tags": "outdoors,gps,b2",
"custom": "custom.html",

View File

@ -5,3 +5,4 @@
0.05: Show currently active gpsrec GPS trace (fix #395)
0.06: Add support for scrolling, option for 3 bit maps
0.07: Move to 96px tiles - less files (64 -> 25) and speed up rendering
0.08: Update for drag event refactor

View File

@ -49,15 +49,17 @@ if (HASWIDGETS) {
redraw();
setWatch(function() {
function recenter() {
if (!fix.fix) return;
m.lat = fix.lat;
m.lon = fix.lon;
redraw();
}, BTN2, {repeat:true});
}
setWatch(recenter, global.BTN2?BTN2:BTN1, {repeat:true});
var hasScrolled = false;
E.on('touch',e=>{
Bangle.on('drag',e=>{
if (e.b) {
g.setClipRect(0,y1,g.getWidth()-1,y2);
g.scroll(e.dx,e.dy);