ClusterManager<T extends ClusterItem> constructor
ClusterManager<T extends ClusterItem> (
- Iterable<
T> _items, - void updateMarkers(
- Set<
Marker>
- Set<
- Future<
Marker> markerBuilder(- Cluster<
T>
- Cluster<
- List<
double> levels = const [1, 4.25, 6.75, 8.25, 11.5, 14.5, 16.0, 16.5, 20.0], - double extraPercent = 0.5,
- int maxItemsForMaxDistAlgo = 200,
- ClusterAlgorithm clusterAlgorithm = ClusterAlgorithm.geoHash,
- MaxDistParams? maxDistParams,
- double? stopClusteringZoom,
- EdgeInsets? padding,
- double? devicePixelRatio,
Implementation
ClusterManager(
this._items,
this.updateMarkers, {
Future<Marker> Function(Cluster<T>)? markerBuilder,
this.levels = const [1, 4.25, 6.75, 8.25, 11.5, 14.5, 16.0, 16.5, 20.0],
this.extraPercent = 0.5,
this.maxItemsForMaxDistAlgo = 200,
this.clusterAlgorithm = ClusterAlgorithm.geoHash,
this.maxDistParams,
this.stopClusteringZoom,
EdgeInsets? padding,
double? devicePixelRatio,
}) : markerBuilder = markerBuilder ?? _basicMarkerBuilder,
assert(
levels.length <= precision,
'Levels length should be less than or equal to precision',
),
devicePixelRatio = devicePixelRatio ??
WidgetsBinding
.instance.platformDispatcher.views.first.devicePixelRatio {
this.padding = padding != null
? EdgeInsets.only(
top: padding.top * this.devicePixelRatio,
left: padding.left * this.devicePixelRatio,
right: padding.right * this.devicePixelRatio,
bottom: padding.bottom * this.devicePixelRatio,
)
: padding;
}