Drawing route on Google Maps using Google Maps Android API v2

后端 未结 3 1480
攒了一身酷
攒了一身酷 2020-12-30 14:08

I have an app in which I am continuously tracking user\'s location using Google Plays new service API for Maps. I am updating the location every single second and I am also

3条回答
  •  清酒与你
    2020-12-30 14:58

    Your code for drawing the path looks strange. Inside the for-loop you should only add the points to an instance of PolylineOptions (which you create before entering the for loop).

    Then, after the for-loop you can add the width, color etc. to the polylineOptions object and finally use that in mGoogleMap.addPolyline().

    In your coding, you are somehow adding a new polyline for each point (I am wondering that this draws lines at all, as each "line" consists of one point only.).

提交回复
热议问题