后端计算路线,此处API仅在地图上显示指导和路线 [英] Backend Calculated Route,Here-API to just show Guidance and route on Map
问题描述
我有一个进行路线计算的后端服务,我将使用here-api在地图上显示计算出的路线并开始导航,我是否知道可用于此目的的API?>
我已经经历过,这里是我看到的API
-
我们可以在覆盖的
onCalculateRouteFinished()
函数上从RouteResult
创建路由. -
从列表中,我们可以获取Route数据并创建一个
MapObject
. -
使用此
MapObject
将此添加到地图中.
但这不是我的意图,因为我根本不会拥有Route数据.
其中Here-api
与地理坐标通话以在地图中显示其黑白路线.
通常,无法将路由从后端服务器(使用HERE Routing API)传输到HERE Mobile SDK.解决方法是:
- 从HERE Routing API检索路线的形状.
- 简化此形状以减少坐标数.这里可能会有不同的可能性,例如,仅使用机动的开始,中间,结束坐标,而不是整个机动形状)
- 将简化形状传递给您的应用
-
在应用程序中,使用HERE Mobile SDK功能CoreRouter重构路线.
calculateRoute(java.util.List<GeoCoordinate> routePoints, RouteOptions routeOptions, Router.Listener<java.util.List<RouteResult>,RoutingError> listener)
- 使用来自回拨的导航用例的路线.
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.
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.
这篇关于后端计算路线,此处API仅在地图上显示指导和路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!