Skip to content

PointStyle

Namespace: ThinkGeo.Core

This class allows you to define how points are drawn on the view.

public class PointStyle : PointBaseStyle

Inheritance Object → Style → PointBaseStyle → PointStyle

Remarks:

This class allows you to define how points are drawn on the view. There are three main drawing types: bitmap, character, and symbol. The bitmap allows you to represent each point with a bitmap. The character allows you to choose a font and an index in the font so you can use that character for the point. This is especially helpful with fonts like Wingdings that have many feature-style graphics. The symbol type is a collection of simple geometric symbols that we have assembled to represent abstract items on the map.

When you select a PointType, you need to be sure to set the various properties associated with that type. The property names are prefixed to help you. For example, all of the character-related properties are prefixed with "Glyph" and the symbol properties follow a similar pattern.

Properties

PointType

This property gets and sets the type of point you want to draw.

public PointType PointType { get; set; }

Property Value

PointType
This property gets the type of point you want to draw.

Remarks:

When using the PointStyle you choose between a bitmap, a font or a predefined symbol to represent the point. Each of these options has corresponding properties on the point symbol. If you set the type to character, then you need to set the properties that start with "Glyph," such as "CharacterFont." The same is true for the symbol.

Image

This property gets and sets the image used if the PointType property is Image.

public GeoImage Image { get; set; }

Property Value

GeoImage
This property gets the image used if the PointType property is Image.

Remarks:

This property is where you can set the image for the points if the PointType is Image. It uses a NativeImage, so you can either reference a file or supply a stream.

ImageScale

This property gets and sets the scale of the image you want to draw.

public double ImageScale { get; set; }

Property Value

Double
This property gets the scale of the image you want to draw.

Remarks:

This property allows you to scale the image up and down depending on how large or small you want it. It can be changed dynamically, so you could change it at every scale level to resize the bitmap based on the current scale. A scale of 1 would be the original size, while a scale of 2 would double the size. A scale of .5 would reduce the size of the image by half, and so on.

GlyphFont

This property gets and sets the font that is used for the character if the PointType is Glyph.

public GeoFont GlyphFont { get; set; }

Property Value

GeoFont

        This property gets the font that is used for the character if the PointType is
        Glyph.

Remarks:

This property allows you to set the font from which to select a character index if you choose the Glyph PointType.

GlyphContent

This property gets and sets the content of the character you want to use from the font you selected in the CharacterFont property.

public string GlyphContent { get; set; }

Property Value

String

        This property gets the content of the character you want to use from the
        font you selected in the CharacterFont property.

Remarks:

You need to specify the content of the character you want to use from the font you selected. For example, if you choose 1, then we will use the first character in the font you set in the CharacterFont property.

SymbolType

This property gets and sets the type of symbol you want to use if the PointType is Symbol.

public PointSymbolType SymbolType { get; set; }

Property Value

PointSymbolType

        This property gets the type of symbol you want to use if the PointType is
        Symbol.

Remarks:

You can choose between a number of predefined symbols. The symbols are simple geometric objects that are typically used for abstract representations on a map. If there is a specific symbol you need that is not part of our symbol collection, you can submit it to us and we will consider adding it.

Mask

public AreaStyle Mask { get; set; }

Property Value

AreaStyle

MaskMargin

public DrawingMargin MaskMargin { get; set; }

Property Value

DrawingMargin

MaskType

public MaskType MaskType { get; set; }

Property Value

MaskType

DrawingLevel

public DrawingLevel DrawingLevel { get; set; }

Property Value

DrawingLevel

FillBrush

This property gets and sets the SolidBrush used to color the interior of the Symbol.

public GeoBrush FillBrush { get; set; }

Property Value

GeoBrush

        This property gets the SolidBrush used to color the interior of the
        Symbol.

Remarks:

This brush is used to draw the interior of the symbol. It is only used if the PointType is Symbol. If you need a brush other than the SolidBrush, you should look in the advanced property of the class.

OutlinePen

This property gets and sets the SolidBrush used to draw the oultine of the Symbol.

public GeoPen OutlinePen { get; set; }

Property Value

GeoPen
This property gets the SolidBrush used to draw the outline of the Symbol.

Remarks:

This pen is used to draw the outline of the Symbol. By default the pen draws a transparent (invisible) color, which just leaves you with a fill.

SymbolSize

This property gets and sets the size of the symbol if the PointType is Symbol.

