0
私はグーグルマップを使用して2地点間の経路を表示する必要がありますが、私は2つの場所の間だけで直線を取得しています、私は以前、さまざまな見てきた、これを行う方法を教えてくださいコードiosでgooglemapを使用して2つの場所の間のルートを表示しますか?
- (void)viewDidLoad {
[super viewDidLoad];
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
longitude:151.20
zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;
// Creates a marker in the center of the map.
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
marker.title = @"Sydney";
marker.snippet = @"Australia";
marker.map = mapView_;
GMSMutablePath *path = [GMSMutablePath path];
[path addCoordinate:CLLocationCoordinate2DMake(@(-33.860).doubleValue,@(151.208).doubleValue)];
[path addCoordinate:CLLocationCoordinate2DMake(@(-32.860).doubleValue,@(150.208).doubleValue)];
GMSPolyline *rectangle = [GMSPolyline polylineWithPath:path];
rectangle.strokeWidth = 2.f;
rectangle.map = mapView_;
self.view = mapView_;
}
の下に使用していますこのタイプの質問ですが、取得していません。 助けてください... 助けていただければ幸いです。
https://github.com/ManoMarks/demos/tree/master/DirectionsAPIAsync/MapsDirections私はこの方法を試しましたが、まだ方向性がありません – user6438311