当前位置: 动力学知识库 > 问答 > 编程问答 >

gps - How to draw Polyline based on current location dynamically in Android

问题描述:

Hi i am developing a application where i tracks users current location periodically and update the path in Google map by drawing polylines . I am Not sure how to do that. Please Help me Out in this issue.

网友答案:

After drawing the Polyline for the first time, you can "update" that polyline by retrieving the actual points (getPoints()) and then adding the new location to that list, then updating PolylinePoints (setPoints()) https://developer.android.com/reference/com/google/android/gms/maps/model/Polyline.html#getPoints()

Keep in mind that getPoints gives you a COPY of the points, not the reference to the list.

分享给朋友:
您可能感兴趣的文章:
随机阅读: