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

Why is source-layer required? #5820

Closed
colllin opened this issue Dec 6, 2017 · 1 comment
Closed

Why is source-layer required? #5820

colllin opened this issue Dec 6, 2017 · 1 comment

Comments

@colllin
Copy link

colllin commented Dec 6, 2017

Exploratory question / feature request:

Why is source-layer required? And, would a PR be accepted that made it optional? By default, we could render all available source layers.

Motivation

The source-layer option when adding vector layers is relatively opaque, in that it's difficult to recognize associated errors, or to know how to fix them. It is a source of silent errors.

Design Alternatives

Why couldn't source-layer be an optional parameter, in which case we could render all source layers by default? Isn't the vector data already "here" at this point anyway? So we might as well make use of the available data? The developer could always add the source-layer parameter later if needed.

Design

TBD

Mock-Up

TBD

Concepts

TBD

Implementation

TBD

@jfirebaugh
Copy link
Contributor

source-layer is required for layers that use sources of type vector, because it's expected that vector tiles are divided into layers in a way that makes it rare to need to render data from multiple source layers with the same style layer. For instance, vector tile layers typically partition by geometry type, placing point place labels in one layer, road lines in another, and building outlines in a third. You would almost never want to render more than one of those with the same style layer.

We have discussed supporting the less common case where you do want to pull data from multiple source layers into the same style layer. #4362 tracks that request.

Finally, it's worth mentioning that layers that use a geojson source don't require source-layer, as GeoJSON does not have layers.

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

2 participants