2013-01-02 63 views
0

我正在使用Apple Maps API编写应用程序。我想按照Google服务的查询指示(https://developers.google.com/maps/documentation/directions/?hl=vi)显示用户和朋友路线。从服务中获取数据后,我使用MKPolyline(iOS SDK中的类)在Apple地图上显示路线。这是可能的,而不是与苹果和谷歌的政策冲突?是否可以将Apple Direction API与Apple Maps一起使用?

期待您的回复。

感谢

回答

4

IIRC,谷歌的地图API服务条款明确禁止使用其数据服务与其他人的地图。


更新:在iOS系统7和后,MapKit具有用于获取路线(和渲染所得路由)的API。请参阅MKDirections和相关文档。

+0

那么这对我来说是个坏消息:-( – haisergeant

+0

那么,有没有为方向API的任何替代方案? – haisergeant

+0

MapQuest的有方向的API – jmstone617

1

是,可以使用谷歌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}]; 

} 
相关问题