Skip to content

ValueItem

Namespace: ThinkGeo.Core

This class represents a single value to match and styles to draw.

public class ValueItem

Inheritance ObjectValueItem

Remarks:

Value Style:

The ValueStyle allows you to match data in the FeatureSource against a value string. If the value matches, then we will use the style defined in that item to do the drawing. For example, let's say you have some data that contains states, and each state is categorized as either a high, medium or low pollution state. Based on the string values of "High", Medium" and "Low", we can match on these. If a feature's data for the column matched the string "High", then we would use the high ValueItem's styles to draw that feature. This can be applied to all kinds of things, such as road classifications, etc.

This can be somewhat slow because we have to match data from the FeatureSource. If performance is key, then instead of using the ValueStyle, we recommend that you create a set custom index for your layer, one index with only "High" elements, one for "Medium" and so on. Then load each as a separate layer. In this way, you would only have one data set, but multiple indexes. This is the fastest way if you are working with Shape Files. If you are working with spatial databases, then we suggest creating a view to segment out each category.

Properties

Value

This property gets and sets the value that we use to match with the feature data. If the value matches, we use the style for this item.

public string Value { get; set; }

Property Value

String
This property gets the value that we use to match with the feature data.

Remarks:

The value must match exactly. If more complex matching is required, we suggest you use the RegexStyle. The RegexStyle enables you to use regular expressions, which are very powerful for fuzzy matching.

DefaultAreaStyle

This property gets and sets the default AreaStyle. You should use this style if your features are area-based.

public AreaStyle DefaultAreaStyle { get; set; }

Property Value

AreaStyle
This property gets the default AreaStyle.

Remarks:

The default style allows you to directly set properties on the styles without having to create a new style each time. You can start simply by setting properties like color, etc. This makes modifying styles very easy.

DefaultLineStyle

This property gets and sets the default LineStyle. You should use this style if your features are line-based.

public LineStyle DefaultLineStyle { get; set; }

Property Value

LineStyle
This property gets the default LineStyle.

Remarks:

The default style allows you to directly set properties on the styles without having to create a new style each time. You can start simply by setting properties like color, etc. This makes modifying styles very easy.

DefaultPointStyle

This property gets and sets the default PointStyle. You should use this style if your features are point-based.

public PointStyle DefaultPointStyle { get; set; }

Property Value

PointStyle
This property gets the default LineStyle.

Remarks:

The default style allows you to directly set properties on the styles without having to create a new style each time. You can start simply by setting properties like color, etc. This makes modifying styles very easy.

DefaultTextStyle

This property gets and sets the default TextStyle. You should use this style if your features are text-based (such as labels).

public TextStyle DefaultTextStyle { get; set; }

Property Value

TextStyle
This property gets the default TextStyle.

Remarks:

The default style allows you to directly set properties on the styles without having to create a new style each time. You can start simply by setting properties like color, etc. This makes modifying styles very easy.

CustomStyles

This property gets the collection of custom styles.

public Collection<Style> CustomStyles { get; }

Property Value

Collection<Style>
This property gets the collection of custom styles.

Remarks:

The custom styles allow you to use styles other than the default style properties of the class. In this way, you can use a DotDensityStyle or any other style in the API.

Constructors

ValueItem()

This is a constructor for the class.

public ValueItem()

Remarks:

If you use this constructor, you should set the necessary properties manually.

ValueItem(String, AreaStyle)

This is a constructor for the class.

public ValueItem(string value, AreaStyle areaStyle)

Parameters

value String

        This parameter is the value that will match with the data specified for the
        feature.

areaStyle AreaStyle
This parameter is the style you want to draw with if the value matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the DefaultAreaStyle.

ValueItem(String, LineStyle)

This is a constructor for the class.

public ValueItem(string value, LineStyle lineStyle)

Parameters

value String

        This parameter is the value that will match with the data specified for the
        feature.

lineStyle LineStyle
This parameter is the style you want to draw with if the value matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the DefaultLineStyle.

ValueItem(String, PointStyle)

This is a constructor for the class.

public ValueItem(string value, PointStyle pointStyle)

Parameters

value String

        This parameter is the value that will match with the data specified for the
        feature.

pointStyle PointStyle
This parameter is the style you want to draw with if the value matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the DefaultPointStyle.

ValueItem(String, TextStyle)

This is a constructor for the class.

public ValueItem(string value, TextStyle textStyle)

Parameters

value String

        This parameter is the value that will match with the data specified for the
        feature.

textStyle TextStyle
This parameter is the style you want to draw with if the value matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the DefaultTextStyle.

ValueItem(String, Collection<Style>)

This is a constructor for the class.

public ValueItem(string value, Collection<Style> customStyles)

Parameters

value String

        This parameter is the value that will match with the data specified for the
        feature.

customStyles Collection<Style>
This parameter represents the styles you want to draw with if the value matches.