Skip to content

Commit 46cbd65

Browse files
committed
imagelayer tilelayer支持point形式的tilesize
1 parent a96ff47 commit 46cbd65

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

dist/iclient9-leaflet.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19817,8 +19817,11 @@ var TiledMapLayer = exports.TiledMapLayer = _leaflet2["default"].TileLayer.exten
1981719817
params = {};
1981819818

1981919819
var tileSize = this.options.tileSize;
19820-
params["width"] = tileSize.toString();
19821-
params["height"] = tileSize.toString();
19820+
if (!(tileSize instanceof _leaflet2["default"].Point)) {
19821+
tileSize = _leaflet2["default"].point(tileSize, tileSize);
19822+
}
19823+
params["width"] = tileSize.x;
19824+
params["height"] = tileSize.y;
1982219825

1982319826
params["redirect"] = options.redirect === true;
1982419827
params["transparent"] = options.transparent === true;
@@ -32631,8 +32634,11 @@ var ImageMapLayer = exports.ImageMapLayer = _leaflet2["default"].TileLayer.exten
3263132634
params = [];
3263232635

3263332636
var tileSize = this.options.tileSize;
32634-
params.push("width=" + tileSize);
32635-
params.push("height=" + tileSize);
32637+
if (!(tileSize instanceof _leaflet2["default"].Point)) {
32638+
tileSize = _leaflet2["default"].point(tileSize, tileSize);
32639+
}
32640+
params.push("width=" + tileSize.x);
32641+
params.push("height=" + tileSize.y);
3263632642

3263732643
var redirect = options.redirect === true ? options.redirect : false;
3263832644
params.push("redirect=" + redirect);

dist/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/leaflet/mapping/ImageMapLayer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ export var ImageMapLayer = L.TileLayer.extend({
9595
var me = this, options = me.options || {}, params = [];
9696

9797
var tileSize = this.options.tileSize;
98-
params.push("width=" + tileSize);
99-
params.push("height=" + tileSize);
98+
if (!(tileSize instanceof L.Point)) {
99+
tileSize = L.point(tileSize, tileSize);
100+
}
101+
params.push("width=" + tileSize.x);
102+
params.push("height=" + tileSize.y);
100103

101104
var redirect = (options.redirect === true) ? options.redirect : false;
102105
params.push("redirect=" + redirect);

src/leaflet/mapping/TiledMapLayer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,11 @@ export var TiledMapLayer = L.TileLayer.extend({
277277
var me = this, options = me.options || {}, params = {};
278278

279279
var tileSize = this.options.tileSize;
280-
params["width"] = tileSize.toString();
281-
params["height"] = tileSize.toString();
280+
if (!(tileSize instanceof L.Point)) {
281+
tileSize = L.point(tileSize, tileSize);
282+
}
283+
params["width"] = tileSize.x;
284+
params["height"] = tileSize.y;
282285

283286
params["redirect"] = options.redirect === true;
284287
params["transparent"] = options.transparent === true;

0 commit comments

Comments
 (0)