当我使用下面的代码时,它给了我一条直线折线,但我希望根据我发布的图像所示的路线曲折。我正在使用以下代码。
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