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.

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.
Groups
Predefined clusterers allow you to separate items into groups prior to clustering (for instance, to group items by attribute values before clustering).

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:ListSourceDataAdapter.Clusterer>
<dxm:DistanceBasedClusterer>
<dxm:DistanceBasedClusterer.GroupProvider>
<dxm:AttributeGroupProvider AttributeName="LocationName"/>
</dxm:DistanceBasedClusterer.GroupProvider>
</dxm:DistanceBasedClusterer>
</dxm:ListSourceDataAdapter.Clusterer>
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).

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:DistanceBasedClusterer>
<dxm:DistanceBasedClusterer.ClusterSettings>
<dxm:MapCustomElementSettings ContentTemplate="{Binding Source={StaticResource itemTemplate}}"/>
</dxm:DistanceBasedClusterer.ClusterSettings>
</dxm:DistanceBasedClusterer>
===========================
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.