You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This question on Stack Overflow reminded of this common pain point: when a layer definition includes source-layer that doesn't correspond to any actual source layer, Mapbox-GL simply fails to render anything, with no warning.
My understanding is that the library should have access to the list of actual source layers for any vector source loaded via TileJSON. So in theory it should be possible to check that the requested source-layer is in that list, and if not, output a warning, something like:
Warning: source-layer "trees" does not exist in vector tile source "test". No features will be displayed..
The text was updated successfully, but these errors were encountered:
The problem as I see it is that vector_layers in TileJSON is a non-standard, undocumented feature (see mapbox/tilejson-spec#14), so we can't rely on it. We also can't rely on the actual tile contents because some tiles will often not contain a particular source layer that is generally expected but not in the specific area. So I'm not sure whether we should proceed until TileJSON spec & MVT producers all catch up.
Hmm, I can see how Mapbox-GL might not always know what vector layers are available (same goes when tiles are specified by tiles property, without a TileJSON at all). But can it warn when it happens to have that information, and just proceed as currently when it's not there (or in the case of a TileJSON that doesn't include it, or if some future version of the spec drops it...)
Maybe I don't quite get why this feature would be so tightly coupled to that spec, but you're the expert :)
This question on Stack Overflow reminded of this common pain point: when a layer definition includes
source-layer
that doesn't correspond to any actual source layer, Mapbox-GL simply fails to render anything, with no warning.My understanding is that the library should have access to the list of actual source layers for any vector source loaded via TileJSON. So in theory it should be possible to check that the requested
source-layer
is in that list, and if not, output a warning, something like:Warning: source-layer "trees" does not exist in vector tile source "test". No features will be displayed.
.The text was updated successfully, but these errors were encountered: