Merge pull request #3508 from JLyne/leaflet-fix
Fix DynmapTileLayer sharing object instances
This commit is contained in:
commit
4110e33afd
2 changed files with 12 additions and 4 deletions
|
|
@ -75,10 +75,17 @@ var DynmapLayerControl = L.Control.Layers.extend({
|
||||||
|
|
||||||
|
|
||||||
var DynmapTileLayer = L.TileLayer.extend({
|
var DynmapTileLayer = L.TileLayer.extend({
|
||||||
_namedTiles: {},
|
_namedTiles: null,
|
||||||
_cachedTileUrls: {},
|
_cachedTileUrls: null,
|
||||||
_loadQueue: [],
|
_loadQueue: null,
|
||||||
_loadingTiles: [],
|
_loadingTiles: null,
|
||||||
|
|
||||||
|
initialize: function() {
|
||||||
|
this._namedTiles = {};
|
||||||
|
this._cachedTileUrls = {};
|
||||||
|
this._loadQueue = [];
|
||||||
|
this._loadingTiles = [];
|
||||||
|
},
|
||||||
|
|
||||||
createTile: function(coords, done) {
|
createTile: function(coords, done) {
|
||||||
var me = this,
|
var me = this,
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ var HDMapType = DynmapTileLayer.extend({
|
||||||
this.projection = new HDProjection($.extend({map: this}, options));
|
this.projection = new HDProjection($.extend({map: this}, options));
|
||||||
|
|
||||||
L.Util.setOptions(this, options);
|
L.Util.setOptions(this, options);
|
||||||
|
DynmapTileLayer.prototype.initialize.call(this, options);
|
||||||
},
|
},
|
||||||
getTileName: function(coords) {
|
getTileName: function(coords) {
|
||||||
var info = this.getTileInfo(coords);
|
var info = this.getTileInfo(coords);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue