Skip to main content
All docs
V24.1

IClusterItemFactory.CustomizeCluster(MapItem) Method

Allows you to configure a cluster element before it is rendered on the map.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.1.dll

NuGet Package: DevExpress.Win.Map

Declaration

void CustomizeCluster(
    MapItem cluster
)

Parameters

Name Type Description
cluster MapItem

A map item that denotes a cluster.

Remarks

The following example uses the CustomizeCluster method to format cluster element titles. Each cluster’s title displays the number of items that the cluster contains:

View Example: Map Control for WinForms - How to Use Clusterers to Aggregate Vector Items

        clusterer.SetClusterItemFactory(new CustomClusterItemFactory());
        // ...
class CustomClusterItemFactory : IClusterItemFactory {
    public MapItem CreateClusterItem(IList<MapItem> objects) {
        return new MapDot();
    }

    public void CustomizeCluster(MapItem cluster) {
        ((MapDot)cluster).TitleOptions.Pattern = cluster.ClusteredItems.Count.ToString();
    }
}
See Also