【发布时间】:2015-03-04 09:31:09
【问题描述】:
我目前正在开发转弯导航应用程序并使用 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);
}
感谢您的帮助。
【问题讨论】:
-
请提供您用于启动导航服务的代码(您是在路线上导航还是只是免费驾驶?)
-
我在一条路线上导航,我就是这样做的:SKRouteSettings* route = [[SKRouteSettings alloc]init]; route.startCoordinate=CLLocationCoordinate2DMake(userLocation.coordinate.latitude,userLocation.coordinate.longitude); route.destinationCoordinate=CLLocationCoordinate2DMake(48.8215965,2.3715504); [[SKRoutingService sharedInstance] calculateRoute:route];
-
你能在演示项目中重现这种行为吗?例如,我正在查看 RoutingViewController 并在导航期间获得所有正确的回调。