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

Delay-loaded images may trigger warning about mismatched SDF property #303

Closed
drwestco opened this issue Sep 3, 2021 · 0 comments · Fixed by #302
Closed

Delay-loaded images may trigger warning about mismatched SDF property #303

drwestco opened this issue Sep 3, 2021 · 0 comments · Fixed by #302

Comments

@drwestco
Copy link
Contributor

drwestco commented Sep 3, 2021

maplibre-gl-js version: some

browser: all

Steps to Trigger Behavior

MVT sprite data with one or more images not specifying the SDF property. SDF is left as undefined, treated the same as 'false'. https://maplibre.org/maplibre-gl-js-docs/style-spec/sprite/

MVT tile with one or more symbols referring to a delay-loaded image ID. In code, respond to styleimagemissing event, and inject the image through the map.addImage API.

symbol_layout.ts does a strict comparison to ensure all referenced images for a bucket use the same value for the SDF property. Thus flags false as different than undefined.

Result: Warning logged to JS console: "Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer".

HarelM pushed a commit that referenced this issue Sep 4, 2021
Fixes #303

* Default handling for image.sdf

Treats null/undefined the same as false for the image sdf property, eliminating a console warning in the process.

* Update CHANGELOG.md
wipfli referenced this issue in wipfli/maplibre-gl-js Sep 9, 2021
Fixes #303

* Default handling for image.sdf

Treats null/undefined the same as false for the image sdf property, eliminating a console warning in the process.

* Update CHANGELOG.md
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 a pull request may close this issue.

1 participant