Skip to content

Commit

Permalink
Merge branch 'main' of github.com:theopensystemslab/map into jess/sna…
Browse files Browse the repository at this point in the history
…p-styles
  • Loading branch information
jessicamcinchak committed Nov 19, 2021
2 parents f1b1bf7 + 4d3ad71 commit c95d8de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/my-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,11 @@ export class MyMap extends LitElement {
if (!loadInitialDrawing) {
map.addInteraction(draw);
}
map.addInteraction(snap);
map.addInteraction(modify);

// XXX: snap must be added after draw and modify
map.addInteraction(snap);

// 'change' listens for 'drawend' and modifications
drawingSource.on("change", () => {
const sketches = drawingSource.getFeatures();
Expand All @@ -333,7 +335,6 @@ export class MyMap extends LitElement {

// limit to drawing a single polygon, only allow modifications to existing shape
map.removeInteraction(draw);
map.removeInteraction(snap);
}
});
}
Expand Down

0 comments on commit c95d8de

Please sign in to comment.