扩展传单路由机以使用 Here Maps

问题描述

Leaflet Routing Machine 提供了一种在 Leaflet 中集成路线功能的简单方法。开箱即用,它曾经与 MapBox 一起使用,但自从它更新以来已经有一段时间了,我发现它不再适用了。无论如何,我想将 Leaflet + LRM 与我选择的提供商一起使用 - HERE 地图。 HERE Maps 路线网址采用以下形式

https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey=<API_KEY>&waypoint0=geo!lat0,lng0

9&waypoint1=geo!lat1,lng1&mode=fastest;car;traffic:disabled

如何修改 Leaflet Routing 机器以访问并使用 Here Directions API 提供的结果?

解决方法

这里的路由 API 有一个插件:https://github.com/Daredzik/lrm-Here

我自己没用过,但看起来不错。