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

Map works slow

3 Answers 252 Views
Map
This is a migrated thread and some comments may be shown as answers.
Javor
Top achievements
Rank 1
Javor asked on 24 Nov 2017, 07:49 AM

We have VisualizationLayer which has ~2400 item that make moving around the map is very slow 
he is code example the resource is DrawingBrush with 2 GeometryDrawing one is arrow another is circle with stroke and fill in different colors. When the zoom level is low (you see more of the map) the map works very slowly. Can you tell me some solution for that?

 

01.<telerik:VisualizationLayer ItemsSource="{Binding items}">
02.                   <telerik:VisualizationLayer.ItemTemplate>
03.                       <DataTemplate>
04.                           <Rectangle Fill="{DynamicResource resource}"
05.                                      telerik:MapLayer.Location="{Binding Location}"
06.                                      telerik:MapLayer.ZoomRange="{Binding ZoomRange}"
07.                                      telerik:MapLayer.BaseZoomLevel="{Binding BaseZoomLevel}"                                        
08.                                      ToolTip="{Binding FormattedDate}" Width="16" Height="16" RenderTransformOrigin="0,0">
09.                               <Rectangle.RenderTransform>
10.                                   <TransformGroup>
11.                                       <TranslateTransform X="-8" Y="-8"/>
12.                                       <RotateTransform CenterX="0" CenterY="0" Angle="{Binding Heading}" />
13.                                   </TransformGroup>
14.                               </Rectangle.RenderTransform>
15.                           </Rectangle>
16.                       </DataTemplate>
17.                   </telerik:VisualizationLayer.ItemTemplate>
18.               </telerik:VisualizationLayer>

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 28 Nov 2017, 12:30 PM
Hello Javor,

Generally, WPF rendering engine has known performance issues when drawing thousands of points. In RadMap we encourage you to use MapShape data objects - in your case RectangleData instead of Rectangles in DataTemplate. This way the geometries of the rectangles will be processed by background threads in parallel. Also, setting up a proper virtualization source would speed up your panning performance as well. Please follow this help article to get you started with this concept:

Map Shapes Virtualization

Regards,
Petar Mladenov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Peter
Top achievements
Rank 1
Veteran
answered on 15 Mar 2019, 08:33 AM

Hi Petar,

I also have a performance issue with RadMap. We are trying to display items moving on the map. Each item is represented by an icon (image + label) and a trail showing the path that the item has taken (typically 20 trail points per item). In an extreme case we might have to display 500 moving items (we receive approximately 1 position update per second for each item). 

For each item I have a view model representing the item itself, and a view model for each trail segment. Item view models collection is bound to one visualisation layer (data template for item has an image, ellipse and canvas elements), and the trail segments are bound to another visualisation layer (data template for trail segment uses PolyLineView).

As we increase the number of moving items the map performance gets worse (slow to pan and zoom, and whole application can become unresponsive). 

I have a number of approaches I want to try:

- replace individual trail segments with a single PolyLineView.
- simplify data template for the "item". Currently this is fairly complex, displaying a label for the item (using a canvas to offset the label from the image), and may also show an Ellipse to highlight the item.

Will the map be capable of displaying the amount of (dynamically changing) data I wish to show Do you have any other ideas I could use to improve performance? Does RadMap provide any metrics that would allow me to objectively assess rendering performance?

Thanks,
Pete

 

 

 

0
Petar Mladenov
Telerik team
answered on 19 Mar 2019, 04:28 PM
Hi Peter,

I will try to suggest a few options for your scenario in order to speed up the overall performance. RadMap does not have built-in ways to measure it, but you can check some WPF techniques for frames-per-second calculations (https://docs.microsoft.com/en-us/previous-versions/aa969767(v=vs.110)).

 - PolyLineView is a UIElement you can use in XAML - in DataTemplate or directly in VisualizationLayer. Internally RadMap reads it and creates Shape Data object which can be processed by multiple threads to speed up perfomance. However, there is a performance loss if you use 1000s of such bindable wrappers. What you can try is to add / remove / update the PolylineData objects on your own instead of using PolylineView objects.

- You can consider Map Shape Data Virtualization approach in your scenario to improve the performance when some shapes are out of viewport.

- the idea of simplifying any template is good as it will decrease the rendering time of all UI Elements. You can consider moving some information regarding map object to ToolTip or to Window which opens on click.

Regards,
Petar Mladenov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Map
Asked by
Javor
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Peter
Top achievements
Rank 1
Veteran
Share this question
or