首页 > 解决方案 > Mapbox - 如何在导航时更改默认语言

问题描述

默认语言是英语,我想在导航时将其更改为其他语言。如何?

代码片段看起来像......

// Specify that the route is intended for automobiles avoiding traffic
let routeOptions = NavigationRouteOptions(waypoints: [origin, destination], profileIdentifier: .automobileAvoidingTraffic)

// Generate the route object and draw it on the map
Directions.shared.calculate(routeOptions) { [weak self] (session, result) in
....

.....

navigationViewController.navigationService.simulationMode = SimulationMode.always
navigationViewController.navigationService.simulationSpeedMultiplier = 9
self.present(navigationViewController, animated: true, completion: nil)

标签: iosswiftmapbox

解决方案


这对我有用:routeOptions.locale = Locale(identifier: "da_DK")


推荐阅读