Clint,
Thanks for your report! We can create the problem as you said very easily!
Currently, in our drawing logic, we will always draw the label at the top of each overlay, so there is 2 ways to go around this problem without changing anything in MapSuite component.
1) As you said, put it to another Overlay.
2) Put it into one overlay, but need to create a special RestrictionAreaStyle, Following is the sample code you can follow.
//Create a RestricitonAreaStyle and Override the DrawCore.
public class RestrictionAreaStyle : AreaStyle
{
public RestrictionAreaStyle()
:base()
{
}
public RestrictionAreaStyle(GeoPen outlinePen)
: base(outlinePen)
{
}
public RestrictionAreaStyle(GeoSolidBrush fillSolidBrush)
:base(fillSolidBrush)
{
}
public RestrictionAreaStyle(GeoPen outlinePen, GeoSolidBrush fillSolidBrush)
: base(outlinePen, fillSolidBrush)
{
}
public RestrictionAreaStyle(GeoPen outlinePen, GeoSolidBrush fillSolidBrush, PenBrushDrawingOrder penBrushDrawingOrder)
: base(outlinePen, fillSolidBrush, penBrushDrawingOrder)
{
}
protected override void DrawCore(IEnumerable<Feature> features, GeoCanvas canvas, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInThisLayer, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInAllLayers)
{
if (canvas.CurrentWorldExtent.Width == 0) { return; }
foreach (Feature feature in features)
{
WellKnownType shapeWellKnownType = feature.GetWellKnownType();
if (shapeWellKnownType != WellKnownType.Polygon && shapeWellKnownType != WellKnownType.Multipolygon)
{
continue;
}
canvas.DrawArea(feature, OutlinePen, Advanced.FillCustomBrush, DrawingLevel.LabelLevel, XOffsetInPixel, YOffsetInPixel, PenBrushDrawingOrder);
}
}
//Use the Created Restriction Style for the RestrictionLayer.
GeoPen geoPen = new GeoPen(GeoColor.StandardColors.Transparent, 0);
geoPen.DashStyle = LineDashStyle.Solid;
GeoHatchBrush brush = new GeoHatchBrush(GeoHatchStyle.Percent80, GeoColor.StandardColors.LightGray, GeoColor.StandardColors.Black);
RestrictionAreaStyle areaStyle = new RestrictionAreaStyle();
areaStyle.Advanced.FillCustomBrush = brush;
areaStyle.OutlinePen = geoPen;
restrictionLayer.CustomStyles.Add(areaStyle);
Any more questions just let me know.
Thanks.
Yale