From 1aa3d07e6a1a3368bb96ba776e900d768c9e2892 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 15 Aug 2011 04:44:24 +0800 Subject: [PATCH] Fix break in namedTile during integrate of updated Leaflet --- web/js/dynmaputils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/js/dynmaputils.js b/web/js/dynmaputils.js index dfdd06a2..14304afd 100644 --- a/web/js/dynmaputils.js +++ b/web/js/dynmaputils.js @@ -107,13 +107,12 @@ var DynmapTileLayer = L.TileLayer.extend({ this._container.appendChild(fragment); }, - + //Copy and mod of Leaflet method - marked changes with Dynmap: to simplify reintegration _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, + name = this.getTileName(tilePoint, zoom), //Dynmap tileLimit = (1 << zoom); // wrap tile coordinates @@ -133,9 +132,12 @@ var DynmapTileLayer = L.TileLayer.extend({ // create tile var tile = this._createTile(); + tile.tileName = name; //Dynmap + tile.tilePoint = tilePoint; //Dynmap L.DomUtil.setPosition(tile, tilePos); this._tiles[key] = tile; + this._namedTiles[name] = tile; //Dynmap if (this.options.scheme == 'tms') { tilePoint.y = tileLimit - tilePoint.y - 1;