开发者

Add address annotation when finding route via google maps api

开发者 https://www.devze.com 2023-04-08 15:44 出处:网络
I\'m using google maps to get directions from one place to another. Here is the code NSString *mapAPIString = [NSString stringWithFormat:@\"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f\",

I'm using google maps to get directions from one place to another. Here is the code

NSString *mapAPIString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",
    sourceAddress.coordiate.latitude,
    sourceAddress.coordiate.longitude,
    destAd开发者_如何转开发dress.coordiate.latitude,
    destAddress.coordiate.longitude,
    ];
NSURL *url = [[NSURL alloc] initWithString:mapAPIString];
[[UIApplication sharedApplication] openURL:url];

The code works perfect. But both addresses are marked as 'Unknown address' in iOS Map App. Is it possible to add custom title for each address ?


iOS 6 is still under NDA, but if you have access to the docs have a look at them and you will probably find useful information for this problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消