MapPolyline and gradient fill

2 posts, 0 answers
  1. Denis
    Denis avatar
    9 posts
    Member since:
    Jun 2012

    Posted 14 Jul 2010 Link to this post

    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 (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!
  2. Andrey
    Andrey avatar
    1681 posts

    Posted 16 Jul 2010 Link to this post

    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:
    Also there is an Items Virtualization example in our demos:
    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
Back to Top