Add guard for map styles in map operations#1445
Merged
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Huulivoide
requested changes
Jun 16, 2026
Huulivoide
left a comment
Contributor
There was a problem hiding this comment.
@Huulivoide reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on patricvincit).
ui/src/utils/map/mapUtils.ts line 23 at r1 (raw file):
* Checks if the map style exists and that it has finished loading. This is needed before performing operations on the map, such as adding/manipulating layers or sources. */ export const isMapStyleReady = (map: MapInstance) => {
funktion määrittely function avainsanalla ylätasolla.
Add isMapStyleReady before map layer/source operations to avoid “Style is not done loading” and "Cannot read properties of undefined" errors. Styles might be still loading even if map exists so checking just for the map is not enough
e87099d to
f5f5214
Compare
Contributor
Author
|
Previously, Huulivoide (Jesse Jaara) wrote…
Done. |
Huulivoide
approved these changes
Jun 17, 2026
Huulivoide
left a comment
Contributor
There was a problem hiding this comment.
@Huulivoide reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on patricvincit).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add isMapStyleReady before map layer/source operations to avoid “Style is not done loading” and "Cannot read properties of undefined" errors.
Styles might be still loading even if map exists so checking just for the map is not enough
This change is