fix Bing attribution issue reported by PitneyBowes
This commit is contained in:
@@ -229,7 +229,8 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
provider = providers[i];
|
||||
for (j=0,jj=provider.coverageAreas.length; j<jj; ++j) {
|
||||
coverage = provider.coverageAreas[j];
|
||||
bbox = OpenLayers.Bounds.fromArray(coverage.bbox);
|
||||
// axis order provided is Y,X
|
||||
bbox = OpenLayers.Bounds.fromArray(coverage.bbox, true);
|
||||
if (extent.intersectsBounds(bbox) &&
|
||||
zoom <= coverage.zoomMax && zoom >= coverage.zoomMin) {
|
||||
copyrights += provider.attribution + " ";
|
||||
|
||||
@@ -98,6 +98,25 @@
|
||||
map.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
function test_attribution_notempty(t) {
|
||||
t.plan(1);
|
||||
|
||||
var log = [];
|
||||
var map = new OpenLayers.Map("map");
|
||||
layer = new OpenLayers.Layer.Bing(OpenLayers.Util.applyDefaults({type: 'Road'}, options));
|
||||
map.addLayer(layer);
|
||||
var format = OpenLayers.String.format;
|
||||
OpenLayers.String.format = function(tpl, options) {
|
||||
log.push(options.copyrights);
|
||||
}
|
||||
map.zoomToExtent(new OpenLayers.Bounds(-14768652, 4492113, -12263964, 5744457));
|
||||
t.delay_call(2, function() {
|
||||
t.ok(log.join("") !== "", "Copyright not empty");
|
||||
OpenLayers.String.format = format;
|
||||
map.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
function test_getXYZ(t) {
|
||||
t.plan(1);
|
||||
|
||||
Reference in New Issue
Block a user