public float SymbolSize { get; set; }

Property Value

Single
This property gets the size of the symbol if the PointType is Symbol.

Remarks:

The allows you to make the symbol larger and smaller.

RotationAngle

This property gets and sets the angle of rotation for the drawing of the point.

public float RotationAngle { get; set; }

Property Value

Single
This property gets the angle of rotation for the drawing of the point.

Remarks:

This property controls the rotation of the bitmap, character or symbol, depending on the PointType.

XOffsetInPixel

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

public float XOffsetInPixel { get; set; }

Property Value

Single
This property gets 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.

YOffsetInPixel

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

public float YOffsetInPixel { get; set; }

Property Value

Single
This property gets 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.

CustomPointStyles

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

public Collection<PointBaseStyle> CustomPointStyles { get; }

Property Value

Collection<PointBaseStyle>
This property returns a collection of area styles.

Remarks:

Using this collection, you can stack multiple styles on top of each other. When we draw the feature, 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.

Name

This property gets and set the name of the style.

public string Name { get; set; }

Property Value

String
This property gets the name of the style.

Remarks:

This name is not used by the system; it is only for the developer. However, it can be used if you generate your own legend.

IsActive

This property gets and sets the active status of the style.

public bool IsActive { get; set; }

Property Value

Boolean
This property gets the active status of the style.

Remarks:

If the style is not active then it will not draw.

RequiredColumnNames

This property gets the collection of fields that are required for the style.

public Collection<string> RequiredColumnNames { get; }

Property Value

Collection<String>

        This property gets the collection of fields that are required for the
        style.

Remarks:

This property gets the collection of fields that are required for the style. These are in addition to any other columns you specify in styles that inherit from this one. For example, if you have use a ValueStyle and it requires a column name for the value comparison, then that column does not need to be in this collection. You only use the RequiredColumnNames for columns you need beyond those required by specific inherited styles.

Filters

public Collection<string> Filters { get; }

Property Value

Collection<String>

Constructors

PointStyle()

This is a constructor for the class.

public PointStyle()

Remarks:

If you use this constructor, you should set the various properties manually. Specifically, you will want to set the PointType, which allows you to choose between bitmap, character and symbol as an option for displaying your points.

PointStyle(GeoImage)

This is a constructor for the class.

public PointStyle(GeoImage image)

Parameters

image GeoImage

        This parameter is the NativeImage of the image you want to use to display the
        point.

Remarks:

If you use this constructor, the PointStyle will be set to Image.

PointStyle(GeoFont, String, GeoBrush)

This is a constructor for the class.

public PointStyle(GeoFont glyphFont, string glyphContent, GeoBrush fillBrush)

Parameters

glyphFont GeoFont
This parameter is the font from which the character will be selected.

glyphContent String
This parameter is the index of the character in the chosen font.

fillBrush GeoBrush
This parameter is the SolidBrush used to draw the character.

Remarks:

If you use this constructor, the PointStyle will be set to Glyph.

PointStyle(GeoFont, String, GeoBrush, GeoPen)

This is a constructor for the class.

public PointStyle(GeoFont glyphFont, string glyphContent, GeoBrush fillBrush, GeoPen outlinePen)

Parameters

glyphFont GeoFont
This parameter is the font from which the character will be selected.

glyphContent String
This parameter is the index of the character in the chosen font.

fillBrush GeoBrush
This parameter is the SolidBrush used to draw the character.

outlinePen GeoPen
This parameter is the Pen used to draw the character.

PointStyle(PointSymbolType, Int32, GeoBrush)

This is a constructor for the class.

public PointStyle(PointSymbolType symbolType, int symbolSize, GeoBrush fillBrush)

Parameters

symbolType PointSymbolType

        This parameter is the type of symbol you want to use, such as a square or a
        circle.

symbolSize Int32
This parameter is the size you want the symbol to be.

fillBrush GeoBrush

        This parameter is the SolidBrush you want to use to fill the inside of the
        symbol.

Remarks:

If you use this constructor, the PointStyle will be set to Symbol.

PointStyle(PointSymbolType, Int32, GeoBrush, GeoPen)

This is a constructor for the class.

public PointStyle(PointSymbolType symbolType, int symbolSize, GeoBrush fillBrush, GeoPen outlinePen)

Parameters

symbolType PointSymbolType

        This parameter is the type of symbol you want to use, such as a square or a
        circle.

symbolSize Int32
This parameter is the size you want the symbol to be.

