I am trying to add a gradient polyline while showing routes in android maps. I tried using addSpan but this is creating a black line.
lineOption.addSpan(
StyleSpan(
StrokeStyle.gradientBuilder(
Color.RED,
Color.YELLOW
).build()
)
)
can anyone help me figure out this? I am new to using google maps in android
Your need to enable the new map renderer to draw gradient polylines.
The use the new map renderer create an application class:
https://developers.google.com/maps/documentation/android-sdk/renderer?_ga=2.28370680.-55268474.1677776288
Make sure to set your application class in the AndroidManifest:
Make sure to check the log if "The latest version of the renderer is used." is there. For the new render the device needs:
so might not work on your emulator