mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-02-17 20:31:37 +01:00
Reapply updated Leaflet patch
This commit is contained in:
parent
f5d5171f86
commit
042544f22e
@ -108,6 +108,43 @@ var DynmapTileLayer = L.TileLayer.extend({
|
||||
this._container.appendChild(fragment);
|
||||
},
|
||||
|
||||
_addTile: function(tilePoint, container) {
|
||||
if(this._container == null) // Ignore if we've stopped being active layer
|
||||
return;
|
||||
var tilePos = this._getTilePos(tilePoint),
|
||||
zoom = this._map.getZoom(),
|
||||
key = tilePoint.x + ':' + tilePoint.y,
|
||||
tileLimit = (1 << zoom);
|
||||
|
||||
// wrap tile coordinates
|
||||
if (!this.options.continuousWorld) {
|
||||
if (!this.options.noWrap) {
|
||||
tilePoint.x = ((tilePoint.x % tileLimit) + tileLimit) % tileLimit;
|
||||
} else if (tilePoint.x < 0 || tilePoint.x >= tileLimit) {
|
||||
this._tilesToLoad--;
|
||||
return;
|
||||
}
|
||||
|
||||
if (tilePoint.y < 0 || tilePoint.y >= tileLimit) {
|
||||
this._tilesToLoad--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// create tile
|
||||
var tile = this._createTile();
|
||||
L.DomUtil.setPosition(tile, tilePos);
|
||||
|
||||
this._tiles[key] = tile;
|
||||
|
||||
if (this.options.scheme == 'tms') {
|
||||
tilePoint.y = tileLimit - tilePoint.y - 1;
|
||||
}
|
||||
|
||||
this._loadTile(tile, tilePoint, zoom);
|
||||
|
||||
container.appendChild(tile);
|
||||
},
|
||||
_loadTile: function(tile, tilePoint, zoom) {
|
||||
var me = this;
|
||||
tile._layer = this;
|
||||
|
Loading…
Reference in New Issue
Block a user