ESRI for window Phone 7 (1) Load bingmap

Source: Internet
Author: User

I recently learned ESRI for Windows Phone 7 map development to improve myself. After a period of understanding and contact, we feel that map data is a huge backend support. In fact, development is a simple process, and most of the APIs can be done. At present, we know that the largest map companies include Google, Baidu, and bingmap. Their data is quite comprehensive and regularly and irregularly updated, I have heard of more than 10 thousand teams that support Background Data.

I recently learned about map development and close-up on mobile phones.ArticleRecord it, and we will also witness the shortcomings in my learning process.

I. Environment Construction

    1. First go to ESRI official website to download ESRI for Windows Phone 7 SDK; http://help.arcgis.com/en/arcgismobile/10.0/apis/windowsphone/index.html
    2. Create a project file for Windows Phone 7. Introduce the DLL in the project, as shown in:

2. Load a bingmap

1. XmalCodeAs follows:

  <  Phone  : Phoneapplicationpage. ApplicationBar  > <  Shell  :  ApplicationBar  Isvisible  = "True"  Ismenuenabled  = "True"> <  Shell  :  Applicationbariconbutton  Iconuri  = "/Images/appbar.add.rest.png" Text  = "Add"/> <  Shell  :  ApplicationBar. menuitems  > <  Shell  :  Applicationbarmenuitem  Text  = "Aerialwithlabels"  Click  = "Applicationbarmenuitem_click"/> <  Shell  : Applicationbarmenuitem  Text  = "Aerial"  Click  = "Applicationbarmenuitem_click"/> <  Shell  :  Applicationbarmenuitem  Text  = "Road"  Click  = "Applicationbarmenuitem_click"/> </  Shell  : ApplicationBar. menuitems  > </  Shell  :  ApplicationBar  > </  Phone  :  Phoneapplicationpage. ApplicationBar  >  <! -- Layoutroot is the root grid where all page content is placed -->  <  Grid  X  : Name  = "Layoutroot"  Background  = "Transparent"> <  Grid. rowdefinitions  > <  Rowdefinition  Height  = "Auto"/> <  Rowdefinition  Height  = "*"/> </  Grid. rowdefinitions  > <! -- Titlepanel contains the name of the application and page title -->  <  Stackpanel  X  :  Name  = "Titlepanel"  Grid. Row  = "0"  Margin  = ","> <  Textblock  X  :  Name = "Applicationtitle"  Text  = "My applicationsProgram"  Style  = "{  Staticresource  Phonetextnormalstyle  } "/> <  Textblock  X  :  Name  = "Pagetitle"  Text  = "ESRI Bing map" Margin  = "9,-7, 0, 0"  Style  = "{  Staticresource  Phonetexttitle1style  } "/> </  Stackpanel  >  <! -- Contentpanel-place additional content here -->  <  Grid  X  :  Name = "Contentpanel"  Grid. Row  = "1"  Margin  = "12, 0, 12, 0"> <  ESRI  :  Map  X  :  Name  = "Mymap"  Background  = "White"> <  Esribing  : Tilelayer  Culture  = "ZH-CN"  Layerstyle  = "Road"  Servertype  = "Production"  Token  = "Success"  ID  = "Titlelayerroad"> </  Esribing  : Tilelayer  > </  ESRI  :  Map  > </  Grid  > </  Grid  > 

The entire page uses three menus for data reloading. An event command is used.

2. The CS code is as follows:

Private void Applicationbarmenuitem_click ( Object Sender, Eventargs E)

{

VaR TEXT = (sender As Applicationbarmenuitem ). Text;

VaR Layer = mymap. Layers [0];

Switch (Text)

{

Case "Aerialwithlabels" :

(Layer As Tilelayer ). Layerstyle = Tilelayer . Layertype . Aerialwithlabels;

Break ;

Case "Aerial" :

(Layer As Tilelayer ). Layerstyle = Tilelayer . Layertype . Aerial;

Break ;

Case "Road" :

(Layer As Tilelayer ). Layerstyle = Tilelayer . Layertype . Road;

Break ;

}

}

3. The running result is as follows:

Iv. Conclusion

the key of bingmap must be used in the learning process, to obtain the key, you must apply to live. Https://www.bingmapsportal.com/

references:

  1. http://help.arcgis.com/en/arcgismobile/10.0/apis/windowsphone/help/index.html#/Using_Bing_Imagery_Geocode_and_Route_services/011v00000018000000/ ESRI for Windows Phone 7api

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.