Appearance
Documentation / @geoverse/editor-core / collectMidpointHandles
Function: collectMidpointHandles()
ts
function collectMidpointHandles(features): FeatureCollection<Point>;Defined in: packages/editor-core/src/geometry/vertices.ts:81
从可编辑要素集合提取"中点句柄"——每条线段的中点,供适配器实现 OL-Modify 式「拖中点插入顶点」的内联幽灵手柄(MapLibre 自绘无原生 Modify,须自备)。 段序 segmentIndex 与 import('../commands/addVertex.js').AddVertexCommand 的语义对齐: 新顶点插在该段之后(splice 到 segmentIndex+1)。
- LineString:相邻顶点构成的段;Polygon:逐环,环坐标含闭合点故自然覆盖闭合段;
- Point / Multi*:无中点(与可插点范围一致——AddVertex 仅 LineString/Polygon)。 纯函数、无地图库依赖,可 node 单测。
Parameters
features
Returns
FeatureCollection<Point>
