0.02: Change color from red->yellow to ease readability (fix #710)

master
Gordon Williams 2021-04-14 13:58:09 +01:00
parent ae25b098bf
commit 1c2e901a8d
3 changed files with 10 additions and 9 deletions

View File

@ -744,7 +744,7 @@
{ "id": "route", { "id": "route",
"name": "Route Viewer", "name": "Route Viewer",
"icon": "app.png", "icon": "app.png",
"version":"0.01", "version":"0.02",
"description": "Upload a KML file of a route, and have your watch display a map with how far around it you are", "description": "Upload a KML file of a route, and have your watch display a map with how far around it you are",
"tags": "", "tags": "",
"custom": "custom.html", "custom": "custom.html",

View File

@ -1 +1,2 @@
0.01: New App! 0.01: New App!
0.02: Change color from red->yellow to ease readability (fix #710)

View File

@ -143,7 +143,7 @@ var currentDist = 0;
function drawMap() { function drawMap() {
g.clearRect(0,0,239,120); g.clearRect(0,0,239,120);
g.setFontAlign(0,0); g.setFontAlign(0,0);
g.setColor(1,0,0); g.setColor(1,1,0);
g.setFontVector(40); g.setFontVector(40);
g.drawString((currentDist===undefined)?"?":(Math.round(currentDist)+"m"), 160, 30); g.drawString((currentDist===undefined)?"?":(Math.round(currentDist)+"m"), 160, 30);
g.setColor(1,1,1); g.setColor(1,1,1);
@ -151,7 +151,7 @@ function drawMap() {
g.drawString(Math.round(totalDistance)+"m", 160, 70); g.drawString(Math.round(totalDistance)+"m", 160, 70);
g.drawString((nextPtIdx/2)+"/"+coordDistance.length, 50, 20); g.drawString((nextPtIdx/2)+"/"+coordDistance.length, 50, 20);
if (!fix.fix) { if (!fix.fix) {
g.setColor(1,0,0); g.setColor(1,1,0);
g.drawString("No GPS", 50, 50); g.drawString("No GPS", 50, 50);
g.setFont("6x8",1); g.setFont("6x8",1);
g.drawString(fix.satellites+" Sats", 50, 70); g.drawString(fix.satellites+" Sats", 50, 70);
@ -161,17 +161,17 @@ function drawMap() {
g.setColor(0,0,0); g.setColor(0,0,0);
g.drawCircle(lastFix.s.x,lastFix.s.y,10); g.drawCircle(lastFix.s.x,lastFix.s.y,10);
} }
for (var i=0;i<gcoords.length;i+=2) { var c1 = g.toColor(1,1,0);
g.setColor((i<=nextPtIdx) ? 63488 : 46486); // red/grey var c2 = g.toColor(0.7,0.7,0.7);
g.fillRect(gcoords[i]-2,gcoords[i+1]-2,gcoords[i]+2,gcoords[i+1]+2); for (var i=0;i<gcoords.length;i+=2)
} g.setColor((i<=nextPtIdx) ? c1 : c2).fillRect(gcoords[i]-2,gcoords[i+1]-2,gcoords[i]+2,gcoords[i+1]+2);
g.setColor(1,0,0); // first part of path g.setColor(1,1,0); // first part of path
g.drawPoly(new Uint8Array(gcoords.buffer, 0, nextPtIdx+2)); g.drawPoly(new Uint8Array(gcoords.buffer, 0, nextPtIdx+2));
g.setColor(1,1,1); // remaining part of path g.setColor(1,1,1); // remaining part of path
g.drawPoly(new Uint8Array(gcoords.buffer, nextPtIdx)); g.drawPoly(new Uint8Array(gcoords.buffer, nextPtIdx));
if (fix && fix.fix) { if (fix && fix.fix) {
g.setColor(1,0,0); g.setColor(1,1,0);
g.drawCircle(fix.s.x,fix.s.y,10); g.drawCircle(fix.s.x,fix.s.y,10);
} }
lastFix = fix; lastFix = fix;