Skip to content

Commit

Permalink
rotate ais target only when curved vectors are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
quantenschaum committed Jan 2, 2025
1 parent c465e76 commit 9b65917
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions viewer/map/aislayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9b65917

Please sign in to comment.