0

如何在 iOS 谷歌地图中进行如下指示?

在此处输入图像描述

此致。

4

2 回答 2

0
于 2012-08-31T15:25:04.523 回答
0

据我了解,您想要两个地方之间的方向

你需要他的 Google Direction API

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/directions/json?origin=%f,%f&destination=%f,%f&sensor=false&mode=driving",getPickUpCoordinate.latitude ,getPickUpCoordinate.longitude, center.latitude, center.longitude]]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; NSURLResponse *response = nil; NSError *error = nil; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; if (!error) { NSDictionary *responseDict = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingAllowFragments error:&error];

于 2016-02-12T11:20:29.473 回答