我无法从平台获取 trafficService

I cannot get the trafficService from platform

我正在尝试从 H.service.Platform 获取 trafficService,但由于某些原因我不能

我正在关注文档: https://developer.here.com/documentation/maps/topics_api/h-service-traffic-service.html

所以我有一个工作 H.service.Platform(这肯定有效,因为我正在使用 TrafficIncidentsService 并且零问题)。

但是当我尝试按照文档中的描述获取 trafficService exaclty 时

let traffic = platform.getTrafficService();

我得到的只是一个错误

ERROR TypeError: platform.getTrafficService is not a function
at HereTrafficApiService.getTrafficFlow (here-traffic-api.service.ts:37)
at TrafficWidgetComponent.getApiData (traffic-widget.component.ts:219)
    at traffic-widget.component.ts:62
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:34182)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at invokeTask (zone-evergreen.js:465)
    at ZoneTask.invoke (zone-evergreen.js:454)
    at timer (zone-evergreen.js:2650)```

也许我遗漏了一些东西,但是,如果我从检查员那里查看平台对象,就会发现 getTrafficIncidentsService() but没有 getTrafficService() 我不知道为什么。 有人可以帮忙吗?

如果您使用的是 3.0 版,则没有显示交通流图块的服务,因为交通流图块是 MapTileService 的一部分。因此:

版本 3.0:

交通磁贴:platform.getMapTileService()

交通事故:platform.getTrafficIncidents()

版本 3.1:

交通板块和事故:platform.getTrafficService()