Version

Using Value Scales

The MapLayer objects ValueScale allows you to specify a mapping of values from MapElement object to numerical values or brushes depending on the value scale you provide. You may set these properties manually or have the XamMap control set them automatically by setting the IsAutoRange property.

You need a ValueScale object when using the Choropleth fill mode. Choropleth mode allows you to color the elements of xamMap according to their values.

There are 3 different types of Value Scales: Linear, Logarithmic, and Distribution.

Linear Value Scale

The LinearScale object allows you to map values linearly. Set the MinimumValue and MaximumValue properties to designate the range of values to use.

Logarithmic Value Scale

The LogarithmicScale object maps values using a logarithmic function. This allows you to more distinctly show values that are largely dispersed. Again, set the MinimumValue and MaximumValue properties to set the range of values to use.

Distribution Value Scale

The DistributionScale object allows you to group elements according to their values. You can specify a set of ranges to use; map elements with values belonging to a certain range are grouped together. Use the ValueStops and ValueStopCount properties to set the desired ranges.

For automatic value distribution, set the IsAutoRange property to True and assign the ValueStopCount property a number. ValueStopCount specifies the number of values used to designate the different ranges. The values are determined automatically.

Color Elements Using Distribution Value Scale

The xamMap control can place elements into groups with similar values. This allows you to define a distinct look or behavior for each group. You can group elements using Choropleth mode along with a Distribution Value Scale.

With a DistributionScale object, you can specify a set of value ranges to group elements into; map elements that have values belonging to a particular range are grouped together. Use the ValueStops and ValueStopCount properties to set the desired ranges.

Automatic

For automatic value distribution, set the IsAutoRange property to True and then assign a numeric value to the ValueStopCount property. The ValueStopCount property specifies the number of values used to designate the different ranges; these values are determined automatically.

Manual

To manually specify a set of ranges, set the ValueStops property to a space delimited string of values.

The following code snippets show you how to set automatic value distribution as well as define your own values. In the first snippet, the ValueStopCount property is used to automatically set the value distribution. In the second snippet, the ValueStops property is used to explicitly define a range of values.

In XAML:

<igMap:MapLayer.Brushes>
   <ig:BrushCollection>
      <SolidColorBrush Color="Blue" />
      <SolidColorBrush Color="Green" />
      <SolidColorBrush Color="Yellow" />
      <SolidColorBrush Color="Red" />
   </ig:BrushCollection>
</igMap:MapLayer.Brushes>
<igMap:MapLayer.ValueScale>
   <igMap:DistributionScale IsAutoRange="True"
                            ValueStopCount="6" />
</igMap:MapLayer.ValueScale>
XamMap Color Group Elements Using Distribution Value Scale 01.png

In XAML:

<igMap:MapLayer.Brushes>
   <ig:BrushCollection>
      <SolidColorBrush Color="ForestGreen" />
      <SolidColorBrush Color="Orange" />
      <SolidColorBrush Color="Red" />
      <SolidColorBrush Color="DarkRed" />
   </ig:BrushCollection>
</igMap:MapLayer.Brushes>
<igMap:MapLayer.ValueScale>
   <igMap:DistributionScale IsAutoRange="
                            ValueStops="0 100 200 300 400 500" />
</igMap:MapLayer.ValueScale>
XamMap Color Group Elements Using Distribution Value Scale 02.png