mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

Clarify that source-layer is not used with GeoJSON sources #547

Closed incanus closed 7 years ago

incanus commented 7 years ago

Currently, a style layer source-layer is optional:

source-layer Optional string. Layer to use from a vector tile source. Required if the source supports multiple layers.

https://www.mapbox.com/mapbox-gl-style-spec/#layer-source-layer

This isn't consistent with vector layers requiring the source-layer to be specified:

All layers that use a vector source must specify a "source-layer" value.

https://www.mapbox.com/mapbox-gl-style-spec/#sources-vector

This requirement exists even if there is only one layer in the source. Bonus: Maybe we can also make assumptions there for convenience?

This led to at least one implementation making the source layer optional (see MGLVectorStyleLayer, where sourceLayerIdentifier is nullable and thus incorrectly optional).

/cc @1ec5 @boundsj

jfirebaugh commented 7 years ago

It's optional because layers whose source is a GeoJSON source do not have a source layer.

lucaswoj commented 7 years ago

This issue was moved to mapbox/mapbox-gl-js#4135