Reputation: 21
I actually want to group a particular type of markers that I am showing and not all. I have been using this package for while but this package doesn't offer any feature like that
I have tried changing the package contents in itself where the
I have found this method which clusters
String nextGeohash = inputItems[0].geohash.substring(0, level);
List<ClusterItem<T>> items = inputItems
.where((p) => p.geohash.substring(0, level) == nextGeohash)
.toList();
markerItems.add(Cluster<T>(items));
List<ClusterItem<T>> newInputList = List.from(inputItems.where((i) =>
i.geohash.substring(0, level) != nextGeohash && i.shouldCluster));
return _computeClusters(newInputList, markerItems, level: level);
in this I have changed the clusterItem class to have another parameter called shouldCluster but this removes not only the cluster functionality but also the marker so I want some approach with which I can cluster certain type of markers and not all in my flutter app with google_maps_cluster_manager
Upvotes: 1
Views: 82
Reputation: 141
Have a look at the google_maps_cluster_manager repo on github, issue #47 has some sample code to show how to exclude markers from clustering. google_maps_cluster_manager github issue 47
Upvotes: 0