Marker metadata
It’s possible to add arbitrary metadata to a marker using the setMetadata(String key, Object value)
method or retrieve previously saved metadata using the getMetadata(String key)
.
Example:
void handleGeoMarkerClick(GeoMarker geoMarker) {
Integer clickCount = (Integer) geoMarker.getMetadata("click_count", 0);
++clickCount;
geoMarker.setMetadata("click_count", clickCount);
Log.d("GeoMarker", String.format("GeoMarker clicked %d times", clickCount));
}
To delete a value associated with a key use deleteMetadata(String key)
, and to remove all metadata associated with a marker, use clearMetadata()
.