Tomino
Tomino

Reputation: 113

Refresh polyline and markers without flickering

Can someone help me with this idea ?

I need to refresh array of locations (markers on map) and polyline represent a route between exact markers. I am doing it now with clear and draw new items, but it flickering markers and polyline.

Polyline refresh without flickering, i was searched in v3 google maps api with setPoints. Problem is, how refresh marker locations and count too without clearing map. Array of locations (markers) may be during refreshs in different counts.

Upvotes: 1

Views: 5316

Answers (1)

N Dorigatti
N Dorigatti

Reputation: 3540

I'm not sure I got the question, but if you want to move a marker and/or a polyline,you don't need to remove (clear) and draw again. There are convenience menthods for doing that, for markers:

marker.setPosition(LatLng)

and for Polyline you just update points: polyline.setPoints(List)

then your objects are moved and redrawn with no flickering (or the lowest possible).

Upvotes: 2

Related Questions