Closed devfelipereis closed 3 years ago
Hello. I think I don't understand your question as clusters and individual markers are handled the same way (individual markers are considered as single item cluster).
Future<gm.Marker> Function(Cluster<Place>) get _markerBuilder => (cluster) async { return gm.Marker( markerId: gm.MarkerId(cluster.getId()), position: cluster.location, onTap: () { print('---- $cluster'); cluster.items.forEach((p) => print(p)); }, icon: await _getMarkerBitmap(cluster.isMultiple ? 125 : 75, text: cluster.isMultiple ? cluster.count.toString() : cluster.items.first.availableChargers), ); };
@devfelipereis I think I understand your question. If the cluster.isMultiple is false, that means that cluster.items only has one item. So you would use cluster.items.first."data you want".
I see that I can add a label for a cluster but I can not figure out how to add a label for each marker on the map.