When using Google Map API V3 I can add custom property in the following way:
var marker = new google.maps.Marker({
position: userLocation,
map: myGoogleMap,
animation: google.maps.Animation.DROP,
icon: avatar,
title: userName,
customProperty1: bla,
customProperty2: bla,
customProperty3: bla,
...
});
I'm wondering if I can do the same for API V2 Android, the reason I want to do this is that each info window of each marker need to know some information of that marker. And I'm trying to achieve this in render
function below:
private void render(Marker marker, View view) {
int badge = R.drawable.android_face;
if (marker.customProperty)
//here I need to know this property to decide which image to use
badge = R.drawable.bla;
((ImageView) view.findViewById(R.id.badge))
.setImageResource(badge);
}