0

I am currently using google_maps_flutter to display a map with multiple cluster manangers on screen. I have chosen to use this lib only because I need to pass a Set of ClusterManangers to the map.

However, I couldn't change the clusters appearance (only the marker's), and I couldn't find anything about this on the documentation. Can anyone help me with this?

My code looks like this:

    clusterManagers.clear();
    for (final group in groupList) {
      clusterManagers.add(maps.ClusterManager(
        clusterManagerId: maps.ClusterManagerId(group["type_id"]),
        onClusterTap: ((val)=>0),
      ));
    }

    final List<maps.Marker> markers = [];

    for (final group in groupList) {
      for (final item in group["data"]) {
        markers.add(
            maps.Marker(
              markerId: maps.MarkerId((item as Place).name),
              clusterManagerId: maps.ClusterManagerId(group["type_id"]),
              position: item.latLng,
              icon: maps.BitmapDescriptor.defaultMarker,
            )
        );
      }
    }


    return maps.GoogleMap(
      mapType: maps.MapType.normal,
      initialCameraPosition: maps.CameraPosition(
        target: position,
        zoom: 18,
      ),

      markers: markers.toSet(),
      clusterManagers: clusterManagers.toSet(),
    );

0

Browse other questions tagged or ask your own question.