Backend Calculated Route,Here-API to just show Guidance and route on Map

烈酒焚心 提交于 2020-02-06 09:58:09

问题


I have a back-end service where the route calculation is done and I will be using here-api to display the calculated route on map and start guidance, Can I know the API which can be used for this purpose ?

I have gone through, Here-API where I see

  1. We can create an Route from RouteResult on Overridden onCalculateRouteFinished() function.

  2. From the list we can get Route data and create a MapObject.

  3. Using this MapObject add this to the Map.

But this is not my intention as I will not be having Route data at all.

Which Here-api to call with Geo-Coordinates to display the route b/w them in the map.


回答1:


In general it is not possible to transfer a route from a back end server (using HERE Routing API) to the HERE Mobile SDK. A workaround solution would be :

  1. Retrieve the shape of the route from HERE Routing API.
  2. Simplify this shape to reduce the number of coordinates. There can be different possibilities here, for e.g use only start,middle,end coordinates of maneuvers instead of the whole maneuver shape )
  3. Pass the Simplified shape to you app
  4. In the app , reconstruct the route using HERE Mobile SDK function CoreRouter.

    calculateRoute(java.util.List<GeoCoordinate> routePoints, RouteOptions routeOptions, Router.Listener<java.util.List<RouteResult>,RoutingError> listener) 
    
  5. Use the route from the call back for Navigation use case.


来源:https://stackoverflow.com/questions/56034357/backend-calculated-route-here-api-to-just-show-guidance-and-route-on-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!