Line patterns with markers do not work properly


since Version 5.2.4 creating linepattern with markers does not work predictable, sometimes the markers appear, sometime they do not.
I verified it with the mapwingis examples app (see attachment) . The error occurs even with the newest version 5.3.0. Using everything is fine.
Please have a look at the code.


I also encountered this problem. Looking forward to answer.


after taking a look at the sourcecode is seems obvious, that in the constructor of CLineSegment (LineSegment.h) the “new” Properties are not or wrong initialized. After adding the missing initialization and recompiling the .ocx everything seems to work.

If someone could verify…?

_pUnkMarshaler = NULL;
_lineType = lltSimple;
_lineColor = RGB(0,0,0);
_markerOutlineColor = RGB(120, 120, 120);
_lineWidth = 1.0f;
_lineStyle = dsSolid;
_marker = dpsDiamond;
_markerSize = 12;
_markerInterval = 16;
_markerOffset = 0.0f;
_markerOrientation = lorParallel;
_markerFlipFirst = VARIANT_FALSE; // WRONG
_markerIntervalIsRelative = VARIANT_FALSE; //MISSING
_markerOffsetIsRelative = VARIANT_FALSE; //MISSING
_markerAllowOverflow = VARIANT_FALSE; //MISSING

Best Regards,

Thanks Frank for also providing a potential fix.

@jerryfaust: Could you have a look. It seems OK to me.
I’ve created MWGIS-255 for this.

Yes, I’ll review it this weekend.

Thank you, Frank.


Ironically, it looks like those new internal variables (listed as MISSING) were first introduced in the release, and none of them were ever pre-initialized, which of course would produce unpredictable results. It’s possible that a subsequent change further altered the behavior. Either way, it is appropriate to initialize them in the constructor as recommended.


Hi @jerryfaust and @pmeems,

I’m also getting a strange result if I use the arrow symbol in my user definined line.
The arrow is drawing correctly but I can’t change the orientation. I want draw a red arrow from left to right, but it’s is drawing in other way from right to left.
Here is my code:

with FWRF do begin
    mUtils := CoUtils.Create;
    mPattern := CoLinePattern.Create;
    mPattern.AddLine(mUtils.ColorByName (Black), 12.0, dsSolid);
    mPattern.AddLine(mUtils.ColorByName (Green), 8.0, dsSolid);
    mSegm := mPattern.AddMarker(dpsArrowLeft);
    mSegm.MarkerOrientation := lorParallel;
    mSegm.Marker := dpsArrowRight ;
    mSegm.MarkerFlipFirst := false;
    mSegm.Color := mUtils.ColorByName (Red);
    mSegm.MarkerSize := 15;
    mSegm.MarkerInterval := 30;
    mSegm.MarkerIntervalIsRelative := false;
    DefaultDrawingOptions.LinePattern := mPattern;
    DefaultDrawingOptions.UseLinePattern := true;

Do you know what I’m doing wrong?
The line below start from left to right, but the array is drawing from right to left:

Can’t you just use
mSegm := mPattern.AddMarker(dpsArrowRight);