Skip to content

fix: keep snapping behaviour while modifying polygon#83

Merged
johnrees merged 1 commit intomainfrom
drag-snaps
Nov 19, 2021
Merged

fix: keep snapping behaviour while modifying polygon#83
johnrees merged 1 commit intomainfrom
drag-snaps

Conversation

@johnrees
Copy link
Copy Markdown
Contributor

I think this should fix this issue with modify shape not snapping, apologies for the extra prettier noise! We'll get prettier running on everything in this repo again at some point.

Steps taken

  • ensure snap interaction behaviour added after draw and modify behaviours
  • don't remove snap behaviour after completing shape

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 19, 2021

✔️ Deploy Preview for oslmap ready!

🔨 Explore the source changes: 6180751

🔍 Inspect the deploy log: https://app.netlify.com/sites/oslmap/deploys/6197923519dfe60008d124a8

😎 Browse the preview: https://deploy-preview-83--oslmap.netlify.app

Comment thread src/my-map.ts
map.addInteraction(modify);

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oo this is interesting!! i had tried not removing the snap interaction, but hadn't thought to re-order how they're added! and figured because the modify interaction can only have a single source which is drawingSource, rather than the pointsSource, that it wasn't quite possible

@johnrees johnrees merged commit 4d3ad71 into main Nov 19, 2021
@johnrees johnrees deleted the drag-snaps branch November 19, 2021 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants