0

I am making an android app and I have an image marker (a circle). When it is on the map, the bottom of the circle aligns with the location, rather than the center of the circle. How would I fix this?

mMap!!.addMarker(
                MarkerOptions().position(LatLng(location!!.latitude, location!!.longitude)).title("Me").snippet("My Location").icon(
                    BitmapDescriptorFactory.fromResource(R.drawable.circle)
                )
            )
Gustavo Pagani
  • 6,583
  • 5
  • 40
  • 71
  • try this link https://stackoverflow.com/questions/15739526/centering-bitmap-marker-google-maps-android-api-v2 – unzila Jun 26 '19 at 05:22

1 Answers1

2

You can locate with this parameter:

.anchor(x, y)

Example usage:

googleMap.addMarker(new MarkerOptions()
                    .position(new LatLng(latitude, longitude))
                    .anchor(0.5f, 1.0f)
                    .title("title")
                    .snippet("snippet"));
Selman Tosun
  • 428
  • 5
  • 14