首页 > 解决方案 > 如何更改 Here Maps Js api 中路由指令的语言?

问题描述

我正在使用此示例生成从 A 到 B 的路线。

https://developer.here.com/documentation/examples/maps-js/services/map-with-route-from-a-to-b

但是我找不到更改说明语言(葡萄牙语)的方法。

有人能帮我吗?

标签: javascripthere-apiheremaps

解决方案


在您的路由请求中,您可以传入语言参数。对于语言,您有两种选择:可以使用 指定的葡萄牙语 - 巴西pt-br,或者可以使用 指定的葡萄牙语 - 葡萄牙pt-pt

routeRequestParams = {
    routingMode: 'fast',
    lang: 'pt-br',
    transportMode: 'car',
    origin: '52.5160,13.3779', // Brandenburg Gate
    destination: '52.5206,13.3862',  // Friedrichstraße Railway Station
    return: 'polyline,turnByTurnActions,actions,instructions,travelSummary'
};

推荐阅读