A Bing Maps layer displays map content from a Bing Maps Imagery web service. The service provides access to static map tiles and imagery metadata. As the user navigates the map, the layer fetches new map tiles to be displayed.
To instantiate an AGSBingMapLayer, you need to provide a valid
Bing Maps key and a style for the
imagery: Roads, Aerial, or Aerial with labels.
NSString* bingMapsKey = @"--your--key--";
AGSBingMapLayer* layer = [[AGSBingMapLayer alloc] initWithAppID:bingMapsKey style:AGSBingMapLayerStyleAerial];
After creating the layer, you can add it to the map to display its contents. Once the layer is ready to be used, its loaded property will be enabled. You can then safely access its properties.
NSLog(@"Spatial Reference : %@", layer.spatialReference);
For the sake of interoperability with ArcGIS Server services, it is assumed that the Bing Maps layer uses the WGS 1984 Web Mercator (Auxiliary Sphere) spatial reference (WKID = 102100). The Bing Maps layer can be used with other tiled layers having a Web Mercator spatial reference such as the following:
- WGS 1984 Web Mercator (Auxiliary Sphere), WKID = 3857
- WGS 1984 Web Mercator, WKID = 102113
Getting a Bing Maps key
If you don't have a key, or you want to generate a new one, follow the directions provided at Bing Maps Account Center.
When using Bing Maps in your application, it's important to include attribution information. See the Branding Guidelines from Microsoft for more information.