HERE Maps: Change color of already travelled part of route

我怕爱的太早我们不能终老 提交于 2019-12-11 07:59:29

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!