User Tools

Site Tools


thinkgeo.mapsuite.windowsphonecore.classbreakstyle

ThinkGeo.MapSuite.WindowsPhoneCore.ClassBreakStyle

Note: The page was created before Map Suite 10. Map Suite 10.0 organized many classes into new namespaces and assemblies as well as had a few minor breaks in compatibility. The majority of previously built code should work without modification assuming the new namespaces are added. For guidance on upgrading your existing code, please check out MapSuite 10 Upgrade Guide.

<!– Class –> This class represents a style based on class break values.

Remarks

The ClassBreakStyle allows you to change the way features are drawn based on their data values. It is often useful for you to display features differently based on ranges of numeric values. For example, you may have a states ShapeFile that has the populations of each state as part of its data. You may then want to color states differently based on their population. The ClassBreakStyle allows you to do this.

How class breaks work:

You add a number of ClassBreak classes to the ClassBreak collection. The numeric values of the breaks are important and you must place the breaks in numerical order. For example, break 0 must be added before break 100. In each ClassBreak, you specify the style you want to represent that break. Additionally, in the ColumnName property, you specify the name of the column where we will find the data used to compare the breaks. The column name must point to a column that is numeric.

When we proceed to draw the style, we look through the ClassBreaks and select the ClassBreak that is where the features column data is greater than and closest to the break value.

Example:

Feature Value = 42

ClassBreak1.Value = 0 ClassBreak2.Value = 20 ClassBreak3.Value = 40 ClassBreak4.Value = 60

In this case, the break closest to the feature value without exceeding it is ClassBreak3(40). If the feature value had been less than zero, nothing would have been drawn. If the feature value were 1000, then ClassBreak4 would draw.

If you wanted to represent a value that is less then zero, you could do that as shown in the sample below.

Feature Value = -1

ClassBreak1.Value = Double.Min ClassBreak2.Value = 0 ClassBreak3.Value = 20 ClassBreak4.Value = 40

In this example, the first class break would be used.

Inheritance Hierarchy

Members Summary

Public Constructors

Name Parameters DeclaringType Summary
Public MethodClassBreakStyle This is the constructor for this class.
Public MethodClassBreakStyle String This is the constructor for this class.
Public MethodClassBreakStyle String, BreakValueInclusion This is the constructor for this class.
Public MethodClassBreakStyle String, BreakValueInclusion, Collection<ClassBreak> This is the constructor for this class.

Protected Constructors

Name Parameters DeclaringType Summary

Public Methods

Name Parameters DeclaringType Summary
Public MethodDraw IEnumerable<BaseShape>, GeoCanvas, Collection<SimpleCandidate>, Collection<SimpleCandidate> Style This method draws the shapes on the canvas you provided.
Public MethodDraw IEnumerable<Feature>, GeoCanvas, Collection<SimpleCandidate>, Collection<SimpleCandidate> Style This method draws the features on the canvas you provided.
Public MethodDrawSample GeoCanvas, DrawingRectangleF Style
Public MethodEquals Object Object
Public MethodGetHashCode Object
Public MethodGetRequiredColumnNames Style This method returns the column data for each feature that is required for the style to properly draw.
Public MethodGetType Object
Public MethodToString Object

Protected Methods

Name Parameters DeclaringType Summary
Protected MethodDrawCore IEnumerable<Feature>, GeoCanvas, Collection<SimpleCandidate>, Collection<SimpleCandidate> Style(overriden) This method draws the features on the canvas you provided.
Protected MethodDrawSampleCore GeoCanvas, DrawingRectangleF Style
Protected MethodFinalize Object
Protected MethodGetRequiredColumnNamesCore Style(overriden) This method returns the column data for each feature that is required for the style to properly draw.
Protected MethodMemberwiseClone Object

Public Properties

Name Return DeclaringType Summary
Public PropertyBreakValueInclusion BreakValueInclusion This property gets and sets the value of if the break values are included in the break calculation.
Public PropertyClassBreaks Collection<ClassBreak> This property gets the collection of class breaks.
Public PropertyColumnName String This property gets and sets the column name in the FeatureSource where the data will be found for each feature.
Public PropertyIsActive Boolean Style This property gets and sets the active status of the style.
Public PropertyName String Style This property gets and set the name of the style.
Public PropertyRequiredColumnNames Collection<String> Style This property gets the collection of fields that are required for the style.

Protected Properties

Name Return DeclaringType Summary

Public Events

Name Event Arguments DeclaringType Summary

Public Constructors

ClassBreakStyle()

This is the constructor for this class.

Parameters

Name Type Description

Go Back

ClassBreakStyle(String)

This is the constructor for this class.

Overloads

This constructor allows you to specify the column name of the column that will be used for the break values.

Parameters

Name Type Description
columnName String<!– System.String –> This parameter is the column name of the column that will be used for the break values.

