In Maps V2, how can I set a pressed state to a Marker?
The setIcon() method takes a BitmapDescriptor; I can't see a way to pass an XML selector which would give a pressed and selected state.
Is the only way to achieve this to override the OnMarkerClickListener and change the image programmatically?
There is no way to change the icon for the duration of Marker
being pressed as of API v2 version 3.1.36.
For the selected state, you may work it around by using OnMarkerClickListener
, setting some icon, remembering the reference to this marker and changing it back to normal when another marker is clicked or some other action occures, e.g. onMapClick
or onMapLongClick
is called.