Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

MGLVectorStyleLayer.sourceLayerIdentifier is never optional #6780

Closed
incanus opened this issue Oct 21, 2016 · 9 comments
Closed

MGLVectorStyleLayer.sourceLayerIdentifier is never optional #6780

incanus opened this issue Oct 21, 2016 · 9 comments
Assignees
Labels
archived Archived because of inactivity bug documentation gl-ios iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling

Comments

@incanus
Copy link
Contributor

incanus commented Oct 21, 2016

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:

  • Auto-determining single-data-layer source layer names
  • A better property name such as sourceDataLayerIdentifier or sourceLayerName to emphasize that sources have data layers that tie to style layers
  • KVO-aware source layer querying a là style layer querying in MGLStyle key-value coding compliance #6097

/cc @1ec5 @boundsj

@incanus incanus added bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release runtime styling labels Oct 21, 2016
@incanus incanus added this to the ios-v3.4.0 milestone Oct 21, 2016
@incanus
Copy link
Contributor Author

incanus commented Oct 21, 2016

Some background on iOS: #6269 (comment)

@1ec5
Copy link
Contributor

1ec5 commented Oct 21, 2016

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 sourceLayerIdentifier initializer parameter but leave it nullable for the vector source case.

Auto-determining single-data-layer source layer names

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.

@boundsj boundsj removed the release blocker Blocks the next final release label Oct 24, 2016
@boundsj boundsj modified the milestones: ios-3.4.1, ios-v3.4.0 Oct 31, 2016
@ericrwolfe
Copy link
Contributor

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.

@1ec5
Copy link
Contributor

1ec5 commented Dec 1, 2016

Auto-determining single-data-layer source layer names

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 -sourceWithIdentifier: (#6584).

@1ec5 1ec5 removed this from the ios-v3.4.1 milestone Jan 24, 2017
@1ec5
Copy link
Contributor

1ec5 commented Jan 24, 2017

Moving off a milestone, because further action depends on #7255.

@fabian-guerra fabian-guerra self-assigned this Jan 24, 2017
@1ec5
Copy link
Contributor

1ec5 commented Jan 24, 2017

An interim fix could look like this:

  • Document the fact that a style layer identifier is required when working with MGLVectorSource
  • When adding an MGLVectorStyleLayer to an MGLMapView, if the source refers to an MGLVectorSource but there’s no style layer identifier, raise an exception

@stale stale bot added the archived Archived because of inactivity label Nov 15, 2018
@stale
Copy link

stale bot commented Nov 24, 2018

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Nov 24, 2018
@fabian-guerra fabian-guerra reopened this Nov 26, 2018
@stale stale bot removed the archived Archived because of inactivity label Nov 26, 2018
@stale stale bot added the archived Archived because of inactivity label May 25, 2019
@stale
Copy link

stale bot commented May 25, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed May 25, 2019
@fabian-guerra fabian-guerra reopened this May 28, 2019
@stale stale bot removed the archived Archived because of inactivity label May 28, 2019
@jmkiley jmkiley added the gl-ios label Nov 21, 2019
@stale stale bot added the archived Archived because of inactivity label May 21, 2020
@stale
Copy link

stale bot commented May 22, 2020

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity bug documentation gl-ios iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling
Projects
None yet
Development

No branches or pull requests

6 participants