问题
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
We can create an Route from
RouteResult
on OverriddenonCalculateRouteFinished()
function.From the list we can get Route data and create a
MapObject
.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 :
- Retrieve the shape of the route from HERE Routing API.
- 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 )
- Pass the Simplified shape to you app
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)
- 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