fillBrush GeoBrush

        This parameter is the SolidBrush you want to use to fill the inside of the
        symbol.

outlinePen GeoPen
This parameter is the Pen used to draw the outline of the symbol.

Remarks:

If you use this constructor, the PointStyle will be set to Symbol.

Methods

Parse(String)

public static PointStyle Parse(string styleJson)

Parameters

styleJson String

Returns

PointStyle

Parse(JObject)

internal static PointStyle Parse(JObject jObject)

Parameters

jObject JObject

Returns

PointStyle

CreateSimplePointStyle(PointSymbolType, GeoColor, Single)

Static API to create a point style.

public static PointStyle CreateSimplePointStyle(PointSymbolType pointStyle, GeoColor fillColor, float size)

Parameters

pointStyle PointSymbolType
This parameter determines the PointStyle symbol type.

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

Returns

PointStyle
The created point style.

CreateSimplePointStyle(PointSymbolType, GeoColor, GeoColor, Single, Single)

Static API to create a point style.

public static PointStyle CreateSimplePointStyle(PointSymbolType pointStyle, GeoColor fillColor, GeoColor outlineColor, float outlineWidth, float size)

Parameters

pointStyle PointSymbolType
This parameter determines the PointStyle symbol type.

fillColor GeoColor
This parameter determines the PointStyle fill color.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

outlineWidth Single
This parameter determines the PointStyle outline width.

size Single
This parameter determines the PointStyle size.

Returns

PointStyle
The created point style.

CreateSimplePointStyle(PointSymbolType, GeoColor, GeoColor, Single)

Static API to create a point style.

public static PointStyle CreateSimplePointStyle(PointSymbolType pointStyle, GeoColor fillColor, GeoColor outlineColor, float size)

Parameters

pointStyle PointSymbolType
This parameter determines the PointStyle symbol type.

fillColor GeoColor
This parameter determines the PointStyle fill color.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

size Single
This parameter determines the PointStyle size.

Returns

PointStyle
The created point style.

CreateSimpleCircleStyle(GeoColor, Single)

Static API to create a circle point style.

public static PointStyle CreateSimpleCircleStyle(GeoColor fillColor, float size)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

Returns

PointStyle
The created point style.

CreateSimpleCircleStyle(GeoColor, Single, GeoColor, Single)

Static API to create a circle point style.

public static PointStyle CreateSimpleCircleStyle(GeoColor fillColor, float size, GeoColor outlineColor, float outlineWidth)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

outlineWidth Single
This parameter determines the PointStyle outline width.

Returns

PointStyle
The created point style.

CreateSimpleCircleStyle(GeoColor, Single, GeoColor)

Static API to create a circle point style.

public static PointStyle CreateSimpleCircleStyle(GeoColor fillColor, float size, GeoColor outlineColor)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

Returns

PointStyle
The created point style.

CreateSimpleSquareStyle(GeoColor, Single)

Static API to create a square point style.

public static PointStyle CreateSimpleSquareStyle(GeoColor fillColor, float size)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

Returns

PointStyle
The created point style.

CreateSimpleSquareStyle(GeoColor, Single, GeoColor)

Static API to create a square point style.

public static PointStyle CreateSimpleSquareStyle(GeoColor fillColor, float size, GeoColor outlineColor)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

Returns

PointStyle
The created point style.

CreateSimpleSquareStyle(GeoColor, Single, GeoColor, Single)

Static API to create a square point style.

public static PointStyle CreateSimpleSquareStyle(GeoColor fillColor, float size, GeoColor outlineColor, float outlineWidth)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

outlineWidth Single
This parameter determines the PointStyle outline width.

Returns

PointStyle
The created point style.

CreateSimpleStarStyle(GeoColor, Single)

Static API to create a star point style.

public static PointStyle CreateSimpleStarStyle(GeoColor fillColor, float size)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

Returns

PointStyle
The created point style.

CreateSimpleStarStyle(GeoColor, Single, GeoColor)

Static API to create a star point style.

public static PointStyle CreateSimpleStarStyle(GeoColor fillColor, float size, GeoColor outlineColor)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

Returns

PointStyle
The created point style.

CreateSimpleStarStyle(GeoColor, Single, GeoColor, Single)

Static API to create a star point style.

public static PointStyle CreateSimpleStarStyle(GeoColor fillColor, float size, GeoColor outlineColor, float outlineWidth)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

