Table of Contents

ThinkGeo.MapSuite.SilverlightCore.TextStyle

Note: The page was created before Map Suite 10. Map Suite 10.0 organized many classes into new namespaces and assemblies as well as had a few minor breaks in compatibility. The majority of previously built code should work without modification assuming the new namespaces are added. For guidance on upgrading your existing code, please check out MapSuite 10 Upgrade Guide.

This class is used to label features on the map.

Inheritance Hierarchy

Members Summary

Public Constructors

TextStyle()

Remarks
Parameters

TextStyle(String,GeoFont,GeoSolidBrush)

Remarks
Parameters

Protected Constructors

Public Methods

Draw(IEnumerable<Feature>,GeoCanvas,Collection<SimpleCandidate>,Collection<SimpleCandidate>)

Remarks
Return Value
Parameters

Draw(IEnumerable<BaseShape>,GeoCanvas,Collection<SimpleCandidate>,Collection<SimpleCandidate>)

Remarks
Return Value
Parameters

GetRequiredColumnNames()

Remarks
Return Value
Parameters

DrawSample(GeoCanvas,DrawingRectangleF)

Remarks
Return Value
Parameters

ToString()

Remarks
Return Value
Parameters

Equals(Object)

Remarks
Return Value
Parameters

GetHashCode()

Remarks
Return Value
Parameters

GetType()

Remarks
Return Value
Parameters

Protected Methods

DrawSampleCore(GeoCanvas,DrawingRectangleF)

Remarks
Return Value
Parameters

FormatCore(String,BaseShape)

Remarks
Return Value
Parameters

OnFormatting(FormattingPositionStyleEventArgs)

Remarks
Return Value
Parameters

OnFormatted(FormattedPositionStyleEventArgs)

Remarks
Return Value
Parameters

DrawCore(IEnumerable<Feature>,GeoCanvas,Collection<SimpleCandidate>,Collection<SimpleCandidate>)

Remarks
Return Value
Parameters

GetRequiredColumnNamesCore()

Remarks
Return Value
Parameters

FilterFeatures(IEnumerable<Feature>,GeoCanvas)

Remarks
Return Value
Parameters

FilterFeaturesCore(IEnumerable<Feature>,GeoCanvas)

Remarks
Return Value
Parameters

GetLabelingCandidates(Feature,GeoCanvas)

Remarks
Return Value
Parameters

GetLabelingCandidateCore(Feature,GeoCanvas)

Remarks
Return Value
Parameters

CheckDuplicate(LabelingCandidate,GeoCanvas,Collection<SimpleCandidate>,Collection<SimpleCandidate>)

Remarks
Return Value
Parameters

CheckDuplicateCore(LabelingCandidate,GeoCanvas,Collection<SimpleCandidate>,Collection<SimpleCandidate>)

Remarks
Return Value
Parameters

CheckOverlapping(LabelingCandidate,GeoCanvas,Collection<SimpleCandidate>,Collection<SimpleCandidate>)

Remarks
Return Value
Parameters

CheckOverlappingCore(LabelingCandidate,GeoCanvas,Collection<SimpleCandidate>,Collection<SimpleCandidate>)

Remarks
Return Value
Parameters

Finalize()

Remarks
Return Value
Parameters

MemberwiseClone()

Remarks
Return Value
Parameters

Public Properties

LabelingLocationModeForPolygon

This property gets and sets the mode that determines how to locate polygon's labeling

Remarks

There are two ways to handle polygon's labeling location. The first is to use polygon's centroid as the labeling location, the second way is to use polygon's boungdingbox center as the labeling location.

Return Value

XOffsetInPixel

This property gets and sets the X pixel offset for drawing each feature.

Remarks

This property allows you to specify an X offset. When combined with a Y offset, it is useful to allow you to achieve effects such as drop shadows, etc. There also may be times when you need to modify the location of feature data so as to better align it with raster satellite data.

Return Value

YOffsetInPixel

This property gets and sets the Y pixel offset for drawing each feature.

Remarks

This property allows you to specify a Y offset. When combined with an X offset, it is useful to allow you to achieve effects such as drop shadows, etc. There also may be times when you need to modify the location of feature data so as to better align it with raster satellite data.