Go Back

ClassBreakStyle(String, BreakValueInclusion)

This is the constructor for this class.

Overloads

This constructor allows you to specify the column name of the column that will be used for the break values. It also lets you specify whether the break value is included in the class break calculation.

Parameters

Name Type Description
columnName String<!– System.String –> This parameter is the column name of the column that will be used for the break values.
breakValueInclusion BreakValueInclusion<!– ThinkGeo.MapSuite.WindowsPhoneCore.BreakValueInclusion –> This parameter lets you specify whether the break value is included in the class break calculation.

Go Back

ClassBreakStyle(String, BreakValueInclusion, Collection<ClassBreak>)

This is the constructor for this class.

Overloads

This constructor allows you to specify the column name of the column that will be used for the break values. It also lets you specify whether the break value is included in the class break calculation.

Parameters

Name Type Description
columnName String<!– System.String –> This parameter is the column name of the column that will be used for the break values.
breakValueInclusion BreakValueInclusion<!– ThinkGeo.MapSuite.WindowsPhoneCore.BreakValueInclusion –> This parameter lets you specify whether the break value is included in the class break calculation.
classBreaks Collection<ClassBreak><!– System.Collections.ObjectModel.Collection{ThinkGeo.MapSuite.WindowsPhoneCore.ClassBreak} –> The parameter represents the class break that will determine which style to be used on the break values. Please see the ClassBreakStyle class remarks for a full description of how the ClassBreakStyle works.

Go Back

Protected Constructors

Public Methods

Draw(IEnumerable<BaseShape>, GeoCanvas, Collection<SimpleCandidate>, Collection<SimpleCandidate>)

This method draws the shapes on the canvas you provided.

Remarks

This method is the concrete wrapper for the abstract method DrawCore. In this method, we take the shapes you passed in and draw them on the canvas you provided. Each style (based on its properties) may draw each shape differently.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description
shapes IEnumerable<BaseShape><!– System.Collections.Generic.IEnumerable{ThinkGeo.MapSuite.WindowsPhoneCore.BaseShape} –> This parameter represents the shapes you want to draw on the canvas.
canvas GeoCanvas<!– ThinkGeo.MapSuite.WindowsPhoneCore.GeoCanvas –> This parameter represents the canvas you want to draw the shapes on.
labelsInThisLayer Collection<SimpleCandidate><!– System.Collections.ObjectModel.Collection{ThinkGeo.MapSuite.WindowsPhoneCore.SimpleCandidate} –> The labels will be drawn in the current layer only.
labelsInAllLayers Collection<SimpleCandidate><!– System.Collections.ObjectModel.Collection{ThinkGeo.MapSuite.WindowsPhoneCore.SimpleCandidate} –> The labels will be drawn in all layers.

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style –> Go Back

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

This method draws the features on the canvas you provided.

Remarks

This method is the concrete wrapper for the abstract method DrawCore. In this method, we take the features you passed in and draw them on the canvas you provided. Each style (based on its properties) may draw each feature differently.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description
features IEnumerable<Feature><!– System.Collections.Generic.IEnumerable{ThinkGeo.MapSuite.WindowsPhoneCore.Feature} –> This parameter represents the features you want to draw on the canvas.
canvas GeoCanvas<!– ThinkGeo.MapSuite.WindowsPhoneCore.GeoCanvas –> This parameter represents the canvas you want to draw the features on.
labelsInThisLayer Collection<SimpleCandidate><!– System.Collections.ObjectModel.Collection{ThinkGeo.MapSuite.WindowsPhoneCore.SimpleCandidate} –> The labels will be drawn in the current layer only.
labelsInAllLayers Collection<SimpleCandidate><!– System.Collections.ObjectModel.Collection{ThinkGeo.MapSuite.WindowsPhoneCore.SimpleCandidate} –> The labels will be drawn in all layers.

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style –> Go Back

DrawSample(GeoCanvas, DrawingRectangleF)

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description
canvas GeoCanvas<!– ThinkGeo.MapSuite.WindowsPhoneCore.GeoCanvas –>
drawingExtent DrawingRectangleF<!– ThinkGeo.MapSuite.WindowsPhoneCore.DrawingRectangleF –>

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style –> Go Back

Equals(Object)

Return Value

Return Type Description
Boolean<!– System.Boolean –>

Parameters

Name Type Description
obj Object<!– System.Object –>

<!– System.Object –> Go Back

GetHashCode()

Return Value

Return Type Description
Int32<!– System.Int32 –>

Parameters

Name Type Description

<!– System.Object –> Go Back

GetRequiredColumnNames()

This method returns the column data for each feature that is required for the style to properly draw.

Remarks