outlineWidth Single
This parameter determines the PointStyle outline width.

Returns

PointStyle
The created point style.

CreateSimpleTriangleStyle(GeoColor, Single)

Static API to create a triangle point style.

public static PointStyle CreateSimpleTriangleStyle(GeoColor fillColor, float size)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

Returns

PointStyle
The created point style.

CreateSimpleTriangleStyle(GeoColor, Single, GeoColor)

Static API to create a triangle point style.

public static PointStyle CreateSimpleTriangleStyle(GeoColor fillColor, float size, GeoColor outlineColor)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

Returns

PointStyle
The created point style.

CreateSimpleTriangleStyle(GeoColor, Single, GeoColor, Single)

Static API to create a triangle point style.

public static PointStyle CreateSimpleTriangleStyle(GeoColor fillColor, float size, GeoColor outlineColor, float outlineWidth)

Parameters

fillColor GeoColor
This parameter determines the PointStyle fill color.

size Single
This parameter determines the PointStyle size.

outlineColor GeoColor
This parameter determines the PointStyle outline color.

outlineWidth Single
This parameter determines the PointStyle outline width.

Returns

PointStyle
The created point style.

CreateCompoundCircleStyle(GeoColor, Single, GeoColor, Single, GeoColor, Single)

Static API to create a compound circle point style.

public static PointStyle CreateCompoundCircleStyle(GeoColor fillColor1, float size1, GeoColor outlineColor1, float outlineWidth1, GeoColor fillColor2, float size2)

Parameters

fillColor1 GeoColor
This parameter determines the outer circle's PointStyle fill color.

size1 Single
This parameter determines the outer circle's PointStyle size.

outlineColor1 GeoColor
This parameter determines the outer circle's PointStyle outline color.

outlineWidth1 Single
This parameter determines the outer circle's PointStyle outline width.

fillColor2 GeoColor
This parameter determines the inner circle's PointStyle fill color.

size2 Single
This parameter determines the inner circle's PointStyle size.

Returns

PointStyle
The created point style.

CreateCompoundCircleStyle(GeoColor, Single, GeoColor, Single, GeoColor, Single, GeoColor, Single)

Static API to create a compound circle point style.

public static PointStyle CreateCompoundCircleStyle(GeoColor fillColor1, float size1, GeoColor outlineColor1, float outlineWidth1, GeoColor fillColor2, float size2, GeoColor outlineColor2, float outlineWidth2)

Parameters

fillColor1 GeoColor
This parameter determines the outer circle's PointStyle fill color.

size1 Single
This parameter determines the outer circle's PointStyle size.

outlineColor1 GeoColor
This parameter determines the outer circle's PointStyle outline color.

outlineWidth1 Single
This parameter determines the outer circle's PointStyle outline width.

fillColor2 GeoColor
This parameter determines the inner circle's PointStyle fill color.

size2 Single
This parameter determines the inner circle's PointStyle size.

outlineColor2 GeoColor
This parameter determines the inner circle's PointStyle outline color.

outlineWidth2 Single
This parameter determines the inner circle's PointStyle outline width.

Returns

PointStyle
The created point style.

CreateCompoundPointStyle(PointSymbolType, GeoColor, GeoColor, Single, Single, PointSymbolType, GeoColor, GeoColor, Single, Single)

Static API to create a compound circle point style.

public static PointStyle CreateCompoundPointStyle(PointSymbolType pointStyle1, GeoColor fillColor1, GeoColor outlineColor1, float outlineWidth1, float size1, PointSymbolType pointStyle2, GeoColor fillColor2, GeoColor outlineColor2, float outlineWidth2, float size2)

Parameters

pointStyle1 PointSymbolType
This parameter determines the outer circle's pointstyle symbol type.

fillColor1 GeoColor
This parameter determines the outer circle's PointStyle fill color.

outlineColor1 GeoColor
This parameter determines the outer circle's PointStyle outline color.

outlineWidth1 Single
This parameter determines the outer circle's PointStyle outline width.

size1 Single
This parameter determines the outer circle's PointStyle size.

pointStyle2 PointSymbolType
This parameter determines the inner circle's pointstyle symbol type.

fillColor2 GeoColor
This parameter determines the inner circle's PointStyle fill color.

outlineColor2 GeoColor
This parameter determines the inner circle's PointStyle outline color.

outlineWidth2 Single
This parameter determines the inner circle's PointStyle outline width.

