How to remove polylines in Google Maps Android API v2? -
so have 2 markers: 1 destination (which static meaning not move) , other marker dynamic , updates position based on current location.
i able draw polyline on route between 2 markers. problem when updating current location, previous polyline drawn previous position of dynamic marker still there.
here image:
)
as can see in image, marker dynamic 1 points current location , polyline marker's previous position located @ university of san carlos @ upper-right position of marker in image. destination marker not shown in image.
how remove previous polyline? tried using method remove() polyline class didn't work.
i based code link: answer : draw path between 2 points using google maps android api v2
create array markers/points , polylines. later, on remove, make this:
polyline ptemp = mpolylines.remove(mpolylines.size() - 1); ptemp.remove()
Comments
Post a Comment