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

Clarify documentation for sprite property #6832

Closed
ryanhamley opened this issue Jun 19, 2018 · 2 comments
Closed

Clarify documentation for sprite property #6832

ryanhamley opened this issue Jun 19, 2018 · 2 comments
Assignees

Comments

@ryanhamley
Copy link
Contributor

The style docs say that the sprite property is required if a layer uses the background-pattern, fill-pattern, fill-extrusion-pattern, line-pattern and icon-image properties. The standalone sprite section of the docs however doesn't mention the fill-extrusion-pattern requirement.

In either case, this is confusing. These properties may be necessary when setting up a map's root style, but at runtime you can use the addImage method to help setup a layer that makes use of the *-pattern and icon-image properties without requiring a sprite URL.

This came up as I was trying to add validation for styles that use the "required" properties without a sprite URL in #6831. A strict test that throws an error turns out to be a breaking change for styles that use these properties in runtime via addImage.

@jfirebaugh
Copy link
Contributor

Aha -- yes, we even used to have the validation, but removed it with the addition of addImage.

f50a304#diff-d2fa2e781710b64955ee1cf6467242d4

#6231 is related. The ideal behavior in my opinion is to validate that image references are valid at the time they are added to the style.

@ansis
Copy link
Contributor

ansis commented Jul 9, 2021

The docs now mention fill-extrusion-pattern. It also no longer says that the sprite is required ("its icons can be used to render..."). The docs could be better (like all our style-spec docs could be) but these specific issues seem fixed.

@ansis ansis closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants