如何在Android中动态地根据当前位置绘制折线

时间:2015-04-21 13:56:57

标签: android gps android-maps-v2 google-geocoder google-polyline

您正在开发一个应用程序,我会定期跟踪用户的当前位置,并通过绘制折线更新Google地图中的路径。我不知道该怎么做。请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

首次绘制折线后,您可以更新"该折线通过检索实际点(getPoints())然后将新位置添加到该列表,然后更新PolylinePoints(setPoints()) https://developer.android.com/reference/com/google/android/gms/maps/model/Polyline.html#getPoints()

请记住,getPoints会为您提供点数的COPY,而不是对列表的引用。