removing the restrictedMinZoom property, and allow for restricting zoom levels with maxResolution and numZoomLevels. Thanks tschaub for the doc, test and examples improvements. r=tschaub (see #3338)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@12106 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -21,6 +21,21 @@
|
||||
*/
|
||||
OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
|
||||
/**
|
||||
* Property: serverResolutions
|
||||
* {Array} the resolutions provided by the Bing servers.
|
||||
*/
|
||||
serverResolutions: [
|
||||
156543.03390625, 78271.516953125, 39135.7584765625,
|
||||
19567.87923828125, 9783.939619140625, 4891.9698095703125,
|
||||
2445.9849047851562, 1222.9924523925781, 611.4962261962891,
|
||||
305.74811309814453, 152.87405654907226, 76.43702827453613,
|
||||
38.218514137268066, 19.109257068634033, 9.554628534317017,
|
||||
4.777314267158508, 2.388657133579254, 1.194328566789627,
|
||||
0.5971642833948135, 0.29858214169740677, 0.14929107084870338,
|
||||
0.07464553542435169
|
||||
],
|
||||
|
||||
/**
|
||||
* Property: attributionTemplate
|
||||
* {String}
|
||||
@@ -80,7 +95,6 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
*/
|
||||
initialize: function(options) {
|
||||
options = OpenLayers.Util.applyDefaults({
|
||||
restrictedMinZoom: 1,
|
||||
sphericalMercator: true
|
||||
}, options);
|
||||
var name = options.name || "Bing " + (options.type || this.type);
|
||||
@@ -127,12 +141,14 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
this.url.push(url.replace("{subdomain}", res.imageUrlSubdomains[i]));
|
||||
};
|
||||
this.addOptions({
|
||||
restrictedMinZoom: res.zoomMin,
|
||||
numZoomLevels: res.zoomMax + 1
|
||||
});
|
||||
this.updateAttribution();
|
||||
// redraw to replace "blank.gif" tiles with real tiles
|
||||
this.redraw();
|
||||
maxResolution: Math.min(
|
||||
this.serverResolutions[res.zoomMin], this.maxResolution
|
||||
),
|
||||
zoomOffset: res.zoomMin,
|
||||
numZoomLevels: Math.min(
|
||||
res.zoomMax + 1 - res.zoomMin, this.numZoomLevels
|
||||
)
|
||||
}, true);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user