Modifying initResolutions so that minResolution and numZoomLevels are respected if they are set as layer options. Note that if only minResolution and maxResolution are specified, minResolution will still not be respected in general. r=pspencer (closes #1300)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5918 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-01-28 16:28:21 +00:00
parent 866cfe631d
commit a14418f53f
2 changed files with 41 additions and 8 deletions

View File

@@ -118,6 +118,24 @@
t.eq(layer.maxResolution, maxResolution, "maxResolution set correctly");
t.eq(layer.numZoomLevels, numZoomLevels, "numZoomLevels set correctly");
}
function test_Layer_initResolutions(t) {
t.plan(3);
var map = new OpenLayers.Map("map");
var options = {
minResolution: 1,
maxResolution: 10,
numZoomLevels: 5
};
var layer = new OpenLayers.Layer("test", options);
layer.map = map;
layer.initResolutions();
t.eq(layer.minResolution.toPrecision(9), (1).toPrecision(9),
"layer minResolution preserved");
t.eq(layer.maxResolution.toPrecision(9), (10).toPrecision(9),
"layer maxResolution preserved");
t.eq(layer.numZoomLevels, 5, "layer numZoomLevels preserved");
}
function test_05_Layer_visibility(t) {