Community
Topic: Geo Augmented Markers
Set Marker Image Per GeoElement (SOLVED)
Is it possible to use a different Image for different markers?
I am using the Android SDK. I update the Marker extending `MarkerViewAdapter` and Passing it to the `initGeoFragment` method. But that updates all the markers.
Thanks
Hi,
when you have got the ImageView in the getView and getSelectedView methods you can substitute the resource you want by verifying, using the id, on which geoElement you are, you can also give the same name to groups of geoElement to make sure you have some kind of categories.
For example:
@Override
public View getView(GeoElement geoElement)
{
ImageView imageView = (ImageView)getMarkerView().findViewById(R.id.image);
if (geoElement.getName().equals("restaurant"))
imageView.setImageResource(R.drawable.map_marker_yellow);
else if (geoElement.getName().equals("park"))
imageView.setImageResource(R.drawable.map_marker_orange);
imageView.invalidate();
return getMarkerView();
}
Seems to solve my problem. Thanks.