Drawing a line with direction indication
Posted: Wed Sep 28, 2016 2:20 pm
Dear colleagues,
One of our customers is using the RoutePolyLine animation to show users which way the route is going. As this takes up a huge amount of CPU time (25% of 1 core in a quad-core system), he wishes to disable the animation but still show which way the route is going. using the following code:
var poly = new MapPolyline
{
Points = pc,
MapStrokeThickness = 10,
StrokeLineJoin = PenLineJoin.Round,
StrokeStartLineCap = PenLineCap.Flat,
StrokeEndLineCap = PenLineCap.Triangle,
Stroke = new SolidColorBrush(System.Windows.Media.Color.FromArgb(128, color.R, color.G, color.B)),
ScaleFactor = 0.05,
ToolTip = toolTip
};
var polyArrow = new MapPolyline
{
Points = pc,
MapStrokeThickness = 11,
StrokeLineJoin = PenLineJoin.Round,
StrokeStartLineCap = PenLineCap.Flat,
StrokeEndLineCap = PenLineCap.Triangle,
Stroke = new SolidColorBrush(System.Windows.Media.Color.FromArgb(128, color.R, color.G, color.B)),
StrokeDashCap = PenLineCap.Triangle,
StrokeDashArray = new DoubleCollection { 1, 2 },
// StrokeDashOffset = 2.0,
ScaleFactor = 0.05,
ToolTip = toolTip
};
The customer is able to produce a line as shown in the attachment arrow1. however, he would like to have a line as depicted in attachment arrow2. is this possible, code-wise?
One of our customers is using the RoutePolyLine animation to show users which way the route is going. As this takes up a huge amount of CPU time (25% of 1 core in a quad-core system), he wishes to disable the animation but still show which way the route is going. using the following code:
var poly = new MapPolyline
{
Points = pc,
MapStrokeThickness = 10,
StrokeLineJoin = PenLineJoin.Round,
StrokeStartLineCap = PenLineCap.Flat,
StrokeEndLineCap = PenLineCap.Triangle,
Stroke = new SolidColorBrush(System.Windows.Media.Color.FromArgb(128, color.R, color.G, color.B)),
ScaleFactor = 0.05,
ToolTip = toolTip
};
var polyArrow = new MapPolyline
{
Points = pc,
MapStrokeThickness = 11,
StrokeLineJoin = PenLineJoin.Round,
StrokeStartLineCap = PenLineCap.Flat,
StrokeEndLineCap = PenLineCap.Triangle,
Stroke = new SolidColorBrush(System.Windows.Media.Color.FromArgb(128, color.R, color.G, color.B)),
StrokeDashCap = PenLineCap.Triangle,
StrokeDashArray = new DoubleCollection { 1, 2 },
// StrokeDashOffset = 2.0,
ScaleFactor = 0.05,
ToolTip = toolTip
};
The customer is able to produce a line as shown in the attachment arrow1. however, he would like to have a line as depicted in attachment arrow2. is this possible, code-wise?