Skip to content

Commit 1abac5e

Browse files
committed
fix: Do not let tile layers have a negative max level
When constructing default parameters, do not specify a negative max level even for very small images compared to their tiles.
1 parent 549bf20 commit 1abac5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,9 @@ var util = {
553553
var minLevel = Math.min(0, Math.floor(Math.log(Math.min(
554554
(mapW || tileWidth) / tileWidth,
555555
(mapH || tileHeight) / tileHeight)) / Math.log(2))),
556-
maxLevel = Math.ceil(Math.log(Math.max(
556+
maxLevel = Math.max(0, Math.ceil(Math.log(Math.max(
557557
width / tileWidth,
558-
height / tileHeight)) / Math.log(2));
558+
height / tileHeight)) / Math.log(2)));
559559
var mapParams = {
560560
node: node,
561561
ingcs: '+proj=longlat +axis=esu',

0 commit comments

Comments
 (0)