我目前正在开发一个转弯导航应用程序,并且使用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(@"Route is calculated."); [routingService zoomToRouteWithInsets:UIEdgeInsetsZero]; // zooming to currrent route //NSArray *adviceList = [routingService routeAdviceListWithDistanceFormat:SKDistanceFormatMetric]; // array of SKRouteAdvice NSLog(@"routing distance : %d",routeInformation.distance); NSLog(@"routing time : %d",routeInformation.estimatedTime); SKNavigationSettings* navSettings = [SKNavigationSettings navigationSettings]; navSettings.navigationType=SKNavigationTypeReal; navSettings.distanceFormat=SKDistanceFormatMetric; [SKRoutingService sharedInstance].mapView.settings.displayMode = SKMapDisplayMode3D; [[SKRoutingService sharedInstance]startNavigationWithSettings:navSettings];}这就是我开始导航的方式:

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

    10-09 01:26