-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MGLVectorStyleLayer.sourceLayerIdentifier is never optional #6780
Comments
Some background on iOS: #6269 (comment) |
mapbox/mapbox-gl-style-spec#547 (comment) points out that the source layer is never specified for GeoJSON sources. The documentation could clarify the fact that the source layer is required for multilayered vector sources. We could also bring back the
If after mapbox/mapbox-gl-style-spec#547 the style specification continues to carve out an exception for single-layer sources, but mbgl doesn’t automatically use the sole layer in a source, please open a separate issue. |
Was just scratching my head as to why a layer wasn't appearing. We ought to consider adding an assertion if the source layer referenced by the style layer isn't found. |
Defaulting to the sole source layer should happen at the mbgl level. The SDK currently can neither do that nor assert that a source layer identifier is valid, because mbgl doesn’t expose any information about what constitutes a vector source (#7255), especially not a source baked into the style and obtained through |
Moving off a milestone, because further action depends on #7255. |
An interim fix could look like this:
|
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Upstream spec issue: mapbox/mapbox-gl-style-spec#547
Vector layer styling doesn't work if the
sourceLayerIdentifier
isn't specified, even if there is only one data layer in the source and/or it is named just like the source identifier and/or layer identifier.While we're in here, we could consider a few enhancements:
sourceDataLayerIdentifier
orsourceLayerName
to emphasize that sources have data layers that tie to style layers/cc @1ec5 @boundsj
The text was updated successfully, but these errors were encountered: