Skip to content

Commit

Permalink
support ILayer's 'pane' property with Leafletjs 1.0 (Leaflet#59)
Browse files Browse the repository at this point in the history
support ILayer's 'pane' property with Leafletjs 1.0
  • Loading branch information
vistawn authored and IvanSanchez committed May 24, 2016
1 parent 204e20b commit a7f07cb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/HeatLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ L.HeatLayer = (L.Layer ? L.Layer : L.Class).extend({
this._initCanvas();
}

map._panes.overlayPane.appendChild(this._canvas);
if (this.options.pane) {
this.getPane().appendChild(this._canvas);
}else{
map._panes.overlayPane.appendChild(this._canvas);
}

map.on('moveend', this._reset, this);

Expand All @@ -59,7 +63,11 @@ L.HeatLayer = (L.Layer ? L.Layer : L.Class).extend({
},

onRemove: function (map) {
map.getPanes().overlayPane.removeChild(this._canvas);
if (this.options.pane) {
this.getPane().removeChild(this._canvas);
}else{
map.getPanes().overlayPane.removeChild(this._canvas);
}

map.off('moveend', this._reset, this);

Expand Down

0 comments on commit a7f07cb

Please sign in to comment.