Calculate zoom level from serverResolutions.

The previous way of hard-coding an offset of 1 causes an incorrect attribution for layers with a custom maxResolution.
This commit is contained in:
ahocevar
2012-04-20 15:08:45 +02:00
parent 7ec0071823
commit 9ab6d08fb0

View File

@@ -223,7 +223,8 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
this.map.getProjectionObject(),
new OpenLayers.Projection("EPSG:4326")
);
var providers = res.imageryProviders, zoom = this.map.getZoom() + 1,
var providers = res.imageryProviders,
zoom = this.serverResolutions.indexOf(this.getServerResolution()),
copyrights = "", provider, i, ii, j, jj, bbox, coverage;
for (i=0,ii=providers.length; i<ii; ++i) {
provider = providers[i];