The given route returned by the BingRouteProvider contains about 24000 points. All of them are set as points in the single Polyline object displayed in the RadMap. As a whole WPF engine is very sensitive when it renders big number of points (in terms of thousands). Also when you zoom / pan the radmap , the geometry of the polyline is changed / transformed and this additionally slows down the rendering.
Generally, we would suggest two approaches you can try:
1) Simplify the points displayed on the map. For example display only one from a hundred points. All route points (if your application needs them ) can be stored in a database / file / dictionary. But display only small subset of points on the map:
PolylineData routeLine =
//Points = routeResponse.Result.RoutePath.Points,
StrokeThickness = 2
i = 0; i < routeResponse.Result.RoutePath.Points.Count; i++)
(i % 100 == 0)
This way you will see polyline consisting of 240 points instead of 24000. It will be fast to process by the RadMap. However, when you zoom in the details /quality will be lower.
2) Instead of single polyline, add hundreds / thousands of polylines with small number of points each.
This way you can benefit from Virtualization feature in VisualizationLayer
- its a concept to request the object on demand - only the ones you need in the current viewport (defined by the center of the map and the zoom level). This approach would require storing the different polylines somehow (for example dictionary) that will be easily accessed when you need them (for certain viewport).
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer
and share your thoughts.