From f89186cf09abd637878c8c2ceb4cbe6135773b86 Mon Sep 17 00:00:00 2001 From: Gwen Hope <6558681+gwennie-chan@users.noreply.github.com> Date: Thu, 19 Jun 2025 13:57:08 -0500 Subject: [PATCH] Fixed the two issues I reported (#39) * Update LeafletMap.vue expand cardinal conversion, prioritize camera:direction first * Update DFMapPopup.vue expand cardinal direction from 8 to 16 * Update DFMapPopup.vue prioritize direction * Update DFMapPopup.vue test fix * Update LeafletMap.vue * Update LeafletMap.vue adding the halves back * revert DFMapPopup (removed direction field) --------- Co-authored-by: Will Freeman --- webapp/src/components/LeafletMap.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/webapp/src/components/LeafletMap.vue b/webapp/src/components/LeafletMap.vue index 261974a..6d0759b 100644 --- a/webapp/src/components/LeafletMap.vue +++ b/webapp/src/components/LeafletMap.vue @@ -62,7 +62,7 @@ let currentLocationLayer: FeatureGroup; // Marker Creation Utilities function createSVGMarkers(alpr: ALPR): string { - const orientationValues = (alpr.tags.direction || alpr.tags['camera:direction'] || '') + const orientationValues = (alpr.tags['camera:direction'] || alpr.tags.direction || '') .split(';') .map(val => /^\d+$/.test(val) ? parseInt(val) : cardinalToDegrees(val.trim())); @@ -89,13 +89,21 @@ function createSVGMarkers(alpr: ALPR): string { function cardinalToDegrees(cardinal: string): number { const cardinalMap: Record = { N: 0, + NNE: 22.5, NE: 45, + ENE: 67.5, E: 90, - SE: 135, + ESE: 112.5, + SE: 135.5, + SSE: 157.5, S: 180, + SSW: 202.5, SW: 225, + WSW: 247.5, W: 270, + WNW: 292.5, NW: 315, + NNW: 337.5 }; return cardinalMap[cardinal] ?? cardinal; }