Set Image from drawable as marker in Google Map version 2

This is how you can set a Drawable as a Marker.

BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.current_position_tennis_ball)

MarkerOptions markerOptions = new MarkerOptions().position(latLng)
         .title("Current Location")
         .snippet("Thinking of finding some thing...")
         .icon(icon);

mMarker = googleMap.addMarker(markerOptions);

VectorDrawables and XML based Drawables do not work with this.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)