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 控件

 

posted on 2010-11-01 13:42  小镇  阅读(2013)  评论(1编辑  收藏  举报