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

Bugfix - remove source #180

Merged
merged 5 commits into from
Nov 14, 2024
Merged

Bugfix - remove source #180

merged 5 commits into from
Nov 14, 2024

Conversation

nofurtherinformation
Copy link
Collaborator

Bug introduced in refactor that missed removing the maplibre source on remove layers. Current refactor is more readable for future changes.

Description

  • In removeBlockLayers adds a second loop for sources that calls removeSource
  • A future refactor should centralize layer and source manipulations in a single class or store to make it more consistent and ergonomic

Reviewers

].forEach(layer => {
map.getLayer(layer) && map.removeLayer(layer);
});

[BLOCK_SOURCE_ID].forEach(source => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the actual bugfix, rest is just prettier

raphaellaude
raphaellaude previously approved these changes Nov 14, 2024
@nofurtherinformation
Copy link
Collaborator Author

P.s. @raphaellaude added one small refactor, the fit to bounds was acting slightly buggy so I pulled that into the setMapDocument state method

@nofurtherinformation nofurtherinformation merged commit ee0e86a into main Nov 14, 2024
1 check passed
@nofurtherinformation nofurtherinformation deleted the source-bug-fix branch November 14, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants