gis-view-webgl2 0.1.7 → 0.1.9

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 (70) hide show
  1. package/README.md +14 -11
  2. package/dist/gis-view.css +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +445 -241
  5. package/dist/index.js +1 -1
  6. package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +65 -498
  7. package/docs/GisView.md +1 -1
  8. package/docs/GisView/345/256/236/347/216/260/345/216/237/347/220/206.md +1 -1
  9. 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 +114 -478
  10. package/docs/demos/BasicDemo.vue +144 -27
  11. package/docs/demos/BatchAddDemo.vue +133 -7
  12. package/docs/demos/ChannelDemo.vue +61 -0
  13. package/docs/demos/ConnectDemo.vue +164 -33
  14. package/docs/demos/CopyMergeDemo.vue +144 -42
  15. package/docs/demos/EventDemo.vue +29 -24
  16. package/docs/demos/LabelDemo.vue +5 -5
  17. package/docs/demos/api-index.js +53 -41
  18. package/docs/demos/gis-view-demo/GisViewDemoCardHeader.vue +1 -1
  19. package/docs/demos/gis-view-demo/GisViewDemoStage.vue +1 -1
  20. package/docs/demos/gis-view-demo/panels/DataPanels.vue +1 -1
  21. package/docs/demos/gis-view-demo/useGisViewDemo.js +31 -33
  22. package/docs/format/02-/350/212/202/347/202/271/344/270/216/347/272/277/350/267/257.md +1 -0
  23. package/docs/format/04-/351/200/232/351/201/223/344/270/216/346/240/207/347/255/276.md +3 -0
  24. 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
  25. package/docs/from0/05-/347/233/270/346/234/272/344/270/216/344/272/244/344/272/222.md +1 -1
  26. 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
  27. package/docs/index.html +136 -13
  28. package/docs/internals/15-04-/351/200/220/350/275/256/350/256/260/345/275/225-/347/203/255/345/212/233/345/233/276/344/270/216/346/200/247/350/203/275.md +10 -0
  29. package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +1 -1
  30. package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +82 -14
  31. package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +23 -17
  32. package/docs/manual/05-/347/224/273/350/264/250/344/270/216/346/211/271/351/207/217/346/233/264/346/226/260.md +65 -0
  33. 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
  34. 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 +100 -40
  35. package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +11 -7
  36. package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +66 -6
  37. 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
  38. package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +28 -5
  39. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +46 -14
  40. package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +5 -2
  41. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +34 -29
  42. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +30 -22
  43. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +168 -81
  44. 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
  45. package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +5 -3
  46. 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 +9 -6
  47. package/docs/steps/README.md +201 -120
  48. package/docs/steps/bench-scale.html +1 -1
  49. package/docs/steps/index.html +222 -6
  50. package/docs/steps/selftest-actions.html +26 -25
  51. package/docs/steps/selftest-data.html +1 -1
  52. package/docs/steps/selftest-demos.html +290 -16
  53. package/docs/steps/selftest-docs.html +17 -6
  54. package/docs/steps/selftest-features.html +594 -54
  55. package/docs/steps/selftest-full.html +3 -3
  56. package/docs/steps/selftest-labels.html +82 -1
  57. package/docs/steps/selftest-perf.html +62 -7
  58. package/docs/steps/selftest-select.html +71 -6
  59. package/docs/steps/step-05-pick.js +4 -8
  60. package/docs/steps/step-07-channels.js +3 -5
  61. package/docs/steps/step-08-labels.js +3 -3
  62. package/docs/steps/step-10-full.js +3 -3
  63. package/docs/steps/step-12-events.js +41 -24
  64. package/docs//344/273/2160/345/210/260/345/256/214/346/225/264/347/232/204/345/256/236/347/216/260.md +1 -0
  65. package/package.json +1 -1
  66. package/docs/ai/01-/350/265/267/346/272/220/344/270/216/350/277/231/344/273/275/346/261/207/346/200/273/347/232/204/347/224/261/346/235/245.md +0 -29
  67. package/docs/ai/02-/346/214/211/345/206/205/345/256/271/345/210/206/347/261/273-/350/277/231/344/270/200/350/267/257/351/203/275/345/234/250/346/224/271/344/273/200/344/271/210.md +0 -66
  68. package/docs/ai/03-/351/207/215/350/246/201/351/227/256/347/255/224/351/200/211/357/274/210/344/270/200/357/274/211/357/274/232/351/200/211/345/236/213/351/200/232/351/201/223/344/270/216/346/240/267/345/274/217.md +0 -178
  69. package/docs/ai/04-/351/207/215/350/246/201/351/227/256/347/255/224/351/200/211/357/274/210/344/272/214/357/274/211/357/274/232/344/272/244/344/272/222/346/200/247/350/203/275/344/270/216/346/225/260/346/215/256.md +0 -140
  70. package/docs/ai/05-/351/207/215/350/246/201/351/227/256/347/255/224/351/200/211/357/274/210/344/270/211/357/274/211/357/274/232/345/256/277/344/270/273/346/227/201/346/224/257/344/270/216/346/224/266/345/217/243.md +0 -43
package/dist/index.d.ts CHANGED
@@ -13,6 +13,14 @@ export interface GisViewCamera {
13
13
  scale: number
14
14
  }
15
15
 
16
+ /** 用户操作空闲回调 / idle 事件的载荷 */
17
+ export interface GisViewIdlePayload {
18
+ /** 距离创建或上一次指针 / 滚轮 / 键盘操作的毫秒数 */
19
+ idleTime: number
20
+ /** 触发这次回调的 idleTimeout(毫秒) */
21
+ timeout: number
22
+ }
23
+
16
24
  /** 直接飞相机时的目标:两项都可省略,没写的那一项沿用当前相机 */
