gis-view-webgl2 0.1.2 → 0.1.3

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 (61) hide show
  1. package/README.md +12 -8
  2. package/dist/gis-view.css +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +309 -59
  5. package/dist/index.js +1 -1
  6. package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +117 -0
  7. package/docs/GisView.md +2 -2
  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 +107 -0
  9. package/docs/api/index.html +1 -1
  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/GisViewDemo.vue +64 -8809
  16. package/docs/demos/api-index.js +48 -41
  17. package/docs/demos/demos.js +33 -16
  18. package/docs/demos/gis-view-demo/GisViewDemoCardHeader.vue +28 -0
  19. package/docs/demos/gis-view-demo/GisViewDemoDialogs.vue +82 -0
  20. package/docs/demos/gis-view-demo/GisViewDemoFooter.vue +16 -0
  21. package/docs/demos/gis-view-demo/GisViewDemoHeading.vue +16 -0
  22. package/docs/demos/gis-view-demo/GisViewDemoPanelStack.vue +71 -0
  23. package/docs/demos/gis-view-demo/GisViewDemoStage.vue +219 -0
  24. package/docs/demos/gis-view-demo/demo.css +1230 -0
  25. package/docs/demos/gis-view-demo/demoContext.js +12 -0
  26. package/docs/demos/gis-view-demo/panels/DataPanels.vue +303 -0
  27. package/docs/demos/gis-view-demo/panels/OpsPanels.vue +174 -0
  28. package/docs/demos/gis-view-demo/panels/StylePanels.vue +561 -0
  29. package/docs/demos/gis-view-demo/panels/ViewPanels.vue +396 -0
  30. package/docs/demos/gis-view-demo/useGisViewDemo.js +6188 -0
  31. 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
  32. 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
  33. package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +3 -2
  34. package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +87 -14
  35. package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +8 -8
  36. 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
  37. package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +26 -0
  38. 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
  39. 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
  40. package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +13 -4
  41. package/docs/manual/13-/345/212/250/346/225/210/344/270/216/345/233/276/345/205/203.md +3 -0
  42. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +35 -19
  43. package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +5 -0
  44. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +12 -6
  45. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +39 -22
  46. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +52 -13
  47. 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
  48. 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 -5
  49. package/docs/steps/README.md +17 -11
  50. package/docs/steps/selftest-actions.html +3 -5
  51. package/docs/steps/selftest-demo.html +27 -18
  52. package/docs/steps/selftest-demos.html +387 -27
  53. package/docs/steps/selftest-docs.html +4 -4
  54. package/docs/steps/selftest-effects.html +200 -0
  55. package/docs/steps/selftest-features.html +512 -11
  56. package/docs/steps/selftest-labels.html +74 -0
  57. package/docs/steps/selftest-perf.html +293 -20
  58. package/docs/steps/selftest-scale.html +52 -29
  59. package/docs/steps/step-10-full.js +1 -1
  60. package/docs/steps/step-12-events.js +1 -1
  61. 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 下标) */
