-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localization plugin should transform expressions #374
Comments
mapbox/mapbox-navigation-ios#1076 implements a fairly thorough expression transformation: https://github.com/mapbox/mapbox-navigation-ios/blob/cced8ad5d37032f059def9ea8a19e47e299536bc/MapboxNavigation/NSExpression.swift The iOS map SDK’s built-in label localization functionality (see mapbox/mapbox-gl-native#10713) is more directly analogous to what the Android localization plugin does, but it’s probably a bit easier to understand the Swift implementation than it’ll be to understand my Objective-C port of this code to the map SDK. |
This issues blocked by a few problems downstream, mainly mapbox/mapbox-gl-native#11659 and mapbox/mapbox-gl-native#11749. |
#455 is a very early start at localizing expressions that has stalled out. Both mapbox/mapbox-gl-native#11659 and mapbox/mapbox-gl-native#11749 have been fixed, so this work is technically unblocked. However, in the process of implementing mapbox/mapbox-navigation-android#1226, we discovered another missing piece of the map SDK. There’s no way to determine a layer’s source, only a layer’s source layer: mapbox/mapbox-gl-native#12691. So although it is possible to localize a style, the localization will be very aggressive, affecting all layers, not only the ones backed by the Streets source. For example, if the style contains a symbol layer whose text field is based on a GeoJSON source’s Until mapbox/mapbox-gl-native#12691 is fixed, this plugin will have to take the same approach as mapbox/mapbox-gl-native#12387 of coalescing the localized field with |
Fixed in #654. |
The map localization plugin added in #74 only works if a
text-field
property is set to a constant value that uses the legacy token syntax, e.g.{name_en}
. In a style such as Mapbox Streets, some layers’text-field
s are set to camera functions, so they remain unlocalized. To make matters worse, future versions of these and other styles will be written for versions of the SDK that support expressions.{name_en}
will become["get", "name_en"]
, so this plugin will end up having no effect whatsoever./ref mapbox/mapbox-gl-native#10713 mapbox/mapbox-gl-js#6197
/cc @langsmith @tobrun
The text was updated successfully, but these errors were encountered: