首页 > 解决方案 > HERE Maps: Realtime coverage for public transit API

问题描述

Does anyone manage to get real time information from the HERE Maps Public Transit API?

Inputting coordinates for Central Station (Sydney, Australia) to Circular Quay Station using simple routing like so:

https://transit.ls.hereapi.com/v3/route.json?dep=-33.883271,151.207000&arr=-33.861508%2C151.210564&time=2019-12-31T22:30:00&routing=sr&apiKey=<apiKey>

which is covered under real time returns:

{
    "Res": {
        "serviceUrl": "https://transit.ls.hereapi.com/transit/v3/route.json",
        "Message": {
            "code": "GW0001",
            "level": "E",
            "subcode": "NO_COV",
            "text": "Out of coverage"
        }
    }
}

标签: restmapshere-apihere-maps-rest

解决方案


为了获得实时的公交路线,有一个参数叫做

路由模式=实时

请参阅以下请求(从您的请求中删除路由:不是有效参数)

https://transit.ls.hereapi.com/v3/route.json?dep=-33.883271,151.207000&arr=-33.861508%2C151.210564&time=2020-01-02T16:32:00&apiKey=your_apiKey&routingMode=realtime

有关详细文档,请访问此处

希望这可以帮助!


推荐阅读