0
當我使用下面的代碼時,它給了我一個直線折線,但我想根據路線曲折,如圖所示我張貼。我正在使用以下代碼。我想使用谷歌地圖來繪製曲折折線
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(center.latitude,center.longitude);
marker.title = @"";
marker.snippet = @"";
//marker.map = mapView_;
marker.map = self.mapView;
marker.groundAnchor=CGPointMake(0.5,0.5);
marker.map=_mapView;
GMSMutablePath *path = [GMSMutablePath path];
[path addCoordinate:CLLocationCoordinate2DMake(userLatitude,userLongitude)];
[path addCoordinate:CLLocationCoordinate2DMake(center.latitude,center.longitude)];
GMSPolyline *rectangle = [GMSPolyline polylineWithPath:path];
rectangle.strokeWidth = 2.f;
rectangle.map = _mapView;
self.view=_mapView;
[1]: http://i.stack.imgur.com/mVvIV.png