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

The source-layer field is optional, but why can't pass undefined #13321

Open
frylstar opened this issue Nov 7, 2024 · 0 comments
Open

The source-layer field is optional, but why can't pass undefined #13321

frylstar opened this issue Nov 7, 2024 · 0 comments

Comments

@frylstar
Copy link

frylstar commented Nov 7, 2024

The source-layer field is optional, but when I pass the value undefined, the console gives an error: Error: layers.outline.source-layer: string expected, undefined found. I'm confused about this sign, but it doesn't seem to report an error in previous versions.
I provide an example of adding source-layer : undefined below.

mapbox-gl-js version: v3.7.0

browser: Chrome

Link to Demonstration

https://jsbin.com/zepefoq/edit?html,output

Expected Behavior

[layer.sourceLayer
string?](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#addlayer)

"source-layer"?: string,

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

No branches or pull requests

1 participant