NRahman NRahman - 9 months ago 100
Android Question

Set Image from drawable as marker in Google Map version 2

I am using this part of code to add a marker in a

in Google Map Version 2.

MarkerOptions op = new MarkerOptions();
m = map.addMarker(op);

I want to use different images from my drawable. Any help will be appreciated.


This is how you can set any 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...")

mMarker = googleMap.addMarker(markerOptions);