waypoints: draw big distance and waypoint name

master
Pavel Machek 2024-11-22 20:56:59 +01:00
parent aa7c87dd2e
commit a5874933fe
1 changed files with 11 additions and 6 deletions

View File

@ -220,17 +220,17 @@ let arrow = {
let distance = this.distanceToWaypoint(currentPos); let distance = this.distanceToWaypoint(currentPos);
let northHeading = this.compassHeading(currentHeading); let northHeading = this.compassHeading(currentHeading);
// Format distance
let distStr = fmt.fmtDist(distance/1000);
northHeading = 0; northHeading = 0;
// Draw compass arrow for north // Draw compass arrow for north
this.drawArrow(northHeading, "N", 1); this.drawArrow(northHeading, "N", 1);
let s = fmt.fmtDist(distance/1000);
// Draw arrow towards waypoint // Draw arrow towards waypoint
if (1) if (1) {
this.drawArrow(waypointBearing, `${distStr}`, 3); this.drawArrow(waypointBearing, s, 3);
}
if (1) { if (1) {
let s = fmt.fmtSpeed(fix.speed); let s = fmt.fmtSpeed(fix.speed);
this.drawArrow(currentHeading, s, 1); this.drawArrow(currentHeading, s, 1);
@ -249,6 +249,11 @@ let arrow = {
this.drawArrow(s.azimuth, "Moon", 1); this.drawArrow(s.azimuth, "Moon", 1);
} }
} }
g.setFont("Vector", 30).setFontAlign(-1, 1)
.drawString(s, 0, 176)
.setFontAlign(1, 1)
.drawString(this.name, 176, 176);
}, },
drawArrow: function(angle, label, width) { drawArrow: function(angle, label, width) {
@ -258,7 +263,7 @@ let arrow = {
// Arrow parameters // Arrow parameters
let centerX = 88; let centerX = 88;
let centerY = 88; let centerY = 88;
let length = 60; // Arrow length let length = 55; // Arrow length
g.drawCircle(centerX, centerY, length); g.drawCircle(centerX, centerY, length);