This method is the concrete wrapper for the abstract method GetRequiredColumnNamesCore. In this method, we return the column names that are required for the style to draw the feature properly. For example, if you have a style that colors areas blue when a certain column value is over 100, then you need to be sure you include that column name. This will ensure that the column data is returned to you in the feature when it is ready to draw.

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.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
Collection<String><!– System.Collections.ObjectModel.Collection{System.String} –> This method returns a collection of column names that the style needs.

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style –> Go Back

GetType()

Return Value

Return Type Description
Type<!– System.Type –>

Parameters

Name Type Description

<!– System.Object –> Go Back

ToString()

Return Value

Return Type Description
String<!– System.String –>

Parameters

Name Type Description

<!– System.Object –> Go Back

Protected Methods

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

This method draws the features on the canvas you provided.

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 canvas 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.

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description
features IEnumerable<Feature><!– System.Collections.Generic.IEnumerable{ThinkGeo.MapSuite.WindowsPhoneCore.Feature} –> This parameter represents the features you want to draw on the canvas.
canvas GeoCanvas<!– ThinkGeo.MapSuite.WindowsPhoneCore.GeoCanvas –> This parameter represents the canvas you want to draw the features on.
labelsInThisLayer Collection<SimpleCandidate><!– System.Collections.ObjectModel.Collection{ThinkGeo.MapSuite.WindowsPhoneCore.SimpleCandidate} –> The labels will be drawn in the current layer only.
labelsInAllLayers Collection<SimpleCandidate><!– System.Collections.ObjectModel.Collection{ThinkGeo.MapSuite.WindowsPhoneCore.SimpleCandidate} –> The labels will be drawn in all layers.

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style(overriden) –> Go Back

DrawSampleCore(GeoCanvas, DrawingRectangleF)

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description
canvas GeoCanvas<!– ThinkGeo.MapSuite.WindowsPhoneCore.GeoCanvas –>
drawingExtent DrawingRectangleF<!– ThinkGeo.MapSuite.WindowsPhoneCore.DrawingRectangleF –>

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style –> Go Back

Finalize()

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description

<!– System.Object –> Go Back

GetRequiredColumnNamesCore()

This method returns the column data for each feature that is required for the style to properly draw.

Remarks

This abstract method is called from the concrete public method GetRequiredFieldNames. In this method, we return the column names that are required for the style to draw the feature properly. For example, if you have a style that colors areas blue when a certain column value is over 100, then you need to be sure you include that column name. This will ensure that the column data is returned to you in the feature when it is ready to draw.

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.

Return Value

Return Type Description
Collection<String><!– System.Collections.ObjectModel.Collection{System.String} –> This method returns a collection of the column names that it needs.

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style(overriden) –> Go Back

MemberwiseClone()

Return Value

Return Type Description
Object<!– System.Object –>

Parameters

Name Type Description

<!– System.Object –> Go Back

Public Properties

BreakValueInclusion

This property gets and sets the value of if the break values are included in the break calculation.

Remarks

Example: If you have a class break value set to 100 and the break value is included, then 100 is included for this break. If you set the value to excluded, then 100 would match with the break below 100 instead.

Please see the ClassBreakStyle class remarks for a full description of how the ClassBreakStyle works.

Return Value

Return Type
BreakValueInclusion<!– ThinkGeo.MapSuite.WindowsPhoneCore.BreakValueInclusion –>

<!– ThinkGeo.MapSuite.WindowsPhoneCore.ClassBreakStyle –> Go Back

ClassBreaks

This property gets the collection of class breaks.

Remarks

The class breaks determine which style to use, based on the break values.

Please see the ClassBreakStyle class remarks for a full description of how the ClassBreakStyle works.

Return Value

Return Type
Collection<ClassBreak><!– System.Collections.ObjectModel.Collection{ThinkGeo.MapSuite.WindowsPhoneCore.ClassBreak} –>

<!– ThinkGeo.MapSuite.WindowsPhoneCore.ClassBreakStyle –> Go Back

ColumnName

This property gets and sets the column name in the FeatureSource where the data will be found for each feature.

Remarks

You use this property to set the name of the column where the numeric data is stored for your features.

Return Value

Return Type
String<!– System.String –>

<!– ThinkGeo.MapSuite.WindowsPhoneCore.ClassBreakStyle –> Go Back

IsActive

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

Remarks

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

Return Value

Return Type
Boolean<!– System.Boolean –>

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style –> Go Back

Name

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

Return Value

Return Type
String<!– System.String –>

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style –> Go Back

RequiredColumnNames

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.

Return Value

Return Type
Collection<String><!– System.Collections.ObjectModel.Collection{System.String} –>

<!– ThinkGeo.MapSuite.WindowsPhoneCore.Style –> Go Back

Protected Properties

Public Events

thinkgeo.mapsuite.windowsphonecore.classbreakstyle.txt · Last modified: 2017/03/16 21:59 (external edit)