Skip to content

Commit 97edc94

Browse files
committed
fix: Fix layer parameters for images smaller than tiles
In PR #1359, a problem was fixed when generating pixelmap parameters for images smaller than tiles. However, when a pixelmap is overlaid on a lower resolution base, this changed the behavior of how that was handled. This fix specifically allows the lowest tile layer in a tile layer as the minimum rather than zero.
1 parent 8e2a6bf commit 97edc94

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/osmLayer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ var osmLayer = function (arg) {
7979
overlap: m_this._options.tileOverlap,
8080
scale: m_this._options.tileScale,
8181
url: m_this._options.url.call(
82-
m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
82+
m_this, urlParams.x, urlParams.y,
83+
Math.max(urlParams.level || 0, Math.min(0, m_this._options.minLevel || 0)),
8384
m_this._options.subdomains),
8485
crossDomain: m_this._options.crossDomain
8586
});

src/pixelmapLayer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ var pixelmapLayer = function (arg) {
8181
overlap: m_this._options.tileOverlap,
8282
scale: m_this._options.tileScale,
8383
url: m_this._options.url.call(
84-
m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
84+
m_this, urlParams.x, urlParams.y,
85+
Math.max(urlParams.level || 0, Math.min(0, m_this._options.minLevel || 0)),
8586
m_this._options.subdomains),
8687
crossDomain: m_this._options.crossDomain
8788
});

src/tileLayer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,8 @@ var tileLayer = function (arg) {
601601
size: {x: m_this._options.tileWidth, y: m_this._options.tileHeight},
602602
queue: m_this._queue,
603603
url: m_this._options.url.call(
604-
m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
604+
m_this, urlParams.x, urlParams.y,
605+
Math.max(urlParams.level || 0, Math.min(0, m_this._options.minLevel || 0)),
605606
m_this._options.subdomains)
606607
});
607608
};

0 commit comments

Comments
 (0)