How to decode the Google Directions API polylines field into lat long points in Objective-C for iPhone?

I hope it’s not against the rules to link to my own blog post if it’s relevant to the question, but I’ve solved this problem in the past. Stand-alone answer from linked post: @implementation MKPolyline (MKPolyline_EncodedString) + (MKPolyline *)polylineWithEncodedString:(NSString *)encodedString { const char *bytes = [encodedString UTF8String]; NSUInteger length = [encodedString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; NSUInteger idx = … Read more

Drawing Route Between Two Places on GMSMapView in iOS

`first get all points coordinates which are coming in route then add these points latitude and longitude in path in will draw path according to that` GMSCameraPosition *cameraPosition=[GMSCameraPosition cameraWithLatitude:18.5203 longitude:73.8567 zoom:12]; _mapView =[GMSMapView mapWithFrame:CGRectZero camera:cameraPosition]; _mapView.myLocationEnabled=YES; GMSMarker *marker=[[GMSMarker alloc]init]; marker.position=CLLocationCoordinate2DMake(18.5203, 73.8567); marker.icon=[UIImage imageNamed:@”aaa.png”] ; marker.groundAnchor=CGPointMake(0.5,0.5); marker.map=_mapView; GMSMutablePath *path = [GMSMutablePath path]; [path addCoordinate:CLLocationCoordinate2DMake(@(18.520).doubleValue,@(73.856).doubleValue)]; [path addCoordinate:CLLocationCoordinate2DMake(@(16.7).doubleValue,@(73.8567).doubleValue)]; … Read more