Performance Issues with large number of data points

2 posts, 0 answers
  1. Josh Eastburn
    Josh Eastburn avatar
    32 posts
    Member since:
    Aug 2012

    Posted 04 Nov 2011 Link to this post

    I am using the RadMap with the BingMapProvider.
    I have an InformationLayer that is bound to a large collection of objects that have a Location property.  This setup is working well with fewer than 1,000 data points, but if I have more than that, it becomes very slow and almost unusable.  The goal is to try to plot 15,000 - 20,000 points on a map.

    Do you have any recommendations for improving performance in these situations?

    Some code snippets:

    <DataTemplate x:Key="mapPinTemplate">
        <Grid x:Name="HotSpotGrid" telerik:MapLayer.Location="{Binding Location}">
                <telerik:HotSpot X="0.5" Y="0.5" ElementName="PART_HotSpot" />
            <Border x:Name="PART_HotSpot" Grid.Row="1" Grid.Column="0" Width="10" Height="10">
                <Ellipse Fill="{Binding FlagColor}" StrokeThickness="1" Stroke="Black" />

    <telerik:RadMap x:Name="rmMap"
        MouseClickMode="None" Margin="0,0,0,2"
        <telerik:InformationLayer x:Name="informationLayer" Visibility="Collapsed"
            ItemsSource="{Binding GeoDataCVS.View}"
            ItemTemplate="{StaticResource mapPinTemplate}">

  2. Andrey
    Andrey avatar
    1681 posts

    Posted 07 Nov 2011 Link to this post

    Hello Josh Eastburn,

    The rendering performance can be insufficient when you add a lot of points on the map. We could propose using the dynamic layer for loading shapes according to zoom level and region. Please take a look at the Using Dynamic Layer topic of our documentation and the Items Virtualization example.

    However the dynamic layer adds/removes items dynamically. It works with squares which are calculated according to its ZoomGridList. When a square appears within the visible area of map then the dynamic layer adds its items onto the view. When a square gets out from visible area then the dynamic layer removes its items.
    During the panning a few squares can change its visibility. When squares contain a lot of points then this process takes a long time. In fact it could be a problem when the number of shapes which are returned in the CompleteItemsRequest more than 50-100. Also the DynamicLayer does not support data binding to the ItemsSource property.

    As alternative way in your case you can use an additional collection which will contain items which are within the viewport only. I recommend that you use a LINQ query in separate thread to select items which are within the viewport.
    I have attached a sample solution. It uses 200000 points. And it allows displaying up to 500 items at the same time on the map. I hope it helps.

    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top