Skip to content

Add guard for map styles in map operations#1445

Merged
patricvincit merged 1 commit into
mainfrom
fix-style-not-loaded-error-map
Jun 17, 2026
Merged

Add guard for map styles in map operations#1445
patricvincit merged 1 commit into
mainfrom
fix-style-not-loaded-error-map

Conversation

@patricvincit

@patricvincit patricvincit commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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 Reviewable

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@Huulivoide Huulivoide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@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
@patricvincit patricvincit force-pushed the fix-style-not-loaded-error-map branch from e87099d to f5f5214 Compare June 17, 2026 05:53
@patricvincit

Copy link
Copy Markdown
Contributor Author

ui/src/utils/map/mapUtils.ts line 23 at r1 (raw file):

Previously, Huulivoide (Jesse Jaara) wrote…

funktion määrittely function avainsanalla ylätasolla.

Done.

@Huulivoide Huulivoide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Huulivoide reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on patricvincit).

@patricvincit patricvincit merged commit a6a2d45 into main Jun 17, 2026
24 checks passed
@patricvincit patricvincit deleted the fix-style-not-loaded-error-map branch June 17, 2026 08:01
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