描述
coordReduce 的回调函数
首次调用回调函数时,提供的参数值取决于 reduce 方法是否有 initialValue 参数。
如果为 reduce 方法提供了 initialValue:
- previousValue 参数为 initialValue。
- currentValue 参数为数组中第一个元素的值。
如果未提供 initialValue:
- previousValue 参数为数组中第一个元素的值。
- currentValue 参数为数组中第二个元素的值。
定义
function (
| 名称 | 类型 | 描述 |
|---|---|---|
| previousValue | Reducer | 上次调用回调返回的累积值,如果提供了 initialValue 则为 initialValue。 |
| currentCoord | Array<number> | 当前正在处理的坐标。 |
| coordIndex | number | 当前正在处理的坐标的索引。如果提供了 initialValue 则从索引 0 开始,否则从索引 1 开始。 |
| featureIndex | number | 当前正在处理的 Feature 的索引。 |
| multiFeatureIndex | number | 当前正在处理的 Multi-Feature 的索引。 |
| geometryIndex | number | 当前正在处理的 Geometry 的索引。 |
)
返回值
Reducer