-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Cannot introspect source or layer obtained from style #6584
Comments
Not really, there's just never been a requirement to expose accessors for them before. API design considerations:
|
Noting that this concept was recently added to the iOS SDK in #6316 to support the initialization of sources with tile templates. |
Also has been a part of the Android API for a bit now. If we want to change this, we need to do this either before the upcoming 4.2 release or wait until 5.0. |
It's probably fine used as a package of parameters you can pass when creating a source. I'm saying, write |
The main thing developers would want to extract from a GeoJSON source would be the (untiled) GeoJSON it contains: #7376. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
A source or style layer obtained from a map’s current style has its identifier set but has no other properties set. Therefore, there’s no way to obtain the source associated with a particular layer that comes with the Mapbox Streets style, nor is there a way to get the tile sets associated with that source.
I’m filing this issue in the course of fixing #6406, based on a close reading of the iOS/macOS and Android code base. To reproduce this issue on iOS or macOS, try the following code with the Mapbox Streets v9 style:
To fix this issue, we’ll have to expose more members of
mbgl::style::Layer
andmbgl::style::Source
that up to now have been stashed away in privateImpl
classes. For instance, we’ll need anmbgl::style::VectorSource::getTileset()
that returns the existingmbgl::style::TileSourceImpl::tileset
. I’m sure these members were hidden for good reason. To mitigate any questions about the expected lifetime of the returned object, it may be necessary to fix #6254 in the course of fixing this bug. (#6254 probably applies to the Android SDK as well.)/cc @jfirebaugh @ivovandongen @incanus @frederoni @boundsj
The text was updated successfully, but these errors were encountered: