是一个用于 iOS 上外部地图应用程序的接口。
#import <TPMapsApp/TPMapsApp.h>
...
NSArray *installedApps = [TPMapsApp installedMapsApps];
TPMapsApp *app = [installedApps firstObject];
NSLog(%"Using map app: %@", app.name);
BOOL opened = app.openWithQuery(@"Philz Coffee");
if (! opened) {
// Something went wrong...
}
opened = app.openForDirectionsWithStart:@"1 Stockton St, San Francisco, CA"
destination:@"3101 24th St, San Francisco, CA"
travelMode:TPMapsAppTravelModeTransit];
if (! opened) {
// Something went wrong...
}
使用 Cocoapods。
$ edit Podfile
pod 'TPMapsApp', '~> 1.0.0'
$ pod install
$ open App.xcworkspace
TPMapsApp 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。