Skip to content

描述 ​

clusterReduce 的回调函数

首次调用回调函数时,提供的参数值取决于 reduce 方法是否有 initialValue 参数。

如果为 reduce 方法提供了 initialValue:

  • previousValue 参数为 initialValue。
  • currentValue 参数为数组中第一个元素的值。

如果未提供 initialValue:

  • previousValue 参数为数组中第一个元素的值。
  • currentValue 参数为数组中第二个元素的值。

定义 ​

function (

名称类型描述
previousValue?*上次调用回调返回的累积值,如果提供了 initialValue 则为 initialValue。
cluster?FeatureCollection当前正在处理的聚类。
clusterValue?*用于创建正在处理的聚类的值。
currentIndex?number数组中当前正在处理的元素的索引。如果提供了 initialValue 则从索引 0 开始,否则从索引 1 开始。

)

返回值 ​

void