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