Skip to content
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

Upgrade to Mapbox Streets source v8 #1909

Merged
merged 1 commit into from
Dec 19, 2018
Merged

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Dec 19, 2018

Both label localization and feature querying for the current road name label now support styles powered by Mapbox Streets source v8. If the current style doesn’t use the Streets source, version 8 is now added automatically instead of v7.

Fixes #1896.

/cc @frederoni @JThramer

Both label localization and feature querying for the current road name label now support styles powered by Mapbox Streets source v8. If the current style doesn’t use the Streets source, version 8 is now added automatically instead of v7.
@@ -1006,7 +1006,8 @@ open class NavigationMapView: MGLMapView, UIGestureRecognizerDelegate {
}

// Road labels should match road signage.
let locale = layer.sourceLayerIdentifier == "road_label" ? Locale(identifier: "mul") : nil
let isLabelLayer = MGLVectorTileSource.roadLabelLayerIdentifiersByTileSetIdentifier.values.contains(layer.sourceLayerIdentifier ?? "")
let locale = isLabelLayer ? Locale(identifier: "mul") : nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's "mul"? Doesn't seem to be supported by Locale 🤔. If so, won't this always evaluate to nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mul is the ISO 639 identifier meaning “multilingual”. The map SDK maps this code to the name field. Since that field displays the local language for each feature, it effectively produces a multilingual map. Locale(identifier: "mul") is supported in the sense that its languageCode is mul, which is all we need for this API.

@1ec5 1ec5 merged commit 3dea3e8 into master Dec 19, 2018
@1ec5 1ec5 deleted the 1ec5-streets-source-v8-1896 branch December 19, 2018 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants