gis-view-webgl2 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +9 -8
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.d.ts +232 -228
  4. package/dist/index.js +1 -1
  5. package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +49 -0
  6. package/docs/GisView.md +1 -1
  7. package/docs/ai/06-/344/274/232/350/257/235/347/264/242/345/274/225/344/270/216/345/244/215/346/237/245/346/226/271/346/263/225.md +48 -0
  8. package/docs/demos/BasicDemo.vue +2 -2
  9. package/docs/demos/BatchAddDemo.vue +6 -6
  10. package/docs/demos/ConnectDemo.vue +164 -33
  11. package/docs/demos/CopyMergeDemo.vue +27 -14
  12. package/docs/demos/EventDemo.vue +17 -20
  13. package/docs/demos/LabelDemo.vue +5 -5
  14. package/docs/demos/api-index.js +31 -29
  15. package/docs/demos/gis-view-demo/GisViewDemoCardHeader.vue +1 -1
  16. package/docs/demos/gis-view-demo/GisViewDemoStage.vue +1 -1
  17. package/docs/demos/gis-view-demo/panels/DataPanels.vue +1 -1
  18. package/docs/demos/gis-view-demo/useGisViewDemo.js +31 -33
  19. package/docs/format/07-/344/272/213/344/273/266/350/275/275/350/215/267/344/270/216/347/244/272/344/276/213/346/225/260/346/215/256.md +8 -7
  20. package/docs/from0/05-/347/233/270/346/234/272/344/270/216/344/272/244/344/272/222.md +1 -1
  21. package/docs/from0/07-/351/200/232/351/201/223/345/210/206/347/273/204/344/270/216/345/244/232/345/233/236/347/272/277.md +26 -10
  22. package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +1 -1
  23. package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +21 -16
  24. package/docs/manual/06-/346/225/260/346/215/256/344/270/216/345/234/272/346/231/257/346/233/264/346/226/260.md +9 -10
  25. package/docs/manual/07-/346/214/207/351/222/210/344/270/216/350/246/201/347/264/240/347/274/226/350/276/221.md +54 -31
  26. package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +3 -3
  27. package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +9 -6
  28. package/docs/manual/10-/351/200/232/351/201/223/347/274/226/350/276/221/344/270/216/346/226/260/345/242/236.md +226 -493
  29. package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +2 -2
  30. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +12 -13
  31. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +23 -21
  32. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +19 -17
  33. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +125 -78
  34. package/docs/manual/19-/350/257/273/346/225/260/344/270/216/346/213/226/346/213/275/351/242/204/350/247/210.md +1 -1
  35. package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +2 -2
  36. package/docs/manual/21-/350/257/264/346/230/216/344/270/216/345/270/270/350/247/201/351/227/256/351/242/230.md +4 -4
  37. package/docs/steps/README.md +9 -7
  38. package/docs/steps/bench-scale.html +1 -1
  39. package/docs/steps/index.html +6 -6
  40. package/docs/steps/selftest-actions.html +26 -25
  41. package/docs/steps/selftest-data.html +1 -1
  42. package/docs/steps/selftest-demos.html +102 -6
  43. package/docs/steps/selftest-docs.html +3 -3
  44. package/docs/steps/selftest-features.html +283 -51
  45. package/docs/steps/selftest-full.html +3 -3
  46. package/docs/steps/selftest-labels.html +1 -1
  47. package/docs/steps/selftest-perf.html +31 -4
  48. package/docs/steps/selftest-select.html +20 -5
  49. package/docs/steps/step-05-pick.js +4 -8
  50. package/docs/steps/step-07-channels.js +3 -5
  51. package/docs/steps/step-08-labels.js +3 -3
  52. package/docs/steps/step-10-full.js +3 -3
  53. package/docs/steps/step-12-events.js +41 -24
  54. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1690,6 +1690,12 @@ export interface GisViewChannelLinesResult {
1690
1690
  groups?: GisViewChannelGroupInfo[]
1691
1691
  }
1692
1692
 
1693
+ /**
1694
+ * 草稿遇到「两端已有通道」时的处理:block 不发新通道、按失败返回;newGroup 把这次新增的回线放进新分组;
1695
+ * joinGroup 并进 groupId / groupIndex 指定的分组;auto 有新分组余量时优先新分组,否则并进可用分组
1696
+ */
1697
+ export type GisViewChannelExistingMode = 'block' | 'newGroup' | 'joinGroup' | 'auto'
1698
+
1693
1699
  /**
1694
1700
  * 新增方案:newChannel 新建一条通道,newGroup 在原通道里加一组(不带拐点),
1695
1701
  * joinGroup 把新回线并进原通道的某一组;上限(channelMaxGroups / channelGroupMaxLines)到了就不 enabled;
@@ -1740,6 +1746,14 @@ export interface GisViewChannelAddPlan {
1740
1746
  to: GisViewChannelNodeDraft
1741
1747
  /** 这一段加什么:'channel' 新建通道 / 回线(缺省),'line' 新建不挂通道的独立线路 */
1742
1748
  kind: 'channel' | 'line'
1749
+ /** 这一次草稿是否处在单一通道模式(已有通道时按 existingChannel 处理) */
1750
+ singleChannel: boolean
1751
+ /** 草稿对已有通道的处理策略;没有配置时为 null(沿用旧的分组方案表) */
1752
+ existingChannel: GisViewChannelExistingMode | null
1753
+ /** 最终推荐的分组(preferred 为 joinGroup 时):group 读数已切到这一组 */
1754
+ targetGroupId: string | number | null
1755
+ /** 最终推荐分组的序号(从 0 起);不落到分组时为 -1 */
1756
+ targetGroupIndex: number
1743
1757
  /** 这一次要加的回线数(余量按它算) */
1744
1758
  count: number
1745
1759
  /** 两个节点之间已有的通道 id(没有就是新建通道) */
