gis-view-webgl2 0.1.8 → 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 (48) hide show
  1. package/README.md +7 -5
  2. package/dist/gis-view.css +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +214 -14
  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 -547
  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 -526
  10. package/docs/demos/BasicDemo.vue +142 -25
  11. package/docs/demos/BatchAddDemo.vue +127 -1
  12. package/docs/demos/ChannelDemo.vue +61 -0
  13. package/docs/demos/CopyMergeDemo.vue +125 -36
  14. package/docs/demos/EventDemo.vue +12 -4
  15. package/docs/demos/api-index.js +26 -16
  16. package/docs/format/02-/350/212/202/347/202/271/344/270/216/347/272/277/350/267/257.md +1 -0
  17. package/docs/format/04-/351/200/232/351/201/223/344/270/216/346/240/207/347/255/276.md +3 -0
  18. package/docs/index.html +136 -13
  19. 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
  20. package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +82 -14
  21. package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +2 -1
  22. 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
  23. 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 +48 -11
  24. package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +8 -4
  25. package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +57 -0
  26. package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +26 -3
  27. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +34 -1
  28. package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +5 -2
  29. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +13 -10
  30. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +14 -8
  31. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +43 -3
  32. package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +3 -1
  33. 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 +5 -2
  34. package/docs/steps/README.md +200 -121
  35. package/docs/steps/index.html +216 -0
  36. package/docs/steps/selftest-demos.html +209 -31
  37. package/docs/steps/selftest-docs.html +17 -6
  38. package/docs/steps/selftest-features.html +311 -3
  39. package/docs/steps/selftest-labels.html +81 -0
  40. package/docs/steps/selftest-perf.html +31 -3
  41. package/docs/steps/selftest-select.html +51 -1
  42. 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
  43. package/package.json +1 -1
  44. 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
  45. 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
  46. 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
  47. 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
  48. 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
  * 配了之后每个分组有自己的成员与拐点,拆分 / 合并的结果也会写在这里;
@@ -1797,6 +1809,38 @@ export interface GisViewChannelBetween {
1797
1809
  currentGroupId: string | number | null
1798
1810
  }
1799
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
+
1800
1844
  /** 新增通道草稿的配置:beginAddChannel 用 */
1801
1845
  export interface GisViewChannelDraftOptions {
1802
1846
  /** 两个节点一选完就自动提交,不用再调 commitAddChannel */
@@ -3523,7 +3567,8 @@ export interface GisViewPointMergePayload {
3523
3567
  /** 合并后保留谁:'target'(缺省,碰撞目标)或 'source'(当前拖动的来源节点);确认时传 confirm({ keep }) */
3524
3568
  keep: GisViewMergeKeep
3525
3569
  /**
3526
- * confirm 阶段的合并结果(按 keep 决定的保留端优先、另一端独有字段带过来、尺寸取双方最大、图标优先保留端):
3570
+ * confirm 阶段的合并结果(按 keep 决定的保留端业务字段优先、merge.maxKeys 列出的字段取双方最高值、
3571
+ * 尺寸取双方最大、图标用保留端):
3527
3572
  * 改它就是改合并结果;其余阶段为 null。confirm({ item }) 可以只给要改的字段,组件先算缺省结果再合并这份补丁
3528
3573
  */
3529
3574
  item: GisViewPoint | null
@@ -3624,7 +3669,7 @@ export type GisViewMergeSelectedOutcome = GisViewMergeSelectedPayload
3624
3669
 
3625
3670
  /** mergeSelectedPoints 改写每一对最终节点时的上下文:merged / item 是缺省合并结果 */
3626
3671
  export interface GisViewMergeSelectedItemContext {
3627
- /** 缺省合并结果(目标优先、来源独有字段带过来) */
3672
+ /** 缺省合并结果(保留节点的业务字段优先,merge.maxKeys 列出的字段取双方最高值) */
3628
3673
  item: GisViewPoint
3629
3674
  /** item 的别名 */
3630
3675
  merged: GisViewPoint
@@ -3684,6 +3729,11 @@ export interface GisViewSplitPointOptions {
3684
3729
  * 解除合并时推荐用它
3685
3730
  */
3686
3731
  autoLines?: 'first' | 'alternate'
3732
+ /**
3733
+ * 拆分 / 自动解除合并后是否选中结果节点:缺省 false(只移除来源节点的选中态,不动其它无关选中);
3734
+ * true 时选中 parts 对应的全部节点
3735
+ */
3736
+ select?: boolean
3687
3737
  }
3688
3738
 
3689
3739
  /** 拆分时没认出来的线路 / 通道引用 */
@@ -3738,6 +3788,10 @@ export interface GisViewSplitPointOutcome {
3738
3788
  autoAssignedLines: number
3739
3789
  /** 每一份最终接到哪些线路(含显式分配与自动分配) */
3740
3790
  lineAssignments: GisViewSplitPointLineAssignment[]
3791
+ /** 这次是否走了 mergeInfo 自动解除合并(省略 parts 且节点带合并记录时为 true) */
3792
+ autoRestored: boolean
3793
+ /** 自动解除时恢复的全部来源节点 id(手工拆分时为空数组) */
3794
+ mergeSourceIds: Array<string | number | null>
3741
3795
  changes: GisViewSplitPointChangeSet | null
3742
3796
  }
3743
3797
 
@@ -4195,6 +4249,18 @@ export interface GisViewItemLabel {
4195
4249
  offset?: [number, number]
4196
4250
  /** 内联样式(与配置里的 style 一层合并,改字号不会把底色清掉) */
4197
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
4198
4264
  /** 线路标签是否与线路方向平行(点的标签忽略这一项) */
4199
4265
  parallel?: boolean
4200
4266
  /** 这一条是否参与避让:false 时即使全局开启 labelOptimize / avoidOverlap 也始终按候选落点画出;缺省跟随全局 */
@@ -4296,6 +4362,12 @@ export interface GisViewLabelOptions {
4296
4362
  className?: string
4297
4363
  /** 标签的内联样式 */
4298
4364
  style?: Record<string, string>
4365
+ /** 标签层级:越大越靠上;不写时是 0 */
4366
+ zIndex?: number
4367
+ /** 跟随节点样式链里的 zIndex(显式 zIndex 优先);更高层的节点会把标签盖住 */
4368
+ followNodeZIndex?: boolean
4369
+ /** 字号跟随地图缩放的指数:0 固定屏幕字号(默认),1 与地图同倍率 */
4370
+ zoomScale?: number
4299
4371
  }
4300
4372
 
4301
4373
  /** 线路标签内容函数的入参 */
@@ -4384,6 +4456,10 @@ export interface GisViewLineLabelOptions {
4384
4456
  className?: string
4385
4457
  /** 标签的内联样式 */
4386
4458
  style?: Record<string, string>
4459
+ /** 标签层级:越大越靠上;不写时是 0 */
4460
+ zIndex?: number
4461
+ /** 字号跟随地图缩放的指数:0 固定屏幕字号(默认),1 与地图同倍率 */
4462
+ zoomScale?: number
4387
4463
  }
4388
4464
 
4389
4465
  /** 标签类别:节点标签 / 线路标签 */
@@ -4415,6 +4491,12 @@ export interface GisViewLabelState {
4415
4491
  parallel: boolean | null
4416
4492
  /** 改过的「整条不画」(removeLabel 对配置 / 数据里声明的那一条就是这么落的);没改过是 null */
4417
4493
  hidden: boolean | null
4494
+ /** 改过的标签层级;没改过是 null */
4495
+ zIndex: number | null
4496
+ /** 改过的「跟随节点层级」;没改过是 null */
4497
+ followNodeZIndex: boolean | null
4498
+ /** 改过的字号缩放指数;没改过是 null */
4499
+ zoomScale: number | null
4418
4500
  /** 这一条是运行时加的(addLabel),不是配置 / 数据里声明的 */
4419
4501
  added: boolean
4420
4502
  /** 运行时加的标签的定义(addLabel 的入参),持久化回显时按它重建;不是运行时标签时为 null */
@@ -4441,6 +4523,12 @@ export interface GisViewLabelPatch {
4441
4523
  parallel?: boolean | null
4442
4524
  /** 整条不画(true 等于 visibility: 'hidden');写 null 回到默认 */
4443
4525
  hidden?: boolean | null
4526
+ /** 标签层级;写 null 回到默认 */
4527
+ zIndex?: number | null
4528
+ /** 是否跟随节点层级;写 null 回到默认 */
4529
+ followNodeZIndex?: boolean | null
4530
+ /** 字号跟随地图缩放的指数(0 = 固定屏幕字号);写 null 回到默认 */
4531
+ zoomScale?: number | null
4444
4532
  }
4445
4533
 
4446
4534
  /**
@@ -4460,6 +4548,12 @@ export interface GisViewLabelInfo {
4460
4548
  className: string | null
4461
4549
  /** 合并之后的逐条内联样式(配置 + 数据 + 运行时状态) */
4462
4550
  style: Record<string, string> | null
4551
+ /** 这一条当下生效的标签层级(显式 zIndex 或跟随节点得到的有效层) */
4552
+ zIndex: number
4553
+ /** 这一条是否跟随所属节点的 zIndex(线路标签忽略这一项) */
4554
+ followNodeZIndex: boolean
4555
+ /** 这一条当下生效的字号缩放指数(0 固定屏幕字号,1 与地图同倍率) */
4556
+ zoomScale: number
4463
4557
  /** 这一条是哪来的:'config' 配置里定义的 / 'data' 数据里写的 / 'runtime' 运行时加的 */
4464
4558
  source: 'config' | 'data' | 'runtime'
4465
4559
  /** 数据里写了同 id 的那一条覆盖 */
@@ -4621,6 +4715,12 @@ export interface GisViewLabelListItem {
4621
4715
  /** 当下生效的偏移(像素):运行时拖出来的优先,否则用声明里的;都没有是 [0, 0] */
4622
4716
  offset: [number, number]
4623
4717
  style: Record<string, string> | null
4718
+ /** 当下生效的标签层级 */
4719
+ zIndex: number
4720
+ /** 是否跟随节点层级 */
4721
+ followNodeZIndex: boolean
4722
+ /** 当下生效的字号缩放指数 */
4723
+ zoomScale: number
4624
4724
  /** 线路标签:这一条是否与线路平行;节点标签恒为 false */
4625
4725
  parallel: boolean
4626
4726
  visibility: GisViewLabelVisibility
@@ -5498,6 +5598,40 @@ export interface GisViewLineStyleSnapshot {
5498
5598
  zIndex: number
5499
5599
  }
5500
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
+
5501
5635
  /** 合并时给的上下文:merge.createItem 会拿到它 */
5502
5636
  export interface GisViewMergeContext {
5503
5637
  sourceIndex: number
@@ -5546,9 +5680,16 @@ export interface GisViewMergeOptions {
5546
5680
  */
5547
5681
  channelGroups?: 'keep' | 'merge'
5548
5682
  /**
5549
- * 自己决定合并之后的节点数据:缺省 `{ ...source, ...target }`(目标优先,来源独有的字段带过来),
5550
- * 尺寸取双方 getPointStyle().size 的较大值(sizeScale 归 1)、图标优先目标节点(目标没有才用来源的);
5551
- * 坐标与 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 无论怎么配都取目标节点 / 由组件维护
5552
5693
  */
5553
5694
  createItem?: (source: GisViewPoint, target: GisViewPoint, context: GisViewMergeContext) => GisViewPoint
5554
5695
  }
@@ -5573,12 +5714,15 @@ export type GisViewChannelWaypointDragMode =
5573
5714
  | 'vertex'
5574
5715
 
5575
5716
  /**
5576
- * 框选 / Ctrl 多选允许收哪几类要素:节点、独立线路、通道回线。
5717
+ * 框选允许收哪几类要素:节点、独立线路、通道回线,以及线路 / 通道的端点口径。
5577
5718
  * 通道回线只归 channel 这一档管;通道之外的普通线路归 line,两者可以任意组合。
5719
+ * `lineEndpoints` / `channelEndpoints` 要求线路 / 通道自己的两端节点都被框住才算命中,
5720
+ * 只用于框选、`selectInBox` 与 `exportData({ scope: 'viewport' })`,不参与点击多选。
5578
5721
  */
5579
- export type GisViewSelectionKind = 'point' | 'line' | 'channel'
5722
+ export type GisViewSelectionKind = 'point' | 'line' | 'channel' | 'lineEndpoints' | 'channelEndpoints'
5580
5723
  /**
5581
5724
  * selectionKinds 的写法:单类、类型数组、'all' / true(全开)或 false / null(全关)。
5725
+ * 端点口径也认 line-endpoints / line_endpoints / channel-endpoints / channel_endpoints 这几种连字符写法。
5582
5726
  * 不写时保留旧行为:框选只收节点,Ctrl / 多选点击仍可收节点与线路(回线按 channelSelectMode 摊开)。
5583
5727
  */
5584
5728
  export type GisViewSelectionKindsInput = GisViewSelectionKind | GisViewSelectionKind[] | 'all' | true | false | null
@@ -6047,6 +6191,8 @@ export interface GisViewEventMap {
6047
6191
  /** 视口尺寸 / 显示比例变化(画布按新尺寸重铺之后才发) */
6048
6192
  viewport: GisViewViewport
6049
6193
  cameraChange: GisViewCamera
6194
+ /** 用户在这段时间内没有指针 / 滚轮 / 键盘操作(每个空闲段只发一次) */
6195
+ idle: GisViewIdlePayload
6050
6196
  cursor: GisViewCursorPayload
6051
6197
  hover: GisViewHoverPayload
6052
6198
  pointer: GisViewPointerState
@@ -6225,6 +6371,16 @@ export interface GisViewWebGLLayer {
6225
6371
  */
6226
6372
  export type GisViewSelectTrigger = 'click' | 'dblClick'
6227
6373
 
6374
+ /** 通道简略配置:分组回线数超过阈值时只显示一条代表线 */
6375
+ export interface GisViewChannelSimplifyOptions {
6376
+ /** false 关闭;缺省对象即开启 */
6377
+ enabled?: boolean
6378
+ /** 分组回线数严格大于这个值时折叠,缺省 4 */
6379
+ threshold?: number
6380
+ /** 代表线的自定义样式(颜色、线宽、线型等);只影响这一条代表线的展示,不改数据 */
6381
+ style?: GisViewLineStyle
6382
+ }
6383
+
6228
6384
  export interface GisViewOptions {
6229
6385
  /**
6230
6386
  * 功能开关:预设名('edit' / 'view' / 'static')、开关表或布尔值 ——
@@ -6309,6 +6465,11 @@ export interface GisViewOptions {
6309
6465
  channelMaxGroups?: number
6310
6466
  /** 一个分组最多几条回线(0 表示不限):新增通道时据此判断还能不能并进这一组 */
6311
6467
  channelGroupMaxLines?: number
6468
+ /**
6469
+ * 通道简略:true 用缺省阈值 4;对象可改 threshold 与代表线 style。
6470
+ * 某个分组超过阈值时只画一条代表线(没有 groups 的通道按一整组算),数据、分组读数与导出不变
6471
+ */
6472
+ channelSimplify?: boolean | GisViewChannelSimplifyOptions
6312
6473
  /** 新增通道草稿线的样式(跟随光标的那条预览线) */
6313
6474
  channelDraftStyle?: GisViewChannelDraftStyle
6314
6475
  /** WebGL 自定义层:内置内容之后按 order 绘制;运行时用 addWebGLLayer / updateWebGLLayer 等维护 */
@@ -6496,9 +6657,11 @@ export interface GisViewOptions {
6496
6657
  selectTrigger?: GisViewSelectTrigger
6497
6658
  /**
6498
6659
  * 框选 / Ctrl 多选允许收哪几类要素:'point' 节点、'line' 独立线路、'channel' 通道回线,
6660
+ * 另有 'lineEndpoints' / 'channelEndpoints' 只在框选时要求线路 / 通道两端节点都在框内;
6499
6661
  * 可写数组任意组合,'all' / true 全开,false / null 全关。
6500
6662
  * **不写时保留旧行为**:框选只收节点,Ctrl / 多选点击仍可收节点与线路;
6501
6663
  * 写了之后框选与 Ctrl / 多选点击统一按这一份过滤(普通单选与接口 select 不受限制)。
6664
+ * 两个端点口径只影响框选,不会因为写进同一份数组就让 Ctrl 点击去猜端点。
6502
6665
  * 运行时走 updateOptions({ selectionKinds })。
6503
6666
  */
6504
6667
  selectionKinds?: GisViewSelectionKindsInput
@@ -6549,6 +6712,10 @@ export interface GisViewOptions {
6549
6712
  fitPadding?: number
6550
6713
  /** 首次有数据时自动适应视图,默认 true;配了 initialView 时以 initialView 为准 */
6551
6714
  fitOnInit?: boolean
6715
+ /** 首屏中心 [x, y] / { x, y }:initialView.center 的简写;显式给出非空 initialView 时以它为准 */
6716
+ center?: GisViewCoordinate | null
6717
+ /** 首屏绝对比例(像素 / 世界单位):initialView.scale 的简写;显式给出非空 initialView 时以它为准 */
6718
+ scale?: number | null
6552
6719
  /**
6553
6720
  * 初始视图:首次有数据时相机落在哪里。不配就是「适应整个数据范围」。
6554
6721
  * 想一进来就看局部(不要一上来铺满整屏)就写 { center, zoom } 或 { scale }:
@@ -6565,6 +6732,11 @@ export interface GisViewOptions {
6565
6732
  * 读数不需要 60Hz,节流能省下每帧一次的回调与对象分配(拖拽时尤其明显)。
6566
6733
  */
6567
6734
  statsInterval?: number
6735
+ /**
6736
+ * 用户操作空闲阈值(毫秒):根节点上这么久没有指针 / 滚轮 / 键盘活动就发一次 idle,
6737
+ * 每个空闲段只发一次;0 / 不写表示关闭。运行中用 getIdleTime() 读当前空闲时长。
6738
+ */
6739
+ idleTimeout?: number
6568
6740
  /**
6569
6741
  * onRender 的节流间隔(毫秒),默认 400;配 0 与 onStats 同拍
6570
6742
  * (再配上 statsInterval: 0 就是每帧一条)。
@@ -6675,6 +6847,8 @@ export interface GisViewOptions {
6675
6847
  /** 分组变化:拆分 / 合并 / 挪线 / 新建组 / 整份声明换(updateChannel),action.type 说明这一笔是什么 */
6676
6848
  onChannelGroupChange?: (payload: GisViewChannelGroupChangePayload) => void
6677
6849
  onCameraChange?: (camera: GisViewCamera) => void
6850
+ /** 用户操作空闲达到 idleTimeout 时回调一次;恢复操作后再次空闲会重新触发 */
6851
+ onIdle?: (payload: GisViewIdlePayload) => void
6678
6852
  /** 视口尺寸 / 显示比例变化:内置鹰眼图与覆盖层按它重排,自建面板也可以拿它跟着调整 */
6679
6853
  onViewport?: (viewport: GisViewViewport) => void
6680
6854
  onStats?: (stats: GisViewEngineStats) => void
@@ -7075,6 +7249,12 @@ export type GisViewExportScope = 'all' | 'viewport' | 'selection'
7075
7249
  export interface GisViewExportDataOptions extends GisViewExportFilterOptions {
7076
7250
  /** 导出范围,缺省 'all';selected / visible 之类的同义词在运行时也认 */
7077
7251
  scope?: GisViewExportScope
7252
+ /**
7253
+ * 只对 scope: 'viewport' 生效的类型过滤:写法与 options.selectionKinds 相同。
7254
+ * 不写时沿用视口导出的旧口径;写 'lineEndpoints' / 'channelEndpoints' 时,
7255
+ * 只有两端节点都落在视口世界矩形内的独立线路 / 通道才会导出(端点模式不会顺带导出节点)。
7256
+ */
7257
+ selectionKinds?: GisViewSelectionKindsInput
7078
7258
  /**
7079
7259
  * 要哪一套:'view'(缺省,节点 / 线路 / 通道 / 拐点分组四份,JS 风格的键名)/
7080
7260
  * 'new'(new.json 口径的整份:station_data + channel_data + 四至范围那几列)/
@@ -7453,6 +7633,8 @@ export interface GisViewSceneSnapshot {
7453
7633
  regions: GisViewSceneRegion[]
7454
7634
  /** 数据线路与节点装饰连接线(连接线也画在节点 / 装饰之前) */
7455
7635
  lines: GisViewSceneLine[]
7636
+ /** 抬层的选中线路:画在普通节点之后、抬层节点之前 */
7637
+ raisedLines: GisViewSceneLine[]
7456
7638
  points: GisViewSceneNode[]
7457
7639
  clusters: GisViewSceneCluster[]
7458
7640
  backgroundPoints: GisViewSceneNode[]
@@ -7689,11 +7871,21 @@ export interface GisViewInstance {
7689
7871
  searchAsync(input: string | GisViewSearchOptions): Promise<GisViewSearchResult>
7690
7872
  setCamera(camera: Partial<GisViewCamera>): GisViewInstance
7691
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
7692
7882
  getBounds(): GisViewBounds
7693
7883
  /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
7694
7884
  getZoomBaseScale(): number
7695
7885
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),之后放大缩小都从它算倍数,返回 this */
7696
7886
  setZoomBaseScale(scale?: number): GisViewInstance
7887
+ /** 距离创建或上一次指针 / 滚轮 / 键盘操作的毫秒数;程序化 API 调用不重置它 */
7888
+ getIdleTime(): number
7697
7889
  /** 鹰眼图根节点(没配 minimap 时为 null):拖动整张图 / 绑定自定义手势时拿它 */
7698
7890
  getMinimapElement(): HTMLElement | null
7699
7891
  /** 鹰眼图自身的倍数:1 是「刚好铺满小图」 */
@@ -7919,24 +8111,27 @@ export interface GisViewInstance {
7919
8111
  getPointClipboard(): GisViewClipboardItem | null
7920
8112
  /**
7921
8113
  * 把来源节点并进目标节点(接口调用):来源 / 目标收 id、下标或 `{ id }` / `{ index }`。
7922
- * 节点数据按 merge.createItem 合并(缺省目标优先、来源独有的字段带过来,尺寸取双方最大、图标优先目标),
8114
+ * 节点数据按 merge.createItem 合并(缺省以目标节点为底,merge.maxKeys 列出的字段取双方最高值,
8115
+ * 尺寸取双方最大、图标取目标),
7923
8116
  * 绑在来源上的线路改绑到目标,合并后自环 / 零长度的线路与两端相同的通道一起删掉,
7924
8117
  * 撞成同一条的通道按 merge.channelGroups 决定分组(缺省各自保留);
8118
+ * 保留节点写完整 mergeInfo 快照,受影响通道写轻量 mergeInfo,供 splitPoint 自动解除合并;
7925
8119
  * options.item 可以给一份已经改好的合并结果(confirm 阶段改过 payload.item 之后就是它);
7926
8120
  * 返回 `{ ok, item, linesChanged, removedLines, removedChannels, mergedChannels }`,
7927
8121
  * 并不了返回 ok: false 并另发一条 `phase: 'merge', ok: false` 的事件
7928
8122
  */
7929
8123
  mergePoints(source: GisViewPointRef, target: GisViewPointRef, options?: { originalEvent?: Event | null; item?: GisViewPoint }): GisViewMergeOutcome
7930
8124
  /**
7931
- * 把一个节点拆成多份(mergePoints 的逆操作):第一份复用原下标与 id,其余追加到 points 末尾。
8125
+ * 把一个节点拆成多份(mergePoints 的逆操作):parts 省略 / null / [] 且节点带 mergeInfo 时自动解除合并,
8126
+ * 恢复全部来源节点与合并前的线路 / 通道;给 parts 时第一份复用原下标与 id,其余追加到 points 末尾。
7932
8127
  * 每份可直接写节点字段或放进 item;lines 显式分配线路,没写时默认跟第一份,
7933
8128
  * options.autoLines 为 'alternate' 时按「通道成组、独立线路单条」轮流分给负载最少的一份(解除合并推荐)。
7934
8129
  * channels / channelFrom / channelTo 分配受影响通道的端点。没显式分配的通道跟随它第一条被分配过的成员线路。
7935
8130
  * 拆分后自环 / 零长度线路与两端相同的通道删掉;整次调用只记一条历史、只发一条 `splitPoint` 数据变更。
7936
8131
  * 返回 `{ ok, items, indexes, pointIds, linesChanged, removedLines, channelsChanged, removedChannels,
7937
- * autoLines, autoAssignedLines, lineAssignments, changes, skipped }`
8132
+ * autoLines, autoAssignedLines, lineAssignments, autoRestored, mergeSourceIds, changes, skipped }`
7938
8133
  */
7939
- splitPoint(source: GisViewPointRef, parts: GisViewSplitPointPart[], options?: GisViewSplitPointOptions): GisViewSplitPointOutcome
8134
+ splitPoint(source: GisViewPointRef, parts?: GisViewSplitPointPart[] | null, options?: GisViewSplitPointOptions): GisViewSplitPointOutcome
7940
8135
  /**
7941
8136
  * 框选 / 多选之后一步把选中的节点并到一个目标上(接口调用):不指定 target 就自动挑「绑定线路最多」的那一个
7942
8137
  * (一样多取画得大的、再一样取下标小的);来源默认是除目标之外的选中节点,也可以直接用 options.sources 给定,
@@ -8124,6 +8319,12 @@ export interface GisViewInstance {
8124
8319
  * 界面做「这两个点之间已经有通道 / 有几组」这类判断用它,不必去看新增方案表
8125
8320
  */
8126
8321
  getChannelBetween(from: string | number, to: string | number): GisViewChannelBetween | null
8322
+ /**
8323
+ * 一组节点之间的直接通道 / 线路:两端都必须真实存在且都在传入的 id 集合里,
8324
+ * 只认通道端点或线路 from / to 的直接绑定,不沿线路穿中间节点,也不返回集合外的边。
8325
+ * 通道按 channels 顺序、线路按 lines 顺序;一条都没命中时返回空数组。
8326
+ */
8327
+ getDirectConnections(pointIds: string | number | Array<string | number>): GisViewDirectConnection[]
8127
8328
  /**
8128
8329
  * 程序化新增一个通道:第一段是通道信息 `{ from, to, name, id, path, routing, channelProps }`,第二段是线路数据 ——
8129
8330
  * 每条按自己的 id 建进通道(id 自动成为 lineIds),第三段是可选的分组信息。只负责新建一个通道:
@@ -8511,6 +8712,8 @@ export interface GisViewEngineOptions {
8511
8712
  channelMaxGroups?: number
8512
8713
  /** 一个分组最多几条回线(0 表示不限):新增通道时据此判断还能不能并进这一组 */
8513
8714
  channelGroupMaxLines?: number
8715
+ /** 通道简略:分组回线数超过阈值时只画一条代表线,见 GisViewChannelSimplifyOptions */
8716
+ channelSimplify?: boolean | GisViewChannelSimplifyOptions
8514
8717
  /** 新增通道草稿线的样式(跟随光标的那条预览线) */
8515
8718
  channelDraftStyle?: GisViewChannelDraftStyle
8516
8719
  /** WebGL 自定义层:与 GisViewOptions.webglLayers 同一份写法 */
@@ -8965,9 +9168,6 @@ export declare const FEATURE_NAMES: GisViewFeatureName[]
8965
9168
  /** 预设表:键是开关名、值是布尔;**没列出来的开关取 featureDefault**(全关;「配了才有」的那几项不给值) */
8966
9169
  export declare const FEATURE_PRESETS: Record<GisViewFeaturePreset, GisViewFeatures>
8967
9170
 
8968
- /** 编辑类开关(会改数据的那几项)的名单:文档与面板按它分组;与查看类一样缺省全关,这一列只说明分类 */
8969
- export declare const FEATURE_EDIT_NAMES: GisViewFeatureName[]
8970
-
8971
9171
  /** 单个开关的缺省值:**全关**(false);「配了才有」的那几项 undefined(跟随详细配置,配了就等于手动打开) */
8972
9172
  export declare const featureDefault: (name: GisViewFeatureName) => boolean | undefined
8973
9173