How to Draw Line Between to Locations in Radmap

2 posts, 0 answers
  1. 666
    666 avatar
    17 posts
    Member since:
    Sep 2010

    Posted 17 Dec 2010 Link to this post


    Hi
    I am using radmap control in my silverlight 4.0 application , i want to bind a collections like (list of city in india).
    1.I want to bind the collections (list of city in india) to the Radmap, how to do this?
    2.I have two locations like chennai and bangalor , i want to draw line in between two cities,how to do this?
    Please let me know how to do above things in telerik radmap.
    Thanks in Advance
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 22 Dec 2010 Link to this post

    Hi srini,

    You can bind items source of the information layer to the collection of the locations. You can find example here:

    http://demos.telerik.com/silverlight/#Map/DataBinding

    To show line between 2 locations on the map you can use MapLine object:

    Location loc1 = new Location(20, 20); 
    Location loc2 = new Location(40, 40); 
    MapLine line = new MapLine() 
        Point1 = loc1, 
        Point2 = loc2, 
        Stroke = new SolidColorBrush(Colors.Red), 
        StrokeThickness = 2 
    }; 
        
    this.informationLayer.Items.Add(line);

    Pay attention, if your information layer is bound to the collection of the locations then you should use second layer to show lines.

    Regards,
    Andrey Murzov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top