my current solution is opening google maps on safari with the link, where i add +to: targets in between:
for (int i == 0; int i < route.count; i++) {
if (i == 0) {
NSString *start = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f", latitude, longitude];
locationString = start;
}
if (i != 0 && i != route.count - 1) {
NSString *between = [NSString stringWithFormat:@"+to:%f,%f", latitude, longitude];
locationString = [locationString stringByAppendingString:between];
}
if (i == route.count - 1) {
NSString *end = [NSString stringWithFormat:@"&daddr=%f,%f", latitude, longitude];
NSString *type = @"&dirflg=w";
locationString = [locationString stringByAppendingString:end];
locationString = [locationString stringByAppendingString:type];
}
}
NSURL *url = [NSURL URLWithString:locationString];
[[UIApplication sharedApplication] openURL:url];
this works fine if I'm using the iOS 5 or 6 sSimulator which opens the link in Safari on the mobile version of maps.google.com
but when i run it on an iOS 5 device and probably on an iOS6 device with installed Google Maps the link starts in Google Maps and there the route is drawn wrong (especially with many targets) and the targets in between have no annotations...
anybody got an idea how to force a link beeing opened in Safari?