Return Value

GridSize

This property gets and sets the grid size used for deterministic labeling.

Remarks

The grid size determines how many labels will be considered as candidates for drawing. The smaller the grid size, the higher the density of candidates. Making the grid size too small may have a performance impact.

Return Value

FittingLineInScreen

This property gets and sets whether the labeler will try to fit the label as best as it can on the visible part of a line on the screen.

Remarks

A label will normally be displayed in the center of a line. If only a small piece of the line is visible on the screen, we cannot see it's label by default. If we set this property to ture though, the label will be displayed in the center of that piece in screen.

Return Value

CustomTextStyles

This property returns a collection of area styles allowing you to stack multiple area styles on top of each other.

Remarks

Using this collection, you can stack multiple area styles on top of each other. When we draw the features, we will draw them in order that they exist in the collection. You can use these stacks to create drop shadow effects, multiple colored outlines, etc.

Return Value

RotationAngle

This property gets and sets the rotation angle of the item being positioned.

Remarks

None

Return Value

TextFormat

This property gets and sets the format that will be applied to the text.

Remarks

With this property, you can apply formats to the text that is retrieved from the feature.

Return Value

NumericFormat

This property gets and sets the format that will be applied to the text which can be parsed to double type.

Remarks

With this property, you can apply formats to the text that is retrieved from the feature.

Return Value

DateFormat

This property gets and sets the format that will be applied to the text which can be parsed to DateTime type.

Remarks

With this property, you can apply formats to the text that is retrieved from the feature.

Return Value

TextSolidBrush

This property gets and sets the SolidBrush that will be used to draw the text.

Remarks

You can use this property to draw a solid color; however, if you need to use other brushes, you can access them through the Advanced property of this class.

Return Value

Font

This property gets and sets the font that will be used to draw the text.

Remarks

None

Return Value

HaloPen

This property gets and sets the halo pen you may use to draw a halo around the text.

Remarks

The halo pen allows you to draw a halo effect around the text, making it stand out more on a busy background.

Return Value

TextColumnName

This property gets and sets the column name in the data that you want to get the text from.

Remarks

This property is used when retrieving text from a feature. You will want to specify the name of the column that contains the text you want to draw.

Return Value

Mask

This property gets and sets the AreaStyle used to draw a mask behind the text.

Remarks

A mask is a plate behind the text that is rectangular and slightly larger than the width and height of the text. It allows the label to stand out well on a busy background. You can also try the HaloPen property instead of the mask, if the mask effect is too pronounced.

Return Value

MaskMargin

This property gets and sets the margin around the text that will be used for the mask.

Remarks

This determines how much larger the mask is than the text, in pixels.

Return Value

Advanced

This property gets the advanced properties of the class.

Remarks

The advanced properties have been consolidated in the Advanced property. This way, the standard options are more easily visible and the advanced options are hidden away.

Return Value

DuplicateRule

This property gets and sets the rule that determines how duplicate labels are handled.

Remarks

There are three ways to handle duplicate label names. The first is to suppress all duplicates, which means if there are two street segments with the same name then only one will be drawn. The second way is to suppress duplicate labels only if they are in one quarter of the screen. In this way, the screen will be divided into four quadrants, and if the two duplicate labels are in different quadrants, then they will both draw. The last way is to draw all duplicates.

Return Value

OverlappingRule

This property gets and sets the rule that determines how overlapping labels are handled.

Remarks

This defines the rules for label overlapping. Currently, either we allow overlapping or we do not. In the future, we may extend this to allow some percentage of partial overlapping.

Return Value

AllowSpline

This property gets and sets whether line labels are allowed to spline around curved lines.

Remarks

This property will allow the labeler to spline the label around curved lines. This is useful for curved streets that need to be labeled. This can have a considerable performance impact, so we suggest you experiment with it to ensure it can meet your needs.

Return Value

AllowLineCarriage

This property gets and sets whether the labeler will allow carriage returns to be inserted.

Remarks

