mapbox-gl-js
mapbox-gl-js copied to clipboard
Spanish language labels can be incorrect and limited
We are using:
map.setLayoutProperty(label, 'text-field', ['get', `name_${language-abbr}`]
to switch between label languages in our Mapbox Studio custom map. The label data source is Mapbox Streets v8. The text field formula I am using in Mapbox Studio is
to-string(coalesce(name, name_local))
When I use the option 'es' for the language-abbr
in the code above, Long Beach in Los Angeles changes to 'Kragujevac', which is a city in Serbia. Please see the screenshots below.
For now, is there a workaround to specifically replace the 'Kragujevac' label with 'Long Beach' when the label language is set to 'es'? For a more proper fix, I'd love to be able to pass this issue on to the appropriate Mapbox team.
There are also many missing Spanish language labels in Los Angeles County. I cannot get Spanish labels for roads, parks, and other POI's. As a result, these labels disappear on the map when the language is changed to Spanish. Airports, waterways, and streams have good coverage!
mapbox-gl-js version: 2.10.0
browser: Any
Expected Behavior
![Screen Shot 2022-09-20 at 4 32 26 PM](https://user-images.githubusercontent.com/15721176/191384401-3b0505bf-bb5d-4f42-9a5c-75750d9d5ec2.png)
Actual Behavior
![Screen Shot 2022-09-20 at 4 32 53 PM](https://user-images.githubusercontent.com/15721176/191386889-1f3c5d8b-e397-42f7-b671-8fcb040ff7da.png)
Thanks for reporting this issue @interwebjill!
We're looking into the incorrect label for Long Beach. As a workaround, you can add an override to always display the name in English as described here.
There are also many missing Spanish language labels in Los Angeles County. I cannot get Spanish labels for roads, parks, and other POI's. As a result, these labels disappear on the map when the language is changed to Spanish. Airports, waterways, and streams have good coverage!
I think you should be able to see fallbacks to English labels by using the same expression as studio, something like this (untested) ['coalesce', ['get', 'name_${language-abbr}'], ['get', 'name']]
The incorrect Spanish label for Long Beach has been resolved.