在iOS 6中打开Goog​​le Maps App

时间:2012-12-13 08:20:43

标签: iphone ios6-maps

我想以编程方式在iOS 6中打开Goog​​le Map App。 我试图通过传递url打开地图 - 地图..... 但它仍然在Safari中开放

2 个答案:

答案 0 :(得分:11)

[[UIApplication sharedApplication] canOpenURL:
[NSURL URLWithString:@"comgooglemaps://"]];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:
@"comgooglemaps://?center=40.765819,-73.975866&zoom=14&views=traffic"]];

参考:https://developers.google.com/maps/documentation/ios/urlscheme

答案 1 :(得分:0)

试试这个

域必须是maps.apple.com。

如果值是URL(因此未拾取KML),则参数不能为q = *。 参数不能包含view = text或dirflg = r。

https://developer.apple.com/library/safari/#featuredarticles/iPhoneURLScheme_Reference/Articles/MapLinks.html#//apple_ref/doc/uid/TP40007894-SW1