问题
Is it possible to change the color of the route during navigation? Specifically I would like the already travelled parts of the route to be a different color then the upcoming parts of the route. Right now it is all the same color.
回答1:
This is currently not supported with the 3.3.x generation of the HERE SDK.
This feature is something we are trying to add in an upcoming release, so stay tuned!
回答2:
you need to use Polyline
class to draw your path and then you can set color to it.
Polyline line = googlemap.addPolyline(new PolylineOptions()
.add(new LatLng (myLocation2.getLatitude(), myLocation2.getLongitude()), new LatLng (currentLocation.getLatitude(), currentLocation.getLongitude())).width(5)
.color(Color.RED));
回答3:
Setting the traveledColor variable of the MapRoute object to transparent did the trick for me.
mapRoute?.color = ResourcesCompat.getColor(resources, R.color.colorAccent, null)
mapRoute?.traveledColor = ResourcesCompat.getColor(resources, android.R.color.transparent, null)
来源:https://stackoverflow.com/questions/41897246/here-maps-change-color-of-already-travelled-part-of-route