This topic provides information on displaying geographic imagery from Bing Maps in the background content of the XamGeographicMap™ control.
The following table lists the topics required as a prerequisite to understanding this topic.
This topic contains the following sections:
Bing Maps is Microsoft’s® licensed geographic imagery mapping service. This geographic imagery service is accessible directly on the http://www.bing.com/maps web site. The XamGeographicMap control displays geographic imagery from Bing Maps in the map’s background content using the BingMapsMapImagery class. However, by default the XamGeographicMap control displays geographic imagery from the Open Street Maps in the map background content requiring you to configure the control to display Bing Maps’ geographic imagery. Prior to using Bing Maps’ geographic imagery, you must register and obtain a Bing Map API key from www.bingmapsportal.com. You must use the Bing Maps’ API key to set the BingMapsMapImagery object’s ApiKey property.
Before the 13.1 release, you had to configure a REST Service to access Bing Maps and retrieve the required titles URIs. With the release of 13.1 this functionality is now built-in to the XamGeographicMap control.
The following images are previews of the XamGeographicMap control in supported map styles of geographic imagery from the Bing Maps service.
In order to use geographic imagery from Bing Maps, you must first register and obtain a Map API key from the www.bingmapsportal.com website. You must set this Bing API key as the BingMapsMapImagery object’s ApiKey property.
The screenshot following this table illustrates how to display geographic imagery from Bing Maps in the background content of the XamGeographicMap control. This is accomplished by configuring the XamGeographicMap control as follows:
Following is the code used in implementing this example:
In XAML:
<ig:XamGeographicMap Name="igMap">
<ig:XamGeographicMap.BackgroundContent>
<ig:BingMapsMapImagery ImageryStyle="Road"
ApiKey="API_KEY" />
</ig:XamGeographicMap.BackgroundContent>
</ig:XamGeographicMap>
In Visual Basic:
Dim igMap As XamGeographicMap
Dim bingMaps as BingMapsMapImagery
bingMaps.ImageryStyle = BingMapsImageryStyle.Aerial
bingMaps.ApiKey = "API_KEY"
igMap.BackgroundContent = bingMaps
In C#:
var igMap = new XamGeographicMap
var bingMaps = new BingMapsMapImagery();
bingMaps.ImageryStyle = BingMapsImageryStyle.Aerial;
bingMaps.ApiKey = "API_KEY";
igMap.BackgroundContent = bingMaps;
The following topics provide additional information related to this topic.