Reputation: 21
im trying to add custom marker in this template but I couldn't can someone help me with this
override fun onGetTemplate(): Template {
val itemListBuilder = ItemList.Builder().setNoItemsMessage("No places to show")
ItemRepository.getItems().forEach { itemListBuilder.addItem(itemRow(it)) }
val builder = PlaceListMapTemplate.Builder()
.setItemList(itemListBuilder.build())
if (hasLocationPermission) {
builder.setCurrentLocationEnabled(true)
}
return builder.build()
}
Upvotes: 1
Views: 41
Reputation: 1447
What does your itemRow
method look like? To customize the marker, you need to associate a Place
that has a PlaceMarker
with each Row
using the Row.Builder::setMetadata
method. PlaceListMapTemplate::setItemList
has more details.
Upvotes: 0