You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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 thesource-layer
parameter later if needed.Design
TBD
Mock-Up
TBD
Concepts
TBD
Implementation
TBD
The text was updated successfully, but these errors were encountered: