Skip to content Skip to sidebar Skip to footer

The Markers On The Map Change Position When Map Is Rotated

I added markers on my map : ClusterLayer markersClusterLayer = new ClusterLayer(); Collection markers = new ArrayList<>(); for (GeoCoordinate geoCoordinate :

Solution 1:

I found the issue, it was related to the altitude of the point.

I was using

PositioningManager.getInstance().getLastKnownPosition()

which returned a position with altitude. As a result the marker was "flying" above the map. Setting altitude to 0 fixed the issue.

Solution 2:

It's not evident from your code, but is it possible that you are using a custom icon for your MapMarkers? If so, remember that the anchor is set to the center of the image by default. This isn't always the correct position.

For example, if your marker image is an arrow, you want to set the anchor to the tip of the arrow. Otherwise it might appear to point to different locations when the map is rotated (event though its center will always be in the same spot). Setting an incorrect anchor can also lead to similar behavior.

You can change the anchor by using the setAnchorPoint method.

Post a Comment for "The Markers On The Map Change Position When Map Is Rotated"