使用此链接.
我试图从一个坐标到另一个坐标获得路线方向,但没有得到路线.下面提到用过的编码......
NSArray *routesArray = [res objectForKey:@"routes"];
NSDictionary *routeDict = [routesArray objectAtIndex:0];
NSDictionary *routeOverviewPolyline = [routeDict objectForKey:@"overview_polyline"];
NSString *points = [routeOverviewPolyline objectForKey:@"points"];
GMSPath *path = [GMSPath pathFromEncodedPath:points];
polyline = [GMSPolyline polylineWithPath:path];
polyline.strokeColor = [UIColor greenColor];
polyline.strokeWidth = 10.f;
polyline.map = mapView_;
Run Code Online (Sandbox Code Playgroud)
谁能知道.帮我解决这个问题..