我正在android studio Here Map中创建一个导航应用程序。我已经使用ArcGis使用自定义数据创建了一个GeoJSON文件。我想知道是否有一种方法可以使用此GeoJSON文件而不是从“这里地图”行驶路线获取导航方向?
答案 0 :(得分:-1)
假设问题与此处提供导航功能的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.