From 7c29451694a3e14e8da6674570d50c483f3f2248 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 28 Aug 2023 22:37:05 -0400 Subject: [PATCH] Fixed APRS symbols orientation. --- htdocs/lib/MapMarkers.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/MapMarkers.js b/htdocs/lib/MapMarkers.js index 19e8109b..fa4882ca 100644 --- a/htdocs/lib/MapMarkers.js +++ b/htdocs/lib/MapMarkers.js @@ -396,6 +396,9 @@ FeatureMarker.prototype.getInfoHTML = function(name, receiverMarker = null) { function AprsMarker() {} +// These symbols are all facing east (mostly vehicles)! +AprsMarker.FACING_EAST = "(*<=>CFPUXYabefghjkpsuv["; + AprsMarker.prototype = new Marker(); AprsMarker.prototype.update = function(update) { @@ -439,12 +442,14 @@ AprsMarker.prototype.draw = function() { if (!this.course) { div.style.transform = null; - } else if (this.symbol && this.symbol.symbol === '^') { - // Airplanes point up (to the north) + } else if (this.symbol && !AprsMarker.FACING_EAST.includes(this.symbol.symbol)) { + // Airplanes and other symbols point up (to the north) div.style.transform = 'rotate(' + this.course + 'deg)'; } else if (this.course > 180) { + // Vehicles and vessels point right (to the east) div.style.transform = 'scalex(-1) rotate(' + (270 - this.course) + 'deg)' } else { + // Vehicles and vessels point right (to the east) div.style.transform = 'rotate(' + (this.course - 90) + 'deg)'; }