Search code examples
positionzoomingosmdroidmarkers

OSMDroid bonuspack Custom Marker moving as I zoom out


I have implemented OSMDroid and added a Custom Marker like this:

Marker marker = new Marker(mMapView);
marker.setPosition(getGeoPoint(item));
marker.setIcon(icon);
marker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
marker.setTitle(item.getName());

if (mInfoWindow != null)
    marker.setInfoWindow(mInfoWindow);

if (mMapView != null) {
    mMapView.getOverlays().add(marker);

I use osmdroid bonus pack - org.osmdroid.bonuspack.overlays.Marker

This works well, as long as I dont zoom:

https://i.sstatic.net/MkmbY.png - good position

https://i.sstatic.net/eRE9f.png - wrong position

The second problem with infoWindow position. What I do wrong?


Solution

  • Really surprising. I assume the marker geoposition is at the manually drawn cross?

    Could you provide your icon file?

    And could you try with this icon:

    icon

    And this setting:

    marker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_CENTER);
    

    then provide the screen captures.

    About InfoWindow position, describe the issue.