首页 > 解决方案 > GeoJson 导航图在这里

问题描述

我正在 android studio Here Map 中创建一个导航应用程序。我使用 ArcGis 创建了一个包含自定义数据的 GeoJSON 文件。我想知道是否有办法使用此 GeoJSON 文件而不是从 Here Map 驾驶路线获取导航方向?

标签: routesnavigationmapshere-api

解决方案


假设问题与提供导航功能的 HERE Android Mobile SDK 有关,则需要使用 CoreRouter 类创建路线。如果有 GeoJSON 文件,则需要对其进行解析并转换为至少 GeoCoordinates,然后将其传递给 CoreRouter -> calculateRoute 函数。

public void calculateRoute(java.util.List<GeoCoordinate> routePoints,
RouteOptions routeOptions,
Router.Listener<java.util.List<RouteResult>,RoutingError> listener)
Invokes an asynchronous route calculation. Upon completion of the request, the Listener will be invoked regardless if the request is completed successfully or not.
Parameters:
routePoints - The list of GeoCoordinate that is used for calculate a route. The list must have at least two items.
routeOptions - The RouteOptions is used for route calculation between points and for route recalculation during navigation mode.
listener - A Listener for the CoreRouter This method returns RoutingError.INVALID_PARAMETERS and a route will not be calculated if calculating a route with RouteOptions.TransportMode.PUBLIC_TRANSPORT This method returns RoutingError.INVALID_PARAMETERS and a route will not be calculated if calculating a route with RouteOptions.TransportMode.TRUCK and routePlan uses any Type other than FASTEST.

参考


推荐阅读