segmentReduceCallback
描述
🌐 Description
segmentReduce 的回调函数
🌐 Callback for segmentReduce
回调函数第一次被调用时,作为参数提供的值取决于 reduce 方法是否有 initialValue 参数。
🌐 The first time the callback function is called, the values provided as arguments depend on whether the reduce method has an initialValue argument.
如果为 reduce 方法提供了 initialValue:
🌐 If an initialValue is provided to the reduce method:
- previousValue 参数是 initialValue。
- currentValue 参数是数组中第一个元素的值。
如果未提供 initialValue:
🌐 If an initialValue is not provided:
- previousValue 参数是数组中第一个元素的值。
- currentValue 参数是数组中第二个元素的值。
定义
🌐 Definition
函数 (
🌐 function (
| 名称 | 类型 | 描述 |
|---|---|---|
| previousValue | Reducer | 上一次调用回调时返回的累积值,或者如果提供了 initialValue,则为 initialValue。 |
| currentSegment | Feature<LineString> | 当前正在处理的段。 |
| featureIndex | number | 当前正在处理的特性索引。 |
| multiFeatureIndex | 数字 | 当前正在处理的多特性的索引。 |
| geometryIndex | 数字 | 当前正在处理的几何体索引。 |
| segmentIndex | number | 当前正在处理的段的索引。 |
)
返回
🌐 Returns
归约器