Merge pull request #1233 from mehmeta/leafletmaster

Polyline layer leaves markers behind if removed in editing state
This commit is contained in:
Vladimir Agafonkin 2012-12-25 22:28:52 -08:00
commit a9c12f1d81

View File

@ -63,6 +63,8 @@ L.Path = L.Class.extend({
onRemove: function (map) {
map._pathRoot.removeChild(this._container);
// Need to fire remove event before we set _map to null as the event hooks might need the object
this.fire('remove');
this._map = null;
if (L.Browser.vml) {
@ -71,8 +73,6 @@ L.Path = L.Class.extend({
this._fill = null;
}
this.fire('remove');
map.off({
'viewreset': this.projectLatlngs,
'moveend': this._updatePath