0

I am using MapBox to put several markers on map. I am using default marker my problem is that when i perform zoom in or out operation marker changes its position.

CODE

 mapView = (MapView) findViewById(R.id.mapView);
        mapView.onCreate(savedInstanceState);
        mapView.getMapAsync(new OnMapReadyCallback() {
            @Override
            public void onMapReady(MapboxMap mapboxMap) {
                map = mapboxMap;      
                MarkerViewOptions marker = new MarkerViewOptions()
                        .position(new LatLng(41.393930, 2.202237))
                        .anchor(0.5f, 0.5f)
                        .flat(true)
                        .title("Parc del Poblenou")
                   .snippet("Carrer de Carmen Amaya, Barcelona, EspaƱa");
            map.addMarker(marker);
        }
    });

I tested these two solve

Markers change position with zoom in/out

Marker changes its position while zoom in or out in google map v2 in android

Community
  • 1
  • 1
Eric Retamero
  • 51
  • 1
  • 5

1 Answers1

0

Which version of the SDK are you using? Try using either 4.1.1 or 4.2.0-beta.3 and see if this resolves the issue (we've had a few bugs with marker anchoring). Also for future reference (I know you are using the default marker) a common issue people have is when using a custom icon, it has padding at the bottom of the image which will cause the effect you are experiencing.

Let me know if changing the version helps, if not, a GIF of what is happening will help troubleshoot the issue.

cammace
  • 3,138
  • 1
  • 13
  • 18