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

How to Draw Line Between to Locations in Radmap

1 Answer 303 Views
Map
This is a migrated thread and some comments may be shown as answers.
666
Top achievements
Rank 1
666 asked on 18 Dec 2010, 05:34 AM

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

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 22 Dec 2010, 01:19 PM
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
Tags
Map
Asked by
666
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or