1. 加一個標記:
加標記,是地圖中最常用的方法。它和bing map又有所不同,首先所在的命名空間不同;其次顯示方式不同;但總之都是可以在類比上啟動並執行。
Pushpin pin = new Pushpin();
pin.Location = new GeoCoordinate(30.259497, 120.129798);
pin.Width = 200;
pin.Height = 200;
pin.Content = "test";
pin.Background = new SolidColorBrush(Colors.Red);
Map控制項顯示的標記
bing map控制項顯示的標記
2. 繪製多邊型地區:
MapPolygon polygon = new MapPolygon();
polygon.Locations = new LocationCollection() { new GeoCoordinate(30.259497, 120.129798),
new GeoCoordinate(30.359497, 120.329998),
new GeoCoordinate(30.379497, 120.529798),
new GeoCoordinate(30.389497, 120.729798) };
3. 繪製多邊線:
MapPolyline polyline = new MapPolyline();
polyline.Stroke = new SolidColorBrush(Colors.Red);
polyline.Locations = new LocationCollection() {
new GeoCoordinate(30.259497, 120.129798),
new GeoCoordinate(30.289497, 120.120998)
};
4.在地圖上增加圖片:
MapLayer imagelayer = new MapLayer();
imagelayer.AddChild(image, new GeoCoordinate(30.259497, 120.129798), PositionOrigin.BottomLeft);
範例程式碼:http://www.daisy123.com/?page_id=275 Map 控制項