我正在使用 Apple Maps API 编写应用程序。我想通过谷歌服务的查询方向显示用户和朋友路线(https://developers.google.com/maps/documentation/directions/?hl=vi)。从服务中获取数据后,我使用 MKPolyline(iOS SDK 中的类)在 Apple 地图上显示路线。这是否可能并且与 Apple 和 Google 的政策不冲突?
期待您的回复。
谢谢
我正在使用 Apple Maps API 编写应用程序。我想通过谷歌服务的查询方向显示用户和朋友路线(https://developers.google.com/maps/documentation/directions/?hl=vi)。从服务中获取数据后,我使用 MKPolyline(iOS SDK 中的类)在 Apple 地图上显示路线。这是否可能并且与 Apple 和 Google 的政策不冲突?
期待您的回复。
谢谢
IIRC,Google 的 Maps API 条款明确禁止将他们的数据服务与其他人的地图一起使用。
更新:在 iOS 7 及更高版本中,MapKit 具有用于获取方向(并呈现结果路线)的 API。请参阅MKDirections
和相关文档。
您可以尝试新的 iOS 版 Google Maps SDK:
是的,可以将谷歌方向api与苹果地图一起使用...在IOS6下面的示例代码中试试这个希望对您有帮助...
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake([_iLat doubleValue],[_iLong doubleValue]);
//create MKMapItem out of coordinates
MKPlacemark* placeMark = [[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:nil];
MKMapItem* destination = [[MKMapItem alloc] initWithPlacemark:placeMark];
if([destination respondsToSelector:@selector(openInMapsWithLaunchOptions:)])
{
//using iOS6 native maps app
[destination openInMapsWithLaunchOptions:@{MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving}];
}