Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure drawMany feature labels are incremental #495

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Sep 4, 2024

Flagged while testing drawMany

I honestly don't fully understand what was happening here, but my best guess is that is has to do with how OpenLayer's change event listens to more internal events than just adding features as we see them on the map, therefore anything called in this block may be firing off more often than we expect?

Setting the label based on the current length of all features, rather than an index of the one we're iterating over, seems to do the trick - labels are consistently incrementing by one now!
chrome-capture-2024-8-4 (1)

Copy link

netlify bot commented Sep 4, 2024

Deploy Preview for oslmap ready!

Name Link
🔨 Latest commit 35a72e8
🔍 Latest deploy log https://app.netlify.com/sites/oslmap/deploys/66d89053d5a941000861e99d
😎 Deploy Preview https://deploy-preview-495--oslmap.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jessicamcinchak jessicamcinchak requested a review from a team September 4, 2024 19:59
@jamdelion
Copy link

jamdelion commented Sep 5, 2024

Flagged while testing drawMany

I honestly don't fully understand what was happening here, but my best guess is that is has to do with how OpenLayer's change event listens to more internal events than just adding features as we see them on the map, therefore anything called in this block may be firing off more often than we expect?

Setting the label based on the current length of all features, rather than an index of the one we're iterating over, seems to do the trick - labels are consistently incrementing by one now! chrome-capture-2024-8-4 (1)

Might be worth making this gif bigger, I can't really see what's happening in it!

@jessicamcinchak
Copy link
Member Author

jessicamcinchak commented Sep 5, 2024

@jamdelion yes sorry know it's tiny - GitHub kept rejecting other versions because too big file size !

Other best way to test changes in this repo is:

  • Go to Netlify deploy of Pitsy docs
  • Open an "interactive playground" for map & directly adjust props there & test!

@jessicamcinchak jessicamcinchak merged commit f1d0421 into main Sep 5, 2024
5 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/fix-drawMany-labeling branch September 5, 2024 09:45
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