我想用修改后的标记和细节打开我的纬度和经度值。因此,我需要检查是否安装了谷歌地图应用程序,我需要打开,否则我将导航到苹果地图。
这里我无法使用以下代码添加自定义引脚
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"maps.apple.com/?z=12&q=%f,%f",[latitude floatValue],[longitude floatValue]]];
if (![[UIApplication sharedApplication] canOpenURL:url]) {
NSLog(@"Google Maps app is not installed");
//left as an exercise for the reader: open the Google Maps mobile website instead!
MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:rdOfficeLocation addressDictionary:nil];
MKMapItem *item = [[MKMapItem alloc] initWithPlacemark:placemark];
item.name = [NSString stringWithFormat:@"%@",[[mDataArray1 objectAtIndex:indexPath.row] valueForKey:@"NAME"]];
item.phoneNumber = [NSString stringWithFormat:@"%@",[[mDataArray1 objectAtIndex:indexPath.row] valueForKey:@"DESTINATION"]];
[item openInMapsWithLaunchOptions:nil];
} else {
[[UIApplication sharedApplication] openURL:url];
}
所以请帮我添加苹果和谷歌地图的自定义图钉值。