-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Switching between label locales can make “null” labels appear #11719
Comments
These ways lack |
I saw this in treble when switching either way between |
The issue reproduces when using mapbox-gl-native/platform/darwin/src/MGLVectorTileSource.mm Lines 123 to 125 in a6c02ad
mapbox-gl-native/platform/darwin/src/NSExpression+MGLAdditions.mm Lines 1420 to 1423 in a6c02ad
|
The layer in question is Then, localizing to |
I’ve confirmed that a
So it’s very likely that this cast is being introduced in mbgl. /cc @anandthakker |
I think this is probably the best place to fix this: can we translate "{name_en}" to (the NSExpression equivalent of) |
Yes, that would be a possibility. However, more generally, it might be unexpected to a developer that |
Hm, good point. Would it be more appropriate for |
Is this the right ticket to track porting mapbox/mapbox-gl-js#6534 to gl-native? Since I don't see another ticket, I'll use this one for the native ignore until we make the corresponding native change to |
Yes, this ticket tracks a port of mapbox/mapbox-gl-js#6534. |
Fixed in #11904 on the release-boba branch for iOS map SDK v4.0.1 and macOS map SDK v0.7.1. |
Mapbox SDK version:
ios-v4.0.0-rc.1
Steps to trigger behavior
-[MGLStyle localizeLabelsIntoLocale:]
to set a locale — e.g.,nil
or[NSLocale localeWithLocaleIdentifier:@"mul"]
.-[MGLStyle localizeLabelsIntoLocale:]
to set a different label locale.Expected behavior
All labels will be localized into the desired locale. If no label should exist, none will exist.
Actual behavior
After switching to the second locale, some map features that shouldn’t be labeled gain “null” labels.
This road at Tokyo Station.
Workaround
Call
-[MGLMapView reloadStyle:]
before switching locales, then set the new locale in-mapView:didFinishLoadingStyle:
./cc @1ec5
The text was updated successfully, but these errors were encountered: