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

Expose sourceLayerIdentifier on Layer #8663

Closed
tobrun opened this issue Apr 6, 2017 · 3 comments · Fixed by #8709
Closed

Expose sourceLayerIdentifier on Layer #8663

tobrun opened this issue Apr 6, 2017 · 3 comments · Fixed by #8709
Assignees
Labels
Android Mapbox Maps SDK for Android runtime styling

Comments

@tobrun
Copy link
Member

tobrun commented Apr 6, 2017

A useful addition to our current Layer API is exposing sourceLayerIdentfier, while we use it internally we don't expose a getter for it. Such a getter can be useful to filter layers. For example take traffic, you want to add a traffic layer just above all other road layers. For this you would need to get all the style layers and filter out the ones with sourceLayerIdentifier="road".

@tobrun tobrun added Android Mapbox Maps SDK for Android runtime styling labels Apr 6, 2017
@tobrun tobrun added this to the android-v5.1.0 milestone Apr 7, 2017
@tobrun
Copy link
Member Author

tobrun commented Apr 7, 2017

Alternatively to exposing a getter we could also solve this use-case with a getLayers(String sourceLayerIdentfier) this might be a bit cleaner as we don't require the user to get all layers and do the filtering themselves.

Thoughts @ivovandongen?

@ivovandongen
Copy link
Contributor

@tobrun Let's start off with a getter and see if there are actual use cases for a filtered getter. If that's the case, I'd like to make it a little more extensible with a filter object that can have a number of properties to filter on (like the source name).

@tobrun
Copy link
Member Author

tobrun commented Apr 11, 2017

Will work on adding the getter, 👍 on the filter idea.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android runtime styling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants