WinForms & WPF Map Control - Clustering (Coming soon in v15.2)

Thinking Out Loud
17 November 2015

Set for release in v15.2 is clustering support for both our WinForms and WPF Map Controls. For those unfamiliar with this feature, its designed to aggregate map items and perform data density analysis.

WinForms and WPF Map Control - Data Clustering

Once shipped, the DevExpress Map Control will support 2 clustering algorithms:

  • Distance Based: joins items - whose separation is smaller than a specified threshold - into a single cluster. The cluster's indicator is calculated as the mean of items.
  • Marker: joins items - whose distance to the central item is smaller than a specified threshold - into a single cluster. The cluster indicator matches the central item.

You can also implement a custom clustering algorithm by inheriting from the MapClustererBase class (WPF) or implementing the IClusterer (WinForms) interface.


Predefined clusterers allow you to separate items into groups prior to clustering (for instance, to group items by attribute values before clustering).

WinForms & WPF Map Control - Clustering Groups

It's relatively straightforward to implement this feature for our WPF Map Control - You simply assign the MapClustererGroupProviderBase class descendant object to the GroupProvider property:

            <dxm:AttributeGroupProvider AttributeName="LocationName"/>

If you're using the WinForms version of our Map Control, you would assign an object implementing the IClustererGroupProvider interface to the GroupProvider property:

ListSourceDataAdapter vectorDataAdapter = new ListSourceDataAdapter();
// Several data adapter configurations...
vectorDataAdapter.Clusterer = new DistanceBasedClusterer {
    GroupProvider = new AttributeGroupProvider { AttributeName = "LocationName" }

Custom Indicators

As you'd expect, you can customize cluster indicators as needed (by using custom cluster item factories for WinForms or item settings for WPF).

WinForms & WPF Map Control - Custom Clustering Indicators

To customize indicators for the WinForms Map Control, use the clusterer's SetClusterFactory(IClusterItemFactory) method to specify the factory used to generate cluster indicators:

public class CustomClusterItemFactory : IClusterItemFactory {
// Code to generate items...
// Additional Code...
clusterer.SetClusterItemFactory(new CustomClusterItemFactory());

For WPF, specify the required MapItemSetting class descendant object to the ClusterSettings property of the clusterer:

        <dxm:MapCustomElementSettings ContentTemplate="{Binding Source={StaticResource itemTemplate}}"/>


We'd love to get your feedback on this new Map Clustering feature. How likely are you to use it in your next WinForms or WPF project?

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.