1

I observed strange behavior of marker on map while spinning/rotating the map from one direction to other.

In my code I have moved the map center point to upward from the marker location to display the current ongoing cursor at the bottom of the map as per the suggestion by Nikunj in this post. it seems working fine while in zoomed view and when the polylinie is drown vertically.

when the polyline is drown towards left or right the marker is displayed in opposite direction but the expectation of marker is to draw on the polyline.

For placing marker what i do is: getting the nearest latlng of the polyline to the current location and assigning it to marker and animating the parking to the polyline's point.

Following are the snapshots of the issue.

1) when polyline is vertically straight : enter image description here

2) when polyline is in right side : enter image description here

3) when polyline is in left side : enter image description here

if anybody has faced the same issue please suggest me to solve this issue.

Community
  • 1
  • 1
dinesh sharma
  • 3,312
  • 1
  • 22
  • 32

1 Answers1

2

You need to set the anchor of the image on your marker. For example:

MarkerOptions markerOptions = new MarkerOptions()
    // Set all the options for your marker
    .anchor(0.5, 0.5);
antonio
  • 18,044
  • 4
  • 45
  • 61