ThinkGeo.com    |     Documentation    |     Premium Support

Displaying a Partial Label

Good Morning ThinkGeo Community, I am working on a map for displaying timber areas. My current problem is that I am trying to show a partial label.
I have successfully shown a label using “TextStyles.CreateSimpleTextStyle” this displays a label such as “M05N25E140812” But I am curious if there is a way to format the label so that it just shows the first 7 characters so it looks more like this “M05N25E” and if there is a way to accomplish this without setting up an abbreviation dictionary, maybe with the “TextFormat”

Hi Tyler,

It looks the TextFormat only works for the numeric but cannot work for cut string.

I think you can modify that by our event Formatting.

shapeFileLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.Formatting += DefaultTextStyle_Formatting;

 private void DefaultTextStyle_Formatting(object sender, FormattingPositionStyleEventArgs e)
    {
        e.Text = e.Text.Substring(0, 7);
    }

Wish that’s helpful.

Regards,

Don

This is exactly what I needed. Thank you Don

Hi Tyler,

I am glad to hear that’s helpful. Any question please let us know.

Regards,

Don