size2 Single
This parameter determines the inner circle PointStyle size.

Returns

PointStyle
The created point style.

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

This method draws the features on the view you provided.

protected void DrawCore(IEnumerable<Feature> features, GeoCanvas canvas, Collection<SimpleCandidate> labelsInThisLayer, Collection<SimpleCandidate> labelsInAllLayers)

Parameters

features IEnumerable<Feature>
This parameter represents the features you want to draw on the view.

canvas GeoCanvas
This parameter represents the view you want to draw the features on.

labelsInThisLayer Collection<SimpleCandidate>
The labels will be drawn in the current layer only.

labelsInAllLayers Collection<SimpleCandidate>
The labels will be drawn in all layers.

Exceptions

InvalidOperationException
In the event you attempt to call this method when the GeoCanvas's IsDrawing mode is false, it will throw an InvalidOperationException.

ArgumentNullException
If you pass a null as the view, we will throw an ArgumentNullException.

ArgumentNullException
If you pass a null as the features, we will throw an ArgumentNullException.

ArgumentNullException
If symbolPen is null, we will throw an ArgumentNullException.

ArgumentNullException
If symbolSolidBrush is null, we will throw an ArgumentNullException.

ArgumentNullException
If characterSolidBrush is null, we will throw an ArgumentNullException.

ArgumentNullException
If glyphFont is null, we will throw an ArgumentNullException.

ArgumentOutOfRangeException
If you pass in a pointSymbolType that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

ArgumentOutOfRangeException
If you pass in a pointType that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

ArgumentOutOfRangeException
If you pass in a imageScale that is less or equal to 0, it will throw an ArgumentOutOfRangeException.

Remarks:

This overridden method is called from the concrete public method Draw. In this method, we take the features you passed in and draw them on the view you provided. Each style (based on its properties) may draw each feature differently.


When overriding this method, consider each feature and its column data values. You can use the full power of the GeoCanvas to do the drawing. If you need column data for a feature, be sure to override the GetRequiredColumnNamesCore and add the columns you need to the collection. In many of the styles, we add properties to allow the user to specify which field they need; then, in the GetRequiredColumnNamesCore, we read that property and add it to the collection.

DrawSampleCore(GeoCanvas, DrawingRectangleF)

This method draws a sample feature on the view you provided.

protected void DrawSampleCore(GeoCanvas canvas, DrawingRectangleF drawingExtent)

Parameters

canvas GeoCanvas
This parameter represents the view you want to draw the features on.

drawingExtent DrawingRectangleF

Exceptions

ArgumentNullException
If you pass a null as the view, we will throw an ArgumentNullException.

InvalidOperationException
In the event you attempt to call this method when the GeoCanvas's IsDrawing mode is false, it will throw an InvalidOperationException.

Remarks:

This virtual method is called from the concrete public method Draw. In this method, we draw a sample style on the view you provided. This is typically used to display a legend or other sample area.

When implementing this virtual method, consider the view size and draw the sample image appropriately. You should keep in mind that the sample typically shows up on a legend.

DrawSymbol(PointSymbolType, Feature, GeoCanvas, GeoBrush, GeoPen, Single, Single)

protected void DrawSymbol(PointSymbolType symbolType, Feature feature, GeoCanvas canvas, GeoBrush geoBrush, GeoPen geoPen, float symbolSize, float rotationAngle)

Parameters

symbolType PointSymbolType

feature Feature

canvas GeoCanvas

geoBrush GeoBrush

geoPen GeoPen

symbolSize Single

rotationAngle Single

DrawImage(GeoImage, Feature, GeoCanvas, Single, Single)

protected void DrawImage(GeoImage geoImage, Feature feature, GeoCanvas canvas, float symbolSize, float rotationAngle)

Parameters

geoImage GeoImage

feature Feature

canvas GeoCanvas

symbolSize Single

rotationAngle Single

DrawGlyph(GeoFont, String, Feature, GeoCanvas, GeoBrush, GeoPen, Single, Single)

protected void DrawGlyph(GeoFont glyphFont, string glyphConent, Feature pointFeature, GeoCanvas canvas, GeoBrush geoBrush, GeoPen geoPen, float symbolSize, float rotationAngle)

Parameters

glyphFont GeoFont

glyphConent String

pointFeature Feature

canvas GeoCanvas

geoBrush GeoBrush

geoPen GeoPen

symbolSize Single

rotationAngle Single