Support the culture attribute in the Bing Layer.

p=dcabasson, r=me (closes http://trac.osgeo.org/openlayers/ticket/3598)
This commit is contained in:
ahocevar
2012-02-14 17:23:01 +01:00
parent 745400fa74
commit fe8a00d5c9

View File

@@ -67,6 +67,13 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
*/
type: "Road",
/**
* APIProperty: culture
* {String} The culture identifier. See http://msdn.microsoft.com/en-us/library/ff701709.aspx
* for the definition and the possible values. Default is "en-US".
*/
culture: "en-US",
/**
* APIProperty: metadataParams
* {Object} Optional url parameters for the Get Imagery Metadata request
@@ -155,6 +162,7 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
initLayer: function() {
var res = this.metadata.resourceSets[0].resources[0];
var url = res.imageUrl.replace("{quadkey}", "${quadkey}");
url = url.replace("{culture}", this.culture);
this.url = [];
for (var i=0; i<res.imageUrlSubdomains.length; ++i) {
this.url.push(url.replace("{subdomain}", res.imageUrlSubdomains[i]));