# OpenLayers.Layer.Bing

Bing layer using direct tile access as provided by Bing Maps REST Services. See http://msdn.microsoft.com/en-us/library/ff701713.aspx for more information. Note: Terms of Service compliant use requires the map to be configured with an OpenLayers.Control.Attribution control and the attribution placed on or near the map.

#### Inherits from

- OpenLayers.Layer.XYZ

Summary

OpenLayers.Layer.Bing | Bing layer using direct tile access as provided by Bing Maps REST Services.
Properties |
serverResolutions | {Array} the resolutions provided by the Bing servers.
attributionTemplate | {String}
metadata | {Object} Metadata for this layer, as returned by the callback script
type | {String} The layer identifier.
metadataParams | {Object} Optional url parameters for the Get Imagery Metadata request as described here: http://msdn.microsoft.com/en-us/library/ff701716.aspx
Constructor |
OpenLayers.Layer.Bing | Create a new Bing layer.
Functions |
loadMetadata |
initLayer | Sets layer properties according to the metadata provided by the API
getURL |
updateAttribution | Updates the attribution according to the requirements outlined in http://gis.638310.n2.nabble.com/Bing-imagery-td5789168.html
setMap |
clone |
destroy |
OpenLayers.Layer.Bing.processMetadata | This function will be bound to an instance, linked to the global scope with an id, and called by the JSONP script returned by the API.

### Properties

### serverResolutions

{Array} the resolutions provided by the Bing servers.

### attributionTemplate

{String}

### metadata

{Object} Metadata for this layer, as returned by the callback script

### type

{String} The layer identifier. Any non-birdseye imageryType from http://msdn.microsoft.com/en-us/library/ff701716.aspx can be used. Default is “Road”.

### metadataParams

{Object} Optional url parameters for the Get Imagery Metadata request as described here: http://msdn.microsoft.com/en-us/library/ff701716.aspx

### Constructor

### OpenLayers.Layer.Bing

Create a new Bing layer.

#### Example

>     var road = new OpenLayers.Layer.Bing({
>         name: "My Bing Aerial Layer",
>         type: "Aerial",
>         key: "my-api-key-here",
>     });

#### Parameters

config | {Object} Configuration properties for the layer.

#### Required configuration properties

key | {String} Bing Maps API key for your application. Get one at http://bingmapsportal.com/.
type | {String} The layer identifier. Any non-birdseye imageryType from http://msdn.microsoft.com/en-us/library/ff701716.aspx can be used.

Any other documented layer properties can be provided in the config object.

### Functions

### loadMetadata

> loadMetadata: function()

### initLayer

> initLayer: function()

Sets layer properties according to the metadata provided by the API

### getURL

> getURL: function( | bounds | )

#### Paramters

bounds | {OpenLayers.Bounds}

### updateAttribution

> updateAttribution: function()

Updates the attribution according to the requirements outlined in http://gis.638310.n2.nabble.com/Bing-imagery-td5789168.html

### setMap

> setMap: function()

### clone

> clone: function( | obj | )

#### Parameters

obj | {Object}

#### Returns

{OpenLayers.Layer.Bing} An exact clone of this OpenLayers.Layer.Bing

### destroy

> destroy: function()

### OpenLayers.Layer.Bing.processMetadata

> OpenLayers.Layer.Bing.processMetadata = function( | metadata | )

This function will be bound to an instance, linked to the global scope with an id, and called by the JSONP script returned by the API.

#### Parameters

metadata | {Object} metadata as returned by the API

> loadMetadata: function()

> initLayer: function()

Sets layer properties according to the metadata provided by the API

> getURL: function( | bounds | )

> updateAttribution: function()

Updates the attribution according to the requirements outlined in http://gis.638310.n2.nabble.com/Bing-imagery-td5789168.html

> setMap: function()

> clone: function( | obj | )

> destroy: function()

> OpenLayers.Layer.Bing.processMetadata = function( | metadata | )

This function will be bound to an instance, linked to the global scope with an id, and called by the JSONP script returned by the API.
The attribution control adds attribution from layers to the map display.
The XYZ class is designed to make it easier for people who have tiles arranged by a standard XYZ grid.
Instances of this class represent bounding boxes.
Create a new Bing layer.
Close