Permalink
Browse files

Don't set zoomOffset - maxResolution and numZoomLevels is enough. r=f…

  • Loading branch information...
1 parent ae56952 commit f79520cf9dfd1f2eaf9c218d4f5a779b93bc27e3 @ahocevar ahocevar committed Dec 7, 2011
Showing with 17 additions and 2 deletions.
  1. +0 −1 lib/OpenLayers/Layer/Bing.js
  2. +17 −1 tests/Layer/Bing.html
@@ -144,7 +144,6 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
maxResolution: Math.min(
this.serverResolutions[res.zoomMin], this.maxResolution
),
- zoomOffset: res.zoomMin,
numZoomLevels: Math.min(
res.zoomMax + 1 - res.zoomMin, this.numZoomLevels
)
View
@@ -41,7 +41,7 @@
var origProcessMetadata = OpenLayers.Layer.Bing.processMetadata;
OpenLayers.Layer.Bing.processMetadata = function(metadata) {
meta.push(metadata);
- }
+ };
map = new OpenLayers.Map("map");
layer = new OpenLayers.Layer.Bing(options);
var extent;
@@ -98,6 +98,22 @@
map.destroy();
});
}
+
+ function test_getXYZ(t) {
+ t.plan(1);
+
+ var map = new OpenLayers.Map("map", {allOverlays: true});
+ var osm = new OpenLayers.Layer.OSM();
+ map.addLayer(osm);
+ map.zoomToExtent(new OpenLayers.Bounds(11373579,-2445208,13628777,680760));
+ layer = new OpenLayers.Layer.Bing(options);
+ map.addLayer(layer);
+
+ t.delay_call(2, function() {
+ var xyz = layer.getXYZ(layer.getTileBounds(new OpenLayers.Pixel(1,1)));
+ t.eq(xyz.z, OpenLayers.Util.indexOf(layer.serverResolutions, map.getResolution()), "zoom level correct");
+ });
+ }
function test_clone(t) {
t.plan(1);

0 comments on commit f79520c

Please sign in to comment.