Hi
I have created one CustomLineStyle class deriving from LineStyle and override the DrawLine method. Buit when I call DrawLine method I cannot see the line I want to draw.
Code is as follows
public class CustomArrowLineStyle : LineStyle
{
protected override void DrawCore(System.Collections.Generic.IEnumerable<Feature> features, GeoCanvas canvas, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInThisLayer, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInAllLayers)
{
foreach (Feature f in features)
{
if (f.GetShape().GetType() == typeof(LineShape))
{
LineShape ln = (LineShape)f.GetShape();
canvas.DrawLine(ln, new GeoPen(new GeoSolidBrush(GeoColor.SimpleColors.Black), 5));
}
}
}
}
I am creating style as:
CustomArrowLineStyle speedAndHeadingLineStyle = new CustomArrowLineStyle();
speedAndHeadingLineStyle.OuterPen = new GeoPen(new GeoColor(0, 0, 0), 5);
speedAndHeadingLineStyle.InnerPen = new GeoPen(new GeoColor(0, 0, 0), 0);
speedAndHeadingLineStyle.CenterPen = new GeoPen(new GeoColor(0, 0, 0), 4);
speedAndHeadingLineStyle.CenterPen.EndCap = GeoDashCap.Triangle;
speedAndHeadingLineStyle.OuterPen.EndCap = GeoDashCap.Triangle;
MemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(speedAndHeadingLineStyle);
MemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
And Creating line at run time as:
LineShape line = new LineShape();
line.Vertices.Add(point);
line.Vertices.Add(point2);
Feature lineFeature = new Feature(line);
MemoryFeatureLayer.InternalFeatures.Add(update.DisplayElementKey + "speed", lineFeature);
But when I run the code, code gets executed properly but does not display line.
Do I have to do anything additionaly.
Thanks
Sunil