My library: com.google.maps.android:android-maps-utils:0.4.2
On initial addMarker, marker is sometimes put randomly somewhere on the map, far away from intended position.
After zoom is applied, marker finds it's correct place. I couldn't figure why, so I "solved" this with unnoticable delayed zoom:
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
map.animateCamera(CameraUpdateFactory.zoomBy(0.0000001f));
}
}, 1200);
So, my markers load, some of them are in incorrect positions for 1 second, then they jump to correct places. But there has to be another solution.
This happens to me only in case if I draw route. If there are only markers on the map, without route, I've never seen this problem. Maybe it's connected to polyline somehow. It's not connected to maker clustering though. As this happens to me both on pages where clustering is present and not.
Questions, closest to my problem that I found:
Marker changes its position while zoom in or out in google map v2 in android - no answers
Android Maps v2 custom marker has incorrect position on zoom - setting anchor doesn't help in my case.
Gmap.Net Marker at incorrect position but when the map is zoomed the marker goes to right place - I'm not using overlay
Any suggestions appreciated.