7

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.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Steve Lobdell
  • 383
  • 3
  • 9

2 Answers2

2

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}];
J2theC
  • 4,412
  • 1
  • 12
  • 14
2

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.

nevan king
  • 112,709
  • 45
  • 203
  • 241