Skip to content

Commit 9174d2a

Browse files
authored
Merge pull request #1359 from OpenGeoscience/smaller-than-tiles
fix: Fix pixelmap parameters for images smaller than tiles
2 parents 99b58e3 + efc2b51 commit 9174d2a

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

src/osmLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ 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, urlParams.level || 0,
82+
m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
8383
m_this._options.subdomains),
8484
crossDomain: m_this._options.crossDomain
8585
});

src/pixelmapLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ 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, urlParams.level || 0,
84+
m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
8585
m_this._options.subdomains),
8686
crossDomain: m_this._options.crossDomain
8787
});

src/tileLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ 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, urlParams.level || 0,
604+
m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
605605
m_this._options.subdomains)
606606
});
607607
};

src/util/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ var util = {
569569
};
570570
var layerParams = {
571571
maxLevel: maxLevel,
572+
minLevel: Math.min(0, maxLevel),
572573
wrapX: false,
573574
wrapY: false,
574575
tileOffset: function () {

0 commit comments

Comments
 (0)