IconValueItem¶
Namespace: ThinkGeo.Core
This class is a single item in an IconValueStyle.
public class IconValueItem
Inheritance Object → IconValueItem
Remarks:
This item is used in the IconValueStyle to determine which way to draw the feature based on the FieldValue property.
How IconValueStyle works:
When you create an IconValueStyle, you need to add multiple IconValueItems to its collection. You input the column name in the IconValueStyle and it will compare the data's value to each IconValueItem's FieldValue. If they match, then it will draw the Feature using the properties of the IconValueItem. In this way, you can render different data with different icons or text.
The MinimumLength and MaximumLength properties are important because they are used to ensure that a properly sized icon is used to draw things like road signs. For example, you can set the minimum and maximum values so that the sign icon for a single-digit road number uses one icon, while a two-digit road uses another, wider sign icon in a separate IconValueItem.
Properties¶
TextStyle¶
This property gets and sets the style that will be used to draw the text in the icon.
public TextStyle TextStyle { get; set; }
Property Value¶
This property gets the style that will be used to draw the text in the
icon.
Remarks:
None
FieldValue¶
This property gets and sets the field value that has to match in the IconValueStyle.
public string FieldValue { get; set; }
Property Value¶
This property gets the field value that has to match in the
IconValueStyle.
Remarks:
For an explanation on how the IconValueStyle works, see the IconValueStyle Class remarks.
IconFilePathName¶
This property gets and sets the path and filename of the icon that will be drawn.
public string IconFilePathName { get; set; }
Property Value¶
This property gets the path and filename of the icon that will be
drawn.
Remarks:
If you need to use a GeoImage, you can set the GeoImage in the constructor or use the property.
TextValueLengthMin¶
This property gets and sets the minimum string length for this item to match.
public int TextValueLengthMin { get; set; }
Property Value¶
Int32
This property gets the minimum string length for this item to match.
Remarks:
This is an important property because it is used to ensure that that a properly sized icon is used to draw things like road signs. For example, you can set the minimum and maximum values so that the sign icon for a single-digit road number uses one icon, while a two-digit road uses another, wider sign icon in a separate IconValueItem.
TextValueLengthMax¶
This property gets and sets the maximum string length for this item to match.
public int TextValueLengthMax { get; set; }
Property Value¶
Int32
This property gets the maximum string length for this item to match.
Remarks:
This is an important property because it is used to ensure that that a properly sized icon is used to draw things like road signs. For example, you can set the minimum and maximum values so that the sign icon for a single-digit road number uses one icon, while a two-digit road uses another, wider sign icon in a separate IconValueItem.
Constructors¶
IconValueItem()¶
This is the constructor for the class.
public IconValueItem()
Remarks:
If you use the constructor, then you should set all the properties manually.
IconValueItem(String, String, TextStyle)¶
This is the constructor for the class.
public IconValueItem(string fieldValue, string iconPathFilename, TextStyle textStyle)
Parameters¶
fieldValue
String
This parameter is the value you want to match.
iconPathFilename
String
This parameter is the path and filename of the image you want to use.
textStyle
TextStyle
This parameter is the TextStyle of how you want the text drawn.
Remarks:
You would typically use this constructor if you are using an icon that's located on disk. If you need to use an image from a stream instead, there is another overload that takes a NativeImage.
IconValueItem(String, GeoImage, TextStyle)¶
This is the constructor for the class.
public IconValueItem(string fieldValue, GeoImage iconImage, TextStyle textStyle)
Parameters¶
fieldValue
String
This parameter is the value you want to match.
iconImage
GeoImage
This parameter is the NativeImage of the image you want to use.
textStyle
TextStyle
This parameter is the TextStyle of how you want the text drawn.
Remarks:
You will typically use this overload if you need to use a stream for the image. If you need to use a file located on disk instead, there is another overload that takes the path and filename to an image.
Methods¶
GetIconImage()¶
This method gets the icon we will draw as a GeoImage.
public GeoImage GetIconImage()
Returns¶
GeoImage
This method gets the icon we will draw as a GeoImage.
Remarks:
This method is used when drawing to get the image as a GeoImage. We will internally either pass along the GeoImage the user set, or create a GeoImage from the IconFilePathName that was set.