This is a migrated thread and some comments may be shown as answers.

Performance Issues with large number of data points

1 Answer 96 Views
Map
This is a migrated thread and some comments may be shown as answers.
Josh Eastburn
Top achievements
Rank 1
Josh Eastburn asked on 04 Nov 2011, 10:32 PM
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:MapLayer.HotSpot>
            <telerik:HotSpot X="0.5" Y="0.5" ElementName="PART_HotSpot" />
        </telerik:MapLayer.HotSpot>
 
        <Border x:Name="PART_HotSpot" Grid.Row="1" Grid.Column="0" Width="10" Height="10">
            <Ellipse Fill="{Binding FlagColor}" StrokeThickness="1" Stroke="Black" />
        </Border>
 
    </Grid>
</DataTemplate>


<telerik:RadMap x:Name="rmMap"
    MinHeight="200"
    MinWidth="200"
    InitializeCompleted="rmMap_InitializeCompleted"
    telerik:StyleManager.Theme="Metro"
    AllowedCommands="Road,Aerial"
    MouseClickMode="None" Margin="0,0,0,2"
    UseDefaultLayout="False">
    <telerik:InformationLayer x:Name="informationLayer" Visibility="Collapsed"
        ItemsSource="{Binding GeoDataCVS.View}"
        ItemTemplate="{StaticResource mapPinTemplate}">
    </telerik:InformationLayer>
</telerik:RadMap>


Thanks,
Josh

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 07 Nov 2011, 03:59 PM
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.
http://www.telerik.com/help/silverlight/radmap-features-dynamic-layer.html
http://demos.telerik.com/silverlight/#Map/DynamicLayer

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.

Regards,
Andrey Murzov
the Telerik team

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

Tags
Map
Asked by
Josh Eastburn
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or