Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ColorizerKeyCollection Class

A collection of ColorizerKeyItem objects.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public class ColorizerKeyCollection :
    NotificationCollection<ColorizerKeyItem>,
    IList<IKeyItem>,
    ICollection<IKeyItem>,
    IEnumerable<IKeyItem>,
    IEnumerable

The following members return ColorizerKeyCollection objects:

#Remarks

An object of this class can be accessed using the KeyColorColorizer.Keys property.

#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;
}
See Also