Adding a Polyline

You can connect geographic coordinates with a polyline by adding a C1VectorPolyline to the C1VectorLayer (see Vector Layer for more information). In this topic, you will create a 3-point polyline using XAML and code.

In XAML

Complete the following steps:

1.   Place the following XAML markup between the <c1:C1Maps> and </c1:C1Maps> tags:

<c1:C1VectorLayer Margin="2,0,-2,0">

     <c1:C1VectorPolyline Points="-80.15,42.12 -123.08,39.09, -3.90,30.85" StrokeThickness="3" Stroke="Red">

     </c1:C1VectorPolyline>

</c1:C1VectorLayer>

2.   Press F5 to run the project.

In Code

Complete the following steps:

1.   In XAML view, add x:Name="C1Maps1" to the <c1:C1Maps> tag so that the object will have a unique identifier for you to call in code.

2.   Enter Code view and import the following namespace:

      Visual Basic

      C#

3.   Add the following code beneath the InitializeComponent() method:

      Visual Basic

      C#

4.   Press F5 to run the project.

 This Topic Illustrates the Following:

The following image depicts a C1Maps control with three geographical coordinates connected by a polyline.

 


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.