Back to Devexpress

Colorizers

windowsforms-15083-controls-and-libraries-map-control-vector-data-colorizers.md

latest7.5 KB
Original Source

Colorizers

  • Aug 31, 2022
  • 4 minutes to read

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

The document consists of the following sections.

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 MapItem.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 do the following:

1) Specify how the vector items layer will obtain the map shapes to color.

This can be done in two ways:

For instance, to specify a path to the Shapefile at design time, do the following:

  • Click the smart tag of the Map control to invoke its actions list. In the invoked actions list, click the Load from Shapefile link.

  • In the invoked dialog, specify a path to the Shapefile.

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

Currently, the following colorizer types are supported:

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, it is necessary to create one of the MapColorizer class descendants and assign it to the VectorItemsLayer.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.

Choropleth Colorizer

To customize the Choropleth colorizer, do the following:

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.

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

To learn more about how to colorize map contours from a Shapefile, refer to How to: Colorize Map Contours Using the Choropleth Colorizer.

Graph Colorizer

To colorize map contours, specify a set of color items using the GraphColorizer.ColorItems property.

As a result, the map contours appear as follows.

This example shows how to use the graph colorizer at run time: How to: Colorize Map Contours Using the Graph Colorizer.

Key-Color Colorizer

To colorize Map shapes using 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 key-color colorizer, refer to How to: Colorize Map Items Using the Key Color Colorizer.

See Also

Vector Items