Skip to main content
A newer version of this page is available. .

AttributeItemKeyProvider Class

This class is used to provide an MapItem objects argument value as a key for the KeyColorColorizer to colorize these items.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v18.1.dll

Declaration

public class AttributeItemKeyProvider :
    NamedAttributeProviderBase,
    IColorizerItemKeyProvider

Example

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

    // Create a vector layer and add it to the map.
    VectorItemsLayer hotelLayer = new VectorItemsLayer() {
        Data = CreateData(),
        Colorizer = CreateColorizer()
    };
    map.Layers.Add(hotelLayer);
// Creates a key color colorizer.
private MapColorizer CreateColorizer() {
    KeyColorColorizer colorizer = new KeyColorColorizer() {
        ItemKeyProvider = new AttributeItemKeyProvider() { AttributeName = "CATEGORY" },
        PredefinedColorSchema = PredefinedColorSchema.Palette
    };

    colorizer.Keys.Add(new ColorizerKeyItem() { Key = 1, Name = "Restaurant" });
    colorizer.Keys.Add(new ColorizerKeyItem() { Key = 2, Name = "Business room" });
    colorizer.Keys.Add(new ColorizerKeyItem() { Key = 3, Name = "Bathroom" });
    colorizer.Keys.Add(new ColorizerKeyItem() { Key = 4, Name = "Living room" });
    colorizer.Keys.Add(new ColorizerKeyItem() { Key = 5, Name = "Other" });
    colorizer.Keys.Add(new ColorizerKeyItem() { Key = 6, Name = "Service room" });
    colorizer.Keys.Add(new ColorizerKeyItem() { Key = 7, Name = "Pool" });
    colorizer.Keys.Add(new ColorizerKeyItem() { Key = 8, Name = "Gym" });

    return colorizer;
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AttributeItemKeyProvider class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
NamedAttributeProviderBase
AttributeItemKeyProvider
See Also