I have iOS app with the Google Maps SDK integrated.
My route has default style and I'm able to change the color to be gradient in length
via spans
.
Is it possible to update polyline color and define gradient in width
instead (like original Google Maps app has)?:
UPDATE:
I have added limited version by using two identical polylines with different styles but I'm definitely looking for a better solution:
I followed the official documentation and didn't find any references of that.
I do this:
GMSPath *path = [GMSPath pathFromEncodedPath:overview_route];
GMSPolyline *polyline = [GMSPolyline polylineWithPath:path];
polyline.strokeWidth = 5;
GMSStrokeStyle *greenToRed = [GMSStrokeStyle gradientFromColor:[UIColor greenColor] toColor:[UIColor redColor]];
polyline.spans = @[[GMSStyleSpan spanWithStyle:greenToRed]];
polyline.map = self.mapView;