Skip to content

Commit

Permalink
pm:cut event layer and original layer properties changes (major)
Browse files Browse the repository at this point in the history
  • Loading branch information
codeofsumit committed Aug 17, 2018
1 parent bf16348 commit 923bec8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/js/Draw/L.PM.Draw.Cut.js
Expand Up @@ -31,7 +31,6 @@ Draw.Cut = Draw.Poly.extend({
}
});


// loop through all layers that intersect with the drawn (cutting) layer
layers.forEach((l) => {
// find layer difference
Expand All @@ -48,15 +47,15 @@ Draw.Cut = Draw.Poly.extend({
// fire pm:cut on the cutted layer
l.fire('pm:cut', {
shape: this._shape,
layer: l,
resultingLayer,
layer: resultingLayer,
originalLayer: l,
});

// fire pm:cut on the map for each cutted layer
// fire pm:cut on the map
this._map.fire('pm:cut', {
shape: this._shape,
cuttedLayer: l,
resultingLayer,
layer: resultingLayer,
originalLayer: l,
});

// add templayer prop so pm:remove isn't fired
Expand Down

0 comments on commit 923bec8

Please sign in to comment.