@@ -1799,8 +1813,21 @@ export interface GisViewChannelDraftOptions {
1799
1813
  continuous?: boolean | 'chain'
1800
1814
  /** 连续新增时是否接着上一段的终点画(等价于 continuous: 'chain') */
1801
1815
  chain?: boolean
1802
- /** 这一段加什么:'channel' 新建通道 / 回线(缺省),'line' 新建不挂通道的独立线路 */
1803
- kind?: 'channel' | 'line'
1816
+ /**
1817
+ * 单一通道模式:true 时 beginAddChannel 默认在已有通道上 fail(等价于 existingChannel: 'block');
1818
+ * 没有已有通道时仍正常新建。beginAddLine 不把 singleChannel 当作挂通道开关,挂已有通道请写 existingChannel
1819
+ */
1820
+ singleChannel?: boolean
1821
+ /**
1822
+ * 两端已有通道时怎么办:block 失败、newGroup 新加一组、joinGroup 并进指定组、auto 新分组优先。
1823
+ * beginAddChannel 不写且 singleChannel 为 true 时按 block;beginAddLine 显式写 newGroup / joinGroup
1824
+ * 时可给已有通道加回线,不写则始终新建独立线路
1825
+ */
1826
+ existingChannel?: GisViewChannelExistingMode
1827
+ /** joinGroup 的目标分组 id;也认 groupIndex(从 0 起,二者都写按 groupId) */
1828
+ groupId?: string | number
1829
+ /** joinGroup 的目标分组序号(从 0 起) */
1830
+ groupIndex?: number
1804
1831
  /** 新建通道时一次加几回(缺省 1):新通道 / 新分组 / 并入分组的余量都按它算 */
1805
1832
  circuits?: number
1806
1833
  /** 新线路名,缺省按两端节点生成 */
@@ -1812,8 +1839,8 @@ export interface GisViewChannelDraftOptions {
1812
1839
  lineProps?: Partial<GisViewLine>
1813
1840
  /** 逐条回线的属性:按下标一一对应(第几项就只管第几回),盖在同一条 lineProps 之上;与 createChannels 的 linePropsByMember 同名同义 */
1814
1841
  linePropsByMember?: Array<Partial<GisViewLine> | undefined>
1815
- /** 第二段 lineItems(一条或一批):与 linePropsByMember 同义,给了几条这一段就加几条(circuits 按它对齐);每项也可以只写一个 id */
1816
- lineItems?: GisViewChannelLineItems
1842
+ /** 第二段 lineData(一条或一批):与 linePropsByMember 同义,给了几条这一段就加几条(circuits 按它对齐);每项也可以只写一个 id */
1843
+ lineData?: GisViewChannelLineData
1817
1844
  /** 走线方式:'straight'(缺省,两端直连)/ 'orthogonal'(自动补一个先横后纵的 90° 拐点) */
1818
1845
  routing?: 'straight' | 'orthogonal'
1819
1846
  /** 中间拐点(不含两端):给了就按它折线;routing 的自动拐点只在没给有效拐点时补 */
@@ -1856,6 +1883,13 @@ export interface GisViewChannelDraftPayload {
1856
1883
  chain: boolean
1857
1884
  /** 这一段加什么:'channel' 新建通道 / 回线,'line' 新建不挂通道的独立线路 */
1858
1885
  kind: 'channel' | 'line'
1886
+ /** 这一段是否开了单一通道模式 */
1887
+ singleChannel: boolean
1888
+ /** 这一段对已有通道的策略(没有配置时为 null) */
1889
+ existingChannel: GisViewChannelExistingMode | null
1890
+ /** 推荐落点的目标分组:preferred 为 joinGroup 时有值,否则为 null / -1 */
1891
+ targetGroupId: string | number | null
1892
+ targetGroupIndex: number
1859
1893
  /** 这一次要加的回线数(kind 为 'channel' 时才有意义) */
1860
1894
  circuits: number
1861
1895
  /** 这是草稿里的第几次点击:1 拿到起点、2 拿到终点(线路结束)、0 表示不是点击 */
@@ -1876,8 +1910,8 @@ export interface GisViewChannelDraftPayload {
1876
1910
  lineProps?: Partial<GisViewLine>
1877
1911
  /** 逐条回线的属性(与 createChannels 同名同义):按下标一一对应,没配为 null */
1878
1912
  linePropsByMember?: Array<Partial<GisViewLine> | undefined> | null
1879
- /** 第二段 lineItems(一条或一批):与 linePropsByMember 同一份写法,提交时一起交给 addChannel */
1880
- lineItems?: Array<Partial<GisViewLine> | undefined> | null
1913
+ /** 第二段 lineData(一条或一批):与 linePropsByMember 同一份写法,提交时一起交给 addChannel */
1914
+ lineData?: Array<Partial<GisViewLine> | undefined> | null
1881
1915
  channelProps?: Partial<GisViewChannel>
1882
1916
  /** 这一次草稿实际生效的预览样式(全局配置 + 本次覆盖) */
1883
1917
  style: GisViewChannelDraftStyle
@@ -2084,10 +2118,9 @@ export interface GisViewAddWaypointsResult {
2084
2118
 
2085
2119
  /** addChannelGroups 的一项:分组信息(id / path)外加这一组新建的线路数据 */
2086
2120
  export interface GisViewChannelAddGroupInput extends GisViewChannelAddGroup {
2087
- /** 这一组新建的线路数据(三个名字等价,写法同 addChannel 第二段) */
2121
+ /** 这一组新建的线路数据(两个名字等价,写法同 addChannel 第二段) */
2088
2122
  lineData?: GisViewChannelLineData
2089
2123
  lines?: GisViewChannelLineData
2090
- lineItems?: GisViewChannelLineData
2091
2124
  }
2092
2125
 
2093
2126
  /** addChannelGroups 的返回:逐组结果、成功落地的回线 id 与新分组 id */
@@ -2188,63 +2221,33 @@ export interface GisViewChannelInView {
2188
2221
  groupIds: Array<string | number>
2189
2222
  }
2190
2223
 
2191
- /**
2192
- * addChannel / addLine 的第二段(也是入参里的 lineItems):一条或一批逐条回线属性,与 linePropsByMember 同义。
2193
- * 每一项也可以只写一个 id(裸字符串 / 数字按 { id } 收),与 GisViewChannelLineData 同一份口径 ——
2194
- * 从前这两条归一是分开的:旧写法只收对象,裸 id 被当没写(见 15.98)
2195
- */
2196
- export type GisViewChannelLineItems = GisViewChannelLineData
2224
+ /** 新增草稿提交时选择落点:显式方案,或 'auto' 使用草稿的推荐方案 */
2225
+ export type GisViewChannelAddResolution = 'auto' | 'newChannel' | 'newGroup' | 'joinGroup' | 'newLine' | {
2226
+ type?: 'newChannel' | 'newGroup' | 'joinGroup' | 'newLine'
2227
+ groupId?: string | number
2228
+ groupIndex?: number
2229
+ channelId?: string | number
2230
+ }
2197
2231
 
2198
- /** 程序化新增通道 / 独立线路的入参:不用交互,按两个节点直接落到数据上 */
2199
- export interface GisViewChannelAddInput {
2232
+ /** 程序化新增独立线路的入参:按两个节点生成线路,不挂通道 */
2233
+ export interface GisViewLineAddSpec {
2200
2234
  from: string | number
2201
2235
  to: string | number
2202
- /**
2203
- * 缺省 / 'auto' 先新建通道、再加新分组、最后并入现有分组;也可以直接给 type 或 { groupId } / { groupIndex } 指定。
2204
- * 只写 channelId 时按这条通道自己的推荐顺序挑(新分组 → 第一个能并的分组)。
2205
- * kind 为 'line'(新增独立线路)时不走方案表,这一步忽略
2206
- */
2207
- resolution?: 'auto' | 'newChannel' | 'newGroup' | 'joinGroup' | 'newLine' | { type?: 'newChannel' | 'newGroup' | 'joinGroup' | 'newLine'; groupId?: string | number; groupIndex?: number; channelId?: string | number }
2208
- /** 加通道还是加独立线路:'channel' 缺省,'line' 不挂通道(addLine 就是它的快捷写法) */
2209
- kind?: 'channel' | 'line'
2210
- /** 一次加几回(缺省 1):新建通道 / 新分组 / 并入分组的余量都按它算 */
2211
- circuits?: number
2212
- /** 线路名,缺省按两端节点生成 */
2236
+ /** 线路名,缺省按两端节点生成;一次多回时自动带序号 */
2213
2237
  name?: string
2214
- /** 新回线 id(等价于 id);一次加多回时按它加序号 */
2215
- lineId?: string | number
2238
+ /** 第一条回线的 id 种子;一次多回时自动带序号,第二段每项也可以各写自己的 id */
2216
2239
  id?: string | number
2217
- lineName?: string
2218
- /**
2219
- * 新建通道时的通道 id;两个节点之间已经有通道时,它是「并进哪条通道」的筛选条件
2220
- * (等价于 resolution 里只写 channelId,按这条通道自己的推荐顺序挑:新分组 → 第一个能并的分组)
2221
- */
2222
- channelId?: string | number
2223
- channelName?: string
2224
- /**
2225
- * 并进已有通道的哪一组(等价于 resolution: { type: 'joinGroup', groupId }):
2226
- * 与 groupIndex 二选一,都写按 groupId;两个节点之间还没有通道时忽略
2227
- */
2228
- groupId?: string | number
2229
- /** 并进已有通道的第几组(从 0 起,与 groupId 二选一):两个节点之间还没有通道时忽略 */
2230
- groupIndex?: number
2240
+ /** 所有回线共用的业务字段(颜色 / 线宽 / 线型…) */
2231
2241
  lineProps?: Partial<GisViewLine>
2232
- /** 逐条回线的属性:按下标一一对应(第几项就只管第几回),盖在同一条 lineProps 之上;与 createChannels 的 linePropsByMember 同名同义 */
2233
- linePropsByMember?: Array<Partial<GisViewLine> | undefined>
2234
- /**
2235
- * 与回线一一对应的逐条属性(addChannel / addLine 的第二段也行):一条或一批 —— 给了几条就建几条
2236
- * (circuits 忽略),每一项盖在同一条 lineProps 与 linePropsByMember 对应项之上;
2237
- * 每一项也可以只写一个 id(裸字符串 / 数字按 { id } 收)
2238
- */
2239
- lineItems?: GisViewChannelLineItems
2240
- channelProps?: Partial<GisViewChannel>
2241
- /** 中间拐点(不含两端):新建通道写进骨架,新建独立线路展开成完整 path;routing 为 orthogonal 时自动补拐点 */
2242
+ /** 中间拐点;routing 为 orthogonal 时也可由它自动补拐点 */
2242
2243
  path?: GisViewCoordinate[]
2243
- /** 走线方式:'straight'(缺省)/ 'orthogonal'(自动补一个先横后纵的 90° 拐点) */
2244
+ /** 走线方式:'straight'(缺省)/ 'orthogonal' */
2244
2245
  routing?: 'straight' | 'orthogonal'
2246
+ /** 第二段的别名:线路数据,一条或一批 */
2247
+ lineData?: GisViewChannelLineData
2245
2248
  }
2246
2249
 
2247
- /** 第二段线路数据(新签名的 line_data / 旧写法的 lineItems 同一份):对象里的 id 就是回线 id(没写的自动编号),裸字符串 / 数字等价于 { id } */
2250
+ /** 第二段线路数据(lineData):对象里的 id 就是回线 id(没写的自动编号),裸字符串 / 数字等价于 { id } */
2248
2251
  export type GisViewChannelLineData = Partial<GisViewLine> | string | number | Array<Partial<GisViewLine> | string | number | undefined>
2249
2252
 
2250
2253
  /** 新签名 addChannel 第三段的一项:新通道的分组信息(id / 成员 / 中间拐点;缺省整条通道一组) */
@@ -2267,6 +2270,12 @@ export interface GisViewChannelAddSpec {
2267
2270
  name?: string
2268
2271
  /** 通道 id,缺省按两端节点拼 channel-<from>-<to> */
2269
2272
  id?: string | number
2273
+ /** 其余通道字段(宽度 / 偏移方式…) */
2274
+ channelProps?: Partial<GisViewChannel>
2275
+ /** 中间拐点(不含两端):写进通道骨架;routing 为 orthogonal 时自动补拐点 */
2276
+ path?: GisViewCoordinate[]
2277
+ /** 走线方式:'straight'(缺省)/ 'orthogonal' */
2278
+ routing?: 'straight' | 'orthogonal'
2270
2279
  /** 第二段的别名(写在对象上时用它):线路数组 line_data */
2271
2280
  lineData?: GisViewChannelLineData
2272
2281
  /** 第三段的别名(写在对象上时用它):分组信息 */
@@ -2274,20 +2283,27 @@ export interface GisViewChannelAddSpec {
2274
2283
  }
2275
2284
 
2276
2285
  /**
2277
- * commitAddChannel 的对象入参:可以写一份新通道 / 新线路,也可以放在 channel / line / lines 里逐段给。
2278
- * - 直接通道对象必须带 lineIds:每个 id 生成一条新回线,groups 是分组声明;通道 id 不参与回线 id。
2279
- * - 直接线路对象的业务字段透传到 lineProps;path 是中间拐点,首尾仍取 from / to。
2280
- * - 容器里的 line 缺省是独立线路,lines / lineData / lineItems 才是成员回线表,且 lines 优先;
2286
+ * commitAddChannel 的对象入参:通道 / 线路对象放在 channel / line / lines / lineData 里逐段给。
2287
+ * - channel.lineIds 的每个 id 生成一条新回线,channel.groups 是分组声明;通道 id 不参与回线 id。
2288
+ * - line 的业务字段透传到 lineProps;path 是中间拐点,首尾仍取 from / to。
2289
+ * - line 缺省是独立线路,lines / lineData 才是成员回线表,且 lines 优先;
2281
2290
  * 空数组不覆盖草稿。channel.lineIds 只在没有成员回线表时当 id 种子。
2282
2291
  * - 对象里的端点、id、名称、路径、样式与分组优先于草稿;没写的字段仍沿用当前草稿。
2283
- * - 容器顶层的 channel.lineProps 目前不参与合并;公共字段写顶层 lineProps,单条写 lines[i]。
2292
+ * - 公共字段写顶层 lineProps,单条写 lines[i]。
2284
2293
  */
2285
- export interface GisViewChannelAddCommitInput extends Partial<GisViewChannelAddInput> {
2294
+ export interface GisViewChannelAddCommitInput {
2295
+ from?: string | number
2296
+ to?: string | number
2297
+ name?: string
2298
+ /** 线路 id 种子(通道 id 写在 channel.id) */
2299
+ id?: string | number
2300
+ /** 这次提交选哪个落点;不写就用草稿的推荐方案 */
2301
+ resolution?: GisViewChannelAddResolution
2286
2302
  /** 本次新增的通道对象(lineIds 会作为新回线 id 种子;groups 作为分组声明) */
2287
2303
  channel?: GisViewChannel
2288
2304
  /** 本次新增的一条线路对象(写了它就按独立线路提交) */
2289
2305
  line?: GisViewLine
2290
- /** 本次新增的回线对象 / 数据(一条或一批,与 lineData / lineItems 同义) */
2306
+ /** 本次新增的回线对象 / 数据(一条或一批,与 lineData 同义) */
2291
2307
  lines?: GisViewChannelLineData
2292
2308
  /** lines 的别名(与 addChannel 的第二段同一个写法) */
2293
2309
  lineData?: GisViewChannelLineData
@@ -2295,6 +2311,16 @@ export interface GisViewChannelAddCommitInput extends Partial<GisViewChannelAddI
2295
2311
  channelGroups?: GisViewChannelAddGroup | GisViewChannelAddGroup[]
2296
2312
  /** channelGroups 的别名(与 addChannel 的第三段同一个写法) */
2297
2313
  group?: GisViewChannelAddGroup | GisViewChannelAddGroup[]
2314
+ /** 所有新回线共用的业务字段 */
2315
+ lineProps?: Partial<GisViewLine>
2316
+ /** 逐条回线的业务字段:按下标覆盖 lineProps / lines[i] */
2317
+ linePropsByMember?: Array<Partial<GisViewLine> | undefined>
2318
+ /** 新通道的其余字段 */
2319
+ channelProps?: Partial<GisViewChannel>
2320
+ /** 中间拐点(不含两端) */
2321
+ path?: GisViewCoordinate[]
2322
+ /** 走线方式:'straight' / 'orthogonal' */
2323
+ routing?: 'straight' | 'orthogonal'
2298
2324
  }
2299
2325
 
2300
2326
  /** 新增通道草稿端点示例点单端的样式:只写哪几项就覆盖哪几项 */
@@ -2775,11 +2801,6 @@ export interface GisViewClusterPickResult extends GisViewCluster {
2775
2801
  /** pick / pickAt / hover 可能拿到普通要素或聚合圆。 */
2776
2802
  export type GisViewHitResult = GisViewPickResult | GisViewClusterPickResult
2777
2803
 
2778
- /** action.data 里的聚合读数:不带 action 自身,避免载荷循环引用。 */
2779
- export interface GisViewClusterPointerData extends GisViewCluster {
2780
- type: 'cluster'
2781
- }
2782
-
2783
2804
  /** 聚合数量文字:覆盖层每帧只需要位置、半径与数量。 */
2784
2805
  export interface GisViewClusterLabel {
2785
2806
  id: string
@@ -2788,12 +2809,12 @@ export interface GisViewClusterLabel {
2788
2809
  radius: number
2789
2810
  }
2790
2811
 
2791
- /** onClusterClick / clusterClick 的载荷:与点击载荷同一套指针字段,但不带普通要素的 item。 */
2812
+ /**
2813
+ * onClusterClick / clusterClick 的载荷:与点击载荷同一套指针字段,但不带普通要素的 item。
2814
+ * 鼠标键与修饰键读 `originalEvent`;选中集读数用 `getSelectionInfo()`。
2815
+ */
2792
2816
  export type GisViewClusterClickPayload = GisViewClusterPickResult & {
2793
- button?: number
2794
- buttons?: number
2795
2817
  originalEvent: Event
2796
- selection: GisViewSelectionInfo
2797
2818
  action: GisViewPointerAction
2798
2819
  }
2799
2820
 
@@ -2825,18 +2846,22 @@ export interface GisViewSelectionChannelFields {
2825
2846
  groupIndex?: number
2826
2847
  group?: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
2827
2848
  groups?: Array<GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }>
2849
+ /** 本次选中集里属于这条通道的回线下标 / id;单通道与 channelContexts 的每项都会给 */
2850
+ lineIndexes?: number[]
2851
+ lineIds?: Array<string | number>
2828
2852
  /** 选中集涉及多条通道时才有(按选中顺序);单通道不创建这一份,直接读顶层平铺字段 */
2829
2853
  channelContexts?: GisViewSelectionChannelContext[]
2830
2854
  }
2831
2855
 
2832
2856
  /** describeSelection 的返回值:要素读数 + 与选中载荷同一套通道上下文字段 */
2833
2857
  export interface GisViewDescribedSelection extends GisViewSelectionChannelFields {
2858
+ /** 选中项;通道回线不重复挂通道字段,归属看外层的 lineIndexes / channelContexts */
2834
2859
  items: GisViewPickResult[]
2835
2860
  }
2836
2861
 
2837
2862
  /** 选中事件载荷:点击选中为 0 / 1 个要素,Shift 框选为框内全部节点(随 shortcuts.boxSelect 改变) */
2838
2863
  export interface GisViewSelectPayload extends GisViewSelectionChannelFields {
2839
- /** 选中项;通道回线只带 channelId / channelIndex / groupId / groupIndex 标量归属,分组读数看顶层或 channelContexts */
2864
+ /** 选中项;通道回线不重复挂 channelId / channelIndex / groupId / groups,归属看顶层 lineIndexes / channelContexts */
2840
2865
  items: GisViewPickResult[]
2841
2866
  /** 框选时的画布 CSS 像素矩形,点击选中为 null */
2842
2867
  box: GisViewRect | null
@@ -2848,11 +2873,10 @@ export interface GisViewSelectPayload extends GisViewSelectionChannelFields {
2848
2873
  mode?: 'single' | 'multi' | 'box'
2849
2874
  }
2850
2875
 
2851
- /**
2852
2876
  /**
2853
2877
  * 选中集读数:ids(选中要素的 id,没有 id 的不进这里)/ count(要素条数)/
2854
- * pointCount / lineCount / channelCount(各类型几个,通道回线按通道算一个)的**计数**版本。
2855
- * onSelectChange、指针载荷里的 selection 与 getSelectionData() 的计数部分都是同一份口径。
2878
+ * points / lines / channels(各类型几个,通道回线按通道算一个)的**计数**版本。
2879
+ * onSelectChange、getSelectionInfo() 与 getSelectionData() 的计数部分都是同一份口径。
2856
2880
  */
2857
2881
  export interface GisViewSelectionInfo {
2858
2882
  ids: Array<string | number>
@@ -2933,7 +2957,7 @@ export interface GisViewSelectionData {
2933
2957
  lines: GisViewLine[]
2934
2958
  /** 选中回线所属的通道(去重) */
2935
2959
  channels: GisViewChannel[]
2936
- /** 与 getSelections() 同一份:带下标、坐标与通道上下文 */
2960
+ /** 与 getSelections() 同一份:带下标与坐标,通道回线不重复挂通道字段 */
2937
2961
  items: GisViewPickResult[]
2938
2962
  pointIndexes: number[]
2939
2963
  lineIndexes: number[]
@@ -2945,7 +2969,7 @@ export interface GisViewSelectionData {
2945
2969
  * 接口选中(select / clearSelection / selectInBox)也会发。
2946
2970
  */
2947
2971
  export interface GisViewSelectChangePayload extends GisViewSelectionInfo, GisViewSelectionChannelFields {
2948
- /** 与对应 onSelect 载荷共用同一批对象;通道回线不重复挂 group / groups */
2972
+ /** 与对应 onSelect 载荷共用同一批对象;通道回线不重复挂 channelId / channelIndex / groupId / groups */
2949
2973
  items: GisViewPickResult[]
2950
2974
  /** 框选时的矩形,其余为 null */
2951
2975
  box: GisViewRect | null
@@ -2955,7 +2979,7 @@ export interface GisViewSelectChangePayload extends GisViewSelectionInfo, GisVie
2955
2979
  /**
2956
2980
  * 这一次操作的判读(与指针事件同一套写法):type 细到 'select'(点中一个或接口选中)/
2957
2981
  * 'toggleSelect'(Ctrl 点击取反)/ 'boxSelect'(框选)/ 'clearSelection'(点空白、Esc 或接口清空);
2958
- * target 是 'selection'(作用在一批要素上)或 'empty'(清空成空集),data 就是这一批 items。
2982
+ * target 是 'selection'(作用在一批要素上)或 'empty'(清空成空集),这一批数据直接读载荷的 items。
2959
2983
  * 取反与清空这两条路不经过 onClick,要按操作分支的界面认这一个字段。
2960
2984
  */
2961
2985
  action: GisViewPointerAction
@@ -2975,8 +2999,8 @@ export interface GisViewWaypointPayload {
2975
2999
  phase: 'add' | 'select' | 'remove' | 'start' | 'move' | 'end'
2976
3000
  /**
2977
3001
  * 这一次操作的判读:type 为 'addWaypoint' / 'removeWaypoint' / 'selectWaypoint' / 'dragWaypoint',
2978
- * target 为 'waypoint',data 是「哪条线、第几个顶点、坐标、改完的那条线」那一份读数
2979
- * (与载荷里的 lineIndex / pathIndex / coordinate / line 同一份,只是打包在一起)
3002
+ * target 为 'waypoint'。哪条线、第几个顶点、坐标与改完的那条线直接读载荷顶层的
3003
+ * lineIndex / pathIndex / coordinate / line。
2980
3004
  */
2981
3005
  action?: GisViewPointerAction
2982
3006
  lineIndex: number
@@ -3030,15 +3054,11 @@ export interface GisViewChannelGroupChangePayload {
3030
3054
  /**
3031
3055
  * 点击与双击事件载荷,点击空白处时载荷为 null。
3032
3056
  * selected 是点完之后的状态、wasSelected 是点之前的状态(Ctrl 点击是取反之前),
3033
- * selection 是点完之后整个选中集的读数 —— 左键要自己接一套操作时看这三个就够。
3057
+ * 选中集读数用 getSelectionInfo(),鼠标键与修饰键读 originalEvent。
3034
3058
  */
3035
3059
  export interface GisViewClickPayload extends GisViewPickResult {
3036
- /** 鼠标按键:0 左键、1 中键、2 右键(与指针载荷同一份口径,单击 / 双击都是从 pointerup 判出来的) */
3037
- button?: number
3038
- buttons?: number
3060
+ /** 原始点击事件:button / buttons / 修饰键与 clientX / clientY 都从这里读 */
3039
3061
  originalEvent: Event
3040
- /** 点完之后整个选中集的读数(ids / count / 各类型条数,通道回线按通道算一个) */
3041
- selection: GisViewSelectionInfo
3042
3062
  /**
3043
3063
  * 这一次点击的判读:type 为 'select'(点中要素、选中已生效)或 'click'(没开选中时的普通点击),
3044
3064
  * 多选取反生效时是 'toggleSelect';double 为 true 说明这一下是双击里的第二下。点空白处的载荷是 null,
@@ -3087,18 +3107,11 @@ export type GisViewPointerActionType =
3087
3107
  | 'drag'
3088
3108
  | 'pointer'
3089
3109
 
3090
- /** 修饰键:与原生事件上的 ctrlKey / metaKey(⌘)/ shiftKey / altKey 一一对应 */
3091
- export interface GisViewPointerModifiers {
3092
- ctrl: boolean
3093
- meta: boolean
3094
- shift: boolean
3095
- alt: boolean
3096
- }
3097
-
3098
3110
  /**
3099
- * 一次指针操作的类型化判读:`action.type` 回答「这是什么操作」、`action.target` 回答「点在什么上面」、
3100
- * `action.data` 回答「能拿到什么数据」。画布上的指针事件、拐点、标签、选中集共用这一套写法 ——
3101
- * 使用方按 action.type / action.target 分支就够,不必自己按事件名分别记一套。
3111
+ * 一次指针操作的类型化判读:`action.type` 回答「这是什么操作」、`action.target` 回答「点在什么上面」。
3112
+ * 原始输入不在这里重复:鼠标键 / 修饰键 / clientX / clientY 读载荷的 `originalEvent`,
3113
+ * 命中的数据读载荷自己的 `item`、`channelContext`、`items` 等字段。
3114
+ * 画布上的指针事件、拐点、标签、选中集共用这一套写法。
3102
3115
  */
3103
3116
  export interface GisViewPointerAction {
3104
3117
  type: GisViewPointerActionType
@@ -3108,18 +3121,6 @@ export interface GisViewPointerAction {
3108
3121
  * 点击 / 右键 / 选中集事件恒为 false,拐点拖动事件里 start 为 false、move / end 为 true。
3109
3122
  */
3110
3123
  moved: boolean
3111
- /** 鼠标键名(left / middle / right),与载荷里的 button 数字一一对应;悬停没有按键,固定是 'none' */
3112
- button?: 'left' | 'middle' | 'right' | 'none' | string
3113
- /** 左键 / 右键两个布尔:判「是哪一只手」写 action.right 比比对字符串更直白(中键两个都是 false) */
3114
- left?: boolean
3115
- right?: boolean
3116
- modifiers?: GisViewPointerModifiers
3117
- /**
3118
- * 按 target 直接取到的那一份数据:点 / 线是数据里那个对象(与 getData() 同一份引用)、
3119
- * 通道回线是通道定义、选中集事件是这一批 items、拐点是「哪条线、第几个顶点、坐标、改完的线」,
3120
- * 空白处是 null(拐点那一份见 GisViewWaypointPayload.action.data、标签那一份见 GisViewLabelActionData)。
3121
- */
3122
- data?: GisViewPoint | GisViewLine | GisViewChannel | GisViewClusterPointerData | GisViewPickResult[] | GisViewWaypointActionData | GisViewLabelActionData | null
3123
3124
  /** 只在 click 载荷里出现:true 说明这一下是双击里的第二下(单双击要分开做事的界面按它推迟一下) */
3124
3125
  double?: boolean
3125
3126
  /**
@@ -3133,20 +3134,6 @@ export interface GisViewPointerAction {
3133
3134
  longPress?: boolean
3134
3135
  }
3135
3136
 
3136
- /** 拐点事件 action.data 的那一份读数:哪条线、第几个顶点、坐标与改完的那条线(与载荷里的同名字段同一份) */
3137
- export interface GisViewWaypointActionData {
3138
- lineIndex: number
3139
- pathIndex: number
3140
- coordinate: [number, number]
3141
- line: GisViewLine
3142
- }
3143
-
3144
- /** 标签事件 action.data 的那一份读数:这一条标签的读数与它挂在哪条要素上(drag / click / 右键 / 双击都认) */
3145
- export interface GisViewLabelActionData {
3146
- label: GisViewLabelInfo | null
3147
- parent: GisViewLabelParent | null
3148
- }
3149
-
3150
3137
  /**
3151
3138
  * 通用指针载荷:左键按下 / 抬起、右键都会发一条。
3152
3139
  * 命中的要素(点 / 线 / 通道回线)在 type / index / item 与通道字段里,没有命中时 type 为 null、hit 为 false;
@@ -3155,7 +3142,7 @@ export interface GisViewLabelActionData {
3155
3142
  export interface GisViewPointerPayload {
3156
3143
  /**
3157
3144
  * 这一次操作的判读:按下时 type 是意图、松开时是刚做完的那件事、右键固定是 'contextMenu';
3158
- * target 说明点的是点 / 线 / 通道 / 空白,data 直接给到那一份数据(左键 / 右键都认这一份)
3145
+ * target 说明点的是点 / 线 / 通道 / 空白;命中的数据直接读载荷的 item / channel / channelContext 等字段。
3159
3146
  */
3160
3147
  action: GisViewPointerAction
3161
3148
  /** 命中的要素类型,空白处为 null;多成员聚合是 'cluster' */
@@ -3170,9 +3157,6 @@ export interface GisViewPointerPayload {
3170
3157
  screen?: [number, number]
3171
3158
  /** 命中的要素自身的世界坐标 */
3172
3159
  coordinate?: [number, number]
3173
- /** 命中的是线路(含通道回线)时,线路在 lines 数组里的下标与 id;右键菜单按它找线路 */
3174
- lineIndex?: number
3175
- lineId?: string | number
3176
3160
  /** 命中的是通道内的回线时,回线所属通道与分组 */
3177
3161
  channelIndex?: number
3178
3162
  channel?: GisViewChannel
@@ -3198,11 +3182,10 @@ export interface GisViewPointerPayload {
3198
3182
  selected?: boolean
3199
3183
  /** 见 selected:左键按下 / 右键这一路上两份是同一个值(点击载荷里才是「点之前 / 点之后」) */
3200
3184
  wasSelected?: boolean
3201
- /** 这一刻整个选中集的读数(右键弹自己的面板时按它决定面板内容) */
3202
- selection?: GisViewSelectionInfo
3203
- /** 鼠标按键:0 左键、1 中键、2 右键 */
3204
- button: number
3205
- buttons: number
3185
+ /*
3186
+ * 选中集读数用 getSelectionInfo();鼠标键与修饰键用 originalEvent.button / buttons / ctrlKey /
3187
+ * metaKey / shiftKey / altKey。lineIndex 就是 index,线路 id 读 item.id 或 getLineChannel(index)。
3188
+ */
3206
3189
  /** 光标处的世界坐标 */
3207
3190
  world: [number, number]
3208
3191
  /** 配了 GeoJSON 底图时,光标位置对应的真实经纬度(含 aspectScale 反算) */
@@ -3210,16 +3193,15 @@ export interface GisViewPointerPayload {
3210
3193
  /** 光标处的画布 CSS 像素 */
3211
3194
  x: number
3212
3195
  y: number
3213
- clientX: number
3214
- clientY: number
3196
+ /** 原始指针 / 鼠标事件:button / buttons / 修饰键 / clientX / clientY 都从这里读 */
3215
3197
  originalEvent: PointerEvent | MouseEvent
3216
3198
  }
3217
3199
 
3218
3200
  /**
3219
3201
  * 悬停载荷(onHover 与 hoverAt 的读数,没有悬停到东西时是 null):
3220
3202
  * 与指针载荷同一层 —— 命中的要素在 type / index / item 与通道字段里,光标位置在 x / y / world 里,
3221
- * 另外带一份 action(type 恒为 'hover'、target 说明停在什么上面、button 恒为 'none')。
3222
- * 光标正好停在最近一次指针事件的位置上时,originalEvent / clientX / clientY 就是那一次事件(修饰键读得到)。
3203
+ * 另外带一份 action(type 恒为 'hover'、target 说明停在什么上面)。
3204
+ * 光标正好停在最近一次指针事件的位置上时,originalEvent 就是那一次事件(按键 / 修饰键 / 指针位置都读得到)。
3223
3205
  */
3224
3206
  export type GisViewHoverPayload = GisViewHitResult & {
3225
3207
  /** 悬停读数一样有:有没有停在某个要素上(空白处是 null,不走这一份) */
@@ -3230,12 +3212,8 @@ export type GisViewHoverPayload = GisViewHitResult & {
3230
3212
  y: number
3231
3213
  /** 光标处的世界坐标 */
3232
3214
  world: [number, number]
3233
- clientX?: number
3234
- clientY?: number
3235
3215
  /** 光标就停在这一次指针事件的位置上时给出(程序化悬停 hoverAt 不带) */
3236
3216
  originalEvent?: PointerEvent | MouseEvent | null
3237
- /** 此刻整个选中集的读数(与指针载荷里的 selection 同一份) */
3238
- selection?: GisViewSelectionInfo
3239
3217
  }
3240
3218
  export type GisViewCursorPayload = [number, number] | null
3241
3219
 
@@ -3286,8 +3264,6 @@ export interface GisViewPointCopyPayload {
3286
3264
  index: number
3287
3265
  /** 复制出来的节点:预览中就是含最新落点的那一份 */
3288
3266
  item: GisViewPoint
3289
- /** item 的别名,与其它载荷的写法对齐 */
3290
- point: GisViewPoint
3291
3267
  /** 来源节点;剪贴板这条的来源下标为 -1(快照还在) */
3292
3268
  source: GisViewCopySource | null
3293
3269
  /** 整组来源(clipboard 与多选复制时给全;普通 Alt 复制只有 source 一项) */
@@ -3308,8 +3284,6 @@ export interface GisViewPointCopyPayload {
3308
3284
  /** 快照是否带上内部线路 / 通道 */
3309
3285
  withLines?: boolean
3310
3286
  withChannels?: boolean
3311
- /** 复制出来的节点当前落在的世界坐标 */
3312
- coordinate: [number, number] | null
3313
3287
  /** 光标在画布内的 CSS 像素位置 */
3314
3288
  screen: [number, number] | null
3315
3289
  originalEvent: Event | null
@@ -3322,8 +3296,6 @@ export interface GisViewPointCopyPayload {
3322
3296
  invalidated: boolean
3323
3297
  /** 改复制节点的数据(字段级合并,坐标仍以预览落点为准),返回改完的节点 */
3324
3298
  update(patch: Partial<GisViewPoint>): GisViewPoint | null
3325
- /** 等价于 update */
3326
- setItem(patch: Partial<GisViewPoint>): GisViewPoint | null
3327
3299
  /** 取消这次复制:预览撤掉,数据不落地 */
3328
3300
  cancel(): GisViewPointCopyPayload | null
3329
3301
  /** 落地这次复制(interaction 结束后可以直接调) */
@@ -3411,13 +3383,11 @@ export interface GisViewBatchCopyPayload {
3411
3383
  /** 屏幕像素偏移量 */
3412
3384
  offsetScreen: [number, number]
3413
3385
  anchor: [number, number]
3414
- coordinate: [number, number] | null
3415
3386
  screen: [number, number] | null
3416
3387
  originalEvent: Event | null
3417
3388
  cancelled: boolean
3418
3389
  invalidated: boolean
3419
3390
  update(patch?: Partial<GisViewPoint>): GisViewPoint | null
3420
- setItem(patch?: Partial<GisViewPoint>): GisViewPoint | null
3421
3391
  /** 撤销整批(等价于 revert) */
3422
3392
  cancel(): GisViewBatchCopyPayload | null
3423
3393
  /** 已经落地,原样返回这份载荷 */
@@ -3708,6 +3678,12 @@ export interface GisViewSplitPointOptions {
3708
3678
  keepSourceId?: boolean
3709
3679
  /** 这一步历史的标签,缺省「拆分节点」 */
3710
3680
  label?: string
3681
+ /**
3682
+ * 没在 parts[].lines 里显式分配的线路怎么分:first 全跟第一份(缺省,兼容旧行为);
3683
+ * alternate 按「通道成组、独立线路单条」为单位轮流给负载最少的一份 —— 同一条通道的成员不会被拆散,
3684
+ * 解除合并时推荐用它
3685
+ */
3686
+ autoLines?: 'first' | 'alternate'
3711
3687
  }
3712
3688
 
3713
3689
  /** 拆分时没认出来的线路 / 通道引用 */
@@ -3730,6 +3706,15 @@ export interface GisViewSplitPointChangeSet {
3730
3706
  removedChannels: GisViewChannel[]
3731
3707
  }
3732
3708
 
3709
+ /** splitPoint 自动 / 显式分配之后,每一份节点接到的线路读数 */
3710
+ export interface GisViewSplitPointLineAssignment {
3711
+ /** 第几份(与 items / pointIds 同序) */
3712
+ index: number
3713
+ pointId: string | number
3714
+ lineIds: Array<string | number>
3715
+ lineCount: number
3716
+ }
3717
+
3733
3718
  /** splitPoint 的返回:ok 为 false 时 reason 说明原因,其余数组为空、changes 为 null */
3734
3719
  export interface GisViewSplitPointOutcome {
3735
3720
  ok: boolean
@@ -3747,6 +3732,12 @@ export interface GisViewSplitPointOutcome {
3747
3732
  removedChannels: number
3748
3733
  removedChannelIds: Array<string | number>
3749
3734
  skipped: { lines: GisViewSplitPointSkip[]; channels: GisViewSplitPointSkip[] }
3735
+ /** 这一次采用的自动分线口径 */
3736
+ autoLines: 'first' | 'alternate'
3737
+ /** 由 autoLines 自动分配(没有显式写 lines)的线路条数 */
3738
+ autoAssignedLines: number
3739
+ /** 每一份最终接到哪些线路(含显式分配与自动分配) */
3740
+ lineAssignments: GisViewSplitPointLineAssignment[]
3750
3741
  changes: GisViewSplitPointChangeSet | null
3751
3742
  }
3752
3743
 
@@ -4526,12 +4517,11 @@ export interface GisViewLabelDragPayload {
4526
4517
  state?: GisViewLabelState | null
4527
4518
  /** 这一条标签对应的要素在不在当前选中集里 */
4528
4519
  selected: boolean
4529
- selection: GisViewSelectionInfo
4530
4520
  /** 停手那一条带 true(说明这一路是拖过来而不是点选);start / move 上没有这个字段 */
4531
4521
  moved?: boolean
4532
4522
  /** 触发起手 / 移动 / 停手的原始指针事件(宿主按它读修饰键与指针位置) */
4533
4523
  originalEvent?: PointerEvent | MouseEvent | null
4534
- /** 这一次拖动的判读:type 为 'dragLabel'、target 为 'label'、data 是这一条标签 */
4524
+ /** 这一次拖动的判读:type 为 'dragLabel'、target 为 'label';标签与 parent 读载荷顶层 */
4535
4525
  action?: GisViewPointerAction
4536
4526
  }
4537
4527
 
@@ -4551,15 +4541,14 @@ export interface GisViewLabelClickPayload {
4551
4541
  /** 这一条当前的覆盖读数,没改过是 null */
4552
4542
  state: GisViewLabelState | null
4553
4543
  selected: boolean
4554
- selection: GisViewSelectionInfo
4555
4544
  /** 触发这一下的原始指针事件(点选是 pointerup;拖动路径里「没挪动」那条也是 pointerup) */
4556
4545
  originalEvent?: PointerEvent | MouseEvent | null
4557
- /** 这一次点选的判读:type 为 'selectLabel'、target 为 'label'、data 是这一条标签 */
4546
+ /** 这一次点选的判读:type 为 'selectLabel'、target 为 'label';标签与 parent 读载荷顶层 */
4558
4547
  action?: GisViewPointerAction
4559
4548
  }
4560
4549
 
4561
4550
  /**
4562
- * 标签上的右键 / 双击载荷:与 labelClick 同一份读数(label / parent),另带指针位置与原始 DOM 事件。
4551
+ * 标签上的右键 / 双击载荷:与 labelClick 同一份读数(label / parent);指针位置、按键与修饰键读 originalEvent。
4563
4552
  * `label.draggable` / `label.editable`(线路标签同一套开关)任开一个的标签都会发。
4564
4553
  */
4565
4554
  export interface GisViewLabelPointerPayload {
@@ -4576,15 +4565,11 @@ export interface GisViewLabelPointerPayload {
4576
4565
  /** 这一条当前的覆盖读数,没改过是 null */
4577
4566
  state: GisViewLabelState | null
4578
4567
  offset: [number, number]
4579
- /** 指针在视口里的位置(右键菜单按它定位;双击时是双击那一下的位置) */
4580
- clientX: number
4581
- clientY: number
4582
- /** 原始 DOM 事件(contextmenu / dblclick):要 preventDefault 或读别的字段时用它 */
4568
+ /** 原始 DOM 事件(contextmenu / dblclick):指针位置、按键、修饰键都从这里读 */
4583
4569
  originalEvent: MouseEvent | null
4584
4570
  /** 这一条标签对应的要素在不在当前选中集里 */
4585
4571
  selected: boolean
4586
- selection: GisViewSelectionInfo
4587
- /** 这一次操作的判读:type 为 'contextMenu' / 'dblClick'、target 为 'label'、data 是这一条标签 */
4572
+ /** 这一次操作的判读:type 为 'contextMenu' / 'dblClick'、target 为 'label';标签与 parent 读载荷顶层 */
4588
4573
  action?: GisViewPointerAction
4589
4574
  }
4590
4575
 
@@ -6049,8 +6034,8 @@ export interface GisViewBatchOptions {
6049
6034
  /**
6050
6035
  * 全部可订阅事件(与 EVENT_NAMES 一致):事件名与 options 里的回调一一对应(`dataChange` 就是 `onDataChange`),
6051
6036
  * 载荷也是同一份 —— 区别只在写法:`on` 可以挂多条、可以运行时订阅、返回的函数就是取消订阅。
6052
- * 需要原样带回 DOM 事件的那三个(pointerDown / pointerUp / contextMenu)载荷是
6053
- * `{ payload, event }`,与回调的两个参数一一对应。
6037
+ * 指针类事件(pointerDown / pointerUp / contextMenu)与回调收到的是同一份直接载荷,
6038
+ * 原始 DOM 事件看 payload.originalEvent。
6054
6039
  */
6055
6040
  export interface GisViewEventMap {
6056
6041
  /** 初始化完成:拿到画布与 WebGL 上下文 */
@@ -6065,9 +6050,9 @@ export interface GisViewEventMap {
6065
6050
  cursor: GisViewCursorPayload
6066
6051
  hover: GisViewHoverPayload
6067
6052
  pointer: GisViewPointerState
6068
- pointerDown: { payload: GisViewPointerPayload; event: PointerEvent }
6069
- pointerUp: { payload: GisViewPointerPayload; event: PointerEvent }
6070
- contextMenu: { payload: GisViewPointerPayload; event: MouseEvent }
6053
+ pointerDown: GisViewPointerPayload
6054
+ pointerUp: GisViewPointerPayload
6055
+ contextMenu: GisViewPointerPayload
6071
6056
  click: GisViewClickPayload
6072
6057
  /** 点中多成员聚合圆:不选中内部节点,普通 click 不会同时触发 */
6073
6058
  clusterClick: GisViewClusterClickPayload
@@ -6629,7 +6614,7 @@ export interface GisViewOptions {
6629
6614
  /** 单击要素或空白处 */
6630
6615
  onClick?: (payload: GisViewClickPayload | null) => void
6631
6616
  /** 点中多成员聚合圆:载荷带 count / pointIds / bounds;不会同时触发 onClick,也不改选中集 */
6632
- onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
6617
+ onClusterClick?: (payload: GisViewClusterClickPayload) => void
6633
6618
  /** 双击要素或空白处 */
6634
6619
  onDblClick?: (payload: GisViewClickPayload | null) => void
6635
6620
  /** 点了一下标签(label.editable / lineLabel.editable 打开时):载荷里是这一条标签的类型、下标与当前覆盖 */
@@ -6640,20 +6625,20 @@ export interface GisViewOptions {
6640
6625
  onLabelChange?: (payload: GisViewLabelChangePayload) => void
6641
6626
  /**
6642
6627
  * 在标签上按右键(label.draggable / label.editable 任开一个时):载荷与 onLabelClick 同一份读数,
6643
- * 另带 clientX / clientY(菜单按它定位)与原始 contextmenu 事件。系统菜单按 preventContextMenu 收
6628
+ * 指针位置、按键与修饰键读 originalEvent。系统菜单按 preventContextMenu 收
6644
6629
  */
6645
6630
  onLabelContextMenu?: (payload: GisViewLabelPointerPayload) => void
6646
6631
  /** 双击标签(开关同上):载荷与 onLabelContextMenu 同一份(原始事件是 dblclick) */
6647
6632
  onLabelDblClick?: (payload: GisViewLabelPointerPayload) => void
6648
- /** 左键 / 中键 / 右键按下:命中的要素、按钮与光标位置都在载荷里 */
6649
- onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6633
+ /** 左键 / 中键 / 右键按下:命中的要素与光标位置在载荷里,原生的键 / 修饰键读 payload.originalEvent */
6634
+ onPointerDown?: (payload: GisViewPointerPayload) => void
6650
6635
  /** 左键 / 中键 / 右键抬起:与 onPointerDown 成对 */
6651
- onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6636
+ onPointerUp?: (payload: GisViewPointerPayload) => void
6652
6637
  /**
6653
6638
  * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
6654
6639
  * 载荷另带 channelContext;要自己弹菜单就在这里 preventDefault()。
6655
6640
  */
6656
- onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
6641
+ onContextMenu?: (payload: GisViewPointerPayload) => void
6657
6642
  /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
6658
6643
  onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
6659
6644
  onHover?: (payload: GisViewHoverPayload) => void
@@ -6664,7 +6649,7 @@ export interface GisViewOptions {
6664
6649
  onPointDrag?: (payload: GisViewPointDragPayload) => void
6665
6650
  /**
6666
6651
  * 复制节点:start / move / commit / end / cancel(复制到剪贴板时另有 clipboard)。
6667
- * 在 commit 阶段可以 payload.cancel() 取消、payload.update() / setItem() 改数据,落地后 payload 里带 index 与最新 item
6652
+ * 在 commit 阶段可以 payload.cancel() 取消、payload.update() 改数据,落地后 payload 里带 index 与最新 item
6668
6653
  */
6669
6654
  onPointCopy?: (payload: GisViewPointCopyPayload | GisViewBatchCopyPayload) => void
6670
6655
  /**
@@ -6840,8 +6825,6 @@ export interface GisViewFocusOptions {
6840
6825
  scale?: number
6841
6826
  /** 显式要求按目标范围适应视图;**缺省不缩放**,只把中心移到目标上 */
6842
6827
  zoom?: boolean
6843
- /** 显式只居中、比例一点不动(与缺省行为一致,保留旧写法) */
6844
- center?: boolean
6845
6828
  /** 按范围适应视图(zoom: true)时四周的留白(CSS 像素),缺省 40 */
6846
6829
  padding?: number
6847
6830
  /** 适应视图(zoom: true)时最多放大到多少比例:单个节点 / 一条直线没有面积,靠它决定要不要放大 */
@@ -7679,8 +7662,8 @@ export interface GisViewInstance {
7679
7662
  zoomToBounds(bounds: GisViewBounds, padding?: number): GisViewInstance
7680
7663
  /**
7681
7664
  * 把视角移到目标上(见 GisViewFocusTargets):一个或一批都行,一批时取整体包围盒 ——
7682
- * 搜到三个节点就是这三个点之间的中心当屏幕中心。`{ center: true }` 只居中不改比例、
7683
- * `{ scale }` 按给定比例居中、缺省按范围适应视图(`padding` / `maxZoom` 可调),
7665
+ * 搜到三个节点就是这三个点之间的中心当屏幕中心。缺省只居中、比例不变;`{ zoom: true }`
7666
+ * 按目标范围适应视图(`padding` / `maxZoom` 可调),`{ scale }` 按给定比例居中,
7684
7667
  * `{ select: true, mode }` 顺手把这些要素选上。认不出目标时什么都不做,返回实例便于链式调用。
7685
7668
  */
7686
7669
  focusOn(target: GisViewFocusTargets, options?: GisViewFocusOptions): GisViewInstance
@@ -7813,7 +7796,7 @@ export interface GisViewInstance {
7813
7796
  * 程序化悬停(参数就是鼠标事件里的 clientX / clientY):让指针「停」到这个位置上 ——
7814
7797
  * 悬停高亮、光标与 onHover 都按它更新(外部列表 / 表格 hover 到某一行时联动高亮图上的要素)。
7815
7798
  * 不走悬停阈值,也不用先订阅一遍事件再把最近一次载荷记住;那儿没有命中要素时返回 null。
7816
- * 返回的读数与 onHover 载荷同一份(action / selection / lngLat 都补齐了)。想撤掉用 clearHover()
7799
+ * 返回的读数与 onHover 载荷同一份(action / lngLat 都补齐了)。想撤掉用 clearHover()
7817
7800
  */
7818
7801
  hoverAt(clientX: number, clientY: number): GisViewHoverPayload | null
7819
7802
  /** 取消程序化悬停:清掉高亮与读数并补发一条 onHover(null);没有悬停着的东西时什么都不做 */
@@ -7861,8 +7844,18 @@ export interface GisViewInstance {
7861
7844
  * onSelect 与 onSelectChange(cause: api)。
7862
7845
  */
7863
7846
  deselect(refs?: GisViewSelectionRefs): GisViewInstance
7864
- /** 当前选中集的原始条目(`{ type, index, item, ... }`,与指针载荷同一份口径),不做整理、不读包围盒 */
7847
+ /**
7848
+ * 当前选中集的原始条目(`{ type, index, item, ... }`),不做整理、不读包围盒。
7849
+ * 通道回线不带 channelId / channelIndex / groupId / groups;归属看选中事件的顶层
7850
+ * lineIndexes / channelContexts,或对单条线路调 getLineChannel()。
7851
+ */
7865
7852
  getSelections(): GisViewPickResult[]
7853
+ /**
7854
+ * 当前选中集的轻量计数:ids / count / points / lines / channels,与 onSelectChange 顶层的同名字段
7855
+ * 是同一份口径(通道回线按通道算一个)。指针 / 点击 / 悬停载荷不再重复挂 selection,需要这份读数时调它;
7856
+ * 结果按选中集引用缓存,十万级选中下也只是一次读取。要要素对象或包围盒时再用 getSelectionData()。
7857
+ */
7858
+ getSelectionInfo(): GisViewSelectionInfo
7866
7859
  /**
7867
7860
  * 这一个要素在不在当前选中集里:`isSelected('p-1')` 按 id 问、
7868
7861
  * `isSelected({ type: 'point', index: 3 })` 按下标问。
@@ -7873,7 +7866,7 @@ export interface GisViewInstance {
7873
7866
  /**
7874
7867
  * 当前画布上选中的数据(一次取全):ids / count 与各类型条数(通道回线按通道算一个)、
7875
7868
  * 要素本身 points / lines / channels 三个数组、下标清单 pointIndexes / lineIndexes、
7876
- * items(与 getSelections() 同一份)与世界包围盒 bounds(空选中时 null)。
7869
+ * items(与 getSelections() 同一份,通道回线不重复挂通道字段)与世界包围盒 bounds(空选中时 null)。
7877
7870
  * 单击、Ctrl 多选、框选与接口选中(selectFeatures / selectInBox)都是同一份 state,不挑选中来源;
7878
7871
  * bounds 走一次 getElementBounds(十万级选中下约 5 ms),只想问「选了哪几个」用 getSelections() 更省
7879
7872
  */
@@ -7895,7 +7888,7 @@ export interface GisViewInstance {
7895
7888
  commitPointCopy(): GisViewPointCopyPayload | null
7896
7889
  /** 取消复制:预览撤掉,数据一直没动过 */
7897
7890
  cancelPointCopy(): GisViewPointCopyPayload | null
7898
- /** 改预览节点的数据(等价于回调里的 payload.update / setItem),返回改完的节点 */
7891
+ /** 改预览节点的数据(等价于回调里的 payload.update),返回改完的节点 */
7899
7892
  updateCopyPoint(patch: Partial<GisViewPoint>): GisViewPoint | null
7900
7893
  /** 当前复制状态:预览中 / 等选点;没有就返回 null */
7901
7894
  getPointCopy(): GisViewPointCopyState | null
@@ -7936,10 +7929,12 @@ export interface GisViewInstance {
7936
7929
  mergePoints(source: GisViewPointRef, target: GisViewPointRef, options?: { originalEvent?: Event | null; item?: GisViewPoint }): GisViewMergeOutcome
7937
7930
  /**
7938
7931
  * 把一个节点拆成多份(mergePoints 的逆操作):第一份复用原下标与 id,其余追加到 points 末尾。
7939
- * 每份可直接写节点字段或放进 item;lines 分配线路(不写时连在原节点上的线路跟第一份),
7932
+ * 每份可直接写节点字段或放进 item;lines 显式分配线路,没写时默认跟第一份,
7933
+ * options.autoLines 为 'alternate' 时按「通道成组、独立线路单条」轮流分给负载最少的一份(解除合并推荐)。
7940
7934
  * channels / channelFrom / channelTo 分配受影响通道的端点。没显式分配的通道跟随它第一条被分配过的成员线路。
7941
7935
  * 拆分后自环 / 零长度线路与两端相同的通道删掉;整次调用只记一条历史、只发一条 `splitPoint` 数据变更。
7942
- * 返回 `{ ok, items, indexes, pointIds, linesChanged, removedLines, channelsChanged, removedChannels, changes, skipped }`
7936
+ * 返回 `{ ok, items, indexes, pointIds, linesChanged, removedLines, channelsChanged, removedChannels,
7937
+ * autoLines, autoAssignedLines, lineAssignments, changes, skipped }`
7943
7938
  */
7944
7939
  splitPoint(source: GisViewPointRef, parts: GisViewSplitPointPart[], options?: GisViewSplitPointOptions): GisViewSplitPointOutcome
7945
7940
  /**
@@ -8073,10 +8068,18 @@ export interface GisViewInstance {
8073
8068
  * (phase: 'ready',载荷里带两个节点、hasChannel / hasGroup / groups / channel 与可选方案)。
8074
8069
  * 它只负责这条可视化示例路径 —— 真正的落地必须用 addChannel(或 addChannelGroupLines /
8075
8070
  * joinChannelGroupLines / addLine),不在事件里落地就用 endAddChannel / cancelAddChannel 收掉假通道。
8076
- * options.kind 为 'line' 时改成「新建独立线路」(不挂通道),options.circuits 决定一次加几回,
8077
- * options.select 打开「点节点时让节点选中」,options.handoff 让 ready 之后草稿自动收掉
8071
+ * 新建独立线路请用 beginAddLine;options.circuits 决定一次加几回,
8072
+ * options.select 打开「点节点时让节点选中」,options.handoff 让 ready 之后草稿自动收掉。
8073
+ * options.singleChannel 打开单一通道模式;已有通道时 existingChannel 为 block / newGroup / joinGroup,
8074
+ * joinGroup 用 groupId / groupIndex 指名分组。没有已有通道时仍按新通道落地
8078
8075
  */
8079
8076
  beginAddChannel(options?: GisViewChannelDraftOptions): GisViewInstance
8077
+ /**
8078
+ * 进入「新增线路」草稿:拾取、预览、连续新增和 beginAddChannel 同一套,kind 恒为 line。
8079
+ * 不写 existingChannel 时只新建独立线路;写 newGroup / joinGroup 时,如果两端已有通道,就把这次
8080
+ * 新建的回线放进新分组或指定分组(joinGroup 用 groupId / groupIndex 指名)。
8081
+ */
8082
+ beginAddLine(options?: GisViewChannelDraftOptions): GisViewInstance
8080
8083
  /** 当前新增通道草稿:两个节点的信息与可选方案,没有草稿时为 null */
8081
8084
  getAddChannelDraft(): GisViewChannelDraftPayload | null
8082
8085
  /** 改当前草稿的预览样式(字段级合并,传 null 回到全局 channelDraftStyle);没有草稿时什么也不做 */
@@ -8088,21 +8091,18 @@ export interface GisViewInstance {
8088
8091
  /** 结束新增草稿并收掉视图上的示例假通道 / 线路(静默,不补 cancel):提前结束不新建就用它 */
8089
8092
  endAddChannel(): GisViewInstance
8090
8093
  /**
8091
- * 提交已 ready 的新增草稿(autoCommit 时由组件内部调用)。input 有五类写法:
8094
+ * 提交已 ready 的新增草稿(autoCommit 时由组件内部调用)。input 只有一类写法:
8092
8095
  * 1. 不传 / null:用草稿的 preferred;
8093
- * 2. 旧 resolution:字符串,或只含 type / groupId / groupIndex / channelId 的对象;
8094
- * 3. 直接线路对象:无 lineIds,且有 from / to / path / kind: 'line' / start / end 之一;
8095
- * 4. 直接通道对象:lineIds 为数组,缺省按 newChannel 落地;
8096
- * 5. 容器:{ channel, line, lines, lineData, lineItems, channelGroups, group, channelProps, lineProps, resolution, ... }。
8096
+ * 2. 对象:{ channel, line, lines, lineData, channelGroups, group, channelProps, lineProps, resolution, ... }。
8097
8097
  *
8098
- * 字段优先级:from / to = 顶层 → channel → line → lineItems 中第一个对象项 → 草稿;
8098
+ * 字段优先级:from / to = 顶层 → channel → line → lines 中第一个对象项 → 草稿;
8099
8099
  * path = 顶层 → line → channel → 草稿;分组 = channelGroups → group → channel.groups;
8100
- * 容器 lineProps = 草稿 → 顶层 → line.lineProps → lines[i](不读 channel.lineProps);
8101
- * channelProps = 草稿 → channel 上的业务字段 → 顶层 channelProps。直接通道对象自己的 lineProps 会生效。
8100
+ * lineProps = 草稿 → 顶层 → line.lineProps → lines[i];channelProps = 草稿 → channel 上的业务字段 → 顶层 channelProps。
8102
8101
  *
8103
- * 直接通道默认新建;要并进已有通道 / 分组,用容器并显式写 resolution。
8102
+ * 要并进已有通道 / 分组,显式写 resolution;直接通道 / 线路对象不再接受,请放进 channel / line。
8104
8103
  * ready 里的方案对象带 enabled / count / lineIds 等读数,不能整条回传,只取
8105
8104
  * `{ type, groupId, groupIndex, channelId }` 子集。调用前草稿必须 ready,否则返回 ok: false 且不写数据。
8105
+ * options.select 为 true 时落地后选中这次新建的全部回线,缺省不动选中集。
8106
8106
  *
8107
8107
  * ```ts
8108
8108
  * view.commitAddChannel({
@@ -8113,8 +8113,8 @@ export interface GisViewInstance {
8113
8113
  * ```
8114
8114
  */
8115
8115
  commitAddChannel(
8116
- input?: GisViewChannelAddInput['resolution'] | GisViewChannel | GisViewLine | GisViewChannelAddCommitInput,
8117
- options?: { auto?: boolean; continuous?: boolean; originalEvent?: Event | null }
8116
+ input?: GisViewChannelAddCommitInput,
8117
+ options?: { auto?: boolean; continuous?: boolean; originalEvent?: Event | null; select?: boolean }
8118
8118
  ): GisViewChannelAddResult
8119
8119
  /** 两个节点之间的新增方案:新通道 / 新分组 / 并进某一组 / 无法添加(kind 为 'line' 时方案表是空的) */
8120
8120
  getChannelAddOptions(from: string | number, to: string | number, count?: number, kind?: 'channel' | 'line'): GisViewChannelAddPlan | null
@@ -8125,55 +8125,50 @@ export interface GisViewInstance {
8125
8125
  */
8126
8126
  getChannelBetween(from: string | number, to: string | number): GisViewChannelBetween | null
8127
8127
  /**
8128
- * 程序化新增一个通道(新签名):第一段是通道信息 `{ from, to, name, id }`,第二段是线路数组 line_data ——
8128
+ * 程序化新增一个通道:第一段是通道信息 `{ from, to, name, id, path, routing, channelProps }`,第二段是线路数据 ——
8129
8129
  * 每条按自己的 id 建进通道(id 自动成为 lineIds),第三段是可选的分组信息。只负责新建一个通道:
8130
8130
  * 两个节点之间已经有通道时整条失败(reason 指路 addChannelGroupLines / joinChannelGroupLines,
8131
- * 结果里的 plan 带着 hasChannel / hasGroup / groups / channel)。第二段 / 第三段显式给了
8132
- * (或对象上写 `lineData` / `group`)才走这条新路;只写 `{ from, to }` 的老调用照旧按方案表分流
8133
- */
8134
- addChannel(channel: GisViewChannelAddSpec, lineData?: GisViewChannelLineData, group?: GisViewChannelAddGroup | GisViewChannelAddGroup[]): GisViewChannelAddResult
8135
- /**
8136
- * 新增通道 / 回线的旧写法(circuits / resolution / channelId / kind 那套):与从前完全一致 ——
8137
- * 按方案表挑新通道 / 新分组 / 并入某组,kind 为 'line' 时加独立线路,circuits 是一次几回,
8138
- * lineItems 是「连同线路一起新建」的第二段(一条或一批逐条属性,给了几条就建几条;
8139
- * 每项也可以只写一个 id —— 裸字符串 / 数字按 { id } 收,与第二段 line_data 同一份口径)
8131
+ * 结果里的 plan 带着 hasChannel / hasGroup / groups / channel)。第二段不写时建一条自动编号回线;
8132
+ * options.select 为 true 时落地后选中新回线,options.emit: false 时不发数据变更。
8140
8133
  */
8141
- addChannel(input: GisViewChannelAddInput, lineItems?: GisViewChannelLineItems): GisViewChannelAddResult
8134
+ addChannel(channel: GisViewChannelAddSpec, lineData?: GisViewChannelLineData, group?: GisViewChannelAddGroup | GisViewChannelAddGroup[], options?: { emit?: boolean; select?: boolean }): GisViewChannelAddResult
8142
8135
  /**
8143
8136
  * 在已有通道里新加一组回线(原 addChannel 的 newGroup 那一支):第二段是这次新建的线路数组 line_data,
8144
8137
  * 第三段可选 `{ id?, path? }` 给新分组的 id 与中间拐点(缺省 `${通道 id}::N`、不带拐点)
8145
8138
  */
8146
- addChannelGroupLines(channelId: string | number, lineData?: GisViewChannelLineData, group?: GisViewChannelAddGroup): GisViewChannelAddResult
8139
+ addChannelGroupLines(channelId: string | number, lineData?: GisViewChannelLineData, group?: GisViewChannelAddGroup, options?: { emit?: boolean; select?: boolean }): GisViewChannelAddResult
8147
8140
  /**
8148
- * 在已有通道里一次新加多组回线:每一项 `{ id?, path?, lineData | lines | lineItems }`,
8141
+ * 在已有通道里一次新加多组回线:每一项 `{ id?, path?, lineData | lines }`,
8149
8142
  * 逐组落地但只记一步历史、只发一条 addChannelGroups 数据变更
8150
8143
  */
8151
- addChannelGroups(channelId: string | number, groups: GisViewChannelAddGroupInput | GisViewChannelAddGroupInput[], options?: { emit?: boolean; label?: string }): GisViewAddChannelGroupsResult
8144
+ addChannelGroups(channelId: string | number, groups: GisViewChannelAddGroupInput | GisViewChannelAddGroupInput[], options?: { emit?: boolean; select?: boolean; label?: string }): GisViewAddChannelGroupsResult
8152
8145
  /**
8153
8146
  * 把新回线并进已有通道的某一组(原 addChannel 的 joinGroup 那一支):groupId 认分组 id,也认序号
8154
8147
  * (从 0 起、按声明顺序),不给就并进第一个还有余量的分组;第三段是这次新建的线路数组 line_data
8155
8148
  */
8156
- joinChannelGroupLines(channelId: string | number, groupId: string | number | undefined, lineData?: GisViewChannelLineData): GisViewChannelAddResult
8149
+ joinChannelGroupLines(channelId: string | number, groupId: string | number | undefined, lineData?: GisViewChannelLineData, options?: { emit?: boolean; select?: boolean }): GisViewChannelAddResult
8157
8150
  /**
8158
- * 程序化新增一条独立线路(不挂通道):等价于 addChannel({ ...input, kind: 'line' }),第二段线路数据同样认 ——
8159
- * 每条可以只写一个 id(裸字符串 / 数字按 { id } 收)、写对象给逐条字段,也可以完全不给(按 from-to-序号自动编号)
8151
+ * 程序化新增独立线路(不挂通道):第一段给 from / to / name / id / lineProps / path / routing,
8152
+ * 第二段是线路数据(一条或一批,可以只写 id),不写就建一条按 from-to-序号自动编号的线路。
8153
+ * 落地走追加式引擎路径;options.select 为 true 时选中新回线,options.emit: false 时不发数据变更。
8160
8154
  */
8161
- addLine(input: GisViewChannelAddInput, lineItems?: GisViewChannelLineItems): GisViewChannelAddResult
8155
+ addLine(input: GisViewLineAddSpec, lineData?: GisViewChannelLineData, options?: { emit?: boolean; select?: boolean }): GisViewChannelAddResult
8162
8156
  /**
8163
- * 一次新增多条通道 / 独立线路(addChannel 的批量版,每条写法一致):逐条落地,但只重排一次场景、
8157
+ * 一次新增多条通道(addChannel 的批量版,每条写法一致):逐条落地,但只重排一次场景、
8164
8158
  * 只记一步历史、只发一条 `addChannels` 数据变更 —— 切场景时把接口里的通道一批批补进来用它。
8165
- * `results` 与传入顺序一一对应,失败条目在自己的 reason 里说明原因;options.emit 传 false 时不发数据变更
8159
+ * `results` 与传入顺序一一对应,失败条目在自己的 reason 里说明原因;options.emit 传 false 时不发数据变更,
8160
+ * options.select 为 true 时最后一次性选中全部新回线
8166
8161
  */
8167
- addChannels(input: GisViewChannelAddInput | GisViewChannelAddInput[], options?: { emit?: boolean }): GisViewAddChannelsResult
8162
+ addChannels(input: GisViewChannelAddSpec | GisViewChannelAddSpec[], options?: { emit?: boolean; select?: boolean }): GisViewAddChannelsResult
8168
8163
  /**
8169
8164
  * 往数据末尾追加一个节点 / 一批节点 / 一批线路(批量导入、从别处拷过来、按坐标补几条):
8170
8165
  * 老数据一个都不动,返回 `{ ok, count, indexes, items }`(单条时另有 index 与 item)。
8171
8166
  * 与 addChannel / addLine 的分工:那两条走「通道 / 草稿」那一套,这里是把现成的数据对象接在
8172
- * points / lines 后面。options.emit 传 false 时不发数据变更
8167
+ * points / lines 后面。options.emit 传 false 时不发数据变更;options.select 为 true 时选中新要素
8173
8168
  */
8174
- addPoint(item: GisViewPoint, options?: { emit?: boolean }): GisViewAddPointResult
8175
- addPoints(items: GisViewPoint | GisViewPoint[], options?: { emit?: boolean }): GisViewAddItemsResult<GisViewPoint>
8176
- addLines(items: GisViewLine | GisViewLine[], options?: { emit?: boolean }): GisViewAddItemsResult<GisViewLine>
8169
+ addPoint(item: GisViewPoint, options?: { emit?: boolean; select?: boolean }): GisViewAddPointResult
8170
+ addPoints(items: GisViewPoint | GisViewPoint[], options?: { emit?: boolean; select?: boolean }): GisViewAddItemsResult<GisViewPoint>
8171
+ addLines(items: GisViewLine | GisViewLine[], options?: { emit?: boolean; select?: boolean }): GisViewAddItemsResult<GisViewLine>
8177
8172
  /** 移除一条线路(撤销刚落地的新增线路):挂在通道上的回线会从通道声明里一起摘掉,通道空了整条删掉 */
8178
8173
  removeLine(lineId: string | number): GisViewRemoveLineResult
8179
8174
  /** 一次移除多条线路(传数组):通道声明与分组跟着收拾,删空的通道整条走 */
@@ -8659,16 +8654,16 @@ export interface GisViewEngineOptions {
8659
8654
  onSelect?: (payload: GisViewSelectPayload | null, detail?: { mode?: 'single' | 'multi' | 'box'; originalEvent?: Event | null; defer?: boolean }) => void
8660
8655
  onClick?: (payload: GisViewClickPayload | null) => void
8661
8656
  /** 点中多成员聚合圆(引擎不选中成员,普通点击回调不会同时触发) */
8662
- onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
8657
+ onClusterClick?: (payload: GisViewClusterClickPayload) => void
8663
8658
  onDblClick?: (payload: GisViewClickPayload | null) => void
8664
- /** 左键 / 中键 / 右键按下与抬起:命中的要素、按钮与光标位置都在载荷里 */
8665
- onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
8666
- onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
8659
+ /** 左键 / 中键 / 右键按下与抬起:命中的要素与光标位置在载荷里,原生的键 / 修饰键读 payload.originalEvent */
8660
+ onPointerDown?: (payload: GisViewPointerPayload) => void
8661
+ onPointerUp?: (payload: GisViewPointerPayload) => void
8667
8662
  /**
8668
8663
  * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
8669
8664
  * 载荷另带 channelContext(几组 / 当前哪组 / 能做什么),不再有单独的通道路由。
8670
8665
  */
8671
- onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
8666
+ onContextMenu?: (payload: GisViewPointerPayload) => void
8672
8667
  /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
8673
8668
  onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
8674
8669
  onPointDrag?: (payload: GisViewPointDragPayload) => void
@@ -8705,8 +8700,8 @@ export interface GisViewEngine {
8705
8700
  describeAll(selection: GisViewFeatureKey[]): GisViewPickResult[]
8706
8701
  /** 批量还原并补通道上下文:单通道摊平 channelId / group / groups,多通道给 channelContexts */
8707
8702
  describeSelection(selection: GisViewFeatureKey[], preferredGroupId?: string | number): GisViewDescribedSelection
8708
- /** 按画布 CSS 像素矩形框选,返回框内要素;第二段兼容旧的 Event 或 { selectionKinds, originalEvent } */
8709
- selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions | Event | null): GisViewPickResult[]
8703
+ /** 按画布 CSS 像素矩形框选,返回框内要素 */
8704
+ selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions): GisViewPickResult[]
8710
8705
  /** 拐点增删改,insertIndex 缺省时按直线上离目标最近的线段插入 */
8711
8706
  insertWaypoint(lineIndex: number, coordinate: GisViewCoordinate, insertIndex?: number): GisViewWaypointPayload | null
8712
8707
  /** 删除指定线路上的拐点 */
@@ -8784,15 +8779,24 @@ export interface GisViewEngine {
8784
8779
  beginChannelDraft(options?: GisViewChannelDraftOptions): GisViewChannelDraftPayload | null
8785
8780
  /** 当前草稿:两个节点的信息与可选方案,没有草稿时为 null */
8786
8781
  getChannelDraft(): GisViewChannelDraftPayload | null
8787
- /** 连续新增:一段落地之后原地重开一段草稿(chain 为 true 时以上一段终点当新起点,也可以换 kind / circuits) */
8782
+ /** 连续新增:一段落地之后原地重开一段草稿(chain 为 true 时以上一段终点当新起点) */
8788
8783
  restartChannelDraft(options?: {
8789
8784
  chain?: boolean
8790
- kind?: 'channel' | 'line'
8785
+ /** 重开上一段时也可以预指定起点(与 beginChannelDraft 的 from 同一份写法) */
8786
+ from?: GisViewPointRef
8787
+ singleChannel?: boolean
8788
+ existingChannel?: GisViewChannelExistingMode
8789
+ groupId?: string | number
8790
+ groupIndex?: number
8791
8791
  circuits?: number
8792
+ /** 换这一段草稿的第二段线路数据;给了几条就按几条对齐 circuits */
8793
+ lineData?: GisViewChannelLineData
8792
8794
  /** 换这一段草稿的预览样式(字段级合并;null 回到全局 channelDraftStyle,不传就沿用) */
8793
8795
  channelDraftStyle?: GisViewChannelDraftStyle | null
8794
8796
  /** 换一份逐条回线的属性(不传就沿用这一段草稿原来的) */
8795
8797
  linePropsByMember?: Array<Partial<GisViewLine> | undefined>
8798
+ routing?: 'straight' | 'orthogonal'
8799
+ path?: GisViewCoordinate[]
8796
8800
  /** 换这一段草稿的交接模式(不传就沿用) */
8797
8801
  handoff?: boolean
8798
8802
  /** 换这一段草稿的「点节点时让节点选中」(不传就沿用) */