i want to draw zigzag polyline using google map

By techno

when i am using the below code it is giving me a straight polyline, but i want zigzag according to the route as shown in image i posted

i am using following code.
.
 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;
return center;

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273