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

Improve Map Component #25

Open
kamicut opened this issue Jan 23, 2025 · 0 comments
Open

Improve Map Component #25

kamicut opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@kamicut
Copy link
Collaborator

kamicut commented Jan 23, 2025

The map component is now written in an imperative style instead of a declarative style, using map.addLayer instead of react components. This was done for the following reasons:

  • We tried using the beforeId layer ordering mechanism in maplibre, but adding a TMS layer after map load would be push it to the top of the layer stack.
  • If the user asks for a location (“I want alerts for Berlin”) followed by another location request (“actually I want alerts for Munich”) we have to dynamically replace the geojson sources in the existing location layer.

For these reasons it was easier to use an imperative style and useEffect. However this decreased the readability in the component and made it more complicated. This ticket tracks how to reduce this complexity.

@kamicut kamicut added the enhancement New feature or request label Jan 23, 2025
@kamicut kamicut self-assigned this Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant