ClusterReduceCallback<T> typedef

ClusterReduceCallback<T> = T? Function(T? previousValue, FeatureCollection<GeometryObject>? cluster, dynamic clusterValue, int? currentIndex)

ClusterReduceCallback The first time the callback function is called, the values provided as arguments depend on whether the reduce method has an initialValue argument.

If an initialValue is provided to the reduce method:

  • The previousValue argument is initialValue.
  • The currentValue argument is the value of the first element present in the List.

If an initialValue is not provided:

  • The previousValue argument is the value of the first element present in the List.
  • The currentValue argument is the value of the second element present in the List.

Takes a previousValue, the accumulated value previously returned in the last invocation of the callback, or initialValue, if supplied, a FeatureCollection cluster, the current cluster being processed, a clusterValue used to create cluster being processed and a currentIndex, the index of the current element being processed in the List. Starts at index 0, if an initialValue is provided, and at index 1 otherwise.

Implementation

typedef ClusterReduceCallback<T> = T? Function(
  T? previousValue,
  FeatureCollection? cluster,
  dynamic clusterValue,
  int? currentIndex,
);