This property enables the labeler to split long labels into multiple lines if need be. For instance, if you have a lake whose name is “Southern Homestead Lake,” then the labeler may try and break the name onto multiple lines in order to better label the feature.

Return Value

ForceLineCarriage

This property gets and sets whether the labeler will force carriage returns to be inserted.

Remarks

This property forces the labeler to split long labels into multiple lines. For instance, if you have a lake whose name is “Southern Homestead Lake,” then the labeler will break the name onto multiple lines in order to better label the feature.

Return Value

FittingPolygon

This property gets and sets whether the labeler will try to fit the label as best as it can within the boundary of a polygon.

Remarks

None

Return Value

LabelAllPolygonParts

This property gets and sets whether the labeler will label every part of a multi-part polygon.

Remarks

In some cases, you may want to label all of the parts of a multi-part polygon, while in other cases you may not. For example, you may have a series of lakes where you do want to label each polygon. In another case, you may have a country with many small islands and in this case you only want to label the largest polygon.

Return Value

LabelAllLineParts

This property gets and sets whether the labeler will label every part of a multi-part line.

Remarks

In some cases, you may want to label all of the parts of a multi-part line, while in other cases you may not.

Return Value

ForceHorizontalLabelForLine

This property gets and sets whether we should force horizontal labeling for lines.

Remarks

Normally, lines are labeled in the direction of the line. There may be some cases, however, when you want to have the line labeled horizontally regardless of the line's direction. In such a case, you can set this property to force the lines to be labeled horizontally.

Return Value

FittingPolygonFactor

This property gets and sets the factor to which it will keep the label inside of the polygon.

Remarks

None

Return Value

SuppressPartialLabels

This property gets and sets whether a partial label in the current extent will be drawn or not.

Remarks

This property provides a solution to the “cut off” label issue in Map Suite Web Edition and Desktop Edition, which occurs when multiple tiles exist. When you set this property to true, any labels outside of the current extent will not be drawn.

Return Value

TextLineSegmentRatio

This property gets and sets the ratio required for the label length to match the line length.

Remarks

This allows you to suppress labels where the label length would greatly exceed the line length. For example, if you set the ratio to 1, then the label will be suppressed if it is longer than the line. If the ratio is lower, then the label would need to be shorter than the line. If higher, then the label is allowed to run past the length of the line. This allows you to control the look of things like road labeling.

Return Value

BestPlacement

This property gets and sets whether the labeler will attempt to change the label position to avoid overlapping for point-based features.

Remarks

The positioning of point labels is mainly determined by the PointPlacement property. This allows you place the text to the right, top, bottom, etc. of the point. In some cases, placing the text in a certain place will cause many labels to be suppressed when the points are dense. This property allows you to override the PointPlacement property and allow the labeler to try other locations, if the default location would cause the label to be suppressed.

Return Value

PointPlacement

This property gets and sets the location of the label for point features relative to the point.

Remarks

This property allows you to choose where the labels are created relative to the point. For example, you can set the property to RightCenter, which would ensure that all labels are placed to the right of and vertically centered with the point. Different kinds of point layers can be positioned differently. If the point layer is dense and position is not a main concern, then you can try the BestPlacement property. That property overrides this property and tries to fit the label in the best location so that the minimum number of labels are suppressed due to overlapping issues.

Return Value

SplineType

Gets or sets the SplineType for labeling.

Remarks

N/A

Return Value

DrawingLevel

Gets or sets the DrawingLavel for this style.

Remarks

N/A

Return Value

LabelPositions

Gets a value represents a keyValuepair which is a feature id and label position of the feature

Remarks

N/A

Return Value

Name

N/A

Remarks

N/A

Return Value

IsActive

N/A

Remarks

N/A

Return Value

RequiredColumnNames

N/A

Remarks

N/A

Return Value

Protected Properties

PolygonLabelingLocationMode

N/A

Remarks

N/A

Return Value

bho=

N/A

Remarks

N/A

Return Value

Public Events

Formatting N/A

Remarks

N/A

Event Arguments:FormattingPositionStyleEventArgs

Formatted N/A

Remarks

N/A

Event Arguments:FormattedPositionStyleEventArgs