gis-view-webgl2 0.1.2 → 0.1.4

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 (66) hide show
  1. package/README.md +21 -14
  2. package/dist/gis-view.css +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +421 -76
  5. package/dist/index.js +1 -1
  6. package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +151 -0
  7. package/docs/GisView.md +4 -4
  8. 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 +137 -0
  9. package/docs/api/index.html +23 -9
  10. package/docs/demos/ApiCoverageDemo.vue +644 -0
  11. package/docs/demos/ChannelDemo.vue +14 -12
  12. package/docs/demos/ClusterDemo.vue +251 -0
  13. package/docs/demos/CopyMergeDemo.vue +3 -4
  14. package/docs/demos/EventDemo.vue +3 -3
  15. package/docs/demos/ExtensionDemo.vue +69 -12
  16. package/docs/demos/GisViewDemo.vue +64 -8809
  17. package/docs/demos/SearchFilterDemo.vue +13 -11
  18. package/docs/demos/api-index.js +58 -47
  19. package/docs/demos/demos.js +34 -17
  20. package/docs/demos/gis-view-demo/GisViewDemoCardHeader.vue +29 -0
  21. package/docs/demos/gis-view-demo/GisViewDemoDialogs.vue +82 -0
  22. package/docs/demos/gis-view-demo/GisViewDemoFooter.vue +16 -0
  23. package/docs/demos/gis-view-demo/GisViewDemoHeading.vue +16 -0
  24. package/docs/demos/gis-view-demo/GisViewDemoPanelStack.vue +71 -0
  25. package/docs/demos/gis-view-demo/GisViewDemoStage.vue +219 -0
  26. package/docs/demos/gis-view-demo/demo.css +1230 -0
  27. package/docs/demos/gis-view-demo/demoContext.js +12 -0
  28. package/docs/demos/gis-view-demo/panels/DataPanels.vue +303 -0
  29. package/docs/demos/gis-view-demo/panels/OpsPanels.vue +174 -0
  30. package/docs/demos/gis-view-demo/panels/StylePanels.vue +561 -0
  31. package/docs/demos/gis-view-demo/panels/ViewPanels.vue +396 -0
  32. package/docs/demos/gis-view-demo/useGisViewDemo.js +6188 -0
  33. 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 +3 -2
  34. package/docs/index.html +41 -4
  35. package/docs/internals/16-03-/344/274/230/345/214/226/344/270/216/345/217/226/350/210/215-/344/270/213.md +1 -1
  36. package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +3 -2
  37. package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +104 -16
  38. package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +15 -14
  39. 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 +40 -3
  40. package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +50 -3
  41. package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +6 -2
  42. 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 +39 -7
  43. package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +13 -4
  44. package/docs/manual/13-/345/212/250/346/225/210/344/270/216/345/233/276/345/205/203.md +3 -0
  45. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +121 -49
  46. package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +37 -3
  47. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +17 -8
  48. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +45 -25
  49. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +91 -20
  50. 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 +3 -3
  51. package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +25 -1
  52. 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 +11 -8
  53. package/docs/steps/README.md +17 -11
  54. package/docs/steps/selftest-actions.html +3 -5
  55. package/docs/steps/selftest-demo.html +27 -18
  56. package/docs/steps/selftest-demos.html +409 -32
  57. package/docs/steps/selftest-docs.html +33 -4
  58. package/docs/steps/selftest-effects.html +200 -0
  59. package/docs/steps/selftest-features.html +603 -21
  60. package/docs/steps/selftest-labels.html +74 -0
  61. package/docs/steps/selftest-perf.html +293 -20
  62. package/docs/steps/selftest-scale.html +150 -29
  63. package/docs/steps/selftest-select.html +90 -0
  64. package/docs/steps/step-10-full.js +1 -1
  65. package/docs/steps/step-12-events.js +1 -1
  66. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1157,6 +1157,12 @@ export interface GisViewLine {
1157
1157
  * 对象在全局那一份上逐字段覆盖,false / null 关掉这一条;不写就跟随全局(全局没配 = 不画)。
1158
1158
  */
1159
1159
  effect?: GisViewLineEffectInput | null
1160
+ /**
1161
+ * 这条线的正向是否从 from / path[0] 走向 to / path[last],默认 true。
1162
+ * 写 false 时装饰位置与朝向、方向箭头、线路动画都按反方向解释;effect.reverse 与
1163
+ * direction.reverse 仍各自生效,两者与 forward 是异或关系(反两次等于正一次)。
1164
+ */
1165
+ forward?: boolean
1160
1166
  /**
1161
1167
  * 这条线的方向箭头(静态,不跑动):true 用全局那一份(options.lineDirection),
1162
1168
  * 对象在全局那一份上逐字段覆盖,false / null 关掉这一条;不写就跟随全局(全局没配 = 不画)。
@@ -1165,6 +1171,70 @@ export interface GisViewLine {
1165
1171
  direction?: GisViewLineDirectionInput | null
1166
1172
  }
1167
1173
 
1174
+ /** 级联高亮的范围:points 只亮节点,both 同时亮直接连接的线路 */
1175
+ export type GisViewCascadeHighlightScope = 'points' | 'both'
1176
+
1177
+ /**
1178
+ * 点击级联高亮:点击节点时高亮它和直接相连的节点 / 线路,点击线路或通道时高亮这条线的两端。
1179
+ * 它与选中集完全分开 —— 不写 selectionKeys、不改 selected,样式也不走悬停 / 选中那一套。
1180
+ * true 等价于 { enabled: true, scope: 'both' };不配或 false 都是关闭。
1181
+ */
1182
+ export interface GisViewCascadeHighlightOptions {
1183
+ /** 开关,缺省 true(写了对象就表示打开) */
1184
+ enabled?: boolean
1185
+ /** 高亮范围,缺省 'both':points 只亮节点,both 连直接连接的线路一起亮 */
1186
+ scope?: GisViewCascadeHighlightScope
1187
+ /** 普通单击是否触发 / 更新级联高亮,缺省 true;关闭后这次单击只走选中,并清掉旧级联 */
1188
+ triggerOnClick?: boolean
1189
+ /**
1190
+ * Ctrl / ⌘ 多选或 options.multiSelect 的累加点击是否触发级联高亮,缺省 true。
1191
+ * 关闭后多选只改变选中集,不改级联状态(并把旧级联收掉)
1192
+ */
1193
+ triggerOnMultiSelect?: boolean
1194
+ /**
1195
+ * 框选是否触发级联高亮,缺省 false(保持框选只改选中集的既有行为)。
1196
+ * 打开后框内每个命中项都参与邻接计算,直接命中的节点 / 线路仍走框选样式,只有邻接项套级联样式
1197
+ */
1198
+ triggerOnBoxSelect?: boolean
1199
+ /** 级联节点样式;缺省是琥珀色描边的白心节点。整份替换,不与悬停 / 选中样式叠加 */
1200
+ pointStyle?: GisViewPointStyle
1201
+ /** 级联线路样式;缺省是琥珀色、稍粗的实线。整份替换,不与悬停 / 选中样式叠加 */
1202
+ lineStyle?: GisViewLineStyle
1203
+ /** 点空白处是否收掉级联高亮,缺省 true */
1204
+ clearOnEmptyClick?: boolean
1205
+ }
1206
+ export type GisViewCascadeHighlightInput = boolean | GisViewCascadeHighlightOptions
1207
+
1208
+ /** 级联高亮里的一个节点 / 线路条目 */
1209
+ export interface GisViewCascadeHighlightEntry<T = GisViewPoint | GisViewLine> {
1210
+ index: number
1211
+ item: T
1212
+ }
1213
+
1214
+ /** 级联高亮的来源:这一次点击命中的节点 / 线路 / 通道回线 */
1215
+ export interface GisViewCascadeHighlightOrigin {
1216
+ /** 命中的种类:通道回线在这里是 channel,底层数据类型仍是 line */
1217
+ target: 'point' | 'line' | 'channel'
1218
+ type: 'point' | 'line'
1219
+ index: number
1220
+ item: GisViewPoint | GisViewLine
1221
+ channelId?: string | number
1222
+ channelIndex?: number
1223
+ groupId?: string | number
1224
+ groupIndex?: number
1225
+ channel?: GisViewChannel
1226
+ }
1227
+
1228
+ /** getCascadeHighlight() / onCascadeHighlight 的读数:来源、范围与当前亮着的节点 / 线路 */
1229
+ export interface GisViewCascadeHighlightInfo {
1230
+ origin: GisViewCascadeHighlightOrigin | null
1231
+ scope: GisViewCascadeHighlightScope
1232
+ points: Array<GisViewCascadeHighlightEntry<GisViewPoint>>
1233
+ lines: Array<GisViewCascadeHighlightEntry<GisViewLine>>
1234
+ pointIndexes: number[]
1235
+ lineIndexes: number[]
1236
+ }
1237
+
1168
1238
  /**
1169
1239
  * updateLine 的补丁:线路自己的字段之外,还可以带一组「分组指令」。
1170
1240
  * groupId / groupIndex 会先把这条回线挪到目标分组(通道内的回线只能进一组),
@@ -1462,24 +1532,6 @@ export interface GisViewChannelContext {
1462
1532
  actions: GisViewChannelAction[]
1463
1533
  }
1464
1534
 
1465
- /** 右键点中通道回线时的载荷:上下文 + 命中的回线与屏幕 / 世界坐标,点空白处回调收到 null */
1466
- export interface GisViewChannelContextPayload extends GisViewChannelContext {
1467
- /** 这一次操作的判读:type 为 'contextMenu'、target 为 'channel'(与 onContextMenu 是同一件操作) */
1468
- action?: GisViewPointerAction
1469
- /** 命中的回线在 lines 数组里的下标 */
1470
- lineIndex: number
1471
- lineId: string | number
1472
- coordinate: [number, number]
1473
- /** 鼠标按键:右键固定是 2(与指针载荷同一份口径,组件层按它补出 action.button) */
1474
- button?: number
1475
- /** 画布 CSS 像素坐标 */
1476
- x: number
1477
- y: number
1478
- clientX: number
1479
- clientY: number
1480
- originalEvent: Event
1481
- }
1482
-
1483
1535
  /** 新增通道时一个节点的读数:下标、id / 数据对象与坐标 */
1484
1536
  export interface GisViewChannelNodeDraft {
1485
1537
  index: number
@@ -1678,6 +1730,11 @@ export interface GisViewChannelBetween {
1678
1730
  export interface GisViewChannelDraftOptions {
1679
1731
  /** 两个节点一选完就自动提交,不用再调 commitAddChannel */
1680
1732
  autoCommit?: boolean
1733
+ /**
1734
+ * 预指定起点:节点 id / 下标 / `{ id }` / `{ index }`。给了就从「已选好起点」进入草稿,
1735
+ * 下一次点节点只选终点;不写则仍由第一次点击选起点。找不到节点时草稿不开始并报 warning
1736
+ */
1737
+ from?: GisViewPointRef
1681
1738
  /**
1682
1739
  * 连续新增:一段线路落地之后自动开下一段草稿,不用再点一次「新增通道」。
1683
1740
  * true 每段都从空白开始;'chain' 以上一段的终点当下一段起点(首尾相接)
@@ -2048,9 +2105,7 @@ export interface GisViewAddPointResult extends GisViewAddItemsResult<GisViewPoin
2048
2105
  * coordinate 与通道字段),另加 target('point' / 'line' / 'channel')与 lngLat(配了 GeoJSON 底图才有);
2049
2106
  * 没命中返回 null。只读 —— 不改选中、不动光标。
2050
2107
  */
2051
- export interface GisViewPickAtResult extends GisViewPickResult {
2052
- target: 'point' | 'line' | 'channel'
2053
- }
2108
+ export type GisViewPickAtResult = GisViewHitResult & { target: 'point' | 'line' | 'channel' | 'cluster' }
2054
2109
 
2055
2110
  /**
2056
2111
  * getFeaturesInRect 的结果:points 是框内的节点(与框选同一口径,含 screen / coordinate / 通道上下文),
@@ -2506,6 +2561,14 @@ export interface GisViewWaypointKey {
2506
2561
  pathIndex: number
2507
2562
  }
2508
2563
 
2564
+ /** 拐点定位的对象写法:lineIndex / lineId / id 任给一个,pathIndex 必有 */
2565
+ export interface GisViewWaypointRef {
2566
+ lineIndex?: number
2567
+ lineId?: string | number
2568
+ id?: string | number
2569
+ pathIndex: number
2570
+ }
2571
+
2509
2572
  /** 拐点信息:坐标与是否处于选中态 */
2510
2573
  export interface GisViewWaypointInfo extends GisViewWaypointKey {
2511
2574
  coordinate: [number, number]
@@ -2552,6 +2615,72 @@ export interface GisViewPickResult extends GisViewFeatureKey {
2552
2615
  group?: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
2553
2616
  }
2554
2617
 
2618
+ /** 点聚合配置:true 等价于开着一份缺省档;对象写法可逐项覆盖。 */
2619
+ export interface GisViewPointClusterOptions {
2620
+ /** 缺省 true;写成 false 与不配一样,都是关 */
2621
+ enabled?: boolean
2622
+ /** 聚合半径(CSS 像素),缺省 60,夹在 8 ~ 500 */
2623
+ radius?: number
2624
+ /** 至少多少个点才合成一个聚合圆,缺省 2(最小也是 2) */
2625
+ minPoints?: number
2626
+ /** 相机比例 / 基准比例超过它之后展开原始点;0(缺省)表示不设上限 */
2627
+ maxZoom?: number
2628
+ }
2629
+
2630
+ /** getPointCluster() 的读数:归一化之后的配置 + 当前缩放档是否仍在聚合。 */
2631
+ export interface GisViewPointClusterReadout extends Required<GisViewPointClusterOptions> {
2632
+ active: boolean
2633
+ }
2634
+
2635
+ /** 一个展示组:count 为 1 是单成员,大于 1 是聚合圆;坐标与包围盒都是世界坐标。 */
2636
+ export interface GisViewCluster {
2637
+ id: string
2638
+ count: number
2639
+ pointIndexes: number[]
2640
+ pointIds: Array<string | number>
2641
+ coordinate: [number, number]
2642
+ /** 当前相机下的画布 CSS 像素位置 */
2643
+ screen: [number, number]
2644
+ radius: number
2645
+ bounds: GisViewBounds
2646
+ }
2647
+
2648
+ /** 多成员聚合圆的拾取结果:item 永远为 null,index 为 -1,不进入普通要素选中集。 */
2649
+ export interface GisViewClusterPickResult extends GisViewCluster {
2650
+ type: 'cluster'
2651
+ index: -1
2652
+ item: null
2653
+ distance: number
2654
+ selected: boolean
2655
+ wasSelected: boolean
2656
+ lngLat?: [number, number]
2657
+ }
2658
+
2659
+ /** pick / pickAt / hover 可能拿到普通要素或聚合圆。 */
2660
+ export type GisViewHitResult = GisViewPickResult | GisViewClusterPickResult
2661
+
2662
+ /** action.data 里的聚合读数:不带 action 自身,避免载荷循环引用。 */
2663
+ export interface GisViewClusterPointerData extends GisViewCluster {
2664
+ type: 'cluster'
2665
+ }
2666
+
2667
+ /** 聚合数量文字:覆盖层每帧只需要位置、半径与数量。 */
2668
+ export interface GisViewClusterLabel {
2669
+ id: string
2670
+ count: number
2671
+ screen: [number, number]
2672
+ radius: number
2673
+ }
2674
+
2675
+ /** onClusterClick / clusterClick 的载荷:与点击载荷同一套指针字段,但不带普通要素的 item。 */
2676
+ export type GisViewClusterClickPayload = GisViewClusterPickResult & {
2677
+ button?: number
2678
+ buttons?: number
2679
+ originalEvent: Event
2680
+ selection: GisViewSelectionInfo
2681
+ action: GisViewPointerAction
2682
+ }
2683
+
2555
2684
  /** 选中事件载荷:点击选中为 0 / 1 个要素,Shift 框选为框内全部节点(随 shortcuts.boxSelect 改变) */
2556
2685
  export interface GisViewSelectPayload {
2557
2686
  items: GisViewPickResult[]
@@ -2589,11 +2718,11 @@ export interface GisViewSelectionInfo {
2589
2718
  * `{ channelId, lineIds: [...] }` / `{ channelIndex, lineIndexes: [...] }` 只取通道里的某几条回线。
2590
2719
  */
2591
2720
  export interface GisViewSelectionRefObject {
2592
- /** 要素类型;写 'channel'(或写了 channelId / channelIndex / channel)就是通道写法 */
2593
- type?: GisViewFeatureType | 'channel'
2594
- /** 搜索命中的类型(与 type 一个意思,point / line / channel 都认):搜索命中可以直接丢给 select */
2595
- kind?: GisViewFeatureType | 'channel'
2596
- /** 要素 id;type / kind 是通道时它就是这个通道的 id */
2721
+ /** 要素类型;写 'channel'(或写了 channelId / channelIndex / channel)就是通道写法,写 'group' 是分组写法 */
2722
+ type?: GisViewFeatureType | 'channel' | 'group'
2723
+ /** 搜索命中的类型(与 type 一个意思,point / line / channel / group 都认);type 是 group 时 id 就是分组 id */
2724
+ kind?: GisViewFeatureType | 'channel' | 'group'
2725
+ /** 要素 id;type / kind 是通道时它就是这个通道的 id,是分组时是分组 id */
2597
2726
  id?: string | number
2598
2727
  /** 要素在 points / lines 里的下标;通道写法里是通道下标 */
2599
2728
  index?: number
@@ -2602,8 +2731,12 @@ export interface GisViewSelectionRefObject {
2602
2731
  channelId?: string | number
2603
2732
  channelIndex?: number
2604
2733
  channel?: string | number | GisViewChannel
2734
+ /** 分组上下文(getLineChannel 的 group 可以直接放进来) */
2735
+ group?: string | number | { id?: string | number }
2605
2736
  /** 只要通道里的某一组 */
2606
2737
  groupId?: string | number | null
2738
+ /** groupId 的 snake_case 别名 */
2739
+ group_id?: string | number
2607
2740
  /** 只要通道里的某几组 */
2608
2741
  groupIds?: Array<string | number>
2609
2742
  /** 只要通道里的某一条 / 某几条回线(按 id 或 lines 下标) */
@@ -2753,7 +2886,7 @@ export interface GisViewClickPayload extends GisViewPickResult {
2753
2886
  selection: GisViewSelectionInfo
2754
2887
  /**
2755
2888
  * 这一次点击的判读:type 为 'select'(点中要素、选中已生效)或 'click'(没开选中时的普通点击),
2756
- * double 为 true 说明这一下是双击里的第二下。点空白处的载荷是 null,
2889
+ * 多选取反生效时是 'toggleSelect';double 为 true 说明这一下是双击里的第二下。点空白处的载荷是 null,
2757
2890
  * 「点了空白」这件事看 onPointerDown / onPointerUp 的 action.target('empty')与 selectChange。
2758
2891
  */
2759
2892
  action: GisViewPointerAction
@@ -2764,7 +2897,7 @@ export interface GisViewClickPayload extends GisViewPickResult {
2764
2897
  * 'waypoint'(线路拐点)/ 'label'(标签)/ 'selection'(一整批选中集,只有 selectChange 用)/ 'empty'(空白)。
2765
2898
  * 与载荷里的 type 差一层:通道回线的 type 也是 'line',但按通道处理的多,target 单独给一个 'channel'。
2766
2899
  */
2767
- export type GisViewPointerTarget = 'point' | 'line' | 'channel' | 'waypoint' | 'label' | 'selection' | 'empty'
2900
+ export type GisViewPointerTarget = 'point' | 'line' | 'channel' | 'cluster' | 'waypoint' | 'label' | 'selection' | 'empty'
2768
2901
 
2769
2902
  /**
2770
2903
  * 一次指针操作的动作名。同一个名字在「按下 / 松开 / 点击」三条事件里含义略有不同:
@@ -2786,6 +2919,7 @@ export type GisViewPointerActionType =
2786
2919
  | 'selectWaypoint'
2787
2920
  | 'dragWaypoint'
2788
2921
  | 'dragPoint'
2922
+ | 'clusterClick'
2789
2923
  | 'dragLabel'
2790
2924
  | 'selectLabel'
2791
2925
  | 'contextMenu'
@@ -2830,7 +2964,7 @@ export interface GisViewPointerAction {
2830
2964
  * 通道回线是通道定义、选中集事件是这一批 items、拐点是「哪条线、第几个顶点、坐标、改完的线」,
2831
2965
  * 空白处是 null(拐点那一份见 GisViewWaypointPayload.action.data、标签那一份见 GisViewLabelActionData)。
2832
2966
  */
2833
- data?: GisViewPoint | GisViewLine | GisViewChannel | GisViewPickResult[] | GisViewWaypointActionData | GisViewLabelActionData | null
2967
+ data?: GisViewPoint | GisViewLine | GisViewChannel | GisViewClusterPointerData | GisViewPickResult[] | GisViewWaypointActionData | GisViewLabelActionData | null
2834
2968
  /** 只在 click 载荷里出现:true 说明这一下是双击里的第二下(单双击要分开做事的界面按它推迟一下) */
2835
2969
  double?: boolean
2836
2970
  /**
@@ -2869,8 +3003,8 @@ export interface GisViewPointerPayload {
2869
3003
  * target 说明点的是点 / 线 / 通道 / 空白,data 直接给到那一份数据(左键 / 右键都认这一份)
2870
3004
  */
2871
3005
  action: GisViewPointerAction
2872
- /** 命中的要素类型,空白处为 null */
2873
- type: GisViewFeatureType | null
3006
+ /** 命中的要素类型,空白处为 null;多成员聚合是 'cluster' */
3007
+ type: GisViewFeatureType | 'cluster' | null
2874
3008
  /** 命中的要素在数据里的下标,空白处为 -1 */
2875
3009
  index: number
2876
3010
  /** 有没有命中要素 */
@@ -2881,6 +3015,9 @@ export interface GisViewPointerPayload {
2881
3015
  screen?: [number, number]
2882
3016
  /** 命中的要素自身的世界坐标 */
2883
3017
  coordinate?: [number, number]
3018
+ /** 命中的是线路(含通道回线)时,线路在 lines 数组里的下标与 id;右键菜单按它找线路 */
3019
+ lineIndex?: number
3020
+ lineId?: string | number
2884
3021
  /** 命中的是通道内的回线时,回线所属通道与分组 */
2885
3022
  channelIndex?: number
2886
3023
  channel?: GisViewChannel
@@ -2888,6 +3025,15 @@ export interface GisViewPointerPayload {
2888
3025
  groupIndex?: number
2889
3026
  /** 命中的是通道内的回线时,这一组的读数 */
2890
3027
  group?: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
3028
+ /** 命中通道回线时的分组上下文:action.target 为 channel,按它直接渲染通道菜单 */
3029
+ channelContext?: GisViewChannelContext
3030
+ /** 命中多成员聚合时:聚合 id、成员数、成员下标 / id、包围盒与屏幕半径 */
3031
+ id?: string
3032
+ count?: number
3033
+ pointIndexes?: number[]
3034
+ pointIds?: Array<string | number>
3035
+ bounds?: GisViewBounds
3036
+ radius?: number
2891
3037
  /**
2892
3038
  * 这一刻命中的要素在不在当前选中集里(没有命中就是 false)。
2893
3039
  * 左键按下 / 抬起与右键都是当下这一份状态:selected 与 wasSelected 相同
@@ -2918,7 +3064,7 @@ export interface GisViewPointerPayload {
2918
3064
  * 另外带一份 action(type 恒为 'hover'、target 说明停在什么上面、button 恒为 'none')。
2919
3065
  * 光标正好停在最近一次指针事件的位置上时,originalEvent / clientX / clientY 就是那一次事件(修饰键读得到)。
2920
3066
  */
2921
- export interface GisViewHoverPayload extends GisViewPickResult {
3067
+ export type GisViewHoverPayload = GisViewHitResult & {
2922
3068
  /** 悬停读数一样有:有没有停在某个要素上(空白处是 null,不走这一份) */
2923
3069
  hit: boolean
2924
3070
  action: GisViewPointerAction
@@ -3535,6 +3681,8 @@ export type GisViewDataChangeType =
3535
3681
  | 'addLines'
3536
3682
  | 'removePoints'
3537
3683
  | 'removeLines'
3684
+ /** 删除型筛选(filter.mode: 'remove')把不命中的要素从数据里删掉 */
3685
+ | 'filterRemove'
3538
3686
  | 'removeSelected'
3539
3687
  | 'removeLine'
3540
3688
  | 'removeChannel'
@@ -3558,6 +3706,8 @@ export interface GisViewDataChangePayload {
3558
3706
  /** 动到 / 删掉的节点下标(单点更新是那一个,删除是删除前的下标升序,新增是它们在数组里的位置) */
3559
3707
  index?: number
3560
3708
  indexes?: number[]
3709
+ /** 这一次删掉的节点下标(删除前它们在 points 里的位置,升序;removeSelected / filterRemove 会带上) */
3710
+ pointIndexes?: number[]
3561
3711
  /** 这一次调用成没成(addPoints / addLines / removePoints 这类批量接口会带上) */
3562
3712
  ok?: boolean
3563
3713
  /** 新增这类动作:这批要素是从哪个下标开始接上去的(就是追加前原数组的长度) */
@@ -3607,8 +3757,14 @@ export interface GisViewDataChangePayload {
3607
3757
  lineIndex?: number
3608
3758
  channelId?: string | number | null
3609
3759
  channelIndex?: number
3760
+ /** filterRemove:这次从数据里删掉的节点数据,顺序与 pointIndexes 对应 */
3761
+ removedPoints?: GisViewPoint[]
3762
+ /** filterRemove:这次从数据里删掉的线路数据,顺序与 removedLineIndexes 对应 */
3763
+ removedLineItems?: GisViewLine[]
3610
3764
  removedLineIds?: Array<string | number>
3611
3765
  removedLineIndexes?: number[]
3766
+ /** filterRemove:固定为 'remove',便于按载荷分流 */
3767
+ mode?: GisViewFilterMode
3612
3768
  /** 通道分组:这条通道最新的分组声明 */
3613
3769
  groups?: GisViewChannelGroup[]
3614
3770
  replaced?: boolean
@@ -3655,6 +3811,12 @@ export interface GisViewEngineStats {
3655
3811
  lineEffectCount: number
3656
3812
  /** 这一帧铺进去的节点涟漪圈数(一个节点 count 圈算 count;关掉或视野内没有涟漪时为 0) */
3657
3813
  pointEffectCount: number
3814
+ /** 当前点聚合的多成员圆个数;聚合关闭或超过 maxZoom 时为 0 */
3815
+ clusterCount: number
3816
+ /** 被收进多成员聚合圆的原始点数:展示点数 = pointCount - clusterPointCount + clusterCount */
3817
+ clusterPointCount: number
3818
+ /** 最近一次聚合重算耗时(毫秒);聚合关闭时为 0 */
3819
+ clusterMs: number
3658
3820
  /** 动画是否还在排下一帧:静止画面是按需渲染的,这时候是 false */
3659
3821
  animating: boolean
3660
3822
  quality: GisViewQualityState
@@ -4734,19 +4896,29 @@ export interface GisViewTooltipOptions {
4734
4896
  */
4735
4897
  export type GisViewFilterCascade = false | 'binding' | 'coordinate' | 'both'
4736
4898
 
4737
- /** 筛选条件:点、线各一个条件,缺省表示该维度不过滤 */
4899
+ /** 筛选模式:hide 只隐藏(缺省);remove 把不命中的要素从数据里删掉(不可恢复,除非撤销) */
4900
+ export type GisViewFilterMode = 'hide' | 'remove'
4901
+
4902
+ /**
4903
+ * 筛选条件:点、线各一个条件,缺省表示该维度不过滤。
4904
+ * 缺省 mode: 'hide' 只算「隐藏集合」,不改数据;已经选中的要素被隐藏后仍留在选中集里,
4905
+ * 条件放宽 / 清空后会原样恢复高亮。mode: 'remove' 把筛选结果(hiddenPoints / hiddenLines)
4906
+ * 真正从数据里删掉(走 dataChange('filterRemove'),可用撤销恢复;不会额外按节点联级删线路)。
4907
+ */
4738
4908
  export interface GisViewFilter {
4739
4909
  points?: GisViewConditionInput<GisViewPoint>
4740
4910
  lines?: GisViewConditionInput<GisViewLine>
4741
4911
  /** 联动隐藏,默认 binding */
4742
4912
  cascade?: GisViewFilterCascade
4913
+ /** 不命中的要素怎么处理:'hide' 只隐藏(默认),'remove' 从数据里删除 */
4914
+ mode?: GisViewFilterMode
4743
4915
  /** 是否用 Worker 计算,缺省跟随 options.filterWorker */
4744
4916
  worker?: boolean
4745
4917
  }
4746
4918
 
4747
4919
  /**
4748
4920
  * 筛选条件的简写:只筛节点时可以直接给节点条件,等价于 `{ points: 条件 }`:
4749
- * `view.setFilter({ vn_kv: { gte: 525 } })`。顶层出现 points / lines / cascade / worker
4921
+ * `view.setFilter({ vn_kv: { gte: 525 } })`。顶层出现 points / lines / cascade / mode / worker
4750
4922
  * 任一键时按完整格式解释,因此简写里可以放心使用业务字段名。
4751
4923
  */
4752
4924
  export type GisViewFilterShorthand = GisViewConditionInput<GisViewPoint>
@@ -4754,7 +4926,7 @@ export type GisViewFilterShorthand = GisViewConditionInput<GisViewPoint>
4754
4926
  /** setFilter / options.filter 接受的条件:完整格式,或只筛节点的简写 */
4755
4927
  export type GisViewFilterInput = GisViewFilter | GisViewFilterShorthand
4756
4928
 
4757
- /** 筛选结果:hiddenPoints / hiddenLines 是当前被隐藏的要素下标 */
4929
+ /** 筛选结果:hiddenPoints / hiddenLines 是当前被隐藏的要素下标;remove 模式删除完会回到空数组 */
4758
4930
  export interface GisViewFilterResult {
4759
4931
  filter: GisViewFilter | null
4760
4932
  hiddenPoints: number[]
@@ -5041,6 +5213,18 @@ export interface GisViewInitialView {
5041
5213
  padding?: number
5042
5214
  }
5043
5215
 
5216
+ /**
5217
+ * 适应视图的节点间距兜底:普通「铺满数据范围」让最近节点在屏幕上挤在一起时,
5218
+ * 按 minDistance 反推一个更高的相机比例。放大时以最近节点对的中点为中心,
5219
+ * 远处孤立点可以把包围盒撑大,但不再把主体节点压成一团,也允许落到视口外。
5220
+ */
5221
+ export interface GisViewFitSpacingOptions {
5222
+ /** 可见节点中心之间的最小屏幕距离(CSS 像素),默认 24;写 0 或负数关闭 */
5223
+ minDistance?: number
5224
+ /** 相对普通适应比例的最大放大倍数,默认 0(不限,只受 maxScale 约束);正数表示上限 */
5225
+ maxZoom?: number
5226
+ }
5227
+
5044
5228
  /**
5045
5229
  * 插件:视图建好之后调用一次,拿到实例本身与带 apiVersion 的上下文;返回 { destroy } 时会挂进实例的 destroy。
5046
5230
  * 写一次插件,之后换项目直接复用,不必把「URL 同步 / 自建图例 / 业务操作」再抄一遍。
@@ -5054,6 +5238,24 @@ export interface GisViewPluginContext {
5054
5238
 
5055
5239
  export type GisViewPlugin = (view: GisViewInstance, context: GisViewPluginContext) => void | { destroy?: () => void }
5056
5240
 
5241
+ /** 实例命令的上下文:注册表属于这个视图,handler 里拿它就能继续调实例方法 */
5242
+ export interface GisViewCommandContext {
5243
+ readonly view: GisViewInstance
5244
+ /** 这次执行注册时用的命令名(已去掉首尾空白) */
5245
+ readonly name: string
5246
+ }
5247
+
5248
+ /** 实例命令:同步执行;返回值原样放进 GisViewCommandResult.value */
5249
+ export type GisViewCommandHandler<Payload = unknown, Value = unknown> = (payload: Payload, context: GisViewCommandContext) => Value
5250
+
5251
+ /** executeCommand 的读数:拿到命令并执行成功时 ok: true;没注册 / 名字非法 / handler 抛错时 ok: false 并给原因 */
5252
+ export interface GisViewCommandResult<Value = unknown> {
5253
+ readonly ok: boolean
5254
+ readonly name: string
5255
+ readonly value?: Value
5256
+ readonly reason?: string
5257
+ }
5258
+
5057
5259
  /**
5058
5260
  * 快捷键写法(大小写不敏感,多个用 + 连接):
5059
5261
  * - 纯修饰键:`ctrl` / `meta` / `shift` / `alt` / `mod`(`ctrl` 同时认 macOS 的 ⌘),按住 + 操作;
@@ -5501,8 +5703,6 @@ export type GisViewFeatureName =
5501
5703
  | 'remove'
5502
5704
  /** 新增通道:进入草稿、点两个节点、落地 */
5503
5705
  | 'channelDraft'
5504
- /** 通道右键交互框(onChannelContextMenu) */
5505
- | 'channelMenu'
5506
5706
  /** 右键回调 onContextMenu(关掉之后组件不再拦右键,浏览器菜单照常) */
5507
5707
  | 'contextMenu'
5508
5708
  /** 悬停提示(tooltip):关掉只影响提示,悬停样式与 onHover 还在 */
@@ -5678,7 +5878,7 @@ export interface GisViewBatchOptions {
5678
5878
  /**
5679
5879
  * 全部可订阅事件(与 EVENT_NAMES 一致):事件名与 options 里的回调一一对应(`dataChange` 就是 `onDataChange`),
5680
5880
  * 载荷也是同一份 —— 区别只在写法:`on` 可以挂多条、可以运行时订阅、返回的函数就是取消订阅。
5681
- * 需要原样带回 DOM 事件的那四个(pointerDown / pointerUp / contextMenu / channelContextMenu)载荷是
5881
+ * 需要原样带回 DOM 事件的那三个(pointerDown / pointerUp / contextMenu)载荷是
5682
5882
  * `{ payload, event }`,与回调的两个参数一一对应。
5683
5883
  */
5684
5884
  export interface GisViewEventMap {
@@ -5698,6 +5898,8 @@ export interface GisViewEventMap {
5698
5898
  pointerUp: { payload: GisViewPointerPayload; event: PointerEvent }
5699
5899
  contextMenu: { payload: GisViewPointerPayload; event: MouseEvent }
5700
5900
  click: GisViewClickPayload
5901
+ /** 点中多成员聚合圆:不选中内部节点,普通 click 不会同时触发 */
5902
+ clusterClick: GisViewClusterClickPayload
5701
5903
  dblClick: GisViewClickPayload
5702
5904
  /** 点了一下标签(label.editable / lineLabel.editable 打开时):用它选中要编辑的那一条 */
5703
5905
  labelClick: GisViewLabelClickPayload
@@ -5711,13 +5913,14 @@ export interface GisViewEventMap {
5711
5913
  labelDblClick: GisViewLabelPointerPayload
5712
5914
  select: GisViewSelectPayload | null
5713
5915
  selectChange: GisViewSelectChangePayload
5916
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
5917
+ cascadeHighlight: GisViewCascadeHighlightInfo | null
5714
5918
  pointDrag: GisViewPointDragPayload
5715
5919
  pointCopy: GisViewPointCopyPayload | GisViewBatchCopyPayload
5716
5920
  pointMerge: GisViewPointMergePayload | GisViewMergeResult | GisViewMergeFailure | GisViewMergeSelectedPayload
5717
5921
  /** 删除:pending(要删什么 / 连带什么 / 能按哪些范围删)→ remove(已删,result 是结果)/ cancel */
5718
5922
  remove: GisViewRemovePayload
5719
5923
  waypointChange: GisViewWaypointPayload
5720
- channelContextMenu: { payload: GisViewChannelContextPayload | null; event: MouseEvent }
5721
5924
  channelDraft: GisViewChannelDraftPayload
5722
5925
  channelDraftClick: GisViewChannelDraftPayload
5723
5926
  /** 动态装饰器草稿:start / hover / leave / ready / update / commit / cancel */
@@ -5860,6 +6063,12 @@ export interface GisViewWebGLLayer {
5860
6063
  draw(context: GisViewWebGLLayerDrawContext): void
5861
6064
  }
5862
6065
 
6066
+ /**
6067
+ * 选中触发方式:'click'(缺省)在第一次单击时改选中集;'dblClick' 等到双击的第二下才改,
6068
+ * 第一下仍照常派发 onClick。两种方式下 onDblClick 都会在双击第二下派发。
6069
+ */
6070
+ export type GisViewSelectTrigger = 'click' | 'dblClick'
6071
+
5863
6072
  export interface GisViewOptions {
5864
6073
  /**
5865
6074
  * 功能开关:预设名('edit' / 'view' / 'static')、开关表或布尔值 ——
@@ -5984,10 +6193,12 @@ export interface GisViewOptions {
5984
6193
  * 纯文本标签的渲染方式,缺省 `auto`:
5985
6194
  * - `auto`:强制显示档下,视口里的纯文本标签达到 1024 条时自动改画到单张 Canvas;
5986
6195
  * 需要 DOM 的标签(`html: true`、函数返回元素、可拖拽 / 可编辑)仍逐条建节点。
6196
+ * - `canvas`:纯文本标签始终改画到单张 Canvas,不受 1024 条阈值限制,`labelOptimize: true` 时
6197
+ * 也按画布尺寸参与避让 / 换落点;需要 DOM 的标签仍逐条建节点。
5987
6198
  * - `dom`:始终逐条建 `.gis-view__label`,保持旧行为。
5988
6199
  * 画布档不改变标签内容、锚点与显隐,只减少高密度场景的 DOM 数量。
5989
6200
  */
5990
- labelRender?: 'auto' | 'dom'
6201
+ labelRender?: 'auto' | 'canvas' | 'dom'
5991
6202
  /**
5992
6203
  * 标签的运行时状态(`getLabelStates()` 的那一份:拖过的偏移、改过的内容与样式、运行时加的标签、隐藏覆盖):
5993
6204
  * 创建 / `updateOptions` 时喂回来就回显,与 `setLabelStates(states)` 同一条路。
@@ -6004,6 +6215,12 @@ export interface GisViewOptions {
6004
6215
  tooltip?: GisViewTooltipOptions
6005
6216
  /** 初始筛选条件,等价于创建之后调用 setFilter;可以写完整格式,也可以只给节点条件 */
6006
6217
  filter?: GisViewFilterInput | null
6218
+ /**
6219
+ * 线路是否跟随节点,默认 true。开启时隐藏 / 删除 / 筛选节点会连带绑定线路与通道;
6220
+ * 关闭后这些操作只影响节点,线路与通道继续停在节点最后一次坐标,筛选未显式写 cascade 时默认不级联。
6221
+ * 筛选里显式写了 cascade 时始终以筛选自己的写法为准。
6222
+ */
6223
+ lineFollowsNode?: boolean
6007
6224
  /** 内置鹰眼图:不配就不显示,配了默认开 */
6008
6225
  minimap?: GisViewMinimapOptions | null
6009
6226
  /** 筛选是否用 Worker 计算:默认在数据量超过阈值时自动启用,false 表示始终同步计算 */
@@ -6028,6 +6245,12 @@ export interface GisViewOptions {
6028
6245
  lineSelectStyle?: GisViewLineStyle
6029
6246
  /** Ctrl 点击累加多选时的线样式:缺省沿用 lineSelectStyle,单条线可用 multiSelectStyle 覆盖 */
6030
6247
  lineMultiSelectStyle?: GisViewLineStyle
6248
+ /**
6249
+ * 点击级联高亮(默认关):点击节点时亮起它和直接相连的节点;scope 为 both 时连线路一起亮,
6250
+ * 点击线路 / 通道回线时亮起两端节点。它不进选中集,样式与悬停 / 选中分开配置,
6251
+ * 当前亮起的清单用 getCascadeHighlight() 读。
6252
+ */
6253
+ cascadeHighlight?: GisViewCascadeHighlightInput
6031
6254
  /** 没有配置状态样式时,是否仍用尺寸 / 宽度增幅画出内置强调;默认 false(不配样式就不改变外观) */
6032
6255
  defaultHighlight?: boolean
6033
6256
  /** 节点整体放大系数(常数倍数,与地图缩放无关,屏幕上的大小因此恒定):与点自身 size、缩放联动一起相乘,默认 1 */
@@ -6048,17 +6271,18 @@ export interface GisViewOptions {
6048
6271
  lineZoomScale?: number
6049
6272
  /** 缩放联动的基准比例:等于它时放大系数为 1,缺省用首次适应视图时的 camera.scale */
6050
6273
  zoomBaseScale?: number
6051
- /**
6052
- * 自适应比例开关(默认 false):打开后没写联动指数的 pointZoomScale / lineZoomScale 按 1 算 ——
6053
- * 要素与地图同倍率,包围盒变大(相机比例变小)时节点 / 线宽跟着一起小,
6054
- * 节点大小与通道间距的比例不再被带跑;显式写过指数(哪怕写 0)以显式值为准。
6055
- */
6056
- zoomScaleAuto?: boolean
6057
6274
  /**
6058
6275
  * 大数据初始化是否从视图中心向外发散渲染(默认开)。
6059
6276
  * 开启后首屏只排中心附近的那一批,剩下的分帧往外补;关了就一次性排完。
6060
6277
  */
6061
6278
  progressiveInit?: boolean
6279
+ /**
6280
+ * 点聚合:true 用缺省档(半径 60px、至少 2 点、不限缩放),对象写法见 GisViewPointClusterOptions。
6281
+ * 只影响展示、拾取、快照与导出;原始 points、选中集与 getData() 不变,
6282
+ * listPoints({ visibleOnly: true }) 会跳过被聚合圆收起的成员,传 false 仍可列全。
6283
+ * 聚合期间发散初始化暂停;缩放超过 maxZoom 后恢复逐点显示。
6284
+ */
6285
+ pointCluster?: boolean | GisViewPointClusterOptions
6062
6286
  /** 是否绘制网格:与其它功能开关同一条口径,**缺省关**,写 showGrid: true 才画 */
6063
6287
  showGrid?: boolean
6064
6288
  gridColor?: string
@@ -6108,6 +6332,12 @@ export interface GisViewOptions {
6108
6332
  * 关着时多选仍走框选(boxSelect)与按住多选快捷键(默认 Ctrl / ⌘)。
6109
6333
  */
6110
6334
  multiSelect?: boolean
6335
+ /**
6336
+ * 选中触发方式:缺省 'click'(单击选中);写 'dblClick' 后第一次点击只派发 onClick,
6337
+ * 第二次(双击判定命中)才更新选中集,并同时派发 onClick 与 onDblClick。
6338
+ * Ctrl / ⌘ 多选与 multiSelect 在双击模式下同样等到第二下才取反。运行时走 updateOptions({ selectTrigger })。
6339
+ */
6340
+ selectTrigger?: GisViewSelectTrigger
6111
6341
  /**
6112
6342
  * 框选 / Ctrl 多选允许收哪几类要素:'point' 节点、'line' 独立线路、'channel' 通道回线,
6113
6343
  * 可写数组任意组合,'all' / true 全开,false / null 全关。
@@ -6169,6 +6399,11 @@ export interface GisViewOptions {
6169
6399
  * zoom 是相对「适应视图」的倍数(2 = 比适应近一倍),scale 是绝对的 像素 / 世界单位。
6170
6400
  */
6171
6401
  initialView?: GisViewInitialView | null
6402
+ /**
6403
+ * 适应视图时按可见节点间距兜底(默认关):true 用 minDistance 24 / maxZoom 不限,
6404
+ * 对象可改两个参数。只在首次默认适应与 fitView() 生效,显式 initialView.scale / zoom 优先。
6405
+ */
6406
+ fitSpacing?: boolean | GisViewFitSpacingOptions
6172
6407
  /**
6173
6408
  * onStats 的最小间隔(毫秒),默认 250,0 表示每帧都发。
6174
6409
  * 读数不需要 60Hz,节流能省下每帧一次的回调与对象分配(拖拽时尤其明显)。
@@ -6212,6 +6447,8 @@ export interface GisViewOptions {
6212
6447
  onSelect?: (payload: GisViewSelectPayload | null) => void
6213
6448
  /** 单击要素或空白处 */
6214
6449
  onClick?: (payload: GisViewClickPayload | null) => void
6450
+ /** 点中多成员聚合圆:载荷带 count / pointIds / bounds;不会同时触发 onClick,也不改选中集 */
6451
+ onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
6215
6452
  /** 双击要素或空白处 */
6216
6453
  onDblClick?: (payload: GisViewClickPayload | null) => void
6217
6454
  /** 点了一下标签(label.editable / lineLabel.editable 打开时):载荷里是这一条标签的类型、下标与当前覆盖 */
@@ -6231,8 +6468,13 @@ export interface GisViewOptions {
6231
6468
  onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6232
6469
  /** 左键 / 中键 / 右键抬起:与 onPointerDown 成对 */
6233
6470
  onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6234
- /** 右键:点、线、空白都会发(要素信息在载荷里,要自己弹菜单就在这里 preventDefault) */
6471
+ /**
6472
+ * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
6473
+ * 载荷另带 channelContext;要自己弹菜单就在这里 preventDefault()。
6474
+ */
6235
6475
  onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
6476
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
6477
+ onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
6236
6478
  onHover?: (payload: GisViewHoverPayload) => void
6237
6479
  onCursor?: (payload: GisViewCursorPayload) => void
6238
6480
  /** 光标移动 / 移出画布:屏幕坐标、世界坐标与经纬度(配了 GeoJSON 底图才有 lngLat) */
@@ -6258,8 +6500,6 @@ export interface GisViewOptions {
6258
6500
  onRemove?: (payload: GisViewRemovePayload) => void
6259
6501
  /** 拐点新增、选中、删除与拖动 */
6260
6502
  onWaypointChange?: (payload: GisViewWaypointPayload) => void
6261
- /** 右键点中通道回线:给出分组上下文(几组 / 当前哪组 / 有哪些交互),点空白处给 null */
6262
- onChannelContextMenu?: (payload: GisViewChannelContextPayload | null, event: MouseEvent) => void
6263
6503
  /** 新增通道草稿:start / from / to / ready / cancel / commit / blocked,两个节点的信息与方案都在载荷里 */
6264
6504
  onChannelDraft?: (payload: GisViewChannelDraftPayload) => void
6265
6505
  /** 草稿里每点一次发一条:step 1 拿到起点、step 2 拿到终点(线路结束),载荷与 onChannelDraft 相同 */
@@ -6320,37 +6560,63 @@ export interface GisViewOptions {
6320
6560
  onError?: (message: string) => void
6321
6561
  }
6322
6562
 
6323
- /** 搜索范围:节点 / 线路 / 通道(通道会连成员回线一起搜) */
6324
- export type GisViewSearchScope = 'points' | 'lines' | 'channels'
6563
+ /** 搜索范围(规范化后的键):节点 / 线路 / 通道 / 通道分组(通道会连成员回线一起搜) */
6564
+ export type GisViewSearchScope = 'points' | 'lines' | 'channels' | 'groups'
6565
+
6566
+ /** scope 的入参写法:复数的规范化键,或与 focusOn 目标一致的 point / line / channel / group 单数别名 */
6567
+ export type GisViewSearchScopeInput = GisViewSearchScope | 'point' | 'line' | 'channel' | 'group'
6325
6568
 
6326
6569
  export interface GisViewSearchOptions {
6327
6570
  /** 关键字:空格分隔多个词时要在同一个字段里全部出现才命中,不区分大小写 */
6328
6571
  keyword?: string
6329
- /** 搜索范围,缺省三类都搜 */
6330
- scope?: GisViewSearchScope | GisViewSearchScope[]
6572
+ /**
6573
+ * 搜索范围,缺省四类都搜。复数的 points / lines / channels / groups 与单数别名
6574
+ * point / line / channel / group 都收;写错或空数组会回落到四类全搜。
6575
+ */
6576
+ scope?: GisViewSearchScopeInput | GisViewSearchScopeInput[]
6331
6577
  /** 限定参与匹配的字段路径(如 ['name', 'props.vn_kv']),缺省用要素的全部字段 */
6332
6578
  fields?: string[]
6333
6579
  /** 每类要素的命中上限,缺省 200,0 表示不限 */
6334
6580
  limit?: number
6335
6581
  }
6336
6582
 
6583
+ /**
6584
+ * 分组搜索命中里的 item:与 getChannelGroups() 的读数同源,但只保留搜索与定位需要的轻量字段
6585
+ * (不带骨架 / 回线几何)。groupIndex 是这一组在所属通道里的序号(从 0 起)。
6586
+ */
6587
+ export interface GisViewSearchGroupItem {
6588
+ channelId: string | number
6589
+ channelIndex: number
6590
+ id: string | number
6591
+ groupIndex: number
6592
+ lineIndexes: number[]
6593
+ lineIds: Array<string | number>
6594
+ lineCount: number
6595
+ anchored: boolean
6596
+ edited: boolean
6597
+ }
6598
+
6337
6599
  /** 一条搜索命中:field / value 是命中的那一项,bounds 用来居中或适应视图 */
6338
6600
  export interface GisViewSearchHit {
6339
- kind: 'point' | 'line' | 'channel'
6340
- /** 点 / 线在数据里的下标;通道是通道下标 */
6601
+ kind: 'point' | 'line' | 'channel' | 'group'
6602
+ /** 点 / 线在数据里的下标;通道是通道下标;分组是 groups 结果里的下标 */
6341
6603
  index: number
6342
6604
  id?: string | number
6343
- item: GisViewPoint | GisViewLine | GisViewChannel
6605
+ item: GisViewPoint | GisViewLine | GisViewChannel | GisViewSearchGroupItem
6344
6606
  field: string
6345
6607
  value: string
6346
6608
  bounds: GisViewBounds
6347
- /** 要素属于某条通道时给出通道下标(线路命中,或通道命中自身字段) */
6609
+ /** 要素属于某条通道时给出通道下标(线路 / 分组命中,或通道命中自身字段) */
6348
6610
  channelIndex?: number
6349
6611
  /** 通道内第几条回线(0 开始) */
6350
6612
  memberIndex?: number
6351
6613
  /** 通道命中来自回线时,该回线在 lines 里的下标与 id */
6352
6614
  memberLineIndex?: number
6353
6615
  memberLineId?: string | number
6616
+ /** 分组命中:分组 id(与 focusOn / selectFeatures 的 groupId 同一口径) */
6617
+ groupId?: string | number
6618
+ /** 分组命中:这一组在所属通道里的序号(从 0 起) */
6619
+ groupIndex?: number
6354
6620
  }
6355
6621
 
6356
6622
  export interface GisViewSearchResult {
@@ -6359,7 +6625,8 @@ export interface GisViewSearchResult {
6359
6625
  points: GisViewSearchHit[]
6360
6626
  lines: GisViewSearchHit[]
6361
6627
  channels: GisViewSearchHit[]
6362
- /** 三类命中的合集,顺序是节点、线路、通道 */
6628
+ groups: GisViewSearchHit[]
6629
+ /** 四类命中的合集,顺序是节点、线路、通道、分组 */
6363
6630
  hits: GisViewSearchHit[]
6364
6631
  total: number
6365
6632
  /** 命中数达到上限被截断 */
@@ -6374,7 +6641,10 @@ export interface GisViewSearchResult {
6374
6641
  /**
6375
6642
  * focusOn 的目标(一个):搜索命中、要素写法、世界坐标(两个数 / `[x, y]` / `{ x, y }`)、
6376
6643
  * 一段世界坐标范围、通道写法(取通道范围)、`{ center: [x, y] }` 或 `{ lngLat: [经度, 纬度] }`
6377
- * (配了 GeoJSON 底图才有意义)。
6644
+ * (配了 GeoJSON 底图才有意义)。要素 / 通道 / 分组可以用 `type` 明确消歧:
6645
+ * `{ type: 'point' | 'line' | 'channel', id | index }`、`{ type: 'group', channelId, groupId }`
6646
+ * (group 的 channelId 可省略,只要 groupId 全局唯一)。字符串 / 数字仍按「先节点 id、再线路 id」兼容;
6647
+ * 同 id 时显式写 `type` 即可;裸字符串不表示通道,通道请写 `{ channelId }` 或显式 `type: 'channel'`。
6378
6648
  */
6379
6649
  export type GisViewFocusTarget = GisViewSearchHit | GisViewFeatureKey | GisViewSelectionRefObject | string | number | GisViewCoordinate | GisViewBounds | { x: number, y: number } | { center: GisViewCoordinate } | { lngLat: GisViewCoordinate } | { longitude: number, latitude: number }
6380
6650
 
@@ -6382,13 +6652,15 @@ export type GisViewFocusTarget = GisViewSearchHit | GisViewFeatureKey | GisViewS
6382
6652
  export type GisViewFocusTargets = GisViewFocusTarget | GisViewFocusTarget[]
6383
6653
 
6384
6654
  export interface GisViewFocusOptions {
6385
- /** 直接设成这个比例(像素 / 世界单位);不给就按目标范围适应视图 */
6655
+ /** 直接设成这个比例(像素 / 世界单位);优先级高于 zoom */
6386
6656
  scale?: number
6387
- /** 只把中心挪到目标上、比例一点不动(聚焦一个点又不想改缩放时用) */
6657
+ /** 显式要求按目标范围适应视图;**缺省不缩放**,只把中心移到目标上 */
6658
+ zoom?: boolean
6659
+ /** 显式只居中、比例一点不动(与缺省行为一致,保留旧写法) */
6388
6660
  center?: boolean
6389
- /** 按范围适应视图时四周的留白(CSS 像素),缺省 40 */
6661
+ /** 按范围适应视图(zoom: true)时四周的留白(CSS 像素),缺省 40 */
6390
6662
  padding?: number
6391
- /** 适应视图时最多放大到多少比例:单个节点 / 一条直线没有面积,靠它决定要不要放大 */
6663
+ /** 适应视图(zoom: true)时最多放大到多少比例:单个节点 / 一条直线没有面积,靠它决定要不要放大 */
6392
6664
  maxZoom?: number
6393
6665
  /**
6394
6666
  * 顺手把这些被聚焦的要素变成选中状态:`true` 选中这次聚焦的这批(通常配合搜索命中),
@@ -6411,6 +6683,13 @@ export interface GisViewExportImageOptions {
6411
6683
  quality?: number
6412
6684
  /** 导出倍率:位图相对画布 CSS 尺寸,缺省按设备像素比导(与屏幕一致);SVG 只影响宽高属性,缺省 1 */
6413
6685
  scale?: number
6686
+ /**
6687
+ * 导出范围:'viewport'(缺省)只导当前可视区域;'all' 临时适应全部数据范围,导完恢复原相机。
6688
+ * 筛选 / visible: false 隐藏的要素仍不会出现;'all' 指当前场景里全部可见内容
6689
+ */
6690
+ scope?: 'viewport' | 'all'
6691
+ /** scope: 'all' 时四周留白(CSS 像素,缺省 24);scope: 'viewport' 时忽略 */
6692
+ padding?: number
6414
6693
  /**
6415
6694
  * 背景:缺省 = 带背景(背景色 / 底图 / GeoJSON 区域填充与网格,与屏幕上一致);
6416
6695
  * false / 'none' / 'transparent' = 不带背景(透明底,上面那些都不画);
@@ -6961,6 +7240,20 @@ export interface GisViewSceneGraphic {
6961
7240
  preserveAspectRatio: string
6962
7241
  }
6963
7242
 
7243
+ /** 矢量快照里的多成员聚合圆(数量文字也在这里;单成员不画圆) */
7244
+ export interface GisViewSceneCluster {
7245
+ id: string
7246
+ count: number
7247
+ x: number
7248
+ y: number
7249
+ radius: number
7250
+ fill: string
7251
+ stroke: string
7252
+ strokeWidth: number
7253
+ textColor: string
7254
+ fontSize: number
7255
+ }
7256
+
6964
7257
  export interface GisViewSceneSnapshot {
6965
7258
  width: number
6966
7259
  height: number
@@ -6974,6 +7267,7 @@ export interface GisViewSceneSnapshot {
6974
7267
  /** 数据线路与节点装饰连接线(连接线也画在节点 / 装饰之前) */
6975
7268
  lines: GisViewSceneLine[]
6976
7269
  points: GisViewSceneNode[]
7270
+ clusters: GisViewSceneCluster[]
6977
7271
  backgroundPoints: GisViewSceneNode[]
6978
7272
  decorations: GisViewSceneNode[]
6979
7273
  waypoints: GisViewSceneNode[]
@@ -7194,7 +7488,7 @@ export interface GisViewInstance {
7194
7488
  setCamera(camera: Partial<GisViewCamera>): GisViewInstance
7195
7489
  getCamera(): GisViewCamera
7196
7490
  getBounds(): GisViewBounds
7197
- /** 缩放联动的基准比例(pointZoomScale / lineZoomScale / zoomScaleAuto 共用那一份):缺省是首次适应视图时的 camera.scale */
7491
+ /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
7198
7492
  getZoomBaseScale(): number
7199
7493
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),之后放大缩小都从它算倍数,返回 this */
7200
7494
  setZoomBaseScale(scale?: number): GisViewInstance
@@ -7279,7 +7573,7 @@ export interface GisViewInstance {
7279
7573
  createGeoMapper(options?: GisViewGeoMapperOptions): GisViewGeoMapper | null
7280
7574
  /** 直接把一份点 / 线 / 通道数据映射到 GeoJSON 坐标上(复制,不改原数据);没有 GeoJSON 底图时是 null */
7281
7575
  mapDataToGeoJson<T extends { points?: GisViewPoint[]; lines?: GisViewLine[]; channels?: GisViewChannel[] }>(data: T, options?: GisViewGeoMapperOptions): T | null
7282
- pick(x: number, y: number): GisViewPickResult | null
7576
+ pick(x: number, y: number): GisViewHitResult | null
7283
7577
  /**
7284
7578
  * 按浏览器客户端坐标拾取(鼠标事件里的 clientX / clientY):与指针事件载荷同一份读数,另加 target
7285
7579
  * ('point' / 'line' / 'channel')与 lngLat(配了 GeoJSON 底图才有);没命中返回 null。
@@ -7315,11 +7609,19 @@ export interface GisViewInstance {
7315
7609
  * getSelectionData 立刻就能读回来。认这些写法(见 GisViewSelectionRef):
7316
7610
  * ① 节点:id、`{ type: 'point', index: 3 }`、一批 id 与对象混着写;
7317
7611
  * ② 通道:`{ type: 'channel', channelId: 'channel-a' }` 选整条通道的回线,
7318
- * `{ channelId, groupId }` 选某一组,`{ channelId, lineIds: [...] }` 选通道里的某几条回线;
7612
+ * `{ channelId, groupId }` / `{ type: 'group', channelId, groupId }` 选某一组
7613
+ * (只给全局唯一的 groupId 也可以),`{ channelId, lineIds: [...] }` 选通道里的某几条回线;
7319
7614
  * ③ 线路:id 或 `{ type: 'line', index: 3 }`。
7320
7615
  * options.mode 给 'add' / 'toggle' / 'remove' 就在当前选中集上做加 / 取反 / 减
7321
7616
  */
7322
7617
  selectFeatures(refs: GisViewSelectionRefs, options?: GisViewSelectOptions): GisViewInstance
7618
+ /**
7619
+ * 选中一个拐点:`selectWaypoint('line-1', 2)` / `selectWaypoint({ lineIndex: 3, pathIndex: 1 })` /
7620
+ * `selectWaypoint({ lineId: 'line-1', pathIndex: 2 })`。同时把拐点所在线路选上(缺省
7621
+ * `waypointVisibility: 'selected'` 下拐点才可见);`selectWaypoint(null)` 只取消拐点选中,
7622
+ * 不改要素选中集。`pathIndex` 只认 `getWaypoints()` 给出的可编辑拐点,无效时不会猜位置。
7623
+ */
7624
+ selectWaypoint(waypoint: GisViewWaypointKey | GisViewWaypointRef | string | number | null, pathIndex?: number, options?: GisViewSelectOptions): GisViewInstance
7323
7625
  /**
7324
7626
  * 取消选中:写法与 selectFeatures 完全一样(节点 / 通道 / 线路,一批可以混着写),
7325
7627
  * 把这些从当前选中集里去掉,其余选中原样留着 —— `deselect('p-1')` 取消一个节点、
@@ -7345,6 +7647,11 @@ export interface GisViewInstance {
7345
7647
  * bounds 走一次 getElementBounds(十万级选中下约 5 ms),只想问「选了哪几个」用 getSelections() 更省
7346
7648
  */
7347
7649
  getSelectionData(): GisViewSelectionData
7650
+ /**
7651
+ * 当前点击级联高亮的读数:来源、scope 与亮着的节点 / 线路;没有级联高亮(或功能关着)时是 null。
7652
+ * 它只读,不改变选中集;点空白处、换数据或关掉 cascadeHighlight 会收掉。
7653
+ */
7654
+ getCascadeHighlight(): GisViewCascadeHighlightInfo | null
7348
7655
  /** 按画布 CSS 像素矩形框选;options.selectionKinds 可临时覆盖全局类型过滤 */
7349
7656
  selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions): GisViewInstance
7350
7657
  /**
@@ -7530,7 +7837,8 @@ export interface GisViewInstance {
7530
7837
  /** 执行右键交互框里的动作,返回执行之后的上下文 */
7531
7838
  runChannelAction(actionId: GisViewChannelActionId, options?: { channelId?: string | number; groupId?: string | number; coordinate?: GisViewCoordinate; pathIndex?: number; size?: number }): GisViewChannelContext | null
7532
7839
  /**
7533
- * 进入「新增通道」:点第一个节点当起点,一条线跟随光标,点第二个节点发结束事件
7840
+ * 进入「新增通道」:缺省点第一个节点当起点,一条线跟随光标,点第二个节点发结束事件;
7841
+ * options.from 可以预指定起点,此后只需要再选终点
7534
7842
  * (phase: 'ready',载荷里带两个节点、hasChannel / hasGroup / groups / channel 与可选方案)。
7535
7843
  * 它只负责这条可视化示例路径 —— 真正的落地必须用 addChannel(或 addChannelGroupLines /
7536
7844
  * joinChannelGroupLines / addLine),不在事件里落地就用 endAddChannel / cancelAddChannel 收掉假通道。
@@ -7798,6 +8106,10 @@ export interface GisViewInstance {
7798
8106
  getChannel(ref: GisViewFeatureRef): GisViewChannelSnapshot | null
7799
8107
  /** 按条件列节点快照(indexes / inView / limit / withScreen / visibleOnly):可见点读数的通用入口 */
7800
8108
  listPoints(options?: GisViewListOptions): GisViewListedPoint[]
8109
+ /** 当前点聚合的展示组(含 count: 1 的单成员):只读,原始 points / getData() 不变 */
8110
+ getClusters(): GisViewCluster[]
8111
+ /** 当前点聚合配置与运行时开关(缩放超过 maxZoom 后 active 为 false) */
8112
+ getPointCluster(): GisViewPointClusterReadout | null
7801
8113
  /** 按条件列线路快照(与 listPoints 同一套选项):通道回线带通道读数,另有 color / width */
7802
8114
  listLines(options?: GisViewListOptions): GisViewListedLine[]
7803
8115
  /** 一批要素的世界包围盒;一个都没对上(数据已经换过)返回 null */
@@ -7850,6 +8162,16 @@ export interface GisViewInstance {
7850
8162
  * 调它就把这个插件返回的 `destroy` 清掉(重复调用只清一次;实例销毁之后再调也安全)
7851
8163
  */
7852
8164
  use(plugin: GisViewPlugin): () => void
8165
+ /**
8166
+ * 注册一个实例命令:`handler(payload, context)` 同步执行,`context.view` 就是这个视图。
8167
+ * 同名覆盖(后注册的生效);返回幂等的注销函数,同名被后注册覆盖后旧卸载函数不会误删新命令。
8168
+ * 名字空 / handler 不是函数只报一条 onWarning;实例销毁后注册不生效。
8169
+ */
8170
+ registerCommand<Payload = unknown, Value = unknown>(name: string, handler: GisViewCommandHandler<Payload, Value>): () => void
8171
+ /** 执行一个实例命令:成功给 `{ ok: true, name, value }`;没注册 / 名字非法 / handler 抛错给 `{ ok: false, name, reason }` */
8172
+ executeCommand<Value = unknown>(name: string, payload?: unknown): GisViewCommandResult<Value>
8173
+ /** 当前注册着哪些实例命令(按注册顺序;同名覆盖不改变原来的位置) */
8174
+ listCommands(): string[]
7853
8175
  /**
7854
8176
  * 注册一个自定义图元:名字写进数据的 `symbol` 字段(`symbol: '三角'`),画法交给一支画笔
7855
8177
  * (`painter(context, info)`,读数见 `GisViewSymbolPainterInfo`)。注册完(或换一支画笔之后)
@@ -7958,6 +8280,8 @@ export interface GisViewEngineOptions {
7958
8280
  lineSelectStyle?: GisViewLineStyle | null
7959
8281
  /** Ctrl 点击累加多选时的线样式:缺省沿用 lineSelectStyle */
7960
8282
  lineMultiSelectStyle?: GisViewLineStyle | null
8283
+ /** 点击级联高亮:true / 对象打开,false / null 关闭;详细写法见 GisViewOptions.cascadeHighlight */
8284
+ cascadeHighlight?: GisViewCascadeHighlightInput | null
7961
8285
  /** 没有配置状态样式时是否仍画内置强调(尺寸 / 宽度增幅与强调环);默认 false */
7962
8286
  defaultHighlight?: boolean
7963
8287
  /** 节点整体放大系数,默认 1 */
@@ -7970,12 +8294,14 @@ export interface GisViewEngineOptions {
7970
8294
  lineZoomScale?: number
7971
8295
  /** 缩放联动的基准比例,缺省用首次适应视图时的 camera.scale */
7972
8296
  zoomBaseScale?: number
7973
- /** 自适应比例开关:没写联动指数的那几项按 1(与地图同倍率)算,默认 false */
7974
- zoomScaleAuto?: boolean
7975
8297
  /** 大数据初始化是否从视图中心向外发散渲染,默认开 */
7976
8298
  progressiveInit?: boolean
8299
+ /** 点聚合:true 用缺省档,对象写法见 GisViewPointClusterOptions(只改展示 / 拾取 / 快照) */
8300
+ pointCluster?: boolean | GisViewPointClusterOptions
7977
8301
  /** 初始视图:首次拿到数据时相机落在哪里(缺省适应数据范围),结构见 GisViewInitialView */
7978
8302
  initialView?: GisViewInitialView | null
8303
+ /** 适应视图的节点间距兜底:true 用缺省档,对象可改 minDistance / maxZoom,默认关 */
8304
+ fitSpacing?: boolean | GisViewFitSpacingOptions
7979
8305
  /** onStats 的最小间隔(毫秒),默认 250,0 表示每帧都发 */
7980
8306
  statsInterval?: number
7981
8307
  /** 画质:档位名或 `{ mode, budgetMs, minScale }`(见 GisViewQualityOptions),只影响画哪些批次与分辨率 */
@@ -7997,10 +8323,12 @@ export interface GisViewEngineOptions {
7997
8323
  zoom?: boolean
7998
8324
  hover?: boolean
7999
8325
  select?: boolean
8326
+ /** 选中触发方式:'click'(缺省)或 'dblClick',见 GisViewSelectTrigger */
8327
+ selectTrigger?: GisViewSelectTrigger
8000
8328
  contextMenu?: boolean
8001
8329
  /**
8002
8330
  * 右键默认把浏览器的系统菜单收掉(组件接住右键时 preventDefault contextmenu)。
8003
- * 写 false 保留系统菜单:onContextMenu / onChannelContextMenu 照常发,只是不再挡浏览器自己弹菜单。
8331
+ * 写 false 保留系统菜单:onContextMenu 照常发,只是不再挡浏览器自己弹菜单。
8004
8332
  */
8005
8333
  preventContextMenu?: boolean
8006
8334
  /** 悬停拾取的移动阈值(CSS 像素):指针移动不超过它时不重算拾取,0 表示每次指针事件都重算;默认 2 */
@@ -8028,6 +8356,8 @@ export interface GisViewEngineOptions {
8028
8356
  channelSelectMode?: GisViewChannelSelectMode
8029
8357
  /** 分组拐点拖动模式:'parallel'(缺省)/ 'vertex',见 GisViewOptions.channelWaypointDragMode */
8030
8358
  channelWaypointDragMode?: GisViewChannelWaypointDragMode
8359
+ /** 线路是否跟随节点,缺省 true;关闭后节点退场时线路 / 通道停在最后一份坐标与解析尺寸 */
8360
+ lineFollowsNode?: boolean
8031
8361
 
8032
8362
  /** 快捷键:动作 -> 写法(框选、多选、加点、复制、粘贴、取消、删除、适应视图),没写的沿用默认值 */
8033
8363
  shortcuts?: GisViewShortcuts
@@ -8058,12 +8388,19 @@ export interface GisViewEngineOptions {
8058
8388
  */
8059
8389
  onSelect?: (payload: GisViewSelectPayload | null, detail?: { mode?: 'single' | 'multi' | 'box'; originalEvent?: Event | null }) => void
8060
8390
  onClick?: (payload: GisViewClickPayload | null) => void
8391
+ /** 点中多成员聚合圆(引擎不选中成员,普通点击回调不会同时触发) */
8392
+ onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
8061
8393
  onDblClick?: (payload: GisViewClickPayload | null) => void
8062
8394
  /** 左键 / 中键 / 右键按下与抬起:命中的要素、按钮与光标位置都在载荷里 */
8063
8395
  onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
8064
8396
  onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
8065
- /** 右键:点、线、空白都会发 */
8397
+ /**
8398
+ * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
8399
+ * 载荷另带 channelContext(几组 / 当前哪组 / 能做什么),不再有单独的通道路由。
8400
+ */
8066
8401
  onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
8402
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
8403
+ onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
8067
8404
  onPointDrag?: (payload: GisViewPointDragPayload) => void
8068
8405
  /** 复制节点:start / move / commit / end / cancel(剪贴板另有 clipboard) */
8069
8406
  onPointCopy?: (payload: GisViewPointCopyPayload | GisViewBatchCopyPayload) => void
@@ -8071,8 +8408,6 @@ export interface GisViewEngineOptions {
8071
8408
  onPointMerge?: (payload: GisViewPointMergePayload | GisViewMergeResult | GisViewMergeFailure | GisViewMergeSelectedPayload) => void
8072
8409
 
8073
8410
  onWaypointChange?: (payload: GisViewWaypointPayload) => void
8074
- /** 右键点中通道回线:给出分组上下文(几组 / 当前哪组 / 有哪些交互),点空白处给 null */
8075
- onChannelContextMenu?: (payload: GisViewChannelContextPayload | null, event: MouseEvent) => void
8076
8411
  /** 新增通道草稿:start / from / ready / cancel / commit / blocked / restart / pick */
8077
8412
  onChannelDraft?: (payload: GisViewChannelDraftPayload) => void
8078
8413
  /** 草稿里每点一次发一条:step 1 拿到起点、step 2 拿到终点(线路结束) */
@@ -8135,6 +8470,10 @@ export interface GisViewEngine {
8135
8470
  getChannels(): GisViewChannelInfo[]
8136
8471
  /** 单条通道运行时状态:只复制这一组;channelId 找不到时可按 channels 下标兜底 */
8137
8472
  getChannel(channelId?: string | number | null, channelIndex?: number): GisViewChannelInfo | null
8473
+ /** 单条通道的范围:按当前骨架与每条回线的折线计算,不复制几何;channelId 找不到时可按 channels 下标兜底 */
8474
+ getChannelBounds(channelId?: string | number | null, channelIndex?: number): GisViewBounds | null
8475
+ /** 一个分组的范围:按这一组当前骨架与回线折线计算,不复制几何;没有 channelId 时按通道下标兜底 */
8476
+ getChannelGroupBounds(channelId: string | number | null | undefined, groupId: string | number, channelIndex?: number): GisViewBounds | null
8138
8477
  /** 通道成员表:成员回线下标与各自的横向偏移,不复制几何(自建覆盖层按通道分流绘制用它) */
8139
8478
  getChannelMembers(): GisViewChannelMembers[]
8140
8479
  /** 通道分组现状:不传 channelId 返回所有分组 */
@@ -8249,7 +8588,7 @@ export interface GisViewEngine {
8249
8588
  applyInitialView(): void
8250
8589
  resetView(): void
8251
8590
  getBounds(): GisViewBounds
8252
- /** 缩放联动的基准比例(pointZoomScale / lineZoomScale / zoomScaleAuto 共用那一份):缺省是首次适应视图时的 camera.scale */
8591
+ /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
8253
8592
  getZoomBaseScale(): number
8254
8593
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),返回落定的基准 */
8255
8594
  setZoomBaseScale(scale?: number): number
@@ -8261,6 +8600,12 @@ export interface GisViewEngine {
8261
8600
  getViewRect(): GisViewBounds
8262
8601
  /** 按条件列节点(只读快照,见 GisViewListOptions):面板读数 / 导出 / 校验用,十万级下别逐帧调 */
8263
8602
  listPoints(options?: GisViewListOptions): GisViewListedPoint[]
8603
+ /** 当前展示组(含 count: 1 的单成员):原始 points 不受影响 */
8604
+ getClusters(): GisViewCluster[]
8605
+ /** 覆盖层每帧同步数量文字用的轻量读数:只含多成员聚合圆 */
8606
+ getClusterLabels(): GisViewClusterLabel[]
8607
+ /** 当前点聚合配置与运行时开关 */
8608
+ getPointCluster(): GisViewPointClusterReadout
8264
8609
  /** 按条件列线路(只读快照):通道内的回线给的是骨架推导出来的折线,另带 color / width 与通道读数 */
8265
8610
  listLines(options?: GisViewListOptions): GisViewListedLine[]
8266
8611
  /** 一批要素的世界包围盒;一个都没对上返回 null */
@@ -8303,9 +8648,9 @@ export interface GisViewEngine {
8303
8648
  clientToWorld(clientX: number, clientY: number): [number, number]
8304
8649
  /** 世界坐标 → 客户端坐标(摆 DOM 浮层 / 菜单用) */
8305
8650
  worldToClient(x: number, y: number): [number, number]
8306
- pick(x: number, y: number): GisViewPickResult | null
8651
+ pick(x: number, y: number): GisViewHitResult | null
8307
8652
  /** 与组件实例的 pickAt 同一份:按浏览器客户端坐标拾取(引擎不等 DOM 事件,直接给 clientX / clientY) */
8308
- pickAtClient(clientX: number, clientY: number): GisViewPickResult | null
8653
+ pickAtClient(clientX: number, clientY: number): GisViewHitResult | null
8309
8654
  /** 程序化悬停(客户端坐标):让指针「停」在这儿,悬停高亮 / 光标 / onHover 一起更新,返回这一次的读数 */
8310
8655
  hoverAtClient(clientX: number, clientY: number): GisViewHoverPayload | null
8311
8656
  /** 取消程序化悬停:清掉高亮与读数并补发 onHover(null) */