问题
I have added markers in google map control using google map api v2 version but How to change Marker Background image when marker click event.
@Override
public boolean onMarkerClick(Marker arg0) {
arg0.setIcon //Not show in List setIcon method Google API V2 Version
return false;
}
回答1:
Override map onMarkerClick()
and change icon for the marker clicked.
private Marker changedMarker = null;
@Override
public boolean onMarkerClick(Marker marker) {
if(changedMarker != null) {
changedMarker.setIcon(defaultIcon); // sets default icon
changedMarker = null;
}
marker.setIcon(icon); // icon is the Bitmap you want
changedMarker = marker;
return true;
}
来源:https://stackoverflow.com/questions/23054166/marker-image-drawable-change-googlemap-v2