From 9f4df9a76e362a829cbfaa96d7619ad654c85333 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sun, 14 Aug 2011 13:11:57 +0800 Subject: [PATCH] Switch to using continuousWorld option in newer Leaflet - saves on override --- web/js/dynmaputils.js | 23 ----------------------- web/js/flatmap.js | 3 ++- web/js/hdmap.js | 3 ++- web/js/kzedmaps.js | 3 ++- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/web/js/dynmaputils.js b/web/js/dynmaputils.js index 9bbf5181..eba240a3 100644 --- a/web/js/dynmaputils.js +++ b/web/js/dynmaputils.js @@ -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; diff --git a/web/js/flatmap.js b/web/js/flatmap.js index 6e66b2ef..da9f20d7 100644 --- a/web/js/flatmap.js +++ b/web/js/flatmap.js @@ -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; diff --git a/web/js/hdmap.js b/web/js/hdmap.js index 3a33bafd..9c84d1b2 100644 --- a/web/js/hdmap.js +++ b/web/js/hdmap.js @@ -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; diff --git a/web/js/kzedmaps.js b/web/js/kzedmaps.js index ea2a65a5..36be3088 100644 --- a/web/js/kzedmaps.js +++ b/web/js/kzedmaps.js @@ -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;