From 9b659170d9dd8db03dc2ea906a43fd47d9a5f56e Mon Sep 17 00:00:00 2001 From: quantenschaum Date: Thu, 2 Jan 2025 08:02:27 +0100 Subject: [PATCH] rotate ais target only when curved vectors are enabled --- viewer/map/aislayer.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/viewer/map/aislayer.js b/viewer/map/aislayer.js index 0aa2ad4b..913a997f 100644 --- a/viewer/map/aislayer.js +++ b/viewer/map/aislayer.js @@ -531,13 +531,14 @@ AisLayer.prototype.drawTargetSymbol=function(drawing,xy,target,drawTargetFunctio if (curved) { let a=Helper.degrees(target_sog*age/turn_radius); var pos=drawTargetFunction(turn_center,target_cog-target_rot_sgn*(90-a),turn_radius); + drawing.drawImageToContext(pos,symbol.ghostImage,{ + ...style, + rotation: style.rotation + Math.radians(target_rot_sgn*target_rot*age/60), + }); } else { var pos=drawTargetFunction(xy,target_cog,target_sog*age); + drawing.drawImageToContext(pos,symbol.ghostImage,style); } - drawing.drawImageToContext(pos,symbol.ghostImage,{ - ...style, - rotation: style.rotation + Math.radians(target_rot_sgn*target_rot*age/60), - }); } } let curpix=drawing.drawImageToContext(xy,symbol.image,style);