ThinkGeo.com    |     Documentation    |     Premium Support

Label Placement in Center of Irregular Polygon

MapSuite Team,

Shown in the screen-capture below is a building layer with address as the label.

I would like those buildings with an irregular polygon to be labeled in the center of the irregular area, but am unable to adjust the labeling properties to achieve this.

The building in the center with a label of “714-728” is such an example. The shape you see is all one polygon. The goal is to have “714-728” appear in the center of this shape.

I have tried all sorts of different combinations of labeling properties without success. These are the propertiy settings:

SuppressPartialLabels		=false;
PointPlacement			=UpperCenter;
LabelOverlappingRule		=NoOverlapping;
LabelDuplicateRule		=UnlimitedDuplicateLabels;
BestPlacement			=false;
DrawingLevel			=LabelLevel;
GridSize			=1;
FittingPolygonFactor		=100;
LabelAllPolygonParts		=true;
PolygonLabelingLocationMode	=Centroid;
FittingPolygon			=false;
AllowLineCarriage		=true;
ForceLineCarriage		=false;
ForceHorizontalLabelForLine	=false;

Is it possible to achieve what I’m looking for?

The buildings that are of a regular polygon shape are labeled as preferred.

Thanks,
Dennis

Hi Dennis,

Thanks to point that, please set this property:

.DefaultTextStyle.PolygonLabelingLocationMode = PolygonLabelingLocationMode.BoundingBoxCenter;

And please get this package after it’s available in NuGet:

Regards,

Ethan

hi Ethan,

Thanks very much! It now places the label in the center of the BoundingBox.

Dennis

Hi Dennis,

I am glad to hear that works!

Regards,

Ethan