From ae41cca700d16ac6e5e8c7a23dc6c204c807bb3c Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Fri, 28 Mar 2025 12:26:17 +0200 Subject: [PATCH] UI: New map widgets - calculate rotation angle for last timestamp. --- .../widget/lib/maps/data-layer/trips-data-layer.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/trips-data-layer.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/trips-data-layer.ts index e598685786..61585cf610 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/trips-data-layer.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/trips-data-layer.ts @@ -351,10 +351,10 @@ class TbTripDataItem extends TbDataLayerItem 1) { + result[timeStamp[timeStamp.length - 1]].rotationAngle = result[timeStamp[timeStamp.length - 2]].rotationAngle; + } + } else if (this.settings.rotateMarker && timeStamp.length > 1) { + const startPoint = this.dataLayer.dataProcessor.extractLocation(result[timeStamp[timeStamp.length - 2]], dsData); + const endPoint = this.dataLayer.dataProcessor.extractLocation(result[timeStamp[timeStamp.length - 1]], dsData); + result[timeStamp[timeStamp.length - 1]].rotationAngle += findRotationAngle(startPoint, endPoint); } return result; }