1

我在一个android项目中使用Here maps SDK。我想在这里计算轨道并将其放入 android 地图中以这种方式进行路由(在 API 上计算)

我试图从 Json 获取点并将它们映射到航点,但计算方式有时与原始方式不同。

到目前为止我已经尝试过:

1. Get calculateroute.json from 
https://route.api.here.com/routing/7.2/calculateroute.json

2. Put coordinates to RoutePlan

RoutePlan plan = new RoutePlan();
plan.addWaypoint(new RouteWaypoint(new GeoCoordinate(54.3782893, 18.7009037, 0), RouteWaypoint.Type.STOP_WAYPOINT));
plan.addWaypoint(new RouteWaypoint(new GeoCoordinate(54.2660919, 18.6583687, 0), RouteWaypoint.Type.STOP_WAYPOINT));

3. Calculate route and put to a map 

new CoreRouter().calculateRoute(plan, new CoreRouter.Listener() {
    @Override
    public void onCalculateRouteFinished(List<RouteResult> list, RoutingError error) {
        MapRoute mapRoute = new MapRoute(list.get(0).getRoute()
        new Map().addMapObject(mapRoute)
    }

}

我想要做 :

1. Get calculateroute.json from 
https://route.api.here.com/routing/7.2/calculateroute.json

2. Create MapRoute from the calculateroute.json result ( but don't calculate it )

3. Put MapRoute to map and start navigation 

4

1 回答 1

0

基本上没有直接的方法可以实现这一点,解决方法如线程中所述:Backend Calculated Route,Here-API to just show Guidance and route on Map

于 2020-01-23T16:00:44.240 回答