gipy openstmap: clear area before redraw
parent
a0119ba74c
commit
c873bf3dd3
|
|
@ -1502,6 +1502,7 @@ function start_gipy(path, maps, interests, heights) {
|
||||||
osm.lon = (minLong+maxLong)/2.0;
|
osm.lon = (minLong+maxLong)/2.0;
|
||||||
|
|
||||||
const drawOpenStmap = () => {
|
const drawOpenStmap = () => {
|
||||||
|
g.clearRect(Bangle.appRect);
|
||||||
osm.draw();
|
osm.draw();
|
||||||
|
|
||||||
// draw track
|
// draw track
|
||||||
|
|
@ -1509,7 +1510,11 @@ function start_gipy(path, maps, interests, heights) {
|
||||||
for(let i=0; i<path.len; i++) {
|
for(let i=0; i<path.len; i++) {
|
||||||
const point = path.point(i);
|
const point = path.point(i);
|
||||||
const mp = osm.latLonToXY(point.lat, point.lon);
|
const mp = osm.latLonToXY(point.lat, point.lon);
|
||||||
g.lineTo(mp.x,mp.y);
|
if (i == 0) {
|
||||||
|
g.moveTo(mp.x,mp.y);
|
||||||
|
} else {
|
||||||
|
g.lineTo(mp.x,mp.y);
|
||||||
|
}
|
||||||
g.fillCircle(mp.x,mp.y,2); // make the track more visible
|
g.fillCircle(mp.x,mp.y,2); // make the track more visible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1534,6 +1539,7 @@ function start_gipy(path, maps, interests, heights) {
|
||||||
Bangle.setUI({
|
Bangle.setUI({
|
||||||
mode: "custom",
|
mode: "custom",
|
||||||
btn: (n) => { // back handling
|
btn: (n) => { // back handling
|
||||||
|
g.clearRect(0, 0, g.getWidth(), g.getHeight());
|
||||||
E.showMenu(menu);
|
E.showMenu(menu);
|
||||||
},
|
},
|
||||||
drag: (ev) => { // zoom, move
|
drag: (ev) => { // zoom, move
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue