The API has it's own checks and expects that we may provide an unsupported language.
There are a couple problems with the current implementation:
Extended language subtag not handled properly
map.setLanguage('es')map.setLanguage('fr-CA')
Expected: show map in fr
Actual: still shows es
Does not switch back to default properly
map.setLanguage('es')map.setLanguage('zz')
Expected: Switch source back to default
Actual: Source stays with es
Different behavior before/after tilejson loaded
There is different behavior when the tilejson has loaded already vs hasn't. This is inconsistent. If we may skip validation in some cases we should skip it in all cases.
We should stop validating whether a language is supported by a particular source.
https://github.com/mapbox/mapbox-gl-js/blob/b456388a97903fbfe94d8d4d66f0eceb53a0bebd/src/source/vector_tile_source.js#L215
The API has it's own checks and expects that we may provide an unsupported language.
There are a couple problems with the current implementation:
Extended language subtag not handled properly
map.setLanguage('es')
map.setLanguage('fr-CA')
Expected: show map in
fr
Actual: still showses
Does not switch back to default properly
map.setLanguage('es')
map.setLanguage('zz')
Expected: Switch source back to default Actual: Source stays with
es
Different behavior before/after tilejson loaded
There is different behavior when the tilejson has loaded already vs hasn't. This is inconsistent. If we may skip validation in some cases we should skip it in all cases.