Modify the unit test for changing maxLevel

This commit is contained in:
Sanghoon Kim 2021-12-01 10:17:10 +09:00
parent 7686812336
commit 3bde256d62

View File

@ -128,8 +128,6 @@
assert.equal(tileSource.maxLevel, 12, 'The initial max level should be 12.');
tileSource.maxLevel = 9;
function assertLevelScale(level, expected) {
var actual = tileSource.getLevelScale(level);
assert.ok(Math.abs(actual - expected) < Number.EPSILON, "The scale at level " + level +
@ -141,6 +139,13 @@
assertLevelScale(10, 1 / 4);
assertLevelScale(8, 1 / 16);
assertLevelScale(6, 1 / 64);
tileSource.setMaxLevel(9);
assertLevelScale(9, 1);
assertLevelScale(7, 1 / 4);
assertLevelScale(5, 1 / 16);
assertLevelScale(3, 1 / 64);
});
}());