What is the URL scheme for the iOS 6.0 maps app?
Previously, within an iOS app you could launch the Maps app from within your application by using the Google Maps URL scheme (http:maps.google.whatever.whatever).
Does anyone know what the new URL scheme for the iOS 6.0 Maps app is? I can't find any new documentation on this.
You need to use MKMapItem to open the maps application. Take a look at the documentation: Documentation
Here's how to use it:
MKMapItem *mapItem=[[MKMapItem alloc] initWithPlacemark:yourPlacemark];
[mapItem openInMapsWithLaunchOptions:@{MKLaunchOptionsMapTypeKey : @(yourMapType), MKLaunchOptionsShowsTrafficKey : @(yourTraffic), MKLaunchOptionsDirectionsModeKey : yourDirectionMode}];
While you will get more control by using an MKMapItem
, the URL scheme is far easier. It hasn't changed much, you just replace google.com with apple.com. Here's the documentation.
上一篇: 有没有