gpt4 book ai didi

android - 路由计算失败,正在模拟重路由

转载 作者:行者123 更新时间:2023-11-29 01:32:04 25 4
gpt4 key购买 nike

我正在使用 Skobbler 示例 Android SDK(从 here 下载)编写导航应用程序,如果我从 Android studio 运行应用程序,它会完美运行,但是当我使用生成的 APK 安装应用程序时,它通常在路线计算和日志中失败我得到的是:

06-04 10:09:43.435    6285-6285/com.skobbler.sdkdemo D/SKMaps﹕ SKMapSurfaceView----@setZoom  11.0
06-04 10:09:43.435 6285-6285/com.skobbler.sdkdemo D/SKMaps﹕ SKMapSurfaceView---- centerMapOnPosition [101.6156902,3.0311728]
06-04 10:09:43.435 6285-6285/com.skobbler.sdkdemo D/SKMaps﹕ SKRouteManager---- @clearAllRoutesFromCache
06-04 10:09:43.436 6285-6285/com.skobbler.sdkdemo D/SKMaps﹕ SKRouteManager---- @calculateRoute SKRouteSettings [startCoordinate=[101.6156902,3.0311728], destinationCoordinate=[101.6156,3.03496], routeMode=CAR_FASTEST, alternativeRouteModes=null, routeConnectionMode=HYBRID, downloadRouteCorridor=true, routeCorridorWidthInMeters=2000, waitForCorridorDownload=false, destinationIsPoint=true, tollRoadsAvoided=false, highWaysAvoided=false, avoidFerries=false, noOfRoutes=1, countryCodesReturned=false, extendedPointsReturned=false, viaPoints=null, useRoadSlopes=false, exposeRoute=true, filterAlternatives=false, requestAdvices=true, bicycleWalk= false, bicycleCarryAvoided= false]
06-04 10:09:43.437 6285-6285/com.skobbler.sdkdemo D/SKMaps﹕ SKRouteManager----@clearCurrentRoute
06-04 10:09:43.437 6285-6285/com.skobbler.sdkdemo D/SkobblerNG﹕ clear route
06-04 10:09:43.437 6285-6285/com.skobbler.sdkdemo D/SkobblerNG﹕ clear route final
06-04 10:09:43.439 6285-6285/com.skobbler.sdkdemo D/SKMaps﹕ SKUtils----Return calculated device type HIGH
06-04 10:09:43.440 6285-6285/com.skobbler.sdkdemo D/SKMaps﹕ SKRouteManager---- Calculate route setroute SKRouteSettings [startCoordinate=[101.6156902,3.0311728], destinationCoordinate=[101.6156,3.03496], routeMode=CAR_FASTEST, alternativeRouteModes=null, routeConnectionMode=HYBRID, downloadRouteCorridor=true, routeCorridorWidthInMeters=2000, waitForCorridorDownload=false, destinationIsPoint=true, tollRoadsAvoided=false, highWaysAvoided=false, avoidFerries=false, noOfRoutes=1, countryCodesReturned=false, extendedPointsReturned=false, viaPoints=null, useRoadSlopes=false, exposeRoute=true, filterAlternatives=false, requestAdvices=true, bicycleWalk= false, bicycleCarryAvoided= false]
06-04 10:09:43.440 6285-6285/com.skobbler.sdkdemo D/SkobblerNG﹕ Java_com_skobbler_ngx_routing_SKRouteManager_setroute
06-04 10:09:43.440 6285-6285/com.skobbler.sdkdemo D/SkobblerNG﹕ No Via points added to the route
06-04 10:09:43.442 6285-6285/com.skobbler.sdkdemo D/SkobblerNG﹕ Java_com_skobbler_ngx_routing_SKRouteManager_setroute final
06-04 10:09:43.445 6285-6344/com.skobbler.sdkdemo D/SKMaps﹕ SKRouteManager---- @onRouteCalculationFailed called with SKRoutingErrorCode =ROUTE_CANNOT_BE_CALCULATED
06-04 10:09:43.447 6285-6344/com.skobbler.sdkdemo W/SKMaps﹕ SKRouteManager---- @onAllRoutesCompleted called

此外,在 SKNavigationType.SIMULATION 模式下使用导航时,是否有任何方法可以模拟重新路由?我尝试像这样在 onCurrentPositionUpdate(SKPosition currentPosition) 方法中显式更改当前用户位置,但它不起作用:

@Override
public void onCurrentPositionUpdate(SKPosition currentPosition) {
iteration++;

this.currentPosition = currentPosition;
if (mapView != null) {

if(iteration >= 5) {
Toast.makeText(MapActivity.this, "Changed location", Toast.LENGTH_LONG).show();
this.currentPosition = new SKPosition();
this.currentPosition.setCoordinate(new SKCoordinate(101.618133, 3.025863));
}

mapView.reportNewGPSPosition(this.currentPosition);
}
}

最佳答案

为了模拟重新路由,您必须使用 SKNavigationManager 中的 blockRoad 方法。请在此处查看文档:http://developer.skobbler.ro/docs/android/com/skobbler/ngx/navigation/SKNavigationManager.html#blockRoad%28double%29

关于android - 路由计算失败,正在模拟重路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30634727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com