一起學windows phone7開發(二十一.三 Map 控制項深入學習)

來源:互聯網
上載者:User

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 控制項

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.