17
25
  export interface GisViewCameraTarget {
18
26
  center?: [number, number]
@@ -1118,6 +1126,8 @@ export interface GisViewPoint {
1118
1126
  copyable?: boolean
1119
1127
  /** 是否允许作为合并目标(把别的节点拖到它身上时弹确认框):false 时不让合并到它,缺省 true */
1120
1128
  mergeable?: boolean
1129
+ /** 合并追溯信息:mergePoints 写入,splitPoint 省略 parts 时按它自动解除合并。业务数据请避开这个字段 */
1130
+ mergeInfo?: GisViewMergeInfo | null
1121
1131
  /** 悬停到这个点上时的光标:覆盖 options.cursorStyle.point,写法见 GisViewCursorValue */
1122
1132
  cursor?: GisViewCursorValue
1123
1133
  /** 按住 Ctrl(macOS 为 Cmd)悬停到这个点上时的光标:覆盖 options.cursorStyle.ctrl.point */
@@ -1359,6 +1369,8 @@ export interface GisViewChannel {
1359
1369
  visible?: boolean
1360
1370
  /** 通道内的线路 id,顺序即回线顺序(沿骨架左法线方向) */
1361
1371
  lineIds: Array<string | number>
1372
+ /** 合并追溯信息:通道被合并 / 改端点时由 mergePoints 写入,便于按原通道 id 和后端对账 */
1373
+ mergeInfo?: GisViewMergeInfo | null
1362
1374
  /**
1363
1375
  * 通道分组:缺省是「一个通道一组」(成员用 lineIds、拐点用 path)。
1364
1376
  * 配了之后每个分组有自己的成员与拐点,拆分 / 合并的结果也会写在这里;
@@ -1690,6 +1702,12 @@ export interface GisViewChannelLinesResult {
1690
1702
  groups?: GisViewChannelGroupInfo[]
1691
1703
  }
1692
1704
 
1705
+ /**
1706
+ * 草稿遇到「两端已有通道」时的处理:block 不发新通道、按失败返回;newGroup 把这次新增的回线放进新分组;
1707
+ * joinGroup 并进 groupId / groupIndex 指定的分组;auto 有新分组余量时优先新分组,否则并进可用分组
1708
+ */
1709
+ export type GisViewChannelExistingMode = 'block' | 'newGroup' | 'joinGroup' | 'auto'
1710
+
1693
1711
  /**
1694
1712
  * 新增方案:newChannel 新建一条通道,newGroup 在原通道里加一组(不带拐点),
1695
1713
  * joinGroup 把新回线并进原通道的某一组;上限(channelMaxGroups / channelGroupMaxLines)到了就不 enabled;
@@ -1740,6 +1758,14 @@ export interface GisViewChannelAddPlan {
1740
1758
  to: GisViewChannelNodeDraft
1741
1759
  /** 这一段加什么:'channel' 新建通道 / 回线(缺省),'line' 新建不挂通道的独立线路 */
1742
1760
  kind: 'channel' | 'line'
1761
+ /** 这一次草稿是否处在单一通道模式(已有通道时按 existingChannel 处理) */
1762
+ singleChannel: boolean
1763
+ /** 草稿对已有通道的处理策略;没有配置时为 null(沿用旧的分组方案表) */
1764
+ existingChannel: GisViewChannelExistingMode | null
1765
+ /** 最终推荐的分组(preferred 为 joinGroup 时):group 读数已切到这一组 */
1766
+ targetGroupId: string | number | null
1767
+ /** 最终推荐分组的序号(从 0 起);不落到分组时为 -1 */
1768
+ targetGroupIndex: number
1743
1769
  /** 这一次要加的回线数(余量按它算) */
1744
1770
  count: number
1745
1771
  /** 两个节点之间已有的通道 id(没有就是新建通道) */
@@ -1783,6 +1809,38 @@ export interface GisViewChannelBetween {
1783
1809
  currentGroupId: string | number | null
1784
1810
  }
1785
1811
 
1812
+ /** getDirectConnections 的端点读数:节点 id、points 下标与数据里那一份 */
1813
+ export interface GisViewDirectConnectionNode {
1814
+ id: string | number
1815
+ index: number
1816
+ item: GisViewPoint
1817
+ }
1818
+
1819
+ /** getDirectConnections 命中的直接通道:两端都在传入的节点集合里 */
1820
+ export interface GisViewDirectChannelConnection {
1821
+ type: 'channel'
1822
+ from: GisViewDirectConnectionNode
1823
+ to: GisViewDirectConnectionNode
1824
+ channelId: string | number | null
1825
+ channelIndex: number
1826
+ /** 通道当前成员表(顶层 lineIds + 分组里的回线,按声明顺序去重) */
1827
+ lineIds: Array<string | number>
1828
+ item: GisViewChannel
1829
+ }
1830
+
1831
+ /** getDirectConnections 命中的直接线路:两端由线路自己的 from / to 绑定 */
1832
+ export interface GisViewDirectLineConnection {
1833
+ type: 'line'
1834
+ from: GisViewDirectConnectionNode
1835
+ to: GisViewDirectConnectionNode
1836
+ lineId: string | number | null
1837
+ lineIndex: number
1838
+ item: GisViewLine
1839
+ }
1840
+
1841
+ /** getDirectConnections 的一项:直接通道或直接线路(通道与成员回线可能同时命中) */
1842
+ export type GisViewDirectConnection = GisViewDirectChannelConnection | GisViewDirectLineConnection
1843
+
1786
1844
  /** 新增通道草稿的配置:beginAddChannel 用 */
1787
1845
  export interface GisViewChannelDraftOptions {
1788
1846
  /** 两个节点一选完就自动提交,不用再调 commitAddChannel */
@@ -1799,8 +1857,21 @@ export interface GisViewChannelDraftOptions {
1799
1857
  continuous?: boolean | 'chain'
1800
1858
  /** 连续新增时是否接着上一段的终点画(等价于 continuous: 'chain') */
1801
1859
  chain?: boolean
1802
- /** 这一段加什么:'channel' 新建通道 / 回线(缺省),'line' 新建不挂通道的独立线路 */
1803
- kind?: 'channel' | 'line'
1860
+ /**
1861
+ * 单一通道模式:true 时 beginAddChannel 默认在已有通道上 fail(等价于 existingChannel: 'block');
1862
+ * 没有已有通道时仍正常新建。beginAddLine 不把 singleChannel 当作挂通道开关,挂已有通道请写 existingChannel
1863
+ */
1864
+ singleChannel?: boolean
1865
+ /**
1866
+ * 两端已有通道时怎么办:block 失败、newGroup 新加一组、joinGroup 并进指定组、auto 新分组优先。
1867
+ * beginAddChannel 不写且 singleChannel 为 true 时按 block;beginAddLine 显式写 newGroup / joinGroup
1868
+ * 时可给已有通道加回线,不写则始终新建独立线路
1869
+ */
1870
+ existingChannel?: GisViewChannelExistingMode
1871
+ /** joinGroup 的目标分组 id;也认 groupIndex(从 0 起,二者都写按 groupId) */
1872
+ groupId?: string | number
1873
+ /** joinGroup 的目标分组序号(从 0 起) */
1874
+ groupIndex?: number
1804
1875
  /** 新建通道时一次加几回(缺省 1):新通道 / 新分组 / 并入分组的余量都按它算 */
1805
1876
  circuits?: number
1806
1877
  /** 新线路名,缺省按两端节点生成 */
@@ -1812,8 +1883,8 @@ export interface GisViewChannelDraftOptions {
1812
1883
  lineProps?: Partial<GisViewLine>
1813
1884
  /** 逐条回线的属性:按下标一一对应(第几项就只管第几回),盖在同一条 lineProps 之上;与 createChannels 的 linePropsByMember 同名同义 */
1814
1885
  linePropsByMember?: Array<Partial<GisViewLine> | undefined>
1815
- /** 第二段 lineItems(一条或一批):与 linePropsByMember 同义,给了几条这一段就加几条(circuits 按它对齐);每项也可以只写一个 id */
1816
- lineItems?: GisViewChannelLineItems
1886
+ /** 第二段 lineData(一条或一批):与 linePropsByMember 同义,给了几条这一段就加几条(circuits 按它对齐);每项也可以只写一个 id */
1887
+ lineData?: GisViewChannelLineData
1817
1888
  /** 走线方式:'straight'(缺省,两端直连)/ 'orthogonal'(自动补一个先横后纵的 90° 拐点) */
1818
1889
  routing?: 'straight' | 'orthogonal'
1819
1890
  /** 中间拐点(不含两端):给了就按它折线;routing 的自动拐点只在没给有效拐点时补 */
@@ -1856,6 +1927,13 @@ export interface GisViewChannelDraftPayload {
1856
1927
  chain: boolean
1857
1928
  /** 这一段加什么:'channel' 新建通道 / 回线,'line' 新建不挂通道的独立线路 */
1858
1929
  kind: 'channel' | 'line'
1930
+ /** 这一段是否开了单一通道模式 */
1931
+ singleChannel: boolean
1932
+ /** 这一段对已有通道的策略(没有配置时为 null) */
1933
+ existingChannel: GisViewChannelExistingMode | null
1934
+ /** 推荐落点的目标分组:preferred 为 joinGroup 时有值,否则为 null / -1 */
1935
+ targetGroupId: string | number | null
1936
+ targetGroupIndex: number
1859
1937
  /** 这一次要加的回线数(kind 为 'channel' 时才有意义) */
1860
1938
  circuits: number
1861
1939
  /** 这是草稿里的第几次点击:1 拿到起点、2 拿到终点(线路结束)、0 表示不是点击 */
@@ -1876,8 +1954,8 @@ export interface GisViewChannelDraftPayload {
1876
1954
  lineProps?: Partial<GisViewLine>
1877
1955
  /** 逐条回线的属性(与 createChannels 同名同义):按下标一一对应,没配为 null */
1878
1956
  linePropsByMember?: Array<Partial<GisViewLine> | undefined> | null
1879
- /** 第二段 lineItems(一条或一批):与 linePropsByMember 同一份写法,提交时一起交给 addChannel */
1880
- lineItems?: Array<Partial<GisViewLine> | undefined> | null
1957
+ /** 第二段 lineData(一条或一批):与 linePropsByMember 同一份写法,提交时一起交给 addChannel */
1958
+ lineData?: Array<Partial<GisViewLine> | undefined> | null
1881
1959
  channelProps?: Partial<GisViewChannel>
1882
1960
  /** 这一次草稿实际生效的预览样式(全局配置 + 本次覆盖) */
1883
1961
  style: GisViewChannelDraftStyle
@@ -2084,10 +2162,9 @@ export interface GisViewAddWaypointsResult {
2084
2162
 
2085
2163
  /** addChannelGroups 的一项:分组信息(id / path)外加这一组新建的线路数据 */
2086
2164
  export interface GisViewChannelAddGroupInput extends GisViewChannelAddGroup {
2087
- /** 这一组新建的线路数据(三个名字等价,写法同 addChannel 第二段) */
2165
+ /** 这一组新建的线路数据(两个名字等价,写法同 addChannel 第二段) */
2088
2166
  lineData?: GisViewChannelLineData
2089
2167
  lines?: GisViewChannelLineData
2090
- lineItems?: GisViewChannelLineData
2091
2168
  }
2092
2169
 
2093
2170
  /** addChannelGroups 的返回:逐组结果、成功落地的回线 id 与新分组 id */
@@ -2188,63 +2265,33 @@ export interface GisViewChannelInView {
2188
2265
  groupIds: Array<string | number>
2189
2266
  }
2190
2267
 
2191
- /**
2192
- * addChannel / addLine 的第二段(也是入参里的 lineItems):一条或一批逐条回线属性,与 linePropsByMember 同义。
2193
- * 每一项也可以只写一个 id(裸字符串 / 数字按 { id } 收),与 GisViewChannelLineData 同一份口径 ——
2194
- * 从前这两条归一是分开的:旧写法只收对象,裸 id 被当没写(见 15.98)
2195
- */
2196
- export type GisViewChannelLineItems = GisViewChannelLineData
2268
+ /** 新增草稿提交时选择落点:显式方案,或 'auto' 使用草稿的推荐方案 */
2269
+ export type GisViewChannelAddResolution = 'auto' | 'newChannel' | 'newGroup' | 'joinGroup' | 'newLine' | {
2270
+ type?: 'newChannel' | 'newGroup' | 'joinGroup' | 'newLine'
2271
+ groupId?: string | number
2272
+ groupIndex?: number
2273
+ channelId?: string | number
2274
+ }
2197
2275
 
2198
- /** 程序化新增通道 / 独立线路的入参:不用交互,按两个节点直接落到数据上 */
2199
- export interface GisViewChannelAddInput {
2276
+ /** 程序化新增独立线路的入参:按两个节点生成线路,不挂通道 */
2277
+ export interface GisViewLineAddSpec {
2200
2278
  from: string | number
2201
2279
  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
- /** 线路名,缺省按两端节点生成 */
2280
+ /** 线路名,缺省按两端节点生成;一次多回时自动带序号 */
2213
2281
  name?: string
2214
- /** 新回线 id(等价于 id);一次加多回时按它加序号 */
2215
- lineId?: string | number
2282
+ /** 第一条回线的 id 种子;一次多回时自动带序号,第二段每项也可以各写自己的 id */
2216
2283
  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
2284
+ /** 所有回线共用的业务字段(颜色 / 线宽 / 线型…) */
2231
2285
  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 时自动补拐点 */
2286
+ /** 中间拐点;routing 为 orthogonal 时也可由它自动补拐点 */
2242
2287
  path?: GisViewCoordinate[]
2243
- /** 走线方式:'straight'(缺省)/ 'orthogonal'(自动补一个先横后纵的 90° 拐点) */
2288
+ /** 走线方式:'straight'(缺省)/ 'orthogonal' */
2244
2289
  routing?: 'straight' | 'orthogonal'
2290
+ /** 第二段的别名:线路数据,一条或一批 */
2291
+ lineData?: GisViewChannelLineData
2245
2292
  }
2246
2293
 
2247
- /** 第二段线路数据(新签名的 line_data / 旧写法的 lineItems 同一份):对象里的 id 就是回线 id(没写的自动编号),裸字符串 / 数字等价于 { id } */
2294
+ /** 第二段线路数据(lineData):对象里的 id 就是回线 id(没写的自动编号),裸字符串 / 数字等价于 { id } */
2248
2295
  export type GisViewChannelLineData = Partial<GisViewLine> | string | number | Array<Partial<GisViewLine> | string | number | undefined>
2249
2296
 
2250
2297
  /** 新签名 addChannel 第三段的一项:新通道的分组信息(id / 成员 / 中间拐点;缺省整条通道一组) */
@@ -2267,6 +2314,12 @@ export interface GisViewChannelAddSpec {
2267
2314
  name?: string
2268
2315
  /** 通道 id,缺省按两端节点拼 channel-<from>-<to> */
2269
2316
  id?: string | number
2317
+ /** 其余通道字段(宽度 / 偏移方式…) */
2318
+ channelProps?: Partial<GisViewChannel>
2319
+ /** 中间拐点(不含两端):写进通道骨架;routing 为 orthogonal 时自动补拐点 */
2320
+ path?: GisViewCoordinate[]
2321
+ /** 走线方式:'straight'(缺省)/ 'orthogonal' */
2322
+ routing?: 'straight' | 'orthogonal'
2270
2323
  /** 第二段的别名(写在对象上时用它):线路数组 line_data */
2271
2324
  lineData?: GisViewChannelLineData
2272
2325
  /** 第三段的别名(写在对象上时用它):分组信息 */
@@ -2274,20 +2327,27 @@ export interface GisViewChannelAddSpec {
2274
2327
  }
2275
2328
 
2276
2329
  /**
2277
- * commitAddChannel 的对象入参:可以写一份新通道 / 新线路,也可以放在 channel / line / lines 里逐段给。
2278
- * - 直接通道对象必须带 lineIds:每个 id 生成一条新回线,groups 是分组声明;通道 id 不参与回线 id。
2279
- * - 直接线路对象的业务字段透传到 lineProps;path 是中间拐点,首尾仍取 from / to。
2280
- * - 容器里的 line 缺省是独立线路,lines / lineData / lineItems 才是成员回线表,且 lines 优先;
2330
+ * commitAddChannel 的对象入参:通道 / 线路对象放在 channel / line / lines / lineData 里逐段给。
2331
+ * - channel.lineIds 的每个 id 生成一条新回线,channel.groups 是分组声明;通道 id 不参与回线 id。
2332
+ * - line 的业务字段透传到 lineProps;path 是中间拐点,首尾仍取 from / to。
2333
+ * - line 缺省是独立线路,lines / lineData 才是成员回线表,且 lines 优先;
2281
2334
  * 空数组不覆盖草稿。channel.lineIds 只在没有成员回线表时当 id 种子。
2282
2335
  * - 对象里的端点、id、名称、路径、样式与分组优先于草稿;没写的字段仍沿用当前草稿。
2283
- * - 容器顶层的 channel.lineProps 目前不参与合并;公共字段写顶层 lineProps,单条写 lines[i]。
2336
+ * - 公共字段写顶层 lineProps,单条写 lines[i]。
2284
2337
  */
2285
- export interface GisViewChannelAddCommitInput extends Partial<GisViewChannelAddInput> {
2338
+ export interface GisViewChannelAddCommitInput {
2339
+ from?: string | number
2340
+ to?: string | number
2341
+ name?: string
2342
+ /** 线路 id 种子(通道 id 写在 channel.id) */
2343
+ id?: string | number
2344
+ /** 这次提交选哪个落点;不写就用草稿的推荐方案 */
2345
+ resolution?: GisViewChannelAddResolution
2286
2346
  /** 本次新增的通道对象(lineIds 会作为新回线 id 种子;groups 作为分组声明) */
2287
2347
  channel?: GisViewChannel
2288
2348
  /** 本次新增的一条线路对象(写了它就按独立线路提交) */
2289
2349
  line?: GisViewLine
2290
- /** 本次新增的回线对象 / 数据(一条或一批,与 lineData / lineItems 同义) */
2350
+ /** 本次新增的回线对象 / 数据(一条或一批,与 lineData 同义) */
2291
2351
  lines?: GisViewChannelLineData
2292
2352
  /** lines 的别名(与 addChannel 的第二段同一个写法) */
2293
2353
  lineData?: GisViewChannelLineData
@@ -2295,6 +2355,16 @@ export interface GisViewChannelAddCommitInput extends Partial<GisViewChannelAddI
2295
2355
  channelGroups?: GisViewChannelAddGroup | GisViewChannelAddGroup[]
2296
2356
  /** channelGroups 的别名(与 addChannel 的第三段同一个写法) */
2297
2357
  group?: GisViewChannelAddGroup | GisViewChannelAddGroup[]
2358
+ /** 所有新回线共用的业务字段 */
2359
+ lineProps?: Partial<GisViewLine>
2360
+ /** 逐条回线的业务字段:按下标覆盖 lineProps / lines[i] */
2361
+ linePropsByMember?: Array<Partial<GisViewLine> | undefined>
2362
+ /** 新通道的其余字段 */
2363
+ channelProps?: Partial<GisViewChannel>
2364
+ /** 中间拐点(不含两端) */
2365
+ path?: GisViewCoordinate[]
2366
+ /** 走线方式:'straight' / 'orthogonal' */
2367
+ routing?: 'straight' | 'orthogonal'
2298
2368
  }
2299
2369
 
2300
2370
  /** 新增通道草稿端点示例点单端的样式:只写哪几项就覆盖哪几项 */
@@ -2775,11 +2845,6 @@ export interface GisViewClusterPickResult extends GisViewCluster {
2775
2845
  /** pick / pickAt / hover 可能拿到普通要素或聚合圆。 */
2776
2846
  export type GisViewHitResult = GisViewPickResult | GisViewClusterPickResult
2777
2847
 
2778
- /** action.data 里的聚合读数:不带 action 自身,避免载荷循环引用。 */
2779
- export interface GisViewClusterPointerData extends GisViewCluster {
2780
- type: 'cluster'
2781
- }
2782
-
2783
2848
  /** 聚合数量文字:覆盖层每帧只需要位置、半径与数量。 */
2784
2849
  export interface GisViewClusterLabel {
2785
2850
  id: string
@@ -2788,12 +2853,12 @@ export interface GisViewClusterLabel {
2788
2853
  radius: number
2789
2854
  }
2790
2855
 
2791
- /** onClusterClick / clusterClick 的载荷:与点击载荷同一套指针字段,但不带普通要素的 item。 */
2856
+ /**
2857
+ * onClusterClick / clusterClick 的载荷:与点击载荷同一套指针字段,但不带普通要素的 item。
2858
+ * 鼠标键与修饰键读 `originalEvent`;选中集读数用 `getSelectionInfo()`。
2859
+ */
2792
2860
  export type GisViewClusterClickPayload = GisViewClusterPickResult & {
2793
- button?: number
2794
- buttons?: number
2795
2861
  originalEvent: Event
2796
- selection: GisViewSelectionInfo
2797
2862
  action: GisViewPointerAction
2798
2863
  }
2799
2864
 
@@ -2825,18 +2890,22 @@ export interface GisViewSelectionChannelFields {
2825
2890
  groupIndex?: number
2826
2891
  group?: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
2827
2892
  groups?: Array<GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }>
2893
+ /** 本次选中集里属于这条通道的回线下标 / id;单通道与 channelContexts 的每项都会给 */
2894
+ lineIndexes?: number[]
2895
+ lineIds?: Array<string | number>
2828
2896
  /** 选中集涉及多条通道时才有(按选中顺序);单通道不创建这一份,直接读顶层平铺字段 */
2829
2897
  channelContexts?: GisViewSelectionChannelContext[]
2830
2898
  }
2831
2899
 
2832
2900
  /** describeSelection 的返回值:要素读数 + 与选中载荷同一套通道上下文字段 */
2833
2901
  export interface GisViewDescribedSelection extends GisViewSelectionChannelFields {
2902
+ /** 选中项;通道回线不重复挂通道字段,归属看外层的 lineIndexes / channelContexts */
2834
2903
  items: GisViewPickResult[]
2835
2904
  }
2836
2905
 
2837
2906
  /** 选中事件载荷:点击选中为 0 / 1 个要素,Shift 框选为框内全部节点(随 shortcuts.boxSelect 改变) */
2838
2907
  export interface GisViewSelectPayload extends GisViewSelectionChannelFields {
2839
- /** 选中项;通道回线只带 channelId / channelIndex / groupId / groupIndex 标量归属,分组读数看顶层或 channelContexts */
2908
+ /** 选中项;通道回线不重复挂 channelId / channelIndex / groupId / groups,归属看顶层 lineIndexes / channelContexts */
2840
2909
  items: GisViewPickResult[]
2841
2910
  /** 框选时的画布 CSS 像素矩形,点击选中为 null */
2842
2911
  box: GisViewRect | null
@@ -2848,11 +2917,10 @@ export interface GisViewSelectPayload extends GisViewSelectionChannelFields {
2848
2917
  mode?: 'single' | 'multi' | 'box'
2849
2918
  }
2850
2919
 
2851
- /**
2852
2920
  /**
2853
2921
  * 选中集读数:ids(选中要素的 id,没有 id 的不进这里)/ count(要素条数)/
2854
- * pointCount / lineCount / channelCount(各类型几个,通道回线按通道算一个)的**计数**版本。
2855
- * onSelectChange、指针载荷里的 selection 与 getSelectionData() 的计数部分都是同一份口径。
2922
+ * points / lines / channels(各类型几个,通道回线按通道算一个)的**计数**版本。
2923
+ * onSelectChange、getSelectionInfo() 与 getSelectionData() 的计数部分都是同一份口径。
2856
2924
  */
2857
2925
  export interface GisViewSelectionInfo {
2858
2926
  ids: Array<string | number>
@@ -2933,7 +3001,7 @@ export interface GisViewSelectionData {
2933
3001
  lines: GisViewLine[]
2934
3002
  /** 选中回线所属的通道(去重) */
2935
3003
  channels: GisViewChannel[]
2936
- /** 与 getSelections() 同一份:带下标、坐标与通道上下文 */
3004
+ /** 与 getSelections() 同一份:带下标与坐标,通道回线不重复挂通道字段 */
2937
3005
  items: GisViewPickResult[]
2938
3006
  pointIndexes: number[]
2939
3007
  lineIndexes: number[]
@@ -2945,7 +3013,7 @@ export interface GisViewSelectionData {
2945
3013
  * 接口选中(select / clearSelection / selectInBox)也会发。
2946
3014
  */
2947
3015
  export interface GisViewSelectChangePayload extends GisViewSelectionInfo, GisViewSelectionChannelFields {
2948
- /** 与对应 onSelect 载荷共用同一批对象;通道回线不重复挂 group / groups */
3016
+ /** 与对应 onSelect 载荷共用同一批对象;通道回线不重复挂 channelId / channelIndex / groupId / groups */
2949
3017
  items: GisViewPickResult[]
2950
3018
  /** 框选时的矩形,其余为 null */
2951
3019
  box: GisViewRect | null
@@ -2955,7 +3023,7 @@ export interface GisViewSelectChangePayload extends GisViewSelectionInfo, GisVie
2955
3023
  /**
2956
3024
  * 这一次操作的判读(与指针事件同一套写法):type 细到 'select'(点中一个或接口选中)/
2957
3025
  * 'toggleSelect'(Ctrl 点击取反)/ 'boxSelect'(框选)/ 'clearSelection'(点空白、Esc 或接口清空);
2958
- * target 是 'selection'(作用在一批要素上)或 'empty'(清空成空集),data 就是这一批 items。
3026
+ * target 是 'selection'(作用在一批要素上)或 'empty'(清空成空集),这一批数据直接读载荷的 items。
2959
3027
  * 取反与清空这两条路不经过 onClick,要按操作分支的界面认这一个字段。
2960
3028
  */
2961
3029
  action: GisViewPointerAction
@@ -2975,8 +3043,8 @@ export interface GisViewWaypointPayload {
2975
3043
  phase: 'add' | 'select' | 'remove' | 'start' | 'move' | 'end'
2976
3044
  /**
2977
3045
  * 这一次操作的判读:type 为 'addWaypoint' / 'removeWaypoint' / 'selectWaypoint' / 'dragWaypoint',
2978
- * target 为 'waypoint',data 是「哪条线、第几个顶点、坐标、改完的那条线」那一份读数
2979
- * (与载荷里的 lineIndex / pathIndex / coordinate / line 同一份,只是打包在一起)
3046
+ * target 为 'waypoint'。哪条线、第几个顶点、坐标与改完的那条线直接读载荷顶层的
3047
+ * lineIndex / pathIndex / coordinate / line。
2980
3048
  */
2981
3049
  action?: GisViewPointerAction
2982
3050
  lineIndex: number
@@ -3030,15 +3098,11 @@ export interface GisViewChannelGroupChangePayload {
3030
3098
  /**
3031
3099
  * 点击与双击事件载荷,点击空白处时载荷为 null。
3032
3100
  * selected 是点完之后的状态、wasSelected 是点之前的状态(Ctrl 点击是取反之前),
3033
- * selection 是点完之后整个选中集的读数 —— 左键要自己接一套操作时看这三个就够。
3101
+ * 选中集读数用 getSelectionInfo(),鼠标键与修饰键读 originalEvent。
3034
3102
  */
3035
3103
  export interface GisViewClickPayload extends GisViewPickResult {
3036
- /** 鼠标按键:0 左键、1 中键、2 右键(与指针载荷同一份口径,单击 / 双击都是从 pointerup 判出来的) */
3037
- button?: number
3038
- buttons?: number
3104
+ /** 原始点击事件:button / buttons / 修饰键与 clientX / clientY 都从这里读 */
3039
3105
  originalEvent: Event
3040
- /** 点完之后整个选中集的读数(ids / count / 各类型条数,通道回线按通道算一个) */
3041
- selection: GisViewSelectionInfo
3042
3106
  /**
3043
3107
  * 这一次点击的判读:type 为 'select'(点中要素、选中已生效)或 'click'(没开选中时的普通点击),
3044
3108
  * 多选取反生效时是 'toggleSelect';double 为 true 说明这一下是双击里的第二下。点空白处的载荷是 null,
@@ -3087,18 +3151,11 @@ export type GisViewPointerActionType =
3087
3151
  | 'drag'
3088
3152
  | 'pointer'
3089
3153
 
3090
- /** 修饰键:与原生事件上的 ctrlKey / metaKey(⌘)/ shiftKey / altKey 一一对应 */
3091
- export interface GisViewPointerModifiers {
3092
- ctrl: boolean
3093
- meta: boolean
3094
- shift: boolean
3095
- alt: boolean
3096
- }
3097
-
3098
3154
  /**
3099
- * 一次指针操作的类型化判读:`action.type` 回答「这是什么操作」、`action.target` 回答「点在什么上面」、
3100
- * `action.data` 回答「能拿到什么数据」。画布上的指针事件、拐点、标签、选中集共用这一套写法 ——
3101
- * 使用方按 action.type / action.target 分支就够,不必自己按事件名分别记一套。
3155
+ * 一次指针操作的类型化判读:`action.type` 回答「这是什么操作」、`action.target` 回答「点在什么上面」。
3156
+ * 原始输入不在这里重复:鼠标键 / 修饰键 / clientX / clientY 读载荷的 `originalEvent`,
3157
+ * 命中的数据读载荷自己的 `item`、`channelContext`、`items` 等字段。
3158
+ * 画布上的指针事件、拐点、标签、选中集共用这一套写法。
3102
3159
  */
3103
3160
  export interface GisViewPointerAction {
3104
3161
  type: GisViewPointerActionType
@@ -3108,18 +3165,6 @@ export interface GisViewPointerAction {
3108
3165
  * 点击 / 右键 / 选中集事件恒为 false,拐点拖动事件里 start 为 false、move / end 为 true。
3109
3166
  */
3110
3167
  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
3168
  /** 只在 click 载荷里出现:true 说明这一下是双击里的第二下(单双击要分开做事的界面按它推迟一下) */
3124
3169
  double?: boolean
3125
3170
  /**
@@ -3133,20 +3178,6 @@ export interface GisViewPointerAction {
3133
3178
  longPress?: boolean
3134
3179
  }
3135
3180
 
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
3181
  /**
3151
3182
  * 通用指针载荷:左键按下 / 抬起、右键都会发一条。
3152
3183
  * 命中的要素(点 / 线 / 通道回线)在 type / index / item 与通道字段里,没有命中时 type 为 null、hit 为 false;
@@ -3155,7 +3186,7 @@ export interface GisViewLabelActionData {
3155
3186
  export interface GisViewPointerPayload {
3156
3187
  /**
3157
3188
  * 这一次操作的判读:按下时 type 是意图、松开时是刚做完的那件事、右键固定是 'contextMenu';
3158
- * target 说明点的是点 / 线 / 通道 / 空白,data 直接给到那一份数据(左键 / 右键都认这一份)
3189
+ * target 说明点的是点 / 线 / 通道 / 空白;命中的数据直接读载荷的 item / channel / channelContext 等字段。
3159
3190
  */
3160
3191
  action: GisViewPointerAction
3161
3192
  /** 命中的要素类型,空白处为 null;多成员聚合是 'cluster' */
@@ -3170,9 +3201,6 @@ export interface GisViewPointerPayload {
3170
3201
  screen?: [number, number]
3171
3202
  /** 命中的要素自身的世界坐标 */
3172
3203
  coordinate?: [number, number]
3173
- /** 命中的是线路(含通道回线)时,线路在 lines 数组里的下标与 id;右键菜单按它找线路 */
3174
- lineIndex?: number
3175
- lineId?: string | number
3176
3204
  /** 命中的是通道内的回线时,回线所属通道与分组 */
3177
3205
  channelIndex?: number
3178
3206
  channel?: GisViewChannel
@@ -3198,11 +3226,10 @@ export interface GisViewPointerPayload {
3198
3226
  selected?: boolean
3199
3227
  /** 见 selected:左键按下 / 右键这一路上两份是同一个值(点击载荷里才是「点之前 / 点之后」) */
3200
3228
  wasSelected?: boolean
3201
- /** 这一刻整个选中集的读数(右键弹自己的面板时按它决定面板内容) */
3202
- selection?: GisViewSelectionInfo
3203
- /** 鼠标按键:0 左键、1 中键、2 右键 */
3204
- button: number
3205
- buttons: number
3229
+ /*
3230
+ * 选中集读数用 getSelectionInfo();鼠标键与修饰键用 originalEvent.button / buttons / ctrlKey /
3231
+ * metaKey / shiftKey / altKey。lineIndex 就是 index,线路 id 读 item.id 或 getLineChannel(index)。
3232
+ */
3206
3233
  /** 光标处的世界坐标 */
3207
3234
  world: [number, number]
3208
3235
  /** 配了 GeoJSON 底图时,光标位置对应的真实经纬度(含 aspectScale 反算) */
@@ -3210,16 +3237,15 @@ export interface GisViewPointerPayload {
3210
3237
  /** 光标处的画布 CSS 像素 */
3211
3238
  x: number
3212
3239
  y: number
3213
- clientX: number
3214
- clientY: number
3240
+ /** 原始指针 / 鼠标事件:button / buttons / 修饰键 / clientX / clientY 都从这里读 */
3215
3241
  originalEvent: PointerEvent | MouseEvent
3216
3242
  }
3217
3243
 
3218
3244
  /**
3219
3245
  * 悬停载荷(onHover 与 hoverAt 的读数,没有悬停到东西时是 null):
3220
3246
  * 与指针载荷同一层 —— 命中的要素在 type / index / item 与通道字段里,光标位置在 x / y / world 里,
3221
- * 另外带一份 action(type 恒为 'hover'、target 说明停在什么上面、button 恒为 'none')。
3222
- * 光标正好停在最近一次指针事件的位置上时,originalEvent / clientX / clientY 就是那一次事件(修饰键读得到)。
3247
+ * 另外带一份 action(type 恒为 'hover'、target 说明停在什么上面)。
3248
+ * 光标正好停在最近一次指针事件的位置上时,originalEvent 就是那一次事件(按键 / 修饰键 / 指针位置都读得到)。
3223
3249
  */
3224
3250
  export type GisViewHoverPayload = GisViewHitResult & {
3225
3251
  /** 悬停读数一样有:有没有停在某个要素上(空白处是 null,不走这一份) */
@@ -3230,12 +3256,8 @@ export type GisViewHoverPayload = GisViewHitResult & {
3230
3256
  y: number
3231
3257
  /** 光标处的世界坐标 */
3232
3258
  world: [number, number]
3233
- clientX?: number
3234
- clientY?: number
3235
3259
  /** 光标就停在这一次指针事件的位置上时给出(程序化悬停 hoverAt 不带) */
3236
3260
  originalEvent?: PointerEvent | MouseEvent | null
3237
- /** 此刻整个选中集的读数(与指针载荷里的 selection 同一份) */
3238
- selection?: GisViewSelectionInfo
3239
3261
  }
3240
3262
  export type GisViewCursorPayload = [number, number] | null
3241
3263
 
@@ -3286,8 +3308,6 @@ export interface GisViewPointCopyPayload {
3286
3308
  index: number
3287
3309
  /** 复制出来的节点:预览中就是含最新落点的那一份 */
3288
3310
  item: GisViewPoint
3289
- /** item 的别名,与其它载荷的写法对齐 */
3290
- point: GisViewPoint
3291
3311
  /** 来源节点;剪贴板这条的来源下标为 -1(快照还在) */
3292
3312
  source: GisViewCopySource | null
3293
3313
  /** 整组来源(clipboard 与多选复制时给全;普通 Alt 复制只有 source 一项) */
@@ -3308,8 +3328,6 @@ export interface GisViewPointCopyPayload {
3308
3328
  /** 快照是否带上内部线路 / 通道 */
3309
3329
  withLines?: boolean
3310
3330
  withChannels?: boolean
3311
- /** 复制出来的节点当前落在的世界坐标 */
3312
- coordinate: [number, number] | null
3313
3331
  /** 光标在画布内的 CSS 像素位置 */
3314
3332
  screen: [number, number] | null
3315
3333
  originalEvent: Event | null
@@ -3322,8 +3340,6 @@ export interface GisViewPointCopyPayload {
3322
3340
  invalidated: boolean
3323
3341
  /** 改复制节点的数据(字段级合并,坐标仍以预览落点为准),返回改完的节点 */
3324
3342
  update(patch: Partial<GisViewPoint>): GisViewPoint | null
3325
- /** 等价于 update */
3326
- setItem(patch: Partial<GisViewPoint>): GisViewPoint | null
3327
3343
  /** 取消这次复制:预览撤掉,数据不落地 */
3328
3344
  cancel(): GisViewPointCopyPayload | null
3329
3345
  /** 落地这次复制(interaction 结束后可以直接调) */
@@ -3411,13 +3427,11 @@ export interface GisViewBatchCopyPayload {
3411
3427
  /** 屏幕像素偏移量 */
3412
3428
  offsetScreen: [number, number]
3413
3429
  anchor: [number, number]
3414
- coordinate: [number, number] | null
3415
3430
  screen: [number, number] | null
3416
3431
  originalEvent: Event | null
3417
3432
  cancelled: boolean
3418
3433
  invalidated: boolean
3419
3434
  update(patch?: Partial<GisViewPoint>): GisViewPoint | null
3420
- setItem(patch?: Partial<GisViewPoint>): GisViewPoint | null
3421
3435
  /** 撤销整批(等价于 revert) */
3422
3436
  cancel(): GisViewBatchCopyPayload | null
3423
3437
  /** 已经落地,原样返回这份载荷 */
@@ -3553,7 +3567,8 @@ export interface GisViewPointMergePayload {
3553
3567
  /** 合并后保留谁:'target'(缺省,碰撞目标)或 'source'(当前拖动的来源节点);确认时传 confirm({ keep }) */
3554
3568
  keep: GisViewMergeKeep
3555
3569
  /**
3556
- * confirm 阶段的合并结果(按 keep 决定的保留端优先、另一端独有字段带过来、尺寸取双方最大、图标优先保留端):
3570
+ * confirm 阶段的合并结果(按 keep 决定的保留端业务字段优先、merge.maxKeys 列出的字段取双方最高值、
3571
+ * 尺寸取双方最大、图标用保留端):
3557
3572
  * 改它就是改合并结果;其余阶段为 null。confirm({ item }) 可以只给要改的字段,组件先算缺省结果再合并这份补丁
3558
3573
  */
3559
3574
  item: GisViewPoint | null
@@ -3654,7 +3669,7 @@ export type GisViewMergeSelectedOutcome = GisViewMergeSelectedPayload
3654
3669
 
3655
3670
  /** mergeSelectedPoints 改写每一对最终节点时的上下文:merged / item 是缺省合并结果 */
3656
3671
  export interface GisViewMergeSelectedItemContext {
3657
- /** 缺省合并结果(目标优先、来源独有字段带过来) */
3672
+ /** 缺省合并结果(保留节点的业务字段优先,merge.maxKeys 列出的字段取双方最高值) */
3658
3673
  item: GisViewPoint
3659
3674
  /** item 的别名 */
3660
3675
  merged: GisViewPoint
@@ -3708,6 +3723,17 @@ export interface GisViewSplitPointOptions {
3708
3723
  keepSourceId?: boolean
3709
3724
  /** 这一步历史的标签,缺省「拆分节点」 */
3710
3725
  label?: string
3726
+ /**
3727
+ * 没在 parts[].lines 里显式分配的线路怎么分:first 全跟第一份(缺省,兼容旧行为);
3728
+ * alternate 按「通道成组、独立线路单条」为单位轮流给负载最少的一份 —— 同一条通道的成员不会被拆散,
3729
+ * 解除合并时推荐用它
3730
+ */
3731
+ autoLines?: 'first' | 'alternate'
3732
+ /**
3733
+ * 拆分 / 自动解除合并后是否选中结果节点:缺省 false(只移除来源节点的选中态,不动其它无关选中);
3734
+ * true 时选中 parts 对应的全部节点
3735
+ */
3736
+ select?: boolean
3711
3737
  }
3712
3738
 
3713
3739
  /** 拆分时没认出来的线路 / 通道引用 */
@@ -3730,6 +3756,15 @@ export interface GisViewSplitPointChangeSet {
3730
3756
  removedChannels: GisViewChannel[]
3731
3757
  }
3732
3758
 
3759
+ /** splitPoint 自动 / 显式分配之后,每一份节点接到的线路读数 */
3760
+ export interface GisViewSplitPointLineAssignment {
3761
+ /** 第几份(与 items / pointIds 同序) */
3762
+ index: number
3763
+ pointId: string | number
3764
+ lineIds: Array<string | number>
3765
+ lineCount: number
3766
+ }
3767
+
3733
3768
  /** splitPoint 的返回:ok 为 false 时 reason 说明原因,其余数组为空、changes 为 null */
3734
3769
  export interface GisViewSplitPointOutcome {
3735
3770
  ok: boolean
@@ -3747,6 +3782,16 @@ export interface GisViewSplitPointOutcome {
3747
3782
  removedChannels: number
3748
3783
  removedChannelIds: Array<string | number>
3749
3784
  skipped: { lines: GisViewSplitPointSkip[]; channels: GisViewSplitPointSkip[] }
3785
+ /** 这一次采用的自动分线口径 */
3786
+ autoLines: 'first' | 'alternate'
3787
+ /** 由 autoLines 自动分配(没有显式写 lines)的线路条数 */
3788
+ autoAssignedLines: number
3789
+ /** 每一份最终接到哪些线路(含显式分配与自动分配) */
3790
+ lineAssignments: GisViewSplitPointLineAssignment[]
3791
+ /** 这次是否走了 mergeInfo 自动解除合并(省略 parts 且节点带合并记录时为 true) */
3792
+ autoRestored: boolean
3793
+ /** 自动解除时恢复的全部来源节点 id(手工拆分时为空数组) */
3794
+ mergeSourceIds: Array<string | number | null>
3750
3795
  changes: GisViewSplitPointChangeSet | null
3751
3796
  }
3752
3797
 
@@ -4204,6 +4249,18 @@ export interface GisViewItemLabel {
4204
4249
  offset?: [number, number]
4205
4250
  /** 内联样式(与配置里的 style 一层合并,改字号不会把底色清掉) */
4206
4251
  style?: Record<string, string>
4252
+ /** 标签层级:越大越靠上;不写时按所在层的最底层处理 */
4253
+ zIndex?: number
4254
+ /**
4255
+ * 是否跟随所属节点的 zIndex(节点标签;线路标签忽略这一项)。
4256
+ * 跟随之后,更高层的节点与标签可以盖住这条标签;显式 zIndex 优先。
4257
+ */
4258
+ followNodeZIndex?: boolean
4259
+ /**
4260
+ * 字号跟随地图缩放的指数:0(默认)保持屏幕像素不变,1 与地图同倍率放大 / 缩小,
4261
+ * 0.5 表示地图放大 4 倍时字号放大 2 倍。基数是标签样式里的 fontSize(缺省 12px)。
4262
+ */
4263
+ zoomScale?: number
4207
4264
  /** 线路标签是否与线路方向平行(点的标签忽略这一项) */
4208
4265
  parallel?: boolean
4209
4266
  /** 这一条是否参与避让:false 时即使全局开启 labelOptimize / avoidOverlap 也始终按候选落点画出;缺省跟随全局 */
@@ -4305,6 +4362,12 @@ export interface GisViewLabelOptions {
4305
4362
  className?: string
4306
4363
  /** 标签的内联样式 */
4307
4364
  style?: Record<string, string>
4365
+ /** 标签层级:越大越靠上;不写时是 0 */
4366
+ zIndex?: number
4367
+ /** 跟随节点样式链里的 zIndex(显式 zIndex 优先);更高层的节点会把标签盖住 */
4368
+ followNodeZIndex?: boolean
4369
+ /** 字号跟随地图缩放的指数:0 固定屏幕字号(默认),1 与地图同倍率 */
4370
+ zoomScale?: number
4308
4371
  }
4309
4372
 
4310
4373
  /** 线路标签内容函数的入参 */
@@ -4393,6 +4456,10 @@ export interface GisViewLineLabelOptions {
4393
4456
  className?: string
4394
4457
  /** 标签的内联样式 */
4395
4458
  style?: Record<string, string>
4459
+ /** 标签层级:越大越靠上;不写时是 0 */
4460
+ zIndex?: number
4461
+ /** 字号跟随地图缩放的指数:0 固定屏幕字号(默认),1 与地图同倍率 */
4462
+ zoomScale?: number
4396
4463
  }
4397
4464
 
4398
4465
  /** 标签类别:节点标签 / 线路标签 */
@@ -4424,6 +4491,12 @@ export interface GisViewLabelState {
4424
4491
  parallel: boolean | null
4425
4492
  /** 改过的「整条不画」(removeLabel 对配置 / 数据里声明的那一条就是这么落的);没改过是 null */
4426
4493
  hidden: boolean | null
4494
+ /** 改过的标签层级;没改过是 null */
4495
+ zIndex: number | null
4496
+ /** 改过的「跟随节点层级」;没改过是 null */
4497
+ followNodeZIndex: boolean | null
4498
+ /** 改过的字号缩放指数;没改过是 null */
4499
+ zoomScale: number | null
4427
4500
  /** 这一条是运行时加的(addLabel),不是配置 / 数据里声明的 */
4428
4501
  added: boolean
4429
4502
  /** 运行时加的标签的定义(addLabel 的入参),持久化回显时按它重建;不是运行时标签时为 null */
@@ -4450,6 +4523,12 @@ export interface GisViewLabelPatch {
4450
4523
  parallel?: boolean | null
4451
4524
  /** 整条不画(true 等于 visibility: 'hidden');写 null 回到默认 */
4452
4525
  hidden?: boolean | null
4526
+ /** 标签层级;写 null 回到默认 */
4527
+ zIndex?: number | null
4528
+ /** 是否跟随节点层级;写 null 回到默认 */
4529
+ followNodeZIndex?: boolean | null
4530
+ /** 字号跟随地图缩放的指数(0 = 固定屏幕字号);写 null 回到默认 */
4531
+ zoomScale?: number | null
4453
4532
  }
4454
4533
 
4455
4534
  /**
@@ -4469,6 +4548,12 @@ export interface GisViewLabelInfo {
4469
4548
  className: string | null
4470
4549
  /** 合并之后的逐条内联样式(配置 + 数据 + 运行时状态) */
4471
4550
  style: Record<string, string> | null
4551
+ /** 这一条当下生效的标签层级(显式 zIndex 或跟随节点得到的有效层) */
4552
+ zIndex: number
4553
+ /** 这一条是否跟随所属节点的 zIndex(线路标签忽略这一项) */
4554
+ followNodeZIndex: boolean
4555
+ /** 这一条当下生效的字号缩放指数(0 固定屏幕字号,1 与地图同倍率) */
4556
+ zoomScale: number
4472
4557
  /** 这一条是哪来的:'config' 配置里定义的 / 'data' 数据里写的 / 'runtime' 运行时加的 */
4473
4558
  source: 'config' | 'data' | 'runtime'
4474
4559
  /** 数据里写了同 id 的那一条覆盖 */
@@ -4526,12 +4611,11 @@ export interface GisViewLabelDragPayload {
4526
4611
  state?: GisViewLabelState | null
4527
4612
  /** 这一条标签对应的要素在不在当前选中集里 */
4528
4613
  selected: boolean
4529
- selection: GisViewSelectionInfo
4530
4614
  /** 停手那一条带 true(说明这一路是拖过来而不是点选);start / move 上没有这个字段 */
4531
4615
  moved?: boolean
4532
4616
  /** 触发起手 / 移动 / 停手的原始指针事件(宿主按它读修饰键与指针位置) */
4533
4617
  originalEvent?: PointerEvent | MouseEvent | null
4534
- /** 这一次拖动的判读:type 为 'dragLabel'、target 为 'label'、data 是这一条标签 */
4618
+ /** 这一次拖动的判读:type 为 'dragLabel'、target 为 'label';标签与 parent 读载荷顶层 */
4535
4619
  action?: GisViewPointerAction
4536
4620
  }
4537
4621
 
@@ -4551,15 +4635,14 @@ export interface GisViewLabelClickPayload {
4551
4635
  /** 这一条当前的覆盖读数,没改过是 null */
4552
4636
  state: GisViewLabelState | null
4553
4637
  selected: boolean
4554
- selection: GisViewSelectionInfo
4555
4638
  /** 触发这一下的原始指针事件(点选是 pointerup;拖动路径里「没挪动」那条也是 pointerup) */
4556
4639
  originalEvent?: PointerEvent | MouseEvent | null
4557
- /** 这一次点选的判读:type 为 'selectLabel'、target 为 'label'、data 是这一条标签 */
4640
+ /** 这一次点选的判读:type 为 'selectLabel'、target 为 'label';标签与 parent 读载荷顶层 */
4558
4641
  action?: GisViewPointerAction
4559
4642
  }
4560
4643
 
4561
4644
  /**
4562
- * 标签上的右键 / 双击载荷:与 labelClick 同一份读数(label / parent),另带指针位置与原始 DOM 事件。
4645
+ * 标签上的右键 / 双击载荷:与 labelClick 同一份读数(label / parent);指针位置、按键与修饰键读 originalEvent。
4563
4646
  * `label.draggable` / `label.editable`(线路标签同一套开关)任开一个的标签都会发。
4564
4647
  */
4565
4648
  export interface GisViewLabelPointerPayload {
@@ -4576,15 +4659,11 @@ export interface GisViewLabelPointerPayload {
4576
4659
  /** 这一条当前的覆盖读数,没改过是 null */
4577
4660
  state: GisViewLabelState | null
4578
4661
  offset: [number, number]
4579
- /** 指针在视口里的位置(右键菜单按它定位;双击时是双击那一下的位置) */
4580
- clientX: number
4581
- clientY: number
4582
- /** 原始 DOM 事件(contextmenu / dblclick):要 preventDefault 或读别的字段时用它 */
4662
+ /** 原始 DOM 事件(contextmenu / dblclick):指针位置、按键、修饰键都从这里读 */
4583
4663
  originalEvent: MouseEvent | null
4584
4664
  /** 这一条标签对应的要素在不在当前选中集里 */
4585
4665
  selected: boolean
4586
- selection: GisViewSelectionInfo
4587
- /** 这一次操作的判读:type 为 'contextMenu' / 'dblClick'、target 为 'label'、data 是这一条标签 */
4666
+ /** 这一次操作的判读:type 为 'contextMenu' / 'dblClick'、target 为 'label';标签与 parent 读载荷顶层 */
4588
4667
  action?: GisViewPointerAction
4589
4668
  }
4590
4669
 
@@ -4636,6 +4715,12 @@ export interface GisViewLabelListItem {
4636
4715
  /** 当下生效的偏移(像素):运行时拖出来的优先,否则用声明里的;都没有是 [0, 0] */
4637
4716
  offset: [number, number]
4638
4717
  style: Record<string, string> | null
4718
+ /** 当下生效的标签层级 */
4719
+ zIndex: number
4720
+ /** 是否跟随节点层级 */
4721
+ followNodeZIndex: boolean
4722
+ /** 当下生效的字号缩放指数 */
4723
+ zoomScale: number
4639
4724
  /** 线路标签:这一条是否与线路平行;节点标签恒为 false */
4640
4725
  parallel: boolean
4641
4726
  visibility: GisViewLabelVisibility
@@ -5513,6 +5598,40 @@ export interface GisViewLineStyleSnapshot {
5513
5598
  zIndex: number
5514
5599
  }
5515
5600
 
5601
+ /** 合并追溯里的一条要素快照:恢复时优先按 id 找当前位置,没有 id 才参考原下标 */
5602
+ export interface GisViewMergeFeatureSnapshot<T> {
5603
+ index: number
5604
+ id: string | number | null
5605
+ item: T
5606
+ }
5607
+
5608
+ /**
5609
+ * mergePoints 写在保留节点 / 受影响通道上的合并追溯信息。场站合并会在保留节点上保存
5610
+ * 第一次合并前的保留节点、每个来源节点与受影响线路 / 通道的快照;同一个保留节点连续合并多个来源时,
5611
+ * 来源与快照会累加。splitPoint(source) 不传 parts 时按这份信息自动解除合并。
5612
+ * 该字段由组件维护,业务数据不要占用;序列化后随 points / channels 一起提交即可。
5613
+ */
5614
+ export interface GisViewMergeInfo {
5615
+ /** 追溯格式版本,目前为 1 */
5616
+ version: 1
5617
+ /** 保留节点的 id(通道上的同一字段表示合并到的目标节点) */
5618
+ targetId: string | number | null
5619
+ /** 第一次合并时保留节点在原数组里的下标 */
5620
+ targetIndex?: number
5621
+ /** 保留节点第一次合并前的快照(不含 mergeInfo 自身) */
5622
+ targetPoint?: GisViewPoint | null
5623
+ /** 合并进来的来源节点 id,按发生顺序 */
5624
+ sourceIds?: Array<string | number | null>
5625
+ /** 来源节点快照,按第一次合并时的原下标顺序恢复 */
5626
+ points?: Array<GisViewMergeFeatureSnapshot<GisViewPoint>>
5627
+ /** 受影响线路第一次合并前的快照;自动解除时按它恢复改绑、几何与删除的线路 */
5628
+ lines?: Array<GisViewMergeFeatureSnapshot<GisViewLine>>
5629
+ /** 受影响通道第一次合并前的快照;自动解除时按它恢复端点、分组与回线归属 */
5630
+ channels?: Array<GisViewMergeFeatureSnapshot<GisViewChannel>>
5631
+ /** 通道溯源:参与本次合并、被改端点或被并掉的原始通道 id */
5632
+ originalIds?: Array<string | number | null>
5633
+ }
5634
+
5516
5635
  /** 合并时给的上下文:merge.createItem 会拿到它 */
5517
5636
  export interface GisViewMergeContext {
5518
5637
  sourceIndex: number
@@ -5561,9 +5680,16 @@ export interface GisViewMergeOptions {
5561
5680
  */
5562
5681
  channelGroups?: 'keep' | 'merge'
5563
5682
  /**
5564
- * 自己决定合并之后的节点数据:缺省 `{ ...source, ...target }`(目标优先,来源独有的字段带过来),
5565
- * 尺寸取双方 getPointStyle().size 的较大值(sizeScale 归 1)、图标优先目标节点(目标没有才用来源的);
5566
- * 坐标与 id 无论怎么配都取目标节点
5683
+ * 合并后取双方最高值的字段:只认列出来的键,缺省空表(不取任何最高值,全部保留目标节点字段)。
5684
+ * 例如 `['vn_kv', 'value']`;也接受 `'vn_kv,value'` 写法。字段两边都是有限数字时取 Math.max,
5685
+ * 只有一边有有效数字就用那一边,否则保持目标节点原值。createItem / options.item 自行接管结果时不参与
5686
+ */
5687
+ maxKeys?: string[] | string
5688
+ /**
5689
+ * 自己决定合并之后的节点数据:缺省以目标节点字段为底,`vn_kv` / `voltage` / `voltageKv` /
5690
+ * `voltage_level` / `voltageLevel` 等电压字段不再自动取最大值(要取就写 maxKeys),其余业务字段
5691
+ * (名称、图标类型等)全部保留目标节点的值;尺寸取双方 getPointStyle().size 的较大值(sizeScale 归 1)。
5692
+ * 坐标、id 与 mergeInfo 无论怎么配都取目标节点 / 由组件维护
5567
5693
  */
5568
5694
  createItem?: (source: GisViewPoint, target: GisViewPoint, context: GisViewMergeContext) => GisViewPoint
5569
5695
  }
@@ -5588,12 +5714,15 @@ export type GisViewChannelWaypointDragMode =
5588
5714
  | 'vertex'
5589
5715
 
5590
5716
  /**
5591
- * 框选 / Ctrl 多选允许收哪几类要素:节点、独立线路、通道回线。
5717
+ * 框选允许收哪几类要素:节点、独立线路、通道回线,以及线路 / 通道的端点口径。
5592
5718
  * 通道回线只归 channel 这一档管;通道之外的普通线路归 line,两者可以任意组合。
5719
+ * `lineEndpoints` / `channelEndpoints` 要求线路 / 通道自己的两端节点都被框住才算命中,
5720
+ * 只用于框选、`selectInBox` 与 `exportData({ scope: 'viewport' })`,不参与点击多选。
5593
5721
  */
5594
- export type GisViewSelectionKind = 'point' | 'line' | 'channel'
5722
+ export type GisViewSelectionKind = 'point' | 'line' | 'channel' | 'lineEndpoints' | 'channelEndpoints'
5595
5723
  /**
5596
5724
  * selectionKinds 的写法:单类、类型数组、'all' / true(全开)或 false / null(全关)。
5725
+ * 端点口径也认 line-endpoints / line_endpoints / channel-endpoints / channel_endpoints 这几种连字符写法。
5597
5726
  * 不写时保留旧行为:框选只收节点,Ctrl / 多选点击仍可收节点与线路(回线按 channelSelectMode 摊开)。
5598
5727
  */
5599
5728
  export type GisViewSelectionKindsInput = GisViewSelectionKind | GisViewSelectionKind[] | 'all' | true | false | null
@@ -6049,8 +6178,8 @@ export interface GisViewBatchOptions {
6049
6178
  /**
6050
6179
  * 全部可订阅事件(与 EVENT_NAMES 一致):事件名与 options 里的回调一一对应(`dataChange` 就是 `onDataChange`),
6051
6180
  * 载荷也是同一份 —— 区别只在写法:`on` 可以挂多条、可以运行时订阅、返回的函数就是取消订阅。
6052
- * 需要原样带回 DOM 事件的那三个(pointerDown / pointerUp / contextMenu)载荷是
6053
- * `{ payload, event }`,与回调的两个参数一一对应。
6181
+ * 指针类事件(pointerDown / pointerUp / contextMenu)与回调收到的是同一份直接载荷,
6182
+ * 原始 DOM 事件看 payload.originalEvent。
6054
6183
  */
6055
6184
  export interface GisViewEventMap {
6056
6185
  /** 初始化完成:拿到画布与 WebGL 上下文 */
@@ -6062,12 +6191,14 @@ export interface GisViewEventMap {
6062
6191
  /** 视口尺寸 / 显示比例变化(画布按新尺寸重铺之后才发) */
6063
6192
  viewport: GisViewViewport
6064
6193
  cameraChange: GisViewCamera
6194
+ /** 用户在这段时间内没有指针 / 滚轮 / 键盘操作(每个空闲段只发一次) */
6195
+ idle: GisViewIdlePayload
6065
6196
  cursor: GisViewCursorPayload
6066
6197
  hover: GisViewHoverPayload
6067
6198
  pointer: GisViewPointerState
6068
- pointerDown: { payload: GisViewPointerPayload; event: PointerEvent }
6069
- pointerUp: { payload: GisViewPointerPayload; event: PointerEvent }
6070
- contextMenu: { payload: GisViewPointerPayload; event: MouseEvent }
6199
+ pointerDown: GisViewPointerPayload
6200
+ pointerUp: GisViewPointerPayload
6201
+ contextMenu: GisViewPointerPayload
6071
6202
  click: GisViewClickPayload
6072
6203
  /** 点中多成员聚合圆:不选中内部节点,普通 click 不会同时触发 */
6073
6204
  clusterClick: GisViewClusterClickPayload
@@ -6240,6 +6371,16 @@ export interface GisViewWebGLLayer {
6240
6371
  */
6241
6372
  export type GisViewSelectTrigger = 'click' | 'dblClick'
6242
6373
 
6374
+ /** 通道简略配置:分组回线数超过阈值时只显示一条代表线 */
6375
+ export interface GisViewChannelSimplifyOptions {
6376
+ /** false 关闭;缺省对象即开启 */
6377
+ enabled?: boolean
6378
+ /** 分组回线数严格大于这个值时折叠,缺省 4 */
6379
+ threshold?: number
6380
+ /** 代表线的自定义样式(颜色、线宽、线型等);只影响这一条代表线的展示,不改数据 */
6381
+ style?: GisViewLineStyle
6382
+ }
6383
+
6243
6384
  export interface GisViewOptions {
6244
6385
  /**
6245
6386
  * 功能开关:预设名('edit' / 'view' / 'static')、开关表或布尔值 ——
@@ -6324,6 +6465,11 @@ export interface GisViewOptions {
6324
6465
  channelMaxGroups?: number
6325
6466
  /** 一个分组最多几条回线(0 表示不限):新增通道时据此判断还能不能并进这一组 */
6326
6467
  channelGroupMaxLines?: number
6468
+ /**
6469
+ * 通道简略:true 用缺省阈值 4;对象可改 threshold 与代表线 style。
6470
+ * 某个分组超过阈值时只画一条代表线(没有 groups 的通道按一整组算),数据、分组读数与导出不变
6471
+ */
6472
+ channelSimplify?: boolean | GisViewChannelSimplifyOptions
6327
6473
  /** 新增通道草稿线的样式(跟随光标的那条预览线) */
6328
6474
  channelDraftStyle?: GisViewChannelDraftStyle
6329
6475
  /** WebGL 自定义层:内置内容之后按 order 绘制;运行时用 addWebGLLayer / updateWebGLLayer 等维护 */
@@ -6511,9 +6657,11 @@ export interface GisViewOptions {
6511
6657
  selectTrigger?: GisViewSelectTrigger
6512
6658
  /**
6513
6659
  * 框选 / Ctrl 多选允许收哪几类要素:'point' 节点、'line' 独立线路、'channel' 通道回线,
6660
+ * 另有 'lineEndpoints' / 'channelEndpoints' 只在框选时要求线路 / 通道两端节点都在框内;
6514
6661
  * 可写数组任意组合,'all' / true 全开,false / null 全关。
6515
6662
  * **不写时保留旧行为**:框选只收节点,Ctrl / 多选点击仍可收节点与线路;
6516
6663
  * 写了之后框选与 Ctrl / 多选点击统一按这一份过滤(普通单选与接口 select 不受限制)。
6664
+ * 两个端点口径只影响框选,不会因为写进同一份数组就让 Ctrl 点击去猜端点。
6517
6665
  * 运行时走 updateOptions({ selectionKinds })。
6518
6666
  */
6519
6667
  selectionKinds?: GisViewSelectionKindsInput
@@ -6564,6 +6712,10 @@ export interface GisViewOptions {
6564
6712
  fitPadding?: number
6565
6713
  /** 首次有数据时自动适应视图,默认 true;配了 initialView 时以 initialView 为准 */
6566
6714
  fitOnInit?: boolean
6715
+ /** 首屏中心 [x, y] / { x, y }:initialView.center 的简写;显式给出非空 initialView 时以它为准 */
6716
+ center?: GisViewCoordinate | null
6717
+ /** 首屏绝对比例(像素 / 世界单位):initialView.scale 的简写;显式给出非空 initialView 时以它为准 */
6718
+ scale?: number | null
6567
6719
  /**
6568
6720
  * 初始视图:首次有数据时相机落在哪里。不配就是「适应整个数据范围」。
6569
6721
  * 想一进来就看局部(不要一上来铺满整屏)就写 { center, zoom } 或 { scale }:
@@ -6580,6 +6732,11 @@ export interface GisViewOptions {
6580
6732
  * 读数不需要 60Hz,节流能省下每帧一次的回调与对象分配(拖拽时尤其明显)。
6581
6733
  */
6582
6734
  statsInterval?: number
6735
+ /**
6736
+ * 用户操作空闲阈值(毫秒):根节点上这么久没有指针 / 滚轮 / 键盘活动就发一次 idle,
6737
+ * 每个空闲段只发一次;0 / 不写表示关闭。运行中用 getIdleTime() 读当前空闲时长。
6738
+ */
6739
+ idleTimeout?: number
6583
6740
  /**
6584
6741
  * onRender 的节流间隔(毫秒),默认 400;配 0 与 onStats 同拍
6585
6742
  * (再配上 statsInterval: 0 就是每帧一条)。
@@ -6629,7 +6786,7 @@ export interface GisViewOptions {
6629
6786
  /** 单击要素或空白处 */
6630
6787
  onClick?: (payload: GisViewClickPayload | null) => void
6631
6788
  /** 点中多成员聚合圆:载荷带 count / pointIds / bounds;不会同时触发 onClick,也不改选中集 */
6632
- onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
6789
+ onClusterClick?: (payload: GisViewClusterClickPayload) => void
6633
6790
  /** 双击要素或空白处 */
6634
6791
  onDblClick?: (payload: GisViewClickPayload | null) => void
6635
6792
  /** 点了一下标签(label.editable / lineLabel.editable 打开时):载荷里是这一条标签的类型、下标与当前覆盖 */
@@ -6640,20 +6797,20 @@ export interface GisViewOptions {
6640
6797
  onLabelChange?: (payload: GisViewLabelChangePayload) => void
6641
6798
  /**
6642
6799
  * 在标签上按右键(label.draggable / label.editable 任开一个时):载荷与 onLabelClick 同一份读数,
6643
- * 另带 clientX / clientY(菜单按它定位)与原始 contextmenu 事件。系统菜单按 preventContextMenu 收
6800
+ * 指针位置、按键与修饰键读 originalEvent。系统菜单按 preventContextMenu 收
6644
6801
  */
6645
6802
  onLabelContextMenu?: (payload: GisViewLabelPointerPayload) => void
6646
6803
  /** 双击标签(开关同上):载荷与 onLabelContextMenu 同一份(原始事件是 dblclick) */
6647
6804
  onLabelDblClick?: (payload: GisViewLabelPointerPayload) => void
6648
- /** 左键 / 中键 / 右键按下:命中的要素、按钮与光标位置都在载荷里 */
6649
- onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6805
+ /** 左键 / 中键 / 右键按下:命中的要素与光标位置在载荷里,原生的键 / 修饰键读 payload.originalEvent */
6806
+ onPointerDown?: (payload: GisViewPointerPayload) => void
6650
6807
  /** 左键 / 中键 / 右键抬起:与 onPointerDown 成对 */
6651
- onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6808
+ onPointerUp?: (payload: GisViewPointerPayload) => void
6652
6809
  /**
6653
6810
  * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
6654
6811
  * 载荷另带 channelContext;要自己弹菜单就在这里 preventDefault()。
6655
6812
  */
6656
- onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
6813
+ onContextMenu?: (payload: GisViewPointerPayload) => void
6657
6814
  /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
6658
6815
  onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
6659
6816
  onHover?: (payload: GisViewHoverPayload) => void
@@ -6664,7 +6821,7 @@ export interface GisViewOptions {
6664
6821
  onPointDrag?: (payload: GisViewPointDragPayload) => void
6665
6822
  /**
6666
6823
  * 复制节点:start / move / commit / end / cancel(复制到剪贴板时另有 clipboard)。
6667
- * 在 commit 阶段可以 payload.cancel() 取消、payload.update() / setItem() 改数据,落地后 payload 里带 index 与最新 item
6824
+ * 在 commit 阶段可以 payload.cancel() 取消、payload.update() 改数据,落地后 payload 里带 index 与最新 item
6668
6825
  */
6669
6826
  onPointCopy?: (payload: GisViewPointCopyPayload | GisViewBatchCopyPayload) => void
6670
6827
  /**
@@ -6690,6 +6847,8 @@ export interface GisViewOptions {
6690
6847
  /** 分组变化:拆分 / 合并 / 挪线 / 新建组 / 整份声明换(updateChannel),action.type 说明这一笔是什么 */
6691
6848
  onChannelGroupChange?: (payload: GisViewChannelGroupChangePayload) => void
6692
6849
  onCameraChange?: (camera: GisViewCamera) => void
6850
+ /** 用户操作空闲达到 idleTimeout 时回调一次;恢复操作后再次空闲会重新触发 */
6851
+ onIdle?: (payload: GisViewIdlePayload) => void
6693
6852
  /** 视口尺寸 / 显示比例变化:内置鹰眼图与覆盖层按它重排,自建面板也可以拿它跟着调整 */
6694
6853
  onViewport?: (viewport: GisViewViewport) => void
6695
6854
  onStats?: (stats: GisViewEngineStats) => void
@@ -6840,8 +6999,6 @@ export interface GisViewFocusOptions {
6840
6999
  scale?: number
6841
7000
  /** 显式要求按目标范围适应视图;**缺省不缩放**,只把中心移到目标上 */
6842
7001
  zoom?: boolean
6843
- /** 显式只居中、比例一点不动(与缺省行为一致,保留旧写法) */
6844
- center?: boolean
6845
7002
  /** 按范围适应视图(zoom: true)时四周的留白(CSS 像素),缺省 40 */
6846
7003
  padding?: number
6847
7004
  /** 适应视图(zoom: true)时最多放大到多少比例:单个节点 / 一条直线没有面积,靠它决定要不要放大 */
@@ -7092,6 +7249,12 @@ export type GisViewExportScope = 'all' | 'viewport' | 'selection'
7092
7249
  export interface GisViewExportDataOptions extends GisViewExportFilterOptions {
7093
7250
  /** 导出范围,缺省 'all';selected / visible 之类的同义词在运行时也认 */
7094
7251
  scope?: GisViewExportScope
7252
+ /**
7253
+ * 只对 scope: 'viewport' 生效的类型过滤:写法与 options.selectionKinds 相同。
7254
+ * 不写时沿用视口导出的旧口径;写 'lineEndpoints' / 'channelEndpoints' 时,
7255
+ * 只有两端节点都落在视口世界矩形内的独立线路 / 通道才会导出(端点模式不会顺带导出节点)。
7256
+ */
7257
+ selectionKinds?: GisViewSelectionKindsInput
7095
7258
  /**
7096
7259
  * 要哪一套:'view'(缺省,节点 / 线路 / 通道 / 拐点分组四份,JS 风格的键名)/
7097
7260
  * 'new'(new.json 口径的整份:station_data + channel_data + 四至范围那几列)/
@@ -7470,6 +7633,8 @@ export interface GisViewSceneSnapshot {
7470
7633
  regions: GisViewSceneRegion[]
7471
7634
  /** 数据线路与节点装饰连接线(连接线也画在节点 / 装饰之前) */
7472
7635
  lines: GisViewSceneLine[]
7636
+ /** 抬层的选中线路:画在普通节点之后、抬层节点之前 */
7637
+ raisedLines: GisViewSceneLine[]
7473
7638
  points: GisViewSceneNode[]
7474
7639
  clusters: GisViewSceneCluster[]
7475
7640
  backgroundPoints: GisViewSceneNode[]
@@ -7679,8 +7844,8 @@ export interface GisViewInstance {
7679
7844
  zoomToBounds(bounds: GisViewBounds, padding?: number): GisViewInstance
7680
7845
  /**
7681
7846
  * 把视角移到目标上(见 GisViewFocusTargets):一个或一批都行,一批时取整体包围盒 ——
7682
- * 搜到三个节点就是这三个点之间的中心当屏幕中心。`{ center: true }` 只居中不改比例、
7683
- * `{ scale }` 按给定比例居中、缺省按范围适应视图(`padding` / `maxZoom` 可调),
7847
+ * 搜到三个节点就是这三个点之间的中心当屏幕中心。缺省只居中、比例不变;`{ zoom: true }`
7848
+ * 按目标范围适应视图(`padding` / `maxZoom` 可调),`{ scale }` 按给定比例居中,
7684
7849
  * `{ select: true, mode }` 顺手把这些要素选上。认不出目标时什么都不做,返回实例便于链式调用。
7685
7850
  */
7686
7851
  focusOn(target: GisViewFocusTargets, options?: GisViewFocusOptions): GisViewInstance
@@ -7706,11 +7871,21 @@ export interface GisViewInstance {
7706
7871
  searchAsync(input: string | GisViewSearchOptions): Promise<GisViewSearchResult>
7707
7872
  setCamera(camera: Partial<GisViewCamera>): GisViewInstance
7708
7873
  getCamera(): GisViewCamera
7874
+ /** 当前视图比例(像素 / 世界单位),与 getCamera().scale 同一份读数 */
7875
+ getScale(): number
7876
+ /** 直接设置视图比例;origin 是画布 CSS 像素锚点,缺省为视口中心 */
7877
+ setScale(scale: number, origin?: [number, number]): GisViewInstance
7878
+ /** 当前视图中心 [x, y](返回副本,可直接改) */
7879
+ getCenter(): [number, number]
7880
+ /** 只移动视图中心、保持当前比例;返回 this 以便链式调用 */
7881
+ setCenter(center: [number, number]): GisViewInstance
7709
7882
  getBounds(): GisViewBounds
7710
7883
  /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
7711
7884
  getZoomBaseScale(): number
7712
7885
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),之后放大缩小都从它算倍数,返回 this */
7713
7886
  setZoomBaseScale(scale?: number): GisViewInstance
7887
+ /** 距离创建或上一次指针 / 滚轮 / 键盘操作的毫秒数;程序化 API 调用不重置它 */
7888
+ getIdleTime(): number
7714
7889
  /** 鹰眼图根节点(没配 minimap 时为 null):拖动整张图 / 绑定自定义手势时拿它 */
7715
7890
  getMinimapElement(): HTMLElement | null
7716
7891
  /** 鹰眼图自身的倍数:1 是「刚好铺满小图」 */
@@ -7813,7 +7988,7 @@ export interface GisViewInstance {
7813
7988
  * 程序化悬停(参数就是鼠标事件里的 clientX / clientY):让指针「停」到这个位置上 ——
7814
7989
  * 悬停高亮、光标与 onHover 都按它更新(外部列表 / 表格 hover 到某一行时联动高亮图上的要素)。
7815
7990
  * 不走悬停阈值,也不用先订阅一遍事件再把最近一次载荷记住;那儿没有命中要素时返回 null。
7816
- * 返回的读数与 onHover 载荷同一份(action / selection / lngLat 都补齐了)。想撤掉用 clearHover()
7991
+ * 返回的读数与 onHover 载荷同一份(action / lngLat 都补齐了)。想撤掉用 clearHover()
7817
7992
  */
7818
7993
  hoverAt(clientX: number, clientY: number): GisViewHoverPayload | null
7819
7994
  /** 取消程序化悬停:清掉高亮与读数并补发一条 onHover(null);没有悬停着的东西时什么都不做 */
@@ -7861,8 +8036,18 @@ export interface GisViewInstance {
7861
8036
  * onSelect 与 onSelectChange(cause: api)。
7862
8037
  */
7863
8038
  deselect(refs?: GisViewSelectionRefs): GisViewInstance
7864
- /** 当前选中集的原始条目(`{ type, index, item, ... }`,与指针载荷同一份口径),不做整理、不读包围盒 */
8039
+ /**
8040
+ * 当前选中集的原始条目(`{ type, index, item, ... }`),不做整理、不读包围盒。
8041
+ * 通道回线不带 channelId / channelIndex / groupId / groups;归属看选中事件的顶层
8042
+ * lineIndexes / channelContexts,或对单条线路调 getLineChannel()。
8043
+ */
7865
8044
  getSelections(): GisViewPickResult[]
8045
+ /**
8046
+ * 当前选中集的轻量计数:ids / count / points / lines / channels,与 onSelectChange 顶层的同名字段
8047
+ * 是同一份口径(通道回线按通道算一个)。指针 / 点击 / 悬停载荷不再重复挂 selection,需要这份读数时调它;
8048
+ * 结果按选中集引用缓存,十万级选中下也只是一次读取。要要素对象或包围盒时再用 getSelectionData()。
8049
+ */
8050
+ getSelectionInfo(): GisViewSelectionInfo
7866
8051
  /**
7867
8052
  * 这一个要素在不在当前选中集里:`isSelected('p-1')` 按 id 问、
7868
8053
  * `isSelected({ type: 'point', index: 3 })` 按下标问。
@@ -7873,7 +8058,7 @@ export interface GisViewInstance {
7873
8058
  /**
7874
8059
  * 当前画布上选中的数据(一次取全):ids / count 与各类型条数(通道回线按通道算一个)、
7875
8060
  * 要素本身 points / lines / channels 三个数组、下标清单 pointIndexes / lineIndexes、
7876
- * items(与 getSelections() 同一份)与世界包围盒 bounds(空选中时 null)。
8061
+ * items(与 getSelections() 同一份,通道回线不重复挂通道字段)与世界包围盒 bounds(空选中时 null)。
7877
8062
  * 单击、Ctrl 多选、框选与接口选中(selectFeatures / selectInBox)都是同一份 state,不挑选中来源;
7878
8063
  * bounds 走一次 getElementBounds(十万级选中下约 5 ms),只想问「选了哪几个」用 getSelections() 更省
7879
8064
  */
@@ -7895,7 +8080,7 @@ export interface GisViewInstance {
7895
8080
  commitPointCopy(): GisViewPointCopyPayload | null
7896
8081
  /** 取消复制:预览撤掉,数据一直没动过 */
7897
8082
  cancelPointCopy(): GisViewPointCopyPayload | null
7898
- /** 改预览节点的数据(等价于回调里的 payload.update / setItem),返回改完的节点 */
8083
+ /** 改预览节点的数据(等价于回调里的 payload.update),返回改完的节点 */
7899
8084
  updateCopyPoint(patch: Partial<GisViewPoint>): GisViewPoint | null
7900
8085
  /** 当前复制状态:预览中 / 等选点;没有就返回 null */
7901
8086
  getPointCopy(): GisViewPointCopyState | null
@@ -7926,22 +8111,27 @@ export interface GisViewInstance {
7926
8111
  getPointClipboard(): GisViewClipboardItem | null
7927
8112
  /**
7928
8113
  * 把来源节点并进目标节点(接口调用):来源 / 目标收 id、下标或 `{ id }` / `{ index }`。
7929
- * 节点数据按 merge.createItem 合并(缺省目标优先、来源独有的字段带过来,尺寸取双方最大、图标优先目标),
8114
+ * 节点数据按 merge.createItem 合并(缺省以目标节点为底,merge.maxKeys 列出的字段取双方最高值,
8115
+ * 尺寸取双方最大、图标取目标),
7930
8116
  * 绑在来源上的线路改绑到目标,合并后自环 / 零长度的线路与两端相同的通道一起删掉,
7931
8117
  * 撞成同一条的通道按 merge.channelGroups 决定分组(缺省各自保留);
8118
+ * 保留节点写完整 mergeInfo 快照,受影响通道写轻量 mergeInfo,供 splitPoint 自动解除合并;
7932
8119
  * options.item 可以给一份已经改好的合并结果(confirm 阶段改过 payload.item 之后就是它);
7933
8120
  * 返回 `{ ok, item, linesChanged, removedLines, removedChannels, mergedChannels }`,
7934
8121
  * 并不了返回 ok: false 并另发一条 `phase: 'merge', ok: false` 的事件
7935
8122
  */
7936
8123
  mergePoints(source: GisViewPointRef, target: GisViewPointRef, options?: { originalEvent?: Event | null; item?: GisViewPoint }): GisViewMergeOutcome
7937
8124
  /**
7938
- * 把一个节点拆成多份(mergePoints 的逆操作):第一份复用原下标与 id,其余追加到 points 末尾。
7939
- * 每份可直接写节点字段或放进 item;lines 分配线路(不写时连在原节点上的线路跟第一份),
8125
+ * 把一个节点拆成多份(mergePoints 的逆操作):parts 省略 / null / [] 且节点带 mergeInfo 时自动解除合并,
8126
+ * 恢复全部来源节点与合并前的线路 / 通道;给 parts 时第一份复用原下标与 id,其余追加到 points 末尾。
8127
+ * 每份可直接写节点字段或放进 item;lines 显式分配线路,没写时默认跟第一份,
8128
+ * options.autoLines 为 'alternate' 时按「通道成组、独立线路单条」轮流分给负载最少的一份(解除合并推荐)。
7940
8129
  * channels / channelFrom / channelTo 分配受影响通道的端点。没显式分配的通道跟随它第一条被分配过的成员线路。
7941
8130
  * 拆分后自环 / 零长度线路与两端相同的通道删掉;整次调用只记一条历史、只发一条 `splitPoint` 数据变更。
7942
- * 返回 `{ ok, items, indexes, pointIds, linesChanged, removedLines, channelsChanged, removedChannels, changes, skipped }`
8131
+ * 返回 `{ ok, items, indexes, pointIds, linesChanged, removedLines, channelsChanged, removedChannels,
8132
+ * autoLines, autoAssignedLines, lineAssignments, autoRestored, mergeSourceIds, changes, skipped }`
7943
8133
  */
7944
- splitPoint(source: GisViewPointRef, parts: GisViewSplitPointPart[], options?: GisViewSplitPointOptions): GisViewSplitPointOutcome
8134
+ splitPoint(source: GisViewPointRef, parts?: GisViewSplitPointPart[] | null, options?: GisViewSplitPointOptions): GisViewSplitPointOutcome
7945
8135
  /**
7946
8136
  * 框选 / 多选之后一步把选中的节点并到一个目标上(接口调用):不指定 target 就自动挑「绑定线路最多」的那一个
7947
8137
  * (一样多取画得大的、再一样取下标小的);来源默认是除目标之外的选中节点,也可以直接用 options.sources 给定,
@@ -8073,10 +8263,18 @@ export interface GisViewInstance {
8073
8263
  * (phase: 'ready',载荷里带两个节点、hasChannel / hasGroup / groups / channel 与可选方案)。
8074
8264
  * 它只负责这条可视化示例路径 —— 真正的落地必须用 addChannel(或 addChannelGroupLines /
8075
8265
  * joinChannelGroupLines / addLine),不在事件里落地就用 endAddChannel / cancelAddChannel 收掉假通道。
8076
- * options.kind 为 'line' 时改成「新建独立线路」(不挂通道),options.circuits 决定一次加几回,
8077
- * options.select 打开「点节点时让节点选中」,options.handoff 让 ready 之后草稿自动收掉
8266
+ * 新建独立线路请用 beginAddLine;options.circuits 决定一次加几回,
8267
+ * options.select 打开「点节点时让节点选中」,options.handoff 让 ready 之后草稿自动收掉。
8268
+ * options.singleChannel 打开单一通道模式;已有通道时 existingChannel 为 block / newGroup / joinGroup,
8269
+ * joinGroup 用 groupId / groupIndex 指名分组。没有已有通道时仍按新通道落地
8078
8270
  */
8079
8271
  beginAddChannel(options?: GisViewChannelDraftOptions): GisViewInstance
8272
+ /**
8273
+ * 进入「新增线路」草稿:拾取、预览、连续新增和 beginAddChannel 同一套,kind 恒为 line。
8274
+ * 不写 existingChannel 时只新建独立线路;写 newGroup / joinGroup 时,如果两端已有通道,就把这次
8275
+ * 新建的回线放进新分组或指定分组(joinGroup 用 groupId / groupIndex 指名)。
8276
+ */
8277
+ beginAddLine(options?: GisViewChannelDraftOptions): GisViewInstance
8080
8278
  /** 当前新增通道草稿:两个节点的信息与可选方案,没有草稿时为 null */
8081
8279
  getAddChannelDraft(): GisViewChannelDraftPayload | null
8082
8280
  /** 改当前草稿的预览样式(字段级合并,传 null 回到全局 channelDraftStyle);没有草稿时什么也不做 */
@@ -8088,21 +8286,18 @@ export interface GisViewInstance {
8088
8286
  /** 结束新增草稿并收掉视图上的示例假通道 / 线路(静默,不补 cancel):提前结束不新建就用它 */
8089
8287
  endAddChannel(): GisViewInstance
8090
8288
  /**
8091
- * 提交已 ready 的新增草稿(autoCommit 时由组件内部调用)。input 有五类写法:
8289
+ * 提交已 ready 的新增草稿(autoCommit 时由组件内部调用)。input 只有一类写法:
8092
8290
  * 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, ... }。
8291
+ * 2. 对象:{ channel, line, lines, lineData, channelGroups, group, channelProps, lineProps, resolution, ... }。
8097
8292
  *
8098
- * 字段优先级:from / to = 顶层 → channel → line → lineItems 中第一个对象项 → 草稿;
8293
+ * 字段优先级:from / to = 顶层 → channel → line → lines 中第一个对象项 → 草稿;
8099
8294
  * path = 顶层 → line → channel → 草稿;分组 = channelGroups → group → channel.groups;
8100
- * 容器 lineProps = 草稿 → 顶层 → line.lineProps → lines[i](不读 channel.lineProps);
8101
- * channelProps = 草稿 → channel 上的业务字段 → 顶层 channelProps。直接通道对象自己的 lineProps 会生效。
8295
+ * lineProps = 草稿 → 顶层 → line.lineProps → lines[i];channelProps = 草稿 → channel 上的业务字段 → 顶层 channelProps。
8102
8296
  *
8103
- * 直接通道默认新建;要并进已有通道 / 分组,用容器并显式写 resolution。
8297
+ * 要并进已有通道 / 分组,显式写 resolution;直接通道 / 线路对象不再接受,请放进 channel / line。
8104
8298
  * ready 里的方案对象带 enabled / count / lineIds 等读数,不能整条回传,只取
8105
8299
  * `{ type, groupId, groupIndex, channelId }` 子集。调用前草稿必须 ready,否则返回 ok: false 且不写数据。
8300
+ * options.select 为 true 时落地后选中这次新建的全部回线,缺省不动选中集。
8106
8301
  *
8107
8302
  * ```ts
8108
8303
  * view.commitAddChannel({
@@ -8113,8 +8308,8 @@ export interface GisViewInstance {
8113
8308
  * ```
8114
8309
  */
8115
8310
  commitAddChannel(
8116
- input?: GisViewChannelAddInput['resolution'] | GisViewChannel | GisViewLine | GisViewChannelAddCommitInput,
8117
- options?: { auto?: boolean; continuous?: boolean; originalEvent?: Event | null }
8311
+ input?: GisViewChannelAddCommitInput,
8312
+ options?: { auto?: boolean; continuous?: boolean; originalEvent?: Event | null; select?: boolean }
8118
8313
  ): GisViewChannelAddResult
8119
8314
  /** 两个节点之间的新增方案:新通道 / 新分组 / 并进某一组 / 无法添加(kind 为 'line' 时方案表是空的) */
8120
8315
  getChannelAddOptions(from: string | number, to: string | number, count?: number, kind?: 'channel' | 'line'): GisViewChannelAddPlan | null
@@ -8125,55 +8320,56 @@ export interface GisViewInstance {
8125
8320
  */
8126
8321
  getChannelBetween(from: string | number, to: string | number): GisViewChannelBetween | null
8127
8322
  /**
8128
- * 程序化新增一个通道(新签名):第一段是通道信息 `{ from, to, name, id }`,第二段是线路数组 line_data ——
8129
- * 每条按自己的 id 建进通道(id 自动成为 lineIds),第三段是可选的分组信息。只负责新建一个通道:
8130
- * 两个节点之间已经有通道时整条失败(reason 指路 addChannelGroupLines / joinChannelGroupLines,
8131
- * 结果里的 plan 带着 hasChannel / hasGroup / groups / channel)。第二段 / 第三段显式给了
8132
- * (或对象上写 `lineData` / `group`)才走这条新路;只写 `{ from, to }` 的老调用照旧按方案表分流
8323
+ * 一组节点之间的直接通道 / 线路:两端都必须真实存在且都在传入的 id 集合里,
8324
+ * 只认通道端点或线路 from / to 的直接绑定,不沿线路穿中间节点,也不返回集合外的边。
8325
+ * 通道按 channels 顺序、线路按 lines 顺序;一条都没命中时返回空数组。
8133
8326
  */
8134
- addChannel(channel: GisViewChannelAddSpec, lineData?: GisViewChannelLineData, group?: GisViewChannelAddGroup | GisViewChannelAddGroup[]): GisViewChannelAddResult
8327
+ getDirectConnections(pointIds: string | number | Array<string | number>): GisViewDirectConnection[]
8135
8328
  /**
8136
- * 新增通道 / 回线的旧写法(circuits / resolution / channelId / kind 那套):与从前完全一致 ——
8137
- * 按方案表挑新通道 / 新分组 / 并入某组,kind 为 'line' 时加独立线路,circuits 是一次几回,
8138
- * lineItems 是「连同线路一起新建」的第二段(一条或一批逐条属性,给了几条就建几条;
8139
- * 每项也可以只写一个 id —— 裸字符串 / 数字按 { id } 收,与第二段 line_data 同一份口径)
8329
+ * 程序化新增一个通道:第一段是通道信息 `{ from, to, name, id, path, routing, channelProps }`,第二段是线路数据 ——
8330
+ * 每条按自己的 id 建进通道(id 自动成为 lineIds),第三段是可选的分组信息。只负责新建一个通道:
8331
+ * 两个节点之间已经有通道时整条失败(reason 指路 addChannelGroupLines / joinChannelGroupLines,
8332
+ * 结果里的 plan 带着 hasChannel / hasGroup / groups / channel)。第二段不写时建一条自动编号回线;
8333
+ * options.select 为 true 时落地后选中新回线,options.emit: false 时不发数据变更。
8140
8334
  */
8141
- addChannel(input: GisViewChannelAddInput, lineItems?: GisViewChannelLineItems): GisViewChannelAddResult
8335
+ addChannel(channel: GisViewChannelAddSpec, lineData?: GisViewChannelLineData, group?: GisViewChannelAddGroup | GisViewChannelAddGroup[], options?: { emit?: boolean; select?: boolean }): GisViewChannelAddResult
8142
8336
  /**
8143
8337
  * 在已有通道里新加一组回线(原 addChannel 的 newGroup 那一支):第二段是这次新建的线路数组 line_data,
8144
8338
  * 第三段可选 `{ id?, path? }` 给新分组的 id 与中间拐点(缺省 `${通道 id}::N`、不带拐点)
8145
8339
  */
8146
- addChannelGroupLines(channelId: string | number, lineData?: GisViewChannelLineData, group?: GisViewChannelAddGroup): GisViewChannelAddResult
8340
+ addChannelGroupLines(channelId: string | number, lineData?: GisViewChannelLineData, group?: GisViewChannelAddGroup, options?: { emit?: boolean; select?: boolean }): GisViewChannelAddResult
8147
8341
  /**
8148
- * 在已有通道里一次新加多组回线:每一项 `{ id?, path?, lineData | lines | lineItems }`,
8342
+ * 在已有通道里一次新加多组回线:每一项 `{ id?, path?, lineData | lines }`,
8149
8343
  * 逐组落地但只记一步历史、只发一条 addChannelGroups 数据变更
8150
8344
  */
8151
- addChannelGroups(channelId: string | number, groups: GisViewChannelAddGroupInput | GisViewChannelAddGroupInput[], options?: { emit?: boolean; label?: string }): GisViewAddChannelGroupsResult
8345
+ addChannelGroups(channelId: string | number, groups: GisViewChannelAddGroupInput | GisViewChannelAddGroupInput[], options?: { emit?: boolean; select?: boolean; label?: string }): GisViewAddChannelGroupsResult
8152
8346
  /**
8153
8347
  * 把新回线并进已有通道的某一组(原 addChannel 的 joinGroup 那一支):groupId 认分组 id,也认序号
8154
8348
  * (从 0 起、按声明顺序),不给就并进第一个还有余量的分组;第三段是这次新建的线路数组 line_data
8155
8349
  */
8156
- joinChannelGroupLines(channelId: string | number, groupId: string | number | undefined, lineData?: GisViewChannelLineData): GisViewChannelAddResult
8350
+ joinChannelGroupLines(channelId: string | number, groupId: string | number | undefined, lineData?: GisViewChannelLineData, options?: { emit?: boolean; select?: boolean }): GisViewChannelAddResult
8157
8351
  /**
8158
- * 程序化新增一条独立线路(不挂通道):等价于 addChannel({ ...input, kind: 'line' }),第二段线路数据同样认 ——
8159
- * 每条可以只写一个 id(裸字符串 / 数字按 { id } 收)、写对象给逐条字段,也可以完全不给(按 from-to-序号自动编号)
8352
+ * 程序化新增独立线路(不挂通道):第一段给 from / to / name / id / lineProps / path / routing,
8353
+ * 第二段是线路数据(一条或一批,可以只写 id),不写就建一条按 from-to-序号自动编号的线路。
8354
+ * 落地走追加式引擎路径;options.select 为 true 时选中新回线,options.emit: false 时不发数据变更。
8160
8355
  */
8161
- addLine(input: GisViewChannelAddInput, lineItems?: GisViewChannelLineItems): GisViewChannelAddResult
8356
+ addLine(input: GisViewLineAddSpec, lineData?: GisViewChannelLineData, options?: { emit?: boolean; select?: boolean }): GisViewChannelAddResult
8162
8357
  /**
8163
- * 一次新增多条通道 / 独立线路(addChannel 的批量版,每条写法一致):逐条落地,但只重排一次场景、
8358
+ * 一次新增多条通道(addChannel 的批量版,每条写法一致):逐条落地,但只重排一次场景、
8164
8359
  * 只记一步历史、只发一条 `addChannels` 数据变更 —— 切场景时把接口里的通道一批批补进来用它。
8165
- * `results` 与传入顺序一一对应,失败条目在自己的 reason 里说明原因;options.emit 传 false 时不发数据变更
8360
+ * `results` 与传入顺序一一对应,失败条目在自己的 reason 里说明原因;options.emit 传 false 时不发数据变更,
8361
+ * options.select 为 true 时最后一次性选中全部新回线
8166
8362
  */
8167
- addChannels(input: GisViewChannelAddInput | GisViewChannelAddInput[], options?: { emit?: boolean }): GisViewAddChannelsResult
8363
+ addChannels(input: GisViewChannelAddSpec | GisViewChannelAddSpec[], options?: { emit?: boolean; select?: boolean }): GisViewAddChannelsResult
8168
8364
  /**
8169
8365
  * 往数据末尾追加一个节点 / 一批节点 / 一批线路(批量导入、从别处拷过来、按坐标补几条):
8170
8366
  * 老数据一个都不动,返回 `{ ok, count, indexes, items }`(单条时另有 index 与 item)。
8171
8367
  * 与 addChannel / addLine 的分工:那两条走「通道 / 草稿」那一套,这里是把现成的数据对象接在
8172
- * points / lines 后面。options.emit 传 false 时不发数据变更
8368
+ * points / lines 后面。options.emit 传 false 时不发数据变更;options.select 为 true 时选中新要素
8173
8369
  */
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>
8370
+ addPoint(item: GisViewPoint, options?: { emit?: boolean; select?: boolean }): GisViewAddPointResult
8371
+ addPoints(items: GisViewPoint | GisViewPoint[], options?: { emit?: boolean; select?: boolean }): GisViewAddItemsResult<GisViewPoint>
8372
+ addLines(items: GisViewLine | GisViewLine[], options?: { emit?: boolean; select?: boolean }): GisViewAddItemsResult<GisViewLine>
8177
8373
  /** 移除一条线路(撤销刚落地的新增线路):挂在通道上的回线会从通道声明里一起摘掉,通道空了整条删掉 */
8178
8374
  removeLine(lineId: string | number): GisViewRemoveLineResult
8179
8375
  /** 一次移除多条线路(传数组):通道声明与分组跟着收拾,删空的通道整条走 */
@@ -8516,6 +8712,8 @@ export interface GisViewEngineOptions {
8516
8712
  channelMaxGroups?: number
8517
8713
  /** 一个分组最多几条回线(0 表示不限):新增通道时据此判断还能不能并进这一组 */
8518
8714
  channelGroupMaxLines?: number
8715
+ /** 通道简略:分组回线数超过阈值时只画一条代表线,见 GisViewChannelSimplifyOptions */
8716
+ channelSimplify?: boolean | GisViewChannelSimplifyOptions
8519
8717
  /** 新增通道草稿线的样式(跟随光标的那条预览线) */
8520
8718
  channelDraftStyle?: GisViewChannelDraftStyle
8521
8719
  /** WebGL 自定义层:与 GisViewOptions.webglLayers 同一份写法 */
@@ -8659,16 +8857,16 @@ export interface GisViewEngineOptions {
8659
8857
  onSelect?: (payload: GisViewSelectPayload | null, detail?: { mode?: 'single' | 'multi' | 'box'; originalEvent?: Event | null; defer?: boolean }) => void
8660
8858
  onClick?: (payload: GisViewClickPayload | null) => void
8661
8859
  /** 点中多成员聚合圆(引擎不选中成员,普通点击回调不会同时触发) */
8662
- onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
8860
+ onClusterClick?: (payload: GisViewClusterClickPayload) => void
8663
8861
  onDblClick?: (payload: GisViewClickPayload | null) => void
8664
- /** 左键 / 中键 / 右键按下与抬起:命中的要素、按钮与光标位置都在载荷里 */
8665
- onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
8666
- onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
8862
+ /** 左键 / 中键 / 右键按下与抬起:命中的要素与光标位置在载荷里,原生的键 / 修饰键读 payload.originalEvent */
8863
+ onPointerDown?: (payload: GisViewPointerPayload) => void
8864
+ onPointerUp?: (payload: GisViewPointerPayload) => void
8667
8865
  /**
8668
8866
  * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
8669
8867
  * 载荷另带 channelContext(几组 / 当前哪组 / 能做什么),不再有单独的通道路由。
8670
8868
  */
8671
- onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
8869
+ onContextMenu?: (payload: GisViewPointerPayload) => void
8672
8870
  /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
8673
8871
  onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
8674
8872
  onPointDrag?: (payload: GisViewPointDragPayload) => void
@@ -8705,8 +8903,8 @@ export interface GisViewEngine {
8705
8903
  describeAll(selection: GisViewFeatureKey[]): GisViewPickResult[]
8706
8904
  /** 批量还原并补通道上下文:单通道摊平 channelId / group / groups,多通道给 channelContexts */
8707
8905
  describeSelection(selection: GisViewFeatureKey[], preferredGroupId?: string | number): GisViewDescribedSelection
8708
- /** 按画布 CSS 像素矩形框选,返回框内要素;第二段兼容旧的 Event 或 { selectionKinds, originalEvent } */
8709
- selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions | Event | null): GisViewPickResult[]
8906
+ /** 按画布 CSS 像素矩形框选,返回框内要素 */
8907
+ selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions): GisViewPickResult[]
8710
8908
  /** 拐点增删改,insertIndex 缺省时按直线上离目标最近的线段插入 */
8711
8909
  insertWaypoint(lineIndex: number, coordinate: GisViewCoordinate, insertIndex?: number): GisViewWaypointPayload | null
8712
8910
  /** 删除指定线路上的拐点 */
@@ -8784,15 +8982,24 @@ export interface GisViewEngine {
8784
8982
  beginChannelDraft(options?: GisViewChannelDraftOptions): GisViewChannelDraftPayload | null
8785
8983
  /** 当前草稿:两个节点的信息与可选方案,没有草稿时为 null */
8786
8984
  getChannelDraft(): GisViewChannelDraftPayload | null
8787
- /** 连续新增:一段落地之后原地重开一段草稿(chain 为 true 时以上一段终点当新起点,也可以换 kind / circuits) */
8985
+ /** 连续新增:一段落地之后原地重开一段草稿(chain 为 true 时以上一段终点当新起点) */
8788
8986
  restartChannelDraft(options?: {
8789
8987
  chain?: boolean
8790
- kind?: 'channel' | 'line'
8988
+ /** 重开上一段时也可以预指定起点(与 beginChannelDraft 的 from 同一份写法) */
8989
+ from?: GisViewPointRef
8990
+ singleChannel?: boolean
8991
+ existingChannel?: GisViewChannelExistingMode
8992
+ groupId?: string | number
8993
+ groupIndex?: number
8791
8994
  circuits?: number
8995
+ /** 换这一段草稿的第二段线路数据;给了几条就按几条对齐 circuits */
8996
+ lineData?: GisViewChannelLineData
8792
8997
  /** 换这一段草稿的预览样式(字段级合并;null 回到全局 channelDraftStyle,不传就沿用) */
8793
8998
  channelDraftStyle?: GisViewChannelDraftStyle | null
8794
8999
  /** 换一份逐条回线的属性(不传就沿用这一段草稿原来的) */
8795
9000
  linePropsByMember?: Array<Partial<GisViewLine> | undefined>
9001
+ routing?: 'straight' | 'orthogonal'
9002
+ path?: GisViewCoordinate[]
8796
9003
  /** 换这一段草稿的交接模式(不传就沿用) */
8797
9004
  handoff?: boolean
8798
9005
  /** 换这一段草稿的「点节点时让节点选中」(不传就沿用) */
@@ -8961,9 +9168,6 @@ export declare const FEATURE_NAMES: GisViewFeatureName[]
8961
9168
  /** 预设表:键是开关名、值是布尔;**没列出来的开关取 featureDefault**(全关;「配了才有」的那几项不给值) */
8962
9169
  export declare const FEATURE_PRESETS: Record<GisViewFeaturePreset, GisViewFeatures>
8963
9170
 
8964
- /** 编辑类开关(会改数据的那几项)的名单:文档与面板按它分组;与查看类一样缺省全关,这一列只说明分类 */
8965
- export declare const FEATURE_EDIT_NAMES: GisViewFeatureName[]
8966
-
8967
9171
  /** 单个开关的缺省值:**全关**(false);「配了才有」的那几项 undefined(跟随详细配置,配了就等于手动打开) */
8968
9172
  export declare const featureDefault: (name: GisViewFeatureName) => boolean | undefined
8969
9173