ThinkGeo.com    |     Documentation    |     Premium Support

Using the same TextStyle for entire layers and individual features

I’m having an issue when using a single TextStyle for both entire layers and individual features. The issue revolves around the TextColumnName.

For individual features, which are held in an InMemoryFeatureLayer, each feature has a column called “MainLabel” which is set equal to a TextStyle’s name. These TextStyles and their names are in a ValueStyle.ValueItems for the layer.

For layers, I just assign the default text style to the TextStyle. I can set the TextColumnName to a column in the layer. But if I do this, the individual features in the other layer won’t show their TextStyle, because the TextColumnName isn’t equal to “MainLabel” anymore.

One option is to make a duplicate of every TextStyle I have and use one for layers and one for individual features with the only difference being the TextColumnName, but that seems inefficient. Is there a better way to handle this?

Hi Dan,

I have a little confuse about your scenario.

It looks you have an entire layer, and does the individual features is also included in the layer?

I don’t understand If they are not in the same layer, why the text style will effect each other.

I think there are two points need to know here:

  1. If you set customStyle, all default style won’t works. So just add your default style into your custom style also.

  2. If you found the layers in same overlay have strange behavior, just put them into different ovelray and see whether it still works.

If you think that’s not helpful for it, please let me know more detail about your scenario.

Regards,

Ethan