Sample - Bing Maps
This sample demonstrates how to generate and use a Bing Maps token with Bing Map imagery, geocode and route components in a Silverlight and WPF application.
Setup instructions:
- Unzip the sample to a location of your choice. Two folders are included, one for Silverlight and another for WPF. Each folder contains solutions for CSharp and VBNet. The Silverlight solutions contain a Silverlight project and a web host application. The WPF solutions contain a desktop application project.
- In Visual Studio 2008, open the CSharp or VB.NET solution for the platform (Silverlight or WPF) of your choice.
- In the Silverlight or WPF project, remove the reference to the ESRI.ArcGIS.Client and ESRI.ArcGIS.Client.Bing assemblies. Readd the reference to the assemblies you downloaded from the ArcGIS Server Resource Center. Be sure to add a reference to the assemblies of the appropriate platform (Silverlight or WPF).
- In the Silverlight web host application, open the BingAppTestPage.aspx. In the WPF application open the BingWindow.xaml.cs or .vb file. Set the following variables:
| Variable |
Description |
| useStagingServer |
If you have a Bing services account but have not purchased a license, set this value to to true. If you have purchased a license and want to use the production services, set this value to false. See the Using Bing Maps overview section for more information on creating a Bing Maps account.
|
| BingAccountID |
Set the Bing service account id you have received from ESRI or Microsoft. The account id is a minimum 6 digit value (e.g. 123456).
|
| BingAccountPassword |
Set the password for the Bing service account id.
|
Make sure you set useStagingServer to true if you have not purchased a production subscription to Bing services.
These variables will be used to generate a Bing token at runtime and applied to Bing map layers, geocoders and routers.
- Run the application.