[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Collapse]Map Control
   [Expand]Getting Started
    Layers
   [Expand]Coordinate Systems
   [Expand]Map Image Data
   [Expand]GIS Data
   [Collapse]Vector Data
    [Expand]Providing Data
     Colorizers
     Clusterers
   [Expand]Visual Elements
   [Expand]End-User Interaction
   [Expand]Examples
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Colorizers

This document introduces the Map Colorizer, lists colorizer types, and explains how to create a colorizer and customize its settings in a map control.

The document consists of the following sections.

Expanded Overview

The Colorizer is used to automatically choose colors for map shapes based on shape data. This feature can be applied to the following MapShape class descendants that utilize the MapShapeBase.Fill property:

For example, you can use the map colorizer to create GDP, population or political maps.

Before using this feature, you will need to perform the following steps.

1) Specify the map control's vector data.

For this, assign a MapDataAdapterBase class descendant object to the VectorLayer.Data property.

For example, let us use the ShapefileDataAdapter and specify a path to the Shapefile at design time. To do this, do the following.

  • Click the MapControl's smart tag to invoke its Tasks list.
  • In the Tasks list, click the Load Shapes from Shapefile link.

This automatically generates the following XAML:

2) Choose which colorizer type should be used in your application.

Currently, the following colorizer types are supported:

  • ChoroplethColorizer

    Represents the Choropleth colorizer, which shows statistical data over predefined regions (such as counties or states) by coloring or shading these regions.

  • GraphColorizer

    Represents the Graph colorizer, which paints shapes that have a common border using different colors according to the Graph Coloring approach. For instance, the Graph colorizer can be used to create a political map.

  • KeyColorColorizer

    Represents the Key-Color colorizer, which paints shapes according to their keys. The Key-Color colorizer can be used to add statistical information to a map.

Note

Shapes that have been obtained from a KML file can only be colored by the Graph Colorizer.

To add the colorizer to the map control, assign one of the MapColorizer class descendants to the VectorLayer.Colorizer property of the appropriate vector layer.

After you select a colorizer type, you can customize the map colorizer settings. The sections below describe how this can be done.

Expanded Choropleth Colorizer

To customize the choropleth colorizer, perform the following steps:

The following XAML shows how this can be done.

Note that when the map control obtains data from a Shapefile, the vector item attributes are generated automatically. Thus, you can select which attribute should be used in your application. If an application uses manually generated map items, specify that the attributes of these items use the choropleth colorizer.

The image below shows the choropleth colorizer with a color scale legend that colors map contours based on GDP data from the Shapefile.

Example

To learn more about how to colorize map contours loaded from a Shapefile, see the following example.

Expanded Graph Colorizer

To colorize map contours, specify a set of colors via the MapColorizer.Colors property.

As a result, the map contours may appear as follows:

Example

This example shows how to use the graph colorizer.

Expanded Key-Color Colorizer

To colorize Map shapes using a key-color colorizer, do the following.

As a result, the map shapes appear as follows.

To learn more about how to colorize map items using a key-color colorizer, refer to How to: Colorize Map Items Using the Key Color Colorizer.

Expanded See Also

Is this topic helpful?​​​​​​​