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:
@@ -67,6 +67,13 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
|||||||
*/
|
*/
|
||||||
type: "Road",
|
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
|
* APIProperty: metadataParams
|
||||||
* {Object} Optional url parameters for the Get Imagery Metadata request
|
* {Object} Optional url parameters for the Get Imagery Metadata request
|
||||||
@@ -155,6 +162,7 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
|||||||
initLayer: function() {
|
initLayer: function() {
|
||||||
var res = this.metadata.resourceSets[0].resources[0];
|
var res = this.metadata.resourceSets[0].resources[0];
|
||||||
var url = res.imageUrl.replace("{quadkey}", "${quadkey}");
|
var url = res.imageUrl.replace("{quadkey}", "${quadkey}");
|
||||||
|
url = url.replace("{culture}", this.culture);
|
||||||
this.url = [];
|
this.url = [];
|
||||||
for (var i=0; i<res.imageUrlSubdomains.length; ++i) {
|
for (var i=0; i<res.imageUrlSubdomains.length; ++i) {
|
||||||
this.url.push(url.replace("{subdomain}", res.imageUrlSubdomains[i]));
|
this.url.push(url.replace("{subdomain}", res.imageUrlSubdomains[i]));
|
||||||
|
|||||||
Reference in New Issue
Block a user