@@ -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
@@ -3655,6 +3801,12 @@ export interface GisViewEngineStats {
3655
3801
  lineEffectCount: number
3656
3802
  /** 这一帧铺进去的节点涟漪圈数(一个节点 count 圈算 count;关掉或视野内没有涟漪时为 0) */
3657
3803
  pointEffectCount: number
3804
+ /** 当前点聚合的多成员圆个数;聚合关闭或超过 maxZoom 时为 0 */
3805
+ clusterCount: number
3806
+ /** 被收进多成员聚合圆的原始点数:展示点数 = pointCount - clusterPointCount + clusterCount */
3807
+ clusterPointCount: number
3808
+ /** 最近一次聚合重算耗时(毫秒);聚合关闭时为 0 */
3809
+ clusterMs: number
3658
3810
  /** 动画是否还在排下一帧:静止画面是按需渲染的,这时候是 false */
3659
3811
  animating: boolean
3660
3812
  quality: GisViewQualityState
@@ -5041,6 +5193,18 @@ export interface GisViewInitialView {
5041
5193
  padding?: number
5042
5194
  }
5043
5195
 
5196
+ /**
5197
+ * 适应视图的节点间距兜底:普通「铺满数据范围」让最近节点在屏幕上挤在一起时,
5198
+ * 按 minDistance 反推一个更高的相机比例。放大时以最近节点对的中点为中心,
5199
+ * 远处孤立点可以把包围盒撑大,但不再把主体节点压成一团,也允许落到视口外。
5200
+ */
5201
+ export interface GisViewFitSpacingOptions {
5202
+ /** 可见节点中心之间的最小屏幕距离(CSS 像素),默认 24;写 0 或负数关闭 */
5203
+ minDistance?: number
5204
+ /** 相对普通适应比例的最大放大倍数,默认 0(不限,只受 maxScale 约束);正数表示上限 */
5205
+ maxZoom?: number
5206
+ }
5207
+
5044
5208
  /**
5045
5209
  * 插件:视图建好之后调用一次,拿到实例本身与带 apiVersion 的上下文;返回 { destroy } 时会挂进实例的 destroy。
5046
5210
  * 写一次插件,之后换项目直接复用,不必把「URL 同步 / 自建图例 / 业务操作」再抄一遍。
@@ -5501,8 +5665,6 @@ export type GisViewFeatureName =
5501
5665
  | 'remove'
5502
5666
  /** 新增通道:进入草稿、点两个节点、落地 */
5503
5667
  | 'channelDraft'
5504
- /** 通道右键交互框(onChannelContextMenu) */
5505
- | 'channelMenu'
5506
5668
  /** 右键回调 onContextMenu(关掉之后组件不再拦右键,浏览器菜单照常) */
5507
5669
  | 'contextMenu'
5508
5670
  /** 悬停提示(tooltip):关掉只影响提示,悬停样式与 onHover 还在 */
@@ -5678,7 +5840,7 @@ export interface GisViewBatchOptions {
5678
5840
  /**
5679
5841
  * 全部可订阅事件(与 EVENT_NAMES 一致):事件名与 options 里的回调一一对应(`dataChange` 就是 `onDataChange`),
5680
5842
  * 载荷也是同一份 —— 区别只在写法:`on` 可以挂多条、可以运行时订阅、返回的函数就是取消订阅。
5681
- * 需要原样带回 DOM 事件的那四个(pointerDown / pointerUp / contextMenu / channelContextMenu)载荷是
5843
+ * 需要原样带回 DOM 事件的那三个(pointerDown / pointerUp / contextMenu)载荷是
5682
5844
  * `{ payload, event }`,与回调的两个参数一一对应。
5683
5845
  */
5684
5846
  export interface GisViewEventMap {
@@ -5698,6 +5860,8 @@ export interface GisViewEventMap {
5698
5860
  pointerUp: { payload: GisViewPointerPayload; event: PointerEvent }
5699
5861
  contextMenu: { payload: GisViewPointerPayload; event: MouseEvent }
5700
5862
  click: GisViewClickPayload
5863
+ /** 点中多成员聚合圆:不选中内部节点,普通 click 不会同时触发 */
5864
+ clusterClick: GisViewClusterClickPayload
5701
5865
  dblClick: GisViewClickPayload
5702
5866
  /** 点了一下标签(label.editable / lineLabel.editable 打开时):用它选中要编辑的那一条 */
5703
5867
  labelClick: GisViewLabelClickPayload
@@ -5711,13 +5875,14 @@ export interface GisViewEventMap {
5711
5875
  labelDblClick: GisViewLabelPointerPayload
5712
5876
  select: GisViewSelectPayload | null
5713
5877
  selectChange: GisViewSelectChangePayload
5878
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
5879
+ cascadeHighlight: GisViewCascadeHighlightInfo | null
5714
5880
  pointDrag: GisViewPointDragPayload
5715
5881
  pointCopy: GisViewPointCopyPayload | GisViewBatchCopyPayload
5716
5882
  pointMerge: GisViewPointMergePayload | GisViewMergeResult | GisViewMergeFailure | GisViewMergeSelectedPayload
5717
5883
  /** 删除:pending(要删什么 / 连带什么 / 能按哪些范围删)→ remove(已删,result 是结果)/ cancel */
5718
5884
  remove: GisViewRemovePayload
5719
5885
  waypointChange: GisViewWaypointPayload
5720
- channelContextMenu: { payload: GisViewChannelContextPayload | null; event: MouseEvent }
5721
5886
  channelDraft: GisViewChannelDraftPayload
5722
5887
  channelDraftClick: GisViewChannelDraftPayload
5723
5888
  /** 动态装饰器草稿:start / hover / leave / ready / update / commit / cancel */
@@ -5984,10 +6149,12 @@ export interface GisViewOptions {
5984
6149
  * 纯文本标签的渲染方式,缺省 `auto`:
5985
6150
  * - `auto`:强制显示档下,视口里的纯文本标签达到 1024 条时自动改画到单张 Canvas;
5986
6151
  * 需要 DOM 的标签(`html: true`、函数返回元素、可拖拽 / 可编辑)仍逐条建节点。
6152
+ * - `canvas`:纯文本标签始终改画到单张 Canvas,不受 1024 条阈值限制,`labelOptimize: true` 时
6153
+ * 也按画布尺寸参与避让 / 换落点;需要 DOM 的标签仍逐条建节点。
5987
6154
  * - `dom`:始终逐条建 `.gis-view__label`,保持旧行为。
5988
6155
  * 画布档不改变标签内容、锚点与显隐,只减少高密度场景的 DOM 数量。
5989
6156
  */
5990
- labelRender?: 'auto' | 'dom'
6157
+ labelRender?: 'auto' | 'canvas' | 'dom'
5991
6158
  /**
5992
6159
  * 标签的运行时状态(`getLabelStates()` 的那一份:拖过的偏移、改过的内容与样式、运行时加的标签、隐藏覆盖):
5993
6160
  * 创建 / `updateOptions` 时喂回来就回显,与 `setLabelStates(states)` 同一条路。
@@ -6004,6 +6171,12 @@ export interface GisViewOptions {
6004
6171
  tooltip?: GisViewTooltipOptions
6005
6172
  /** 初始筛选条件,等价于创建之后调用 setFilter;可以写完整格式,也可以只给节点条件 */
6006
6173
  filter?: GisViewFilterInput | null
6174
+ /**
6175
+ * 线路是否跟随节点,默认 true。开启时隐藏 / 删除 / 筛选节点会连带绑定线路与通道;
6176
+ * 关闭后这些操作只影响节点,线路与通道继续停在节点最后一次坐标,筛选未显式写 cascade 时默认不级联。
6177
+ * 筛选里显式写了 cascade 时始终以筛选自己的写法为准。
6178
+ */
6179
+ lineFollowsNode?: boolean
6007
6180
  /** 内置鹰眼图:不配就不显示,配了默认开 */
6008
6181
  minimap?: GisViewMinimapOptions | null
6009
6182
  /** 筛选是否用 Worker 计算:默认在数据量超过阈值时自动启用,false 表示始终同步计算 */
@@ -6028,6 +6201,12 @@ export interface GisViewOptions {
6028
6201
  lineSelectStyle?: GisViewLineStyle
6029
6202
  /** Ctrl 点击累加多选时的线样式:缺省沿用 lineSelectStyle,单条线可用 multiSelectStyle 覆盖 */
6030
6203
  lineMultiSelectStyle?: GisViewLineStyle
6204
+ /**
6205
+ * 点击级联高亮(默认关):点击节点时亮起它和直接相连的节点;scope 为 both 时连线路一起亮,
6206
+ * 点击线路 / 通道回线时亮起两端节点。它不进选中集,样式与悬停 / 选中分开配置,
6207
+ * 当前亮起的清单用 getCascadeHighlight() 读。
6208
+ */
6209
+ cascadeHighlight?: GisViewCascadeHighlightInput
6031
6210
  /** 没有配置状态样式时,是否仍用尺寸 / 宽度增幅画出内置强调;默认 false(不配样式就不改变外观) */
6032
6211
  defaultHighlight?: boolean
6033
6212
  /** 节点整体放大系数(常数倍数,与地图缩放无关,屏幕上的大小因此恒定):与点自身 size、缩放联动一起相乘,默认 1 */
@@ -6048,17 +6227,18 @@ export interface GisViewOptions {
6048
6227
  lineZoomScale?: number
6049
6228
  /** 缩放联动的基准比例:等于它时放大系数为 1,缺省用首次适应视图时的 camera.scale */
6050
6229
  zoomBaseScale?: number
6051
- /**
6052
- * 自适应比例开关(默认 false):打开后没写联动指数的 pointZoomScale / lineZoomScale 按 1 算 ——
6053
- * 要素与地图同倍率,包围盒变大(相机比例变小)时节点 / 线宽跟着一起小,
6054
- * 节点大小与通道间距的比例不再被带跑;显式写过指数(哪怕写 0)以显式值为准。
6055
- */
6056
- zoomScaleAuto?: boolean
6057
6230
  /**
6058
6231
  * 大数据初始化是否从视图中心向外发散渲染(默认开)。
6059
6232
  * 开启后首屏只排中心附近的那一批,剩下的分帧往外补;关了就一次性排完。
6060
6233
  */
6061
6234
  progressiveInit?: boolean
6235
+ /**
6236
+ * 点聚合:true 用缺省档(半径 60px、至少 2 点、不限缩放),对象写法见 GisViewPointClusterOptions。
6237
+ * 只影响展示、拾取、快照与导出;原始 points、选中集与 getData() 不变,
6238
+ * listPoints({ visibleOnly: true }) 会跳过被聚合圆收起的成员,传 false 仍可列全。
6239
+ * 聚合期间发散初始化暂停;缩放超过 maxZoom 后恢复逐点显示。
6240
+ */
6241
+ pointCluster?: boolean | GisViewPointClusterOptions
6062
6242
  /** 是否绘制网格:与其它功能开关同一条口径,**缺省关**,写 showGrid: true 才画 */
6063
6243
  showGrid?: boolean
6064
6244
  gridColor?: string
@@ -6169,6 +6349,11 @@ export interface GisViewOptions {
6169
6349
  * zoom 是相对「适应视图」的倍数(2 = 比适应近一倍),scale 是绝对的 像素 / 世界单位。
6170
6350
  */
6171
6351
  initialView?: GisViewInitialView | null
6352
+ /**
6353
+ * 适应视图时按可见节点间距兜底(默认关):true 用 minDistance 24 / maxZoom 不限,
6354
+ * 对象可改两个参数。只在首次默认适应与 fitView() 生效,显式 initialView.scale / zoom 优先。
6355
+ */
6356
+ fitSpacing?: boolean | GisViewFitSpacingOptions
6172
6357
  /**
6173
6358
  * onStats 的最小间隔(毫秒),默认 250,0 表示每帧都发。
6174
6359
  * 读数不需要 60Hz,节流能省下每帧一次的回调与对象分配(拖拽时尤其明显)。
@@ -6212,6 +6397,8 @@ export interface GisViewOptions {
6212
6397
  onSelect?: (payload: GisViewSelectPayload | null) => void
6213
6398
  /** 单击要素或空白处 */
6214
6399
  onClick?: (payload: GisViewClickPayload | null) => void
6400
+ /** 点中多成员聚合圆:载荷带 count / pointIds / bounds;不会同时触发 onClick,也不改选中集 */
6401
+ onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
6215
6402
  /** 双击要素或空白处 */
6216
6403
  onDblClick?: (payload: GisViewClickPayload | null) => void
6217
6404
  /** 点了一下标签(label.editable / lineLabel.editable 打开时):载荷里是这一条标签的类型、下标与当前覆盖 */
@@ -6231,8 +6418,13 @@ export interface GisViewOptions {
6231
6418
  onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6232
6419
  /** 左键 / 中键 / 右键抬起:与 onPointerDown 成对 */
6233
6420
  onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6234
- /** 右键:点、线、空白都会发(要素信息在载荷里,要自己弹菜单就在这里 preventDefault) */
6421
+ /**
6422
+ * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
6423
+ * 载荷另带 channelContext;要自己弹菜单就在这里 preventDefault()。
6424
+ */
6235
6425
  onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
6426
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
6427
+ onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
6236
6428
  onHover?: (payload: GisViewHoverPayload) => void
6237
6429
  onCursor?: (payload: GisViewCursorPayload) => void
6238
6430
  /** 光标移动 / 移出画布:屏幕坐标、世界坐标与经纬度(配了 GeoJSON 底图才有 lngLat) */
@@ -6258,8 +6450,6 @@ export interface GisViewOptions {
6258
6450
  onRemove?: (payload: GisViewRemovePayload) => void
6259
6451
  /** 拐点新增、选中、删除与拖动 */
6260
6452
  onWaypointChange?: (payload: GisViewWaypointPayload) => void
6261
- /** 右键点中通道回线:给出分组上下文(几组 / 当前哪组 / 有哪些交互),点空白处给 null */
6262
- onChannelContextMenu?: (payload: GisViewChannelContextPayload | null, event: MouseEvent) => void
6263
6453
  /** 新增通道草稿:start / from / to / ready / cancel / commit / blocked,两个节点的信息与方案都在载荷里 */
6264
6454
  onChannelDraft?: (payload: GisViewChannelDraftPayload) => void
6265
6455
  /** 草稿里每点一次发一条:step 1 拿到起点、step 2 拿到终点(线路结束),载荷与 onChannelDraft 相同 */
@@ -6374,7 +6564,10 @@ export interface GisViewSearchResult {
6374
6564
  /**
6375
6565
  * focusOn 的目标(一个):搜索命中、要素写法、世界坐标(两个数 / `[x, y]` / `{ x, y }`)、
6376
6566
  * 一段世界坐标范围、通道写法(取通道范围)、`{ center: [x, y] }` 或 `{ lngLat: [经度, 纬度] }`
6377
- * (配了 GeoJSON 底图才有意义)。
6567
+ * (配了 GeoJSON 底图才有意义)。要素 / 通道 / 分组可以用 `type` 明确消歧:
6568
+ * `{ type: 'point' | 'line' | 'channel', id | index }`、`{ type: 'group', channelId, groupId }`
6569
+ * (group 的 channelId 可省略,只要 groupId 全局唯一)。字符串 / 数字仍按「先节点 id、再线路 id」兼容;
6570
+ * 同 id 时显式写 `type` 即可;裸字符串不表示通道,通道请写 `{ channelId }` 或显式 `type: 'channel'`。
6378
6571
  */
6379
6572
  export type GisViewFocusTarget = GisViewSearchHit | GisViewFeatureKey | GisViewSelectionRefObject | string | number | GisViewCoordinate | GisViewBounds | { x: number, y: number } | { center: GisViewCoordinate } | { lngLat: GisViewCoordinate } | { longitude: number, latitude: number }
6380
6573
 
@@ -6411,6 +6604,13 @@ export interface GisViewExportImageOptions {
6411
6604
  quality?: number
6412
6605
  /** 导出倍率:位图相对画布 CSS 尺寸,缺省按设备像素比导(与屏幕一致);SVG 只影响宽高属性,缺省 1 */
6413
6606
  scale?: number
6607
+ /**
6608
+ * 导出范围:'viewport'(缺省)只导当前可视区域;'all' 临时适应全部数据范围,导完恢复原相机。
6609
+ * 筛选 / visible: false 隐藏的要素仍不会出现;'all' 指当前场景里全部可见内容
6610
+ */
6611
+ scope?: 'viewport' | 'all'
6612
+ /** scope: 'all' 时四周留白(CSS 像素,缺省 24);scope: 'viewport' 时忽略 */
6613
+ padding?: number
6414
6614
  /**
6415
6615
  * 背景:缺省 = 带背景(背景色 / 底图 / GeoJSON 区域填充与网格,与屏幕上一致);
6416
6616
  * false / 'none' / 'transparent' = 不带背景(透明底,上面那些都不画);
@@ -6961,6 +7161,20 @@ export interface GisViewSceneGraphic {
6961
7161
  preserveAspectRatio: string
6962
7162
  }
6963
7163
 
7164
+ /** 矢量快照里的多成员聚合圆(数量文字也在这里;单成员不画圆) */
7165
+ export interface GisViewSceneCluster {
7166
+ id: string
7167
+ count: number
7168
+ x: number
7169
+ y: number
7170
+ radius: number
7171
+ fill: string
7172
+ stroke: string
7173
+ strokeWidth: number
7174
+ textColor: string
7175
+ fontSize: number
7176
+ }
7177
+
6964
7178
  export interface GisViewSceneSnapshot {
6965
7179
  width: number
6966
7180
  height: number
@@ -6974,6 +7188,7 @@ export interface GisViewSceneSnapshot {
6974
7188
  /** 数据线路与节点装饰连接线(连接线也画在节点 / 装饰之前) */
6975
7189
  lines: GisViewSceneLine[]
6976
7190
  points: GisViewSceneNode[]
7191
+ clusters: GisViewSceneCluster[]
6977
7192
  backgroundPoints: GisViewSceneNode[]
6978
7193
  decorations: GisViewSceneNode[]
6979
7194
  waypoints: GisViewSceneNode[]
@@ -7194,7 +7409,7 @@ export interface GisViewInstance {
7194
7409
  setCamera(camera: Partial<GisViewCamera>): GisViewInstance
7195
7410
  getCamera(): GisViewCamera
7196
7411
  getBounds(): GisViewBounds
7197
- /** 缩放联动的基准比例(pointZoomScale / lineZoomScale / zoomScaleAuto 共用那一份):缺省是首次适应视图时的 camera.scale */
7412
+ /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
7198
7413
  getZoomBaseScale(): number
7199
7414
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),之后放大缩小都从它算倍数,返回 this */
7200
7415
  setZoomBaseScale(scale?: number): GisViewInstance
@@ -7279,7 +7494,7 @@ export interface GisViewInstance {
7279
7494
  createGeoMapper(options?: GisViewGeoMapperOptions): GisViewGeoMapper | null
7280
7495
  /** 直接把一份点 / 线 / 通道数据映射到 GeoJSON 坐标上(复制,不改原数据);没有 GeoJSON 底图时是 null */
7281
7496
  mapDataToGeoJson<T extends { points?: GisViewPoint[]; lines?: GisViewLine[]; channels?: GisViewChannel[] }>(data: T, options?: GisViewGeoMapperOptions): T | null
7282
- pick(x: number, y: number): GisViewPickResult | null
7497
+ pick(x: number, y: number): GisViewHitResult | null
7283
7498
  /**
7284
7499
  * 按浏览器客户端坐标拾取(鼠标事件里的 clientX / clientY):与指针事件载荷同一份读数,另加 target
7285
7500
  * ('point' / 'line' / 'channel')与 lngLat(配了 GeoJSON 底图才有);没命中返回 null。
@@ -7315,11 +7530,19 @@ export interface GisViewInstance {
7315
7530
  * getSelectionData 立刻就能读回来。认这些写法(见 GisViewSelectionRef):
7316
7531
  * ① 节点:id、`{ type: 'point', index: 3 }`、一批 id 与对象混着写;
7317
7532
  * ② 通道:`{ type: 'channel', channelId: 'channel-a' }` 选整条通道的回线,
7318
- * `{ channelId, groupId }` 选某一组,`{ channelId, lineIds: [...] }` 选通道里的某几条回线;
7533
+ * `{ channelId, groupId }` / `{ type: 'group', channelId, groupId }` 选某一组
7534
+ * (只给全局唯一的 groupId 也可以),`{ channelId, lineIds: [...] }` 选通道里的某几条回线;
7319
7535
  * ③ 线路:id 或 `{ type: 'line', index: 3 }`。
7320
7536
  * options.mode 给 'add' / 'toggle' / 'remove' 就在当前选中集上做加 / 取反 / 减
7321
7537
  */
7322
7538
  selectFeatures(refs: GisViewSelectionRefs, options?: GisViewSelectOptions): GisViewInstance
7539
+ /**
7540
+ * 选中一个拐点:`selectWaypoint('line-1', 2)` / `selectWaypoint({ lineIndex: 3, pathIndex: 1 })` /
7541
+ * `selectWaypoint({ lineId: 'line-1', pathIndex: 2 })`。同时把拐点所在线路选上(缺省
7542
+ * `waypointVisibility: 'selected'` 下拐点才可见);`selectWaypoint(null)` 只取消拐点选中,
7543
+ * 不改要素选中集。`pathIndex` 只认 `getWaypoints()` 给出的可编辑拐点,无效时不会猜位置。
7544
+ */
7545
+ selectWaypoint(waypoint: GisViewWaypointKey | GisViewWaypointRef | string | number | null, pathIndex?: number, options?: GisViewSelectOptions): GisViewInstance
7323
7546
  /**
7324
7547
  * 取消选中:写法与 selectFeatures 完全一样(节点 / 通道 / 线路,一批可以混着写),
7325
7548
  * 把这些从当前选中集里去掉,其余选中原样留着 —— `deselect('p-1')` 取消一个节点、
@@ -7345,6 +7568,11 @@ export interface GisViewInstance {
7345
7568
  * bounds 走一次 getElementBounds(十万级选中下约 5 ms),只想问「选了哪几个」用 getSelections() 更省
7346
7569
  */
7347
7570
  getSelectionData(): GisViewSelectionData
7571
+ /**
7572
+ * 当前点击级联高亮的读数:来源、scope 与亮着的节点 / 线路;没有级联高亮(或功能关着)时是 null。
7573
+ * 它只读,不改变选中集;点空白处、换数据或关掉 cascadeHighlight 会收掉。
7574
+ */
7575
+ getCascadeHighlight(): GisViewCascadeHighlightInfo | null
7348
7576
  /** 按画布 CSS 像素矩形框选;options.selectionKinds 可临时覆盖全局类型过滤 */
7349
7577
  selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions): GisViewInstance
7350
7578
  /**
@@ -7530,7 +7758,8 @@ export interface GisViewInstance {
7530
7758
  /** 执行右键交互框里的动作,返回执行之后的上下文 */
7531
7759
  runChannelAction(actionId: GisViewChannelActionId, options?: { channelId?: string | number; groupId?: string | number; coordinate?: GisViewCoordinate; pathIndex?: number; size?: number }): GisViewChannelContext | null
7532
7760
  /**
7533
- * 进入「新增通道」:点第一个节点当起点,一条线跟随光标,点第二个节点发结束事件
7761
+ * 进入「新增通道」:缺省点第一个节点当起点,一条线跟随光标,点第二个节点发结束事件;
7762
+ * options.from 可以预指定起点,此后只需要再选终点
7534
7763
  * (phase: 'ready',载荷里带两个节点、hasChannel / hasGroup / groups / channel 与可选方案)。
7535
7764
  * 它只负责这条可视化示例路径 —— 真正的落地必须用 addChannel(或 addChannelGroupLines /
7536
7765
  * joinChannelGroupLines / addLine),不在事件里落地就用 endAddChannel / cancelAddChannel 收掉假通道。
@@ -7798,6 +8027,10 @@ export interface GisViewInstance {
7798
8027
  getChannel(ref: GisViewFeatureRef): GisViewChannelSnapshot | null
7799
8028
  /** 按条件列节点快照(indexes / inView / limit / withScreen / visibleOnly):可见点读数的通用入口 */
7800
8029
  listPoints(options?: GisViewListOptions): GisViewListedPoint[]
8030
+ /** 当前点聚合的展示组(含 count: 1 的单成员):只读,原始 points / getData() 不变 */
8031
+ getClusters(): GisViewCluster[]
8032
+ /** 当前点聚合配置与运行时开关(缩放超过 maxZoom 后 active 为 false) */
8033
+ getPointCluster(): GisViewPointClusterReadout | null
7801
8034
  /** 按条件列线路快照(与 listPoints 同一套选项):通道回线带通道读数,另有 color / width */
7802
8035
  listLines(options?: GisViewListOptions): GisViewListedLine[]
7803
8036
  /** 一批要素的世界包围盒;一个都没对上(数据已经换过)返回 null */
@@ -7958,6 +8191,8 @@ export interface GisViewEngineOptions {
7958
8191
  lineSelectStyle?: GisViewLineStyle | null
7959
8192
  /** Ctrl 点击累加多选时的线样式:缺省沿用 lineSelectStyle */
7960
8193
  lineMultiSelectStyle?: GisViewLineStyle | null
8194
+ /** 点击级联高亮:true / 对象打开,false / null 关闭;详细写法见 GisViewOptions.cascadeHighlight */
8195
+ cascadeHighlight?: GisViewCascadeHighlightInput | null
7961
8196
  /** 没有配置状态样式时是否仍画内置强调(尺寸 / 宽度增幅与强调环);默认 false */
7962
8197
  defaultHighlight?: boolean
7963
8198
  /** 节点整体放大系数,默认 1 */
@@ -7970,12 +8205,14 @@ export interface GisViewEngineOptions {
7970
8205
  lineZoomScale?: number
7971
8206
  /** 缩放联动的基准比例,缺省用首次适应视图时的 camera.scale */
7972
8207
  zoomBaseScale?: number
7973
- /** 自适应比例开关:没写联动指数的那几项按 1(与地图同倍率)算,默认 false */
7974
- zoomScaleAuto?: boolean
7975
8208
  /** 大数据初始化是否从视图中心向外发散渲染,默认开 */
7976
8209
  progressiveInit?: boolean
8210
+ /** 点聚合:true 用缺省档,对象写法见 GisViewPointClusterOptions(只改展示 / 拾取 / 快照) */
8211
+ pointCluster?: boolean | GisViewPointClusterOptions
7977
8212
  /** 初始视图:首次拿到数据时相机落在哪里(缺省适应数据范围),结构见 GisViewInitialView */
7978
8213
  initialView?: GisViewInitialView | null
8214
+ /** 适应视图的节点间距兜底:true 用缺省档,对象可改 minDistance / maxZoom,默认关 */
8215
+ fitSpacing?: boolean | GisViewFitSpacingOptions
7979
8216
  /** onStats 的最小间隔(毫秒),默认 250,0 表示每帧都发 */
7980
8217
  statsInterval?: number
7981
8218
  /** 画质:档位名或 `{ mode, budgetMs, minScale }`(见 GisViewQualityOptions),只影响画哪些批次与分辨率 */
@@ -8000,7 +8237,7 @@ export interface GisViewEngineOptions {
8000
8237
  contextMenu?: boolean
8001
8238
  /**
8002
8239
  * 右键默认把浏览器的系统菜单收掉(组件接住右键时 preventDefault contextmenu)。
8003
- * 写 false 保留系统菜单:onContextMenu / onChannelContextMenu 照常发,只是不再挡浏览器自己弹菜单。
8240
+ * 写 false 保留系统菜单:onContextMenu 照常发,只是不再挡浏览器自己弹菜单。
8004
8241
  */
8005
8242
  preventContextMenu?: boolean
8006
8243
  /** 悬停拾取的移动阈值(CSS 像素):指针移动不超过它时不重算拾取,0 表示每次指针事件都重算;默认 2 */
@@ -8028,6 +8265,8 @@ export interface GisViewEngineOptions {
8028
8265
  channelSelectMode?: GisViewChannelSelectMode
8029
8266
  /** 分组拐点拖动模式:'parallel'(缺省)/ 'vertex',见 GisViewOptions.channelWaypointDragMode */
8030
8267
  channelWaypointDragMode?: GisViewChannelWaypointDragMode
8268
+ /** 线路是否跟随节点,缺省 true;关闭后节点退场时线路 / 通道停在最后一份坐标与解析尺寸 */
8269
+ lineFollowsNode?: boolean
8031
8270
 
8032
8271
  /** 快捷键:动作 -> 写法(框选、多选、加点、复制、粘贴、取消、删除、适应视图),没写的沿用默认值 */
8033
8272
  shortcuts?: GisViewShortcuts
@@ -8058,12 +8297,19 @@ export interface GisViewEngineOptions {
8058
8297
  */
8059
8298
  onSelect?: (payload: GisViewSelectPayload | null, detail?: { mode?: 'single' | 'multi' | 'box'; originalEvent?: Event | null }) => void
8060
8299
  onClick?: (payload: GisViewClickPayload | null) => void
8300
+ /** 点中多成员聚合圆(引擎不选中成员,普通点击回调不会同时触发) */
8301
+ onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
8061
8302
  onDblClick?: (payload: GisViewClickPayload | null) => void
8062
8303
  /** 左键 / 中键 / 右键按下与抬起:命中的要素、按钮与光标位置都在载荷里 */
8063
8304
  onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
8064
8305
  onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
8065
- /** 右键:点、线、空白都会发 */
8306
+ /**
8307
+ * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
8308
+ * 载荷另带 channelContext(几组 / 当前哪组 / 能做什么),不再有单独的通道路由。
8309
+ */
8066
8310
  onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
8311
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
8312
+ onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
8067
8313
  onPointDrag?: (payload: GisViewPointDragPayload) => void
8068
8314
  /** 复制节点:start / move / commit / end / cancel(剪贴板另有 clipboard) */
8069
8315
  onPointCopy?: (payload: GisViewPointCopyPayload | GisViewBatchCopyPayload) => void
@@ -8071,8 +8317,6 @@ export interface GisViewEngineOptions {
8071
8317
  onPointMerge?: (payload: GisViewPointMergePayload | GisViewMergeResult | GisViewMergeFailure | GisViewMergeSelectedPayload) => void
8072
8318
 
8073
8319
  onWaypointChange?: (payload: GisViewWaypointPayload) => void
8074
- /** 右键点中通道回线:给出分组上下文(几组 / 当前哪组 / 有哪些交互),点空白处给 null */
8075
- onChannelContextMenu?: (payload: GisViewChannelContextPayload | null, event: MouseEvent) => void
8076
8320
  /** 新增通道草稿:start / from / ready / cancel / commit / blocked / restart / pick */
8077
8321
  onChannelDraft?: (payload: GisViewChannelDraftPayload) => void
8078
8322
  /** 草稿里每点一次发一条:step 1 拿到起点、step 2 拿到终点(线路结束) */
@@ -8249,7 +8493,7 @@ export interface GisViewEngine {
8249
8493
  applyInitialView(): void
8250
8494
  resetView(): void
8251
8495
  getBounds(): GisViewBounds
8252
- /** 缩放联动的基准比例(pointZoomScale / lineZoomScale / zoomScaleAuto 共用那一份):缺省是首次适应视图时的 camera.scale */
8496
+ /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
8253
8497
  getZoomBaseScale(): number
8254
8498
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),返回落定的基准 */
8255
8499
  setZoomBaseScale(scale?: number): number
@@ -8261,6 +8505,12 @@ export interface GisViewEngine {
8261
8505
  getViewRect(): GisViewBounds
8262
8506
  /** 按条件列节点(只读快照,见 GisViewListOptions):面板读数 / 导出 / 校验用,十万级下别逐帧调 */
8263
8507
  listPoints(options?: GisViewListOptions): GisViewListedPoint[]
8508
+ /** 当前展示组(含 count: 1 的单成员):原始 points 不受影响 */
8509
+ getClusters(): GisViewCluster[]
8510
+ /** 覆盖层每帧同步数量文字用的轻量读数:只含多成员聚合圆 */
8511
+ getClusterLabels(): GisViewClusterLabel[]
8512
+ /** 当前点聚合配置与运行时开关 */
8513
+ getPointCluster(): GisViewPointClusterReadout
8264
8514
  /** 按条件列线路(只读快照):通道内的回线给的是骨架推导出来的折线,另带 color / width 与通道读数 */
8265
8515
  listLines(options?: GisViewListOptions): GisViewListedLine[]
8266
8516
  /** 一批要素的世界包围盒;一个都没对上返回 null */
@@ -8303,9 +8553,9 @@ export interface GisViewEngine {
8303
8553
  clientToWorld(clientX: number, clientY: number): [number, number]
8304
8554
  /** 世界坐标 → 客户端坐标(摆 DOM 浮层 / 菜单用) */
8305
8555
  worldToClient(x: number, y: number): [number, number]
8306
- pick(x: number, y: number): GisViewPickResult | null
8556
+ pick(x: number, y: number): GisViewHitResult | null
8307
8557
  /** 与组件实例的 pickAt 同一份:按浏览器客户端坐标拾取(引擎不等 DOM 事件,直接给 clientX / clientY) */
8308
- pickAtClient(clientX: number, clientY: number): GisViewPickResult | null
8558
+ pickAtClient(clientX: number, clientY: number): GisViewHitResult | null
8309
8559
  /** 程序化悬停(客户端坐标):让指针「停」在这儿,悬停高亮 / 光标 / onHover 一起更新,返回这一次的读数 */
8310
8560
  hoverAtClient(clientX: number, clientY: number): GisViewHoverPayload | null
8311
8561
  /** 取消程序化悬停:清掉高亮与读数并补发 onHover(null) */