accept name in Layer getPane, make Marker panes configurable
This commit is contained in:
parent
7f03570b8d
commit
d53bc0e4f8
@ -63,9 +63,10 @@ L.Layer = L.Class.extend({
|
||||
this._map = null;
|
||||
},
|
||||
|
||||
getPane: function () {
|
||||
getPane: function (name) {
|
||||
// TODO make pane if not present
|
||||
return this._map._panes[this.options.pane];
|
||||
var paneName = name ? this.options[name] || name : this.options.pane;
|
||||
return this._map._panes[paneName];
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
L.Marker = L.Layer.extend({
|
||||
|
||||
options: {
|
||||
pane: 'markerPane',
|
||||
|
||||
icon: new L.Icon.Default(),
|
||||
// title: '',
|
||||
// alt: '',
|
||||
@ -147,13 +149,11 @@ L.Marker = L.Layer.extend({
|
||||
}
|
||||
|
||||
|
||||
var panes = this._map._panes;
|
||||
|
||||
if (addIcon) {
|
||||
panes.markerPane.appendChild(this._icon);
|
||||
this.getPane().appendChild(this._icon);
|
||||
}
|
||||
if (newShadow && addShadow) {
|
||||
panes.shadowPane.appendChild(this._shadow);
|
||||
this.getPane('shadowPane').appendChild(this._shadow);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user