-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
Right now if you set bounds on a tile layer, and zoom out/pan you'll see that the tiles are only loaded for the first world, not later wrapped worlds. When determining if a tile should be loaded, a tile's bounds' latlng should be wrapped so that the tiles are loaded for the "next world" as well.
diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js
index e1cbca0..f27eb37 100644
--- a/src/layer/tile/TileLayer.js
+++ b/src/layer/tile/TileLayer.js
@@ -356,8 +356,8 @@ L.TileLayer = L.Class.extend({
var tileSize = this.options.tileSize,
nwPoint = tilePoint.multiplyBy(tileSize),
sePoint = nwPoint.add([tileSize, tileSize]),
- nw = this._map.unproject(nwPoint),
- se = this._map.unproject(sePoint);
+ nw = this._map.unproject(nwPoint).wrap(),
+ se = this._map.unproject(sePoint).wrap();
if (!this.options.bounds.intersects([nw, se])) {Is there any case where the left/right values for .wrap() should not be the defaults?
Metadata
Metadata
Assignees
Labels
No labels