This quick start guide familiarizes you with some of the features of Map control. In this section, you will learn to create a new WinForms application in Visual Studio, add the Map control, add vector data to it and run the application.
Complete the steps given below to see how the Map control appears after data binding and setting the properties.
C# |
Copy Code
|
---|---|
using C1.FlexMap; using C1.Win.Map; |
C# |
Copy Code
|
---|---|
//set the source property c1Map1.TileLayer.TileSource = new VirtualEarthRoadSource(); //create a vector layer and add it to the map C1.Win.Map.VectorLayer layer = new C1.Win.Map.VectorLayer(); c1Map1.Layers.Add(layer); |
c1Map1.TileLayer.TileSource = new VirtualEarthHybridSource("Bing_maps_key");
C# |
Copy Code
|
---|---|
//Create a vector placemark and add it to the layer C1.Win.Map.VectorPlacemark vpl = new C1.Win.Map.VectorPlacemark(); layer.Items.Add(vpl); //customize the vector placemark vpl.Style.BackColor = Color.Aqua; vpl.Marker.Shape = MarkerShape.Diamond; vpl.Marker.Size = new SizeF(10, 10); //set the geometry shape for vector placemark vpl.Geometry = new GeoPoint(75, 25); |
You can add any other vector elements such as, VectorPolyline and/or VectorPolygon to the map according to your requirements.
Press F5 to run the application and observe how the Map control appears with the placemark vector added to it.
In addition to adding placemarks, you can add various types of vector data on a map. Map also allows you to add markers on a map, customize them, and add image as markers as well, and add legends. For more information on further information, see Markers.