mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-27 11:07:38 +01:00
Switch to using continuousWorld option in newer Leaflet - saves on override
This commit is contained in:
parent
0bc760230f
commit
9f4df9a76e
@ -108,29 +108,6 @@ var DynmapTileLayer = L.TileLayer.extend({
|
|||||||
this._container.appendChild(fragment);
|
this._container.appendChild(fragment);
|
||||||
},
|
},
|
||||||
|
|
||||||
// We should override this, since Leaflet does modulo on tilePoint by default. (https://github.com/CloudMade/Leaflet/blob/master/src/layer/tile/TileLayer.js#L151)
|
|
||||||
_addTile: function(tilePoint) {
|
|
||||||
if(this._container == null) // Ignore if we're not active layer
|
|
||||||
return;
|
|
||||||
|
|
||||||
var tilePos = this._getTilePos(tilePoint),
|
|
||||||
zoom = this._map.getZoom(),
|
|
||||||
key = tilePoint.x + ':' + tilePoint.y,
|
|
||||||
name = this.getTileName(tilePoint, zoom);
|
|
||||||
|
|
||||||
// create tile
|
|
||||||
var tile = this._createTile();
|
|
||||||
tile.tileName = name;
|
|
||||||
tile.tilePoint = tilePoint;
|
|
||||||
L.DomUtil.setPosition(tile, tilePos);
|
|
||||||
|
|
||||||
this._tiles[key] = tile;
|
|
||||||
this._namedTiles[name] = tile;
|
|
||||||
|
|
||||||
this._loadTile(tile, tilePoint, zoom);
|
|
||||||
|
|
||||||
this._container.appendChild(tile);
|
|
||||||
},
|
|
||||||
_loadTile: function(tile, tilePoint, zoom) {
|
_loadTile: function(tile, tilePoint, zoom) {
|
||||||
var me = this;
|
var me = this;
|
||||||
tile._layer = this;
|
tile._layer = this;
|
||||||
|
@ -17,7 +17,8 @@ var FlatMapType = DynmapTileLayer.extend({
|
|||||||
options: {
|
options: {
|
||||||
minZoom: 0,
|
minZoom: 0,
|
||||||
maxZoom: 4,
|
maxZoom: 4,
|
||||||
errorTileUrl: 'images/blank.png'
|
errorTileUrl: 'images/blank.png',
|
||||||
|
continuousWorld: true
|
||||||
},
|
},
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
options.maxZoom = options.mapzoomin + options.mapzoomout;
|
options.maxZoom = options.mapzoomin + options.mapzoomout;
|
||||||
|
@ -24,7 +24,8 @@ var HDMapType = DynmapTileLayer.extend({
|
|||||||
options: {
|
options: {
|
||||||
minZoom: 0,
|
minZoom: 0,
|
||||||
maxZoom: 0,
|
maxZoom: 0,
|
||||||
errorTileUrl: 'images/blank.png'
|
errorTileUrl: 'images/blank.png',
|
||||||
|
continuousWorld: true
|
||||||
},
|
},
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
options.maxZoom = options.mapzoomin + options.mapzoomout;
|
options.maxZoom = options.mapzoomin + options.mapzoomout;
|
||||||
|
@ -26,7 +26,8 @@ var KzedMapType = DynmapTileLayer.extend({
|
|||||||
options: {
|
options: {
|
||||||
minZoom: 0,
|
minZoom: 0,
|
||||||
maxZoom: 4,
|
maxZoom: 4,
|
||||||
errorTileUrl: 'images/blank.png'
|
errorTileUrl: 'images/blank.png',
|
||||||
|
continuousWorld: true
|
||||||
},
|
},
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
options.maxZoom = options.mapzoomin + options.mapzoomout;
|
options.maxZoom = options.mapzoomin + options.mapzoomout;
|
||||||
|
Loading…
Reference in New Issue
Block a user