Switch to using continuousWorld option in newer Leaflet - saves on override

This commit is contained in:
Mike Primm 2011-08-14 13:11:57 +08:00 committed by mikeprimm
parent 0bc760230f
commit 9f4df9a76e
4 changed files with 6 additions and 26 deletions

View File

@ -108,29 +108,6 @@ var DynmapTileLayer = L.TileLayer.extend({
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) {
var me = this;
tile._layer = this;

View File

@ -17,7 +17,8 @@ var FlatMapType = DynmapTileLayer.extend({
options: {
minZoom: 0,
maxZoom: 4,
errorTileUrl: 'images/blank.png'
errorTileUrl: 'images/blank.png',
continuousWorld: true
},
initialize: function(options) {
options.maxZoom = options.mapzoomin + options.mapzoomout;

View File

@ -24,7 +24,8 @@ var HDMapType = DynmapTileLayer.extend({
options: {
minZoom: 0,
maxZoom: 0,
errorTileUrl: 'images/blank.png'
errorTileUrl: 'images/blank.png',
continuousWorld: true
},
initialize: function(options) {
options.maxZoom = options.mapzoomin + options.mapzoomout;

View File

@ -26,7 +26,8 @@ var KzedMapType = DynmapTileLayer.extend({
options: {
minZoom: 0,
maxZoom: 4,
errorTileUrl: 'images/blank.png'
errorTileUrl: 'images/blank.png',
continuousWorld: true
},
initialize: function(options) {
options.maxZoom = options.mapzoomin + options.mapzoomout;