Hey @Mikko_Viitala,
Glad you were able to figure out the dash styles on your own and thank you for posting your solution! I think it would be fitting for us to update our samples to include more detail on how to do more complex LineStyles
for future reference.
To expand on this a bit more, you really only need the inner and outer pen to achieve your results, no need for the center pen as you’ve already figured out. Additionally, I would recommend using the normal LineStyle
constructor when it comes to more complex line styles, like dash lines, since it gives you better control over how each pen is drawn. Below is some example code that achieves similar results:
var lineStyle = new LineStyle(
outerPen: new GeoPen(GeoColors.Black, 16)
{
DashStyle = LineDashStyle.Custom,
DashPattern = { 0.2f, 5f },
StartCap = DrawingLineCap.Flat,
EndCap = DrawingLineCap.Flat
},
innerPen: new GeoPen(GeoColors.Black, 4)
);
var lineStyle = new LineStyle(
outerPen: new GeoPen(GeoColors.Black, 12),
innerPen: new GeoPen(GeoColors.White, 6)
{
DashStyle = LineDashStyle.Custom,
DashPattern = { 3f, 3f },
StartCap = DrawingLineCap.Flat,
EndCap = DrawingLineCap.Flat
}
);
Thanks,
Kyle