我正在尝试使用 google 路线获取路线,但出现此错误:
错误域=org.brautaset.JSON.ErrorDomain 代码=3 \"无法识别的前导字符 (41)\
这是Json
loadDirections('Avenida Paulista', 'Rua Augusta', { 'locale': 'en', travelMode: G_TRAVEL_MODE_WALKING, avoidHighways: false, getPolyline: true, getSteps: true, preserveViewport: false})
怎么了?什么是无法识别的主角(41)是什么意思?
- (void)loadWithStartPoint:(NSString *)startPoint endPoint:(NSMutableArray *)endPoints options:(UICGDirectionsOptions *)options {
for (int idx = 0; idx < [endPoints count];idx ++)
{
NSString* msg = [NSString stringWithFormat:@"loadDirections('%@', '%@', %@)", startPoint, [endPoints objectAtIndex:idx], [options JSONRepresentation]];
NSLog(@"msg %@",msg);
mstr = [msg retain];
[self performSelector:@selector(loadDirections:) withObject:nil afterDelay:0.5];
}
}
-(void)loadDirections:(NSString *)message
{
[googleMapsAPI stringByEvaluatingJavaScriptFromString:mstr];
}