gpt4 book ai didi

ios - Skobbler 当前街道名称、currentAdviceInstruction 和音频建议不起作用

转载 作者:行者123 更新时间:2023-11-29 12:26:45 25 4
gpt4 key购买 nike

我目前正在开发一个转弯导航应用程序,我使用 API Skobbler,我设法集成了,但是当我进行实时测试时,我注意到我没有从回调中获取信息,例如:

-(void)routingService:(SKRoutingService *)routingService didUpdateFilteredAudioAdvices:(NSArray *)audioAdvices{

NSLog(@"audio advices: %@",audioAdvices);

} -(void)routingService:(SKRoutingService *)routingService didChangeCurrentStreetName:(NSString *)currentStreetName streetType:(SKStreetType)streetType countryCode:(NSString *)countryCode{

NSLog(@"street name: %@,%d,%@",currentStreetName,streetType,countryCode );
// NSLog(@"routing service array: %@",routingService.visualAdviceConfigurations);

} -(void)routingService:(SKRoutingService *)routingService didChangeCurrentAdviceImage:(UIImage *)adviceImage withLastAdvice:(BOOL)isLastAdvice{

NSLog(@"image changed");
}
- (void)routingService:(SKRoutingService *)routingService didChangeCurrentAdviceInstruction:(NSString *)currentAdviceInstruction nextAdviceInstruction:(NSString *)nextAdviceInstruction{

NSLog(@"current instruction: %@",currentAdviceInstruction);

我得到的唯一回调是:

  • (void)routingService:(SKRoutingService *)routingService didChangeCurrentSpeed:(double)speed{

    NSLog(@"speed: %f",speed);

} - (void)routingService:(SKRoutingService *)routingService didChangeDistanceToDestination:(int)distance withFormattedDistance:(NSString *)formattedDistance{

NSLog(@"distance: %@",formattedDistance);

感谢您的帮助。

最佳答案

- (void)routingService:(SKRoutingService *)routingService didFinishRouteCalculationWithInfo:(SKRouteInformation*)routeInformation{
NSLog(@"路由计算完毕。");
[routingService zoomToRouteWithInsets:UIEdgeInsetsZero];//缩放到当前路线
//NSArray *adviceList = [routingService routeAdviceListWithDistanceFormat:SKDistanceFormatMetric];//SKRouteAdvice 数组
NSLog(@"路由距离:%d",routeInformation.distance);
NSLog(@"路由时间: %d",routeInformation.estimatedTime);
SKNavigationSettings* navSettings = [SKNavigationSettings 导航设置];
navSettings.navigationType=SKNavigationTypeReal;
navSettings.distanceFormat=SKDistanceFormatMetric;
[SKRoutingService sharedInstance].mapView.settings.displayMode = SKMapDisplayMode3D;
[[SKRoutingService sharedInstance]startNavigationWithSettings:navSettings];
这就是我开始导航的方式:

关于ios - Skobbler 当前街道名称、currentAdviceInstruction 和音频建议不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28850856/

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