Clustered Data Source

2 posts, 0 answers
  1. Adnan
    Adnan avatar
    5 posts
    Member since:
    Jul 2011

    Posted 20 Jul 2012 Link to this post


    I'm currently exploring the use of the Clustered Data Source to improve performance when displaying a large number of map items.

    Can the Clustered Data Source be setup so that it is only active for certain zoom levels?

    The scenario is displaying a very large number of map items, when you are zoomed out, a number of points overlap and rather then having these all displayed, the Clustered Data Source would be used.  However when zoomed in to Zoom Level 15 >, we would want all the map items displayed without any Clustered Data Source.

    Many Thanks,

  2. Andrey
    Andrey avatar
    1681 posts

    Posted 24 Jul 2012 Link to this post

    Hello Adnan,

    No, you can't do it this way. But there is another approach which you can use. 

    Clustered data source provides functionality for grouping of the geographic locations using some criteria.The default implementation uses distance in degrees between 2 locations as grouping condition. It can be changed at any time by creation of the new class which implements IClusterItemGenerator or which inherits from the ClusterItemGenerator class (the default built-in implementation of the grouping condition). For example:

    /// <summary>
    /// Custom cluster item generator.
    /// </summary>
    public class CustomClusterItemGenerator : ClusterItemGenerator
        public override bool IsItemInClusterRegion(ClusterItem cluster, object dataItem, int zoomLevel)
            if (zoomLevel >= 10)
                return false;
                return base.IsItemInClusterRegion(cluster, dataItem, zoomLevel);

    public MainWindow()
        ClusteredDataSource dataSource = this.informationLayer.ClusteredDataSource;
        CustomClusterItemGenerator generator = new CustomClusterItemGenerator();
        dataSource.ClusterItemGenerator = generator;

    All the best,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top