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

MapPolyline and gradient fill

1 Answer 141 Views
Map
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 14 Jul 2010, 05:07 PM
Hello, I use RadMap for showing of car activity from GPS trackers. But, our customers request of several feature.

First, they want a car track with gradient fill of car speed like this http://s48.radikal.ru/i122/1007/95/f043f9605fc4.png (or look to attached file) - this polyline contain some points, line between point N and N+1 must be showed as gradient from speed in point N and speed in point N+1. In this image speed variation from 5-10 km/h (green color) to 70-90 km/h (red). I'm looking to RadMap sources and can't found any samples for achievement this goal. Now, I can show polyline only with solid color. Should I use MapPathSegment or make inherited class from MapShape and drawing segments manual ?

My second question, how I can optimize drawing of big polyline? One polyline with ~2000 points (filled with solid color) showed nicely, but some map panning is slowly. How many points per one polyline is optimal? I try split big polyline to 10-20 polylines (with 100-200 points per line), but no speed up found.

Thank you for very useful control!

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 16 Jul 2010, 12:13 PM
Hi Denis,

You can try to build linear gradient brushes between points like the arrows on the screenshot.
I have attached a sample solution that calculates CreateLinearGradientBrush between two locations. The example adds MapLine instance by mouse click event and shows it as a gradient from green to brown.
I hope it helps.

You cannot increase the performance of the RadMap with a lot of objects in the InformationLayer.
I would like to recommend using the Dynamic layer instead of Information layer.
It allows decreasing the quantity of objects on the map at the same time. Also it allows displaying different shapes according to zoom level of map control.
For more information please see the Using dynamic layer documentation topic:
http://www.telerik.com/help/silverlight/map-using-dynamic-layer.html
Also there is an Items Virtualization example in our demos:
http://demos.telerik.com/silverlight/#Map/DynamicLayer
The example uses WCF service. You can find the sample code of this service using the local path like the following:
C:\Program Files\Telerik\RadControls for Silverlight Q1 2010\Demos\ExamplesWeb\RadMapDataService.svc.cs

Kind regards,
Andrey Murzov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Map
Asked by
Denis
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or