Skip to content

Commit

Permalink
snap:true assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Mar 8, 2024
1 parent 0b68b28 commit 02ca012
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/mapview/interactions/snap.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ export default function(mapview) {
// The current draw/modify interaction doesn't snap.
if (!mapview.interaction.snap) return;

if (mapview.interaction.snap === true) {

// Assign the interaction layer as snap layer if snap is true.
mapview.interaction.snap = {
layer: mapview.interaction.layer.key
}
}

// Assign mapview and interaction to be _this.
mapview.interaction.snap = {
remove: ()=>{
Expand Down

0 comments on commit 02ca012

Please sign in to comment.