Add gradient/multi-color polyline support for iOS (MapKit) #1911
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi guys, it's Christmas so it's time for presents 🎁
This PR adds support for gradient/multi-color Polylines for iOS/MapKit.
It adds a prop called
strokeColors
to<Polyline>
which should be an array of colors, and which should have the same length as thecoordinates
prop. If two colors are different, it will then draw a gradient between those two coordinates. In order to create "smoother" gradients, you can also create "holes" in the color-array, be specifying#00000000
. This will then draw a path using a linear gradient between the coordinates for which a color was defined.Example:
I've updated the docs and the MapExplorer as well.
Hopefully I can Android support for it too soon.
cheers,
Hein