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
- 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
- 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:
- 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