From 0630b2f15df3e04df31a5712045ab3499eb783ea Mon Sep 17 00:00:00 2001 From: James Lyne Date: Mon, 4 Oct 2021 20:40:07 +0100 Subject: [PATCH] Fix DynmapTileLayer sharing object instances --- .../resources/extracted/web/js/dynmaputils.js | 15 +++++++++++---- .../src/main/resources/extracted/web/js/hdmap.js | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/DynmapCore/src/main/resources/extracted/web/js/dynmaputils.js b/DynmapCore/src/main/resources/extracted/web/js/dynmaputils.js index 0f5b9fdb..8884a422 100644 --- a/DynmapCore/src/main/resources/extracted/web/js/dynmaputils.js +++ b/DynmapCore/src/main/resources/extracted/web/js/dynmaputils.js @@ -75,10 +75,17 @@ var DynmapLayerControl = L.Control.Layers.extend({ var DynmapTileLayer = L.TileLayer.extend({ - _namedTiles: {}, - _cachedTileUrls: {}, - _loadQueue: [], - _loadingTiles: [], + _namedTiles: null, + _cachedTileUrls: null, + _loadQueue: null, + _loadingTiles: null, + + initialize: function() { + this._namedTiles = {}; + this._cachedTileUrls = {}; + this._loadQueue = []; + this._loadingTiles = []; + }, createTile: function(coords, done) { var me = this, diff --git a/DynmapCore/src/main/resources/extracted/web/js/hdmap.js b/DynmapCore/src/main/resources/extracted/web/js/hdmap.js index 159c84bf..ecd9b208 100644 --- a/DynmapCore/src/main/resources/extracted/web/js/hdmap.js +++ b/DynmapCore/src/main/resources/extracted/web/js/hdmap.js @@ -35,6 +35,7 @@ var HDMapType = DynmapTileLayer.extend({ this.projection = new HDProjection($.extend({map: this}, options)); L.Util.setOptions(this, options); + DynmapTileLayer.prototype.initialize.call(this, options); }, getTileName: function(coords) { var info = this.getTileInfo(coords);