gis-view-webgl2 0.1.1 → 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 (66) hide show
  1. package/README.md +23 -7
  2. package/dist/gis-view.css +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +563 -61
  5. package/dist/index.js +1 -1
  6. package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +182 -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 +165 -0
  9. package/docs/api/index.html +1 -1
  10. package/docs/demos/ApiCoverageDemo.vue +644 -0
  11. package/docs/demos/ChannelDemo.vue +580 -18
  12. package/docs/demos/ClusterDemo.vue +251 -0
  13. package/docs/demos/CopyMergeDemo.vue +60 -10
  14. package/docs/demos/EventDemo.vue +3 -3
  15. package/docs/demos/GisViewDemo.vue +64 -8809
  16. package/docs/demos/LabelDemo.vue +67 -11
  17. package/docs/demos/api-index.js +58 -41
  18. package/docs/demos/demos.js +33 -16
  19. package/docs/demos/gis-view-demo/GisViewDemoCardHeader.vue +28 -0
  20. package/docs/demos/gis-view-demo/GisViewDemoDialogs.vue +82 -0
  21. package/docs/demos/gis-view-demo/GisViewDemoFooter.vue +16 -0
  22. package/docs/demos/gis-view-demo/GisViewDemoHeading.vue +16 -0
  23. package/docs/demos/gis-view-demo/GisViewDemoPanelStack.vue +71 -0
  24. package/docs/demos/gis-view-demo/GisViewDemoStage.vue +219 -0
  25. package/docs/demos/gis-view-demo/demo.css +1230 -0
  26. package/docs/demos/gis-view-demo/demoContext.js +12 -0
  27. package/docs/demos/gis-view-demo/panels/DataPanels.vue +303 -0
  28. package/docs/demos/gis-view-demo/panels/OpsPanels.vue +174 -0
  29. package/docs/demos/gis-view-demo/panels/StylePanels.vue +561 -0
  30. package/docs/demos/gis-view-demo/panels/ViewPanels.vue +396 -0
  31. package/docs/demos/gis-view-demo/useGisViewDemo.js +6188 -0
  32. package/docs/format/03-/346/213/220/347/202/271/350/243/205/351/245/260/344/270/216/346/240/267/345/274/217.md +4 -2
  33. package/docs/format/04-/351/200/232/351/201/223/344/270/216/346/240/207/347/255/276.md +5 -4
  34. 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
  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 +10 -4
  37. package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +105 -16
  38. package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +8 -8
  39. package/docs/manual/06-/346/225/260/346/215/256/344/270/216/345/234/272/346/231/257/346/233/264/346/226/260.md +100 -0
  40. 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 +78 -3
  41. package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +31 -5
  42. package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +64 -10
  43. 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 +65 -8
  44. package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +54 -1
  45. package/docs/manual/13-/345/212/250/346/225/210/344/270/216/345/233/276/345/205/203.md +3 -0
  46. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +35 -19
  47. package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +5 -0
  48. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +18 -6
  49. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +47 -22
  50. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +80 -13
  51. package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +27 -0
  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 +5 -5
  53. package/docs/steps/README.md +18 -10
  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 +578 -53
  57. package/docs/steps/selftest-docs.html +7 -6
  58. package/docs/steps/selftest-effects.html +200 -0
  59. package/docs/steps/selftest-features.html +725 -12
  60. package/docs/steps/selftest-labels.html +323 -4
  61. package/docs/steps/selftest-perf.html +293 -20
  62. package/docs/steps/selftest-scale.html +52 -29
  63. package/docs/steps/step-10-full.js +1 -1
  64. package/docs/steps/step-12-events.js +1 -1
  65. package/docs//346/216/245/345/217/243/345/215/217/350/256/256.md +17 -11
  66. package/package.json +2 -2
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 会先把这条回线挪到目标分组(通道内的回线只能进一组),
@@ -1208,6 +1278,11 @@ export interface GisViewChannelGroup {
1208
1278
  lineIds: Array<string | number>
1209
1279
  /** 这一组自己的骨架拐点(两端锚定时只写中间拐点):新拆分出来的分组不带拐点,就是一条直线 */
1210
1280
  path?: GisViewCoordinate[]
1281
+ /**
1282
+ * 刚性拐点偏移:键是分组骨架顶点序号(含首尾端点,从 0 起,只认中间拐点),值是这一组所有成员回线在该顶点的世界坐标增量。
1283
+ * `channelWaypointDragMode: 'vertex'` 拖出来的结果写在这里;不写或空对象就是普通平行骨架
1284
+ */
1285
+ waypointOffsets?: Record<string, GisViewCoordinate>
1211
1286
  }
1212
1287
 
1213
1288
  /**
@@ -1219,6 +1294,12 @@ export interface GisViewChannel {
1219
1294
  id?: string | number
1220
1295
  /** 通道名:仅作业务标识,组件不渲染 */
1221
1296
  name?: string
1297
+ /**
1298
+ * 是否显示这条通道:false 时整条通道与成员回线一起隐藏,数据、分组、拐点与编辑状态都保留,
1299
+ * 改回 true(或 `showFeatures('channel', ref)`)立即恢复;缺省 true。
1300
+ * 端点节点 `visible: false` 时通道也会整条隐藏,节点恢复后自动回来
1301
+ */
1302
+ visible?: boolean
1222
1303
  /** 通道内的线路 id,顺序即回线顺序(沿骨架左法线方向) */
1223
1304
  lineIds: Array<string | number>
1224
1305
  /**
@@ -1300,6 +1381,8 @@ export interface GisViewChannelInfo {
1300
1381
  to?: string | number
1301
1382
  /** 两端是否都落在节点上:锚定的通道会跟着节点拖动走 */
1302
1383
  anchored: boolean
1384
+ /** 分组刚性拐点偏移:与 groups[].waypointOffsets 同一份口径,没有偏移时是空对象 */
1385
+ waypointOffsets: Record<string, [number, number]>
1303
1386
  /** 整条通道相邻回线的中心间距(世界单位),单回线通道为 0;分组之后各组共用这一套间距 */
1304
1387
  spacing: number
1305
1388
  }
@@ -1352,6 +1435,8 @@ export interface GisViewChannelGroupInfo {
1352
1435
  skeleton: Array<[number, number]>
1353
1436
  /** 骨架换算回声明用的中间拐点(两端锚定时不含首尾节点),可以直接写回 groups[].path */
1354
1437
  path: Array<[number, number]>
1438
+ /** 刚性拐点偏移:与 groups[].waypointOffsets 同一份口径,可以直接写回声明 */
1439
+ waypointOffsets: Record<string, [number, number]>
1355
1440
  }
1356
1441
 
1357
1442
  /** getChannelGroupWaypoints 里的一条成员回线:偏移之后的折线与拐点(与图上画的一致) */
@@ -1386,6 +1471,8 @@ export interface GisViewChannelGroupWaypoints {
1386
1471
  skeleton: Array<[number, number]>
1387
1472
  /** 整组共用的中间拐点:给后端的 channel.group.path 就是这一份 */
1388
1473
  path: Array<[number, number]>
1474
+ /** 刚性拐点偏移:需要把非平行拖动结果一起回传时写回 groups[].waypointOffsets */
1475
+ waypointOffsets: Record<string, [number, number]>
1389
1476
  /** 组里每条回线偏移后的折线与拐点(同组同步之后「其他线路的拐点」读它) */
1390
1477
  lines: GisViewChannelGroupLineWaypoints[]
1391
1478
  }
@@ -1445,24 +1532,6 @@ export interface GisViewChannelContext {
1445
1532
  actions: GisViewChannelAction[]
1446
1533
  }
1447
1534
 
1448
- /** 右键点中通道回线时的载荷:上下文 + 命中的回线与屏幕 / 世界坐标,点空白处回调收到 null */
1449
- export interface GisViewChannelContextPayload extends GisViewChannelContext {
1450
- /** 这一次操作的判读:type 为 'contextMenu'、target 为 'channel'(与 onContextMenu 是同一件操作) */
1451
- action?: GisViewPointerAction
1452
- /** 命中的回线在 lines 数组里的下标 */
1453
- lineIndex: number
1454
- lineId: string | number
1455
- coordinate: [number, number]
1456
- /** 鼠标按键:右键固定是 2(与指针载荷同一份口径,组件层按它补出 action.button) */
1457
- button?: number
1458
- /** 画布 CSS 像素坐标 */
1459
- x: number
1460
- y: number
1461
- clientX: number
1462
- clientY: number
1463
- originalEvent: Event
1464
- }
1465
-
1466
1535
  /** 新增通道时一个节点的读数:下标、id / 数据对象与坐标 */
1467
1536
  export interface GisViewChannelNodeDraft {
1468
1537
  index: number
@@ -1661,6 +1730,11 @@ export interface GisViewChannelBetween {
1661
1730
  export interface GisViewChannelDraftOptions {
1662
1731
  /** 两个节点一选完就自动提交,不用再调 commitAddChannel */
1663
1732
  autoCommit?: boolean
1733
+ /**
1734
+ * 预指定起点:节点 id / 下标 / `{ id }` / `{ index }`。给了就从「已选好起点」进入草稿,
1735
+ * 下一次点节点只选终点;不写则仍由第一次点击选起点。找不到节点时草稿不开始并报 warning
1736
+ */
1737
+ from?: GisViewPointRef
1664
1738
  /**
1665
1739
  * 连续新增:一段线路落地之后自动开下一段草稿,不用再点一次「新增通道」。
1666
1740
  * true 每段都从空白开始;'chain' 以上一段的终点当下一段起点(首尾相接)
@@ -1826,6 +1900,102 @@ export interface GisViewMovedPoint {
1826
1900
  item: GisViewPoint
1827
1901
  }
1828
1902
 
1903
+ /** 可整批隐藏 / 显示的要素类型 */
1904
+ export type GisViewVisibilityKind = 'point' | 'line' | 'channel'
1905
+
1906
+ /** 隐藏 / 显示的引用:单个 id / 下标 / `{ id }` / `{ index }`,一批,或当前选中集 `'selection'` */
1907
+ export type GisViewVisibilityRefs = GisViewFeatureRef | 'selection' | Array<GisViewFeatureRef | 'selection'>
1908
+
1909
+ /** 隐藏 / 显示时没认出来的引用 */
1910
+ export interface GisViewVisibilitySkip {
1911
+ ref: unknown
1912
+ reason: string
1913
+ }
1914
+
1915
+ /** setFeatureVisible / hideFeatures / showFeatures 的返回:indexes 与 items 按数据顺序一一对应 */
1916
+ export interface GisViewSetVisibilityOutcome {
1917
+ ok: boolean
1918
+ reason: string | null
1919
+ kind: GisViewVisibilityKind
1920
+ visible: boolean
1921
+ /** 实际改到的下标(去重、按传入顺序) */
1922
+ indexes: number[]
1923
+ /** 对应的 id;要素没 id 时退回下标 */
1924
+ ids: Array<string | number>
1925
+ items: Array<GisViewPoint | GisViewLine | GisViewChannel>
1926
+ skipped: GisViewVisibilitySkip[]
1927
+ }
1928
+
1929
+ /** 通道变化里的一组:成员与骨架都是当次读数的可比较快照 */
1930
+ export interface GisViewChangedChannelGroup {
1931
+ id: string | number | null
1932
+ lineIds: string[]
1933
+ path: GisViewCoordinate[] | null
1934
+ }
1935
+
1936
+ /** 通道变化原因 */
1937
+ export type GisViewChangedChannelReason = 'groups' | 'members' | 'waypoints' | 'endpoints' | 'visibility' | 'fields'
1938
+
1939
+ /** getChangedChannels 的查询选项 */
1940
+ export interface GisViewChangedChannelOptions {
1941
+ /** 只返回带这些原因的变化(空数组 = 不返回任何变化);不传 = 全部原因 */
1942
+ reasons?: GisViewChangedChannelReason[]
1943
+ /**
1944
+ * 忽略分组结构的新增 / 删除 / 重排:不报 `groups`,也不把整组增删算成拐点变化;
1945
+ * 基准与当前都存在、且分组 `path` 真变过的,仍报 `waypoints`
1946
+ */
1947
+ ignoreGroups?: boolean
1948
+ }
1949
+
1950
+ /** getChangedChannels 的一项:相对上次通道对账发生了哪些变化 */
1951
+ export interface GisViewChangedChannel {
1952
+ index: number
1953
+ id: string | number | null
1954
+ item: GisViewChannel
1955
+ /** 当前分组读数(没写 groups 的通道按「一整组」折算) */
1956
+ groups: GisViewChangedChannelGroup[]
1957
+ groupsChanged: boolean
1958
+ waypointsChanged: boolean
1959
+ membersChanged: boolean
1960
+ endpointsChanged: boolean
1961
+ visibilityChanged: boolean
1962
+ fieldsChanged: boolean
1963
+ /** 除 id / lineIds / groups / path / from / to / visible 之外变过的字段名 */
1964
+ fields: string[]
1965
+ /** 变化原因:groups / members / waypoints / endpoints / visibility / fields */
1966
+ reasons: GisViewChangedChannelReason[]
1967
+ }
1968
+
1969
+ /** 线路变化原因:path(path / start / end)、端点、可见性、其余字段 */
1970
+ export type GisViewChangedLineReason = 'path' | 'endpoints' | 'visibility' | 'fields'
1971
+
1972
+ /** getChangedLines 的查询选项 */
1973
+ export interface GisViewChangedLineOptions {
1974
+ /** 只返回带这些原因的变化(空数组 = 不返回任何变化);不传 = 全部原因 */
1975
+ reasons?: GisViewChangedLineReason[]
1976
+ }
1977
+
1978
+ /** getChangedLines 的一项:相对上次线路对账发生了哪些变化 */
1979
+ export interface GisViewChangedLine {
1980
+ index: number
1981
+ id: string | number | null
1982
+ item: GisViewLine
1983
+ /** 当前声明的 path(没有 path 时为 null);线条几何还会看 start / end */
1984
+ path: GisViewCoordinate[] | null
1985
+ start: GisViewCoordinate | null
1986
+ end: GisViewCoordinate | null
1987
+ from: string | number | null
1988
+ to: string | number | null
1989
+ visible: boolean
1990
+ pathChanged: boolean
1991
+ endpointsChanged: boolean
1992
+ visibilityChanged: boolean
1993
+ fieldsChanged: boolean
1994
+ /** 除 id / start / end / path / from / to / visible 之外变过的字段名 */
1995
+ fields: string[]
1996
+ reasons: GisViewChangedLineReason[]
1997
+ }
1998
+
1829
1999
  /**
1830
2000
  * addChannels 的返回:results 与传入顺序一一对应(失败的条目也在里面,按各自的 reason 读),
1831
2001
  * count 是成功落地的条数;lineIds / channelIds 只列成功那几条的(顺序与 results 里成功的一致)。
@@ -1935,9 +2105,7 @@ export interface GisViewAddPointResult extends GisViewAddItemsResult<GisViewPoin
1935
2105
  * coordinate 与通道字段),另加 target('point' / 'line' / 'channel')与 lngLat(配了 GeoJSON 底图才有);
1936
2106
  * 没命中返回 null。只读 —— 不改选中、不动光标。
1937
2107
  */
1938
- export interface GisViewPickAtResult extends GisViewPickResult {
1939
- target: 'point' | 'line' | 'channel'
1940
- }
2108
+ export type GisViewPickAtResult = GisViewHitResult & { target: 'point' | 'line' | 'channel' | 'cluster' }
1941
2109
 
1942
2110
  /**
1943
2111
  * getFeaturesInRect 的结果:points 是框内的节点(与框选同一口径,含 screen / coordinate / 通道上下文),
@@ -2393,6 +2561,14 @@ export interface GisViewWaypointKey {
2393
2561
  pathIndex: number
2394
2562
  }
2395
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
+
2396
2572
  /** 拐点信息:坐标与是否处于选中态 */
2397
2573
  export interface GisViewWaypointInfo extends GisViewWaypointKey {
2398
2574
  coordinate: [number, number]
@@ -2439,6 +2615,72 @@ export interface GisViewPickResult extends GisViewFeatureKey {
2439
2615
  group?: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
2440
2616
  }
2441
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
+
2442
2684
  /** 选中事件载荷:点击选中为 0 / 1 个要素,Shift 框选为框内全部节点(随 shortcuts.boxSelect 改变) */
2443
2685
  export interface GisViewSelectPayload {
2444
2686
  items: GisViewPickResult[]
@@ -2476,11 +2718,11 @@ export interface GisViewSelectionInfo {
2476
2718
  * `{ channelId, lineIds: [...] }` / `{ channelIndex, lineIndexes: [...] }` 只取通道里的某几条回线。
2477
2719
  */
2478
2720
  export interface GisViewSelectionRefObject {
2479
- /** 要素类型;写 'channel'(或写了 channelId / channelIndex / channel)就是通道写法 */
2480
- type?: GisViewFeatureType | 'channel'
2481
- /** 搜索命中的类型(与 type 一个意思,point / line / channel 都认):搜索命中可以直接丢给 select */
2482
- kind?: GisViewFeatureType | 'channel'
2483
- /** 要素 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 */
2484
2726
  id?: string | number
2485
2727
  /** 要素在 points / lines 里的下标;通道写法里是通道下标 */
2486
2728
  index?: number
@@ -2489,8 +2731,12 @@ export interface GisViewSelectionRefObject {
2489
2731
  channelId?: string | number
2490
2732
  channelIndex?: number
2491
2733
  channel?: string | number | GisViewChannel
2734
+ /** 分组上下文(getLineChannel 的 group 可以直接放进来) */
2735
+ group?: string | number | { id?: string | number }
2492
2736
  /** 只要通道里的某一组 */
2493
2737
  groupId?: string | number | null
2738
+ /** groupId 的 snake_case 别名 */
2739
+ group_id?: string | number
2494
2740
  /** 只要通道里的某几组 */
2495
2741
  groupIds?: Array<string | number>
2496
2742
  /** 只要通道里的某一条 / 某几条回线(按 id 或 lines 下标) */
@@ -2651,7 +2897,7 @@ export interface GisViewClickPayload extends GisViewPickResult {
2651
2897
  * 'waypoint'(线路拐点)/ 'label'(标签)/ 'selection'(一整批选中集,只有 selectChange 用)/ 'empty'(空白)。
2652
2898
  * 与载荷里的 type 差一层:通道回线的 type 也是 'line',但按通道处理的多,target 单独给一个 'channel'。
2653
2899
  */
2654
- export type GisViewPointerTarget = 'point' | 'line' | 'channel' | 'waypoint' | 'label' | 'selection' | 'empty'
2900
+ export type GisViewPointerTarget = 'point' | 'line' | 'channel' | 'cluster' | 'waypoint' | 'label' | 'selection' | 'empty'
2655
2901
 
2656
2902
  /**
2657
2903
  * 一次指针操作的动作名。同一个名字在「按下 / 松开 / 点击」三条事件里含义略有不同:
@@ -2673,6 +2919,7 @@ export type GisViewPointerActionType =
2673
2919
  | 'selectWaypoint'
2674
2920
  | 'dragWaypoint'
2675
2921
  | 'dragPoint'
2922
+ | 'clusterClick'
2676
2923
  | 'dragLabel'
2677
2924
  | 'selectLabel'
2678
2925
  | 'contextMenu'
@@ -2717,7 +2964,7 @@ export interface GisViewPointerAction {
2717
2964
  * 通道回线是通道定义、选中集事件是这一批 items、拐点是「哪条线、第几个顶点、坐标、改完的线」,
2718
2965
  * 空白处是 null(拐点那一份见 GisViewWaypointPayload.action.data、标签那一份见 GisViewLabelActionData)。
2719
2966
  */
2720
- data?: GisViewPoint | GisViewLine | GisViewChannel | GisViewPickResult[] | GisViewWaypointActionData | GisViewLabelActionData | null
2967
+ data?: GisViewPoint | GisViewLine | GisViewChannel | GisViewClusterPointerData | GisViewPickResult[] | GisViewWaypointActionData | GisViewLabelActionData | null
2721
2968
  /** 只在 click 载荷里出现:true 说明这一下是双击里的第二下(单双击要分开做事的界面按它推迟一下) */
2722
2969
  double?: boolean
2723
2970
  /**
@@ -2756,8 +3003,8 @@ export interface GisViewPointerPayload {
2756
3003
  * target 说明点的是点 / 线 / 通道 / 空白,data 直接给到那一份数据(左键 / 右键都认这一份)
2757
3004
  */
2758
3005
  action: GisViewPointerAction
2759
- /** 命中的要素类型,空白处为 null */
2760
- type: GisViewFeatureType | null
3006
+ /** 命中的要素类型,空白处为 null;多成员聚合是 'cluster' */
3007
+ type: GisViewFeatureType | 'cluster' | null
2761
3008
  /** 命中的要素在数据里的下标,空白处为 -1 */
2762
3009
  index: number
2763
3010
  /** 有没有命中要素 */
@@ -2768,6 +3015,9 @@ export interface GisViewPointerPayload {
2768
3015
  screen?: [number, number]
2769
3016
  /** 命中的要素自身的世界坐标 */
2770
3017
  coordinate?: [number, number]
3018
+ /** 命中的是线路(含通道回线)时,线路在 lines 数组里的下标与 id;右键菜单按它找线路 */
3019
+ lineIndex?: number
3020
+ lineId?: string | number
2771
3021
  /** 命中的是通道内的回线时,回线所属通道与分组 */
2772
3022
  channelIndex?: number
2773
3023
  channel?: GisViewChannel
@@ -2775,6 +3025,15 @@ export interface GisViewPointerPayload {
2775
3025
  groupIndex?: number
2776
3026
  /** 命中的是通道内的回线时,这一组的读数 */
2777
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
2778
3037
  /**
2779
3038
  * 这一刻命中的要素在不在当前选中集里(没有命中就是 false)。
2780
3039
  * 左键按下 / 抬起与右键都是当下这一份状态:selected 与 wasSelected 相同
@@ -2805,7 +3064,7 @@ export interface GisViewPointerPayload {
2805
3064
  * 另外带一份 action(type 恒为 'hover'、target 说明停在什么上面、button 恒为 'none')。
2806
3065
  * 光标正好停在最近一次指针事件的位置上时,originalEvent / clientX / clientY 就是那一次事件(修饰键读得到)。
2807
3066
  */
2808
- export interface GisViewHoverPayload extends GisViewPickResult {
3067
+ export type GisViewHoverPayload = GisViewHitResult & {
2809
3068
  /** 悬停读数一样有:有没有停在某个要素上(空白处是 null,不走这一份) */
2810
3069
  hit: boolean
2811
3070
  action: GisViewPointerAction
@@ -3269,6 +3528,71 @@ export interface GisViewMergeSelectedOptions {
3269
3528
  originalEvent?: Event | null
3270
3529
  }
3271
3530
 
3531
+ /**
3532
+ * splitPoint 的一份节点定义:节点字段可直接写在顶层(id / x / y / name / style…),也可以放进 item;
3533
+ * lines / channels / channelFrom / channelTo 是会从节点字段里摘出来的分配指令,不会写进节点数据。
3534
+ */
3535
+ export interface GisViewSplitPointPart extends Partial<GisViewPoint> {
3536
+ /** 新节点的字段(与顶层的节点字段合并,顶层优先) */
3537
+ item?: Partial<GisViewPoint>
3538
+ /** 分到这一份的线路(id / 下标 / { id } / { index }):不写时连在原节点上的线路跟第一份 */
3539
+ lines?: GisViewFeatureRef | GisViewFeatureRef[]
3540
+ /** 两端都分到这一份的受影响通道;把同一条通道写进两份时按 from / to 各去一份 */
3541
+ channels?: GisViewFeatureRef | GisViewFeatureRef[]
3542
+ /** 只把通道的 from 端分到这一份 */
3543
+ channelFrom?: GisViewFeatureRef | GisViewFeatureRef[]
3544
+ /** 只把通道的 to 端分到这一份 */
3545
+ channelTo?: GisViewFeatureRef | GisViewFeatureRef[]
3546
+ }
3547
+
3548
+ /** splitPoint 的选项 */
3549
+ export interface GisViewSplitPointOptions {
3550
+ /** 第一份是否沿用来源节点的 id(缺省 true);false 时也给第一份生成 `${来源 id}-split-1` */
3551
+ keepSourceId?: boolean
3552
+ /** 这一步历史的标签,缺省「拆分节点」 */
3553
+ label?: string
3554
+ }
3555
+
3556
+ /** 拆分时没认出来的线路 / 通道引用 */
3557
+ export interface GisViewSplitPointSkip {
3558
+ ref: unknown
3559
+ reason: string
3560
+ }
3561
+
3562
+ /**
3563
+ * 一次拆分的完整变更集:removedPoint 是拆分前的来源节点,points 是拆分后的全部节点,
3564
+ * lines / channels 是仍存在且受影响的最终数据,removedLines / removedChannels 是拆分前被删掉的数据。
3565
+ * 可直接作为后端事务的输入。
3566
+ */
3567
+ export interface GisViewSplitPointChangeSet {
3568
+ removedPoint: GisViewPoint
3569
+ points: GisViewPoint[]
3570
+ lines: GisViewLine[]
3571
+ removedLines: GisViewLine[]
3572
+ channels: GisViewChannel[]
3573
+ removedChannels: GisViewChannel[]
3574
+ }
3575
+
3576
+ /** splitPoint 的返回:ok 为 false 时 reason 说明原因,其余数组为空、changes 为 null */
3577
+ export interface GisViewSplitPointOutcome {
3578
+ ok: boolean
3579
+ reason: string | null
3580
+ source: { index: number; id: string | number | null; item: GisViewPoint } | null
3581
+ /** 拆分后的节点,第一份在原下标,其余按 indexes 追加 */
3582
+ items: GisViewPoint[]
3583
+ indexes: number[]
3584
+ pointIds: Array<string | number>
3585
+ linesChanged: number
3586
+ removedLines: number
3587
+ removedLineIds: Array<string | number>
3588
+ removedLineIndexes: number[]
3589
+ channelsChanged: number
3590
+ removedChannels: number
3591
+ removedChannelIds: Array<string | number>
3592
+ skipped: { lines: GisViewSplitPointSkip[]; channels: GisViewSplitPointSkip[] }
3593
+ changes: GisViewSplitPointChangeSet | null
3594
+ }
3595
+
3272
3596
  /** 定位一个节点:id、数组下标,或带 id / index 的对象(`{ id: 'a' }` / `{ index: 2 }`) */
3273
3597
  export type GisViewPointRef = string | number | { id: string | number } | { index: number }
3274
3598
 
@@ -3347,6 +3671,7 @@ export type GisViewDataChangeType =
3347
3671
  | 'copyPoint'
3348
3672
  | 'copyPoints'
3349
3673
  | 'mergePoints'
3674
+ | 'splitPoint'
3350
3675
  | 'waypoint'
3351
3676
  | 'addChannel'
3352
3677
  | 'addChannels'
@@ -3476,6 +3801,12 @@ export interface GisViewEngineStats {
3476
3801
  lineEffectCount: number
3477
3802
  /** 这一帧铺进去的节点涟漪圈数(一个节点 count 圈算 count;关掉或视野内没有涟漪时为 0) */
3478
3803
  pointEffectCount: number
3804
+ /** 当前点聚合的多成员圆个数;聚合关闭或超过 maxZoom 时为 0 */
3805
+ clusterCount: number
3806
+ /** 被收进多成员聚合圆的原始点数:展示点数 = pointCount - clusterPointCount + clusterCount */
3807
+ clusterPointCount: number
3808
+ /** 最近一次聚合重算耗时(毫秒);聚合关闭时为 0 */
3809
+ clusterMs: number
3479
3810
  /** 动画是否还在排下一帧:静止画面是按需渲染的,这时候是 false */
3480
3811
  animating: boolean
3481
3812
  quality: GisViewQualityState
@@ -3706,6 +4037,8 @@ export interface GisViewItemLabel {
3706
4037
  style?: Record<string, string>
3707
4038
  /** 线路标签是否与线路方向平行(点的标签忽略这一项) */
3708
4039
  parallel?: boolean
4040
+ /** 这一条是否参与避让:false 时即使全局开启 labelOptimize / avoidOverlap 也始终按候选落点画出;缺省跟随全局 */
4041
+ avoidOverlap?: boolean
3709
4042
  /**
3710
4043
  * 这一条撞上别的标签之后怎么避让:`shift`(默认)主动换锚点 / 沿线挪,`hide` 直接不显示。
3711
4044
  * 只在顶层 `labelOptimize: true` 且这条的 `avoidOverlap` 不为 false 时生效;只和底图区域文字重叠时仍按软冲突照画。
@@ -3715,6 +4048,10 @@ export interface GisViewItemLabel {
3715
4048
  visibility?: GisViewLabelVisibility
3716
4049
  /** 整条不画(等于 visibility: 'hidden');false 表示撤回隐藏覆盖 */
3717
4050
  hidden?: boolean
4051
+ /** 这一条标签能不能拖:逐条覆盖 options.label / lineLabel 里的同名开关 */
4052
+ draggable?: boolean
4053
+ /** 这一条标签能不能点选:逐条覆盖 options.label / lineLabel 里的同名开关 */
4054
+ editable?: boolean
3718
4055
  /** 这条标签是运行时加的(addLabel),导出时带上它便于整份回显 */
3719
4056
  added?: boolean
3720
4057
  className?: string
@@ -3954,8 +4291,10 @@ export interface GisViewLabelPatch {
3954
4291
  export interface GisViewLabelInfo {
3955
4292
  /** 这一条要素上的哪一条标签 */
3956
4293
  id: string
3957
- /** 当下画出来的文本(DOM 里的那一份:模板 / 函数算完之后的结果) */
4294
+ /** 当下画出来的内容(DOM 里的那一份:模板 / 函数算完之后的结果;html 时保留标记本身) */
3958
4295
  content: string
4296
+ /** 这一条当下是否按 HTML 渲染(html: true 才有子节点;false 永远是纯文本) */
4297
+ html: boolean
3959
4298
  /** 当下生效的锚点(点八向 / 线沿线位置),算不出来时是 null */
3960
4299
  position: GisViewLabelPosition | GisViewLineLabelPosition | null
3961
4300
  className: string | null
@@ -4120,12 +4459,12 @@ export interface GisViewLabelListItem {
4120
4459
  id: string
4121
4460
  /** 这一条是哪来的:'config' 配置里定义的 / 'data' 数据里写的 / 'runtime' 运行时加的(与事件载荷里的 GisViewLabelInfo.source 同一口径) */
4122
4461
  source: 'config' | 'data' | 'runtime'
4123
- /** 这一条声明里的内容(模板 / 函数原样给出),没写是 null */
4462
+ /** 这一条当下生效的内容(运行时覆盖优先,模板 / 函数原样给出),没写是 null */
4124
4463
  content: GisViewLabelContent | GisViewLineLabelContent | null
4125
4464
  html: boolean
4126
4465
  className: string | null
4127
4466
  position: GisViewLabelPosition | GisViewLineLabelPosition | null
4128
- /** 声明里的偏移(像素),没写是 [0, 0] */
4467
+ /** 当下生效的偏移(像素):运行时拖出来的优先,否则用声明里的;都没有是 [0, 0] */
4129
4468
  offset: [number, number]
4130
4469
  style: Record<string, string> | null
4131
4470
  /** 线路标签:这一条是否与线路平行;节点标签恒为 false */
@@ -4854,6 +5193,18 @@ export interface GisViewInitialView {
4854
5193
  padding?: number
4855
5194
  }
4856
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
+
4857
5208
  /**
4858
5209
  * 插件:视图建好之后调用一次,拿到实例本身与带 apiVersion 的上下文;返回 { destroy } 时会挂进实例的 destroy。
4859
5210
  * 写一次插件,之后换项目直接复用,不必把「URL 同步 / 自建图例 / 业务操作」再抄一遍。
@@ -5020,6 +5371,13 @@ export type GisViewChannelSelectMode =
5020
5371
  /** 整条通道(所有分组的回线)一起选 */
5021
5372
  | 'channel'
5022
5373
 
5374
+ /** 分组拐点拖动模式:普通线路永远只动自己,这里只影响通道里的一组回线 */
5375
+ export type GisViewChannelWaypointDragMode =
5376
+ /** 缺省:改共用骨架,组内回线按平行偏移重算;拐角处相邻顶点可能随 miter 微调 */
5377
+ | 'parallel'
5378
+ /** 只把同组同一 pathIndex 的拐点按相同世界增量平移,其他拐点(含相邻顶点)保持不动 */
5379
+ | 'vertex'
5380
+
5023
5381
  /**
5024
5382
  * 框选 / Ctrl 多选允许收哪几类要素:节点、独立线路、通道回线。
5025
5383
  * 通道回线只归 channel 这一档管;通道之外的普通线路归 line,两者可以任意组合。
@@ -5307,8 +5665,6 @@ export type GisViewFeatureName =
5307
5665
  | 'remove'
5308
5666
  /** 新增通道:进入草稿、点两个节点、落地 */
5309
5667
  | 'channelDraft'
5310
- /** 通道右键交互框(onChannelContextMenu) */
5311
- | 'channelMenu'
5312
5668
  /** 右键回调 onContextMenu(关掉之后组件不再拦右键,浏览器菜单照常) */
5313
5669
  | 'contextMenu'
5314
5670
  /** 悬停提示(tooltip):关掉只影响提示,悬停样式与 onHover 还在 */
@@ -5484,7 +5840,7 @@ export interface GisViewBatchOptions {
5484
5840
  /**
5485
5841
  * 全部可订阅事件(与 EVENT_NAMES 一致):事件名与 options 里的回调一一对应(`dataChange` 就是 `onDataChange`),
5486
5842
  * 载荷也是同一份 —— 区别只在写法:`on` 可以挂多条、可以运行时订阅、返回的函数就是取消订阅。
5487
- * 需要原样带回 DOM 事件的那四个(pointerDown / pointerUp / contextMenu / channelContextMenu)载荷是
5843
+ * 需要原样带回 DOM 事件的那三个(pointerDown / pointerUp / contextMenu)载荷是
5488
5844
  * `{ payload, event }`,与回调的两个参数一一对应。
5489
5845
  */
5490
5846
  export interface GisViewEventMap {
@@ -5504,6 +5860,8 @@ export interface GisViewEventMap {
5504
5860
  pointerUp: { payload: GisViewPointerPayload; event: PointerEvent }
5505
5861
  contextMenu: { payload: GisViewPointerPayload; event: MouseEvent }
5506
5862
  click: GisViewClickPayload
5863
+ /** 点中多成员聚合圆:不选中内部节点,普通 click 不会同时触发 */
5864
+ clusterClick: GisViewClusterClickPayload
5507
5865
  dblClick: GisViewClickPayload
5508
5866
  /** 点了一下标签(label.editable / lineLabel.editable 打开时):用它选中要编辑的那一条 */
5509
5867
  labelClick: GisViewLabelClickPayload
@@ -5517,13 +5875,14 @@ export interface GisViewEventMap {
5517
5875
  labelDblClick: GisViewLabelPointerPayload
5518
5876
  select: GisViewSelectPayload | null
5519
5877
  selectChange: GisViewSelectChangePayload
5878
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
5879
+ cascadeHighlight: GisViewCascadeHighlightInfo | null
5520
5880
  pointDrag: GisViewPointDragPayload
5521
5881
  pointCopy: GisViewPointCopyPayload | GisViewBatchCopyPayload
5522
5882
  pointMerge: GisViewPointMergePayload | GisViewMergeResult | GisViewMergeFailure | GisViewMergeSelectedPayload
5523
5883
  /** 删除:pending(要删什么 / 连带什么 / 能按哪些范围删)→ remove(已删,result 是结果)/ cancel */
5524
5884
  remove: GisViewRemovePayload
5525
5885
  waypointChange: GisViewWaypointPayload
5526
- channelContextMenu: { payload: GisViewChannelContextPayload | null; event: MouseEvent }
5527
5886
  channelDraft: GisViewChannelDraftPayload
5528
5887
  channelDraftClick: GisViewChannelDraftPayload
5529
5888
  /** 动态装饰器草稿:start / hover / leave / ready / update / commit / cancel */
@@ -5786,6 +6145,16 @@ export interface GisViewOptions {
5786
6145
  * 只管「画不画、画哪几条」:`visibility` / `when` / 拖拽 / 编辑 / 样式与动画都不受影响
5787
6146
  */
5788
6147
  labelOptimize?: boolean
6148
+ /**
6149
+ * 纯文本标签的渲染方式,缺省 `auto`:
6150
+ * - `auto`:强制显示档下,视口里的纯文本标签达到 1024 条时自动改画到单张 Canvas;
6151
+ * 需要 DOM 的标签(`html: true`、函数返回元素、可拖拽 / 可编辑)仍逐条建节点。
6152
+ * - `canvas`:纯文本标签始终改画到单张 Canvas,不受 1024 条阈值限制,`labelOptimize: true` 时
6153
+ * 也按画布尺寸参与避让 / 换落点;需要 DOM 的标签仍逐条建节点。
6154
+ * - `dom`:始终逐条建 `.gis-view__label`,保持旧行为。
6155
+ * 画布档不改变标签内容、锚点与显隐,只减少高密度场景的 DOM 数量。
6156
+ */
6157
+ labelRender?: 'auto' | 'canvas' | 'dom'
5789
6158
  /**
5790
6159
  * 标签的运行时状态(`getLabelStates()` 的那一份:拖过的偏移、改过的内容与样式、运行时加的标签、隐藏覆盖):
5791
6160
  * 创建 / `updateOptions` 时喂回来就回显,与 `setLabelStates(states)` 同一条路。
@@ -5802,6 +6171,12 @@ export interface GisViewOptions {
5802
6171
  tooltip?: GisViewTooltipOptions
5803
6172
  /** 初始筛选条件,等价于创建之后调用 setFilter;可以写完整格式,也可以只给节点条件 */
5804
6173
  filter?: GisViewFilterInput | null
6174
+ /**
6175
+ * 线路是否跟随节点,默认 true。开启时隐藏 / 删除 / 筛选节点会连带绑定线路与通道;
6176
+ * 关闭后这些操作只影响节点,线路与通道继续停在节点最后一次坐标,筛选未显式写 cascade 时默认不级联。
6177
+ * 筛选里显式写了 cascade 时始终以筛选自己的写法为准。
6178
+ */
6179
+ lineFollowsNode?: boolean
5805
6180
  /** 内置鹰眼图:不配就不显示,配了默认开 */
5806
6181
  minimap?: GisViewMinimapOptions | null
5807
6182
  /** 筛选是否用 Worker 计算:默认在数据量超过阈值时自动启用,false 表示始终同步计算 */
@@ -5826,6 +6201,12 @@ export interface GisViewOptions {
5826
6201
  lineSelectStyle?: GisViewLineStyle
5827
6202
  /** Ctrl 点击累加多选时的线样式:缺省沿用 lineSelectStyle,单条线可用 multiSelectStyle 覆盖 */
5828
6203
  lineMultiSelectStyle?: GisViewLineStyle
6204
+ /**
6205
+ * 点击级联高亮(默认关):点击节点时亮起它和直接相连的节点;scope 为 both 时连线路一起亮,
6206
+ * 点击线路 / 通道回线时亮起两端节点。它不进选中集,样式与悬停 / 选中分开配置,
6207
+ * 当前亮起的清单用 getCascadeHighlight() 读。
6208
+ */
6209
+ cascadeHighlight?: GisViewCascadeHighlightInput
5829
6210
  /** 没有配置状态样式时,是否仍用尺寸 / 宽度增幅画出内置强调;默认 false(不配样式就不改变外观) */
5830
6211
  defaultHighlight?: boolean
5831
6212
  /** 节点整体放大系数(常数倍数,与地图缩放无关,屏幕上的大小因此恒定):与点自身 size、缩放联动一起相乘,默认 1 */
@@ -5846,17 +6227,18 @@ export interface GisViewOptions {
5846
6227
  lineZoomScale?: number
5847
6228
  /** 缩放联动的基准比例:等于它时放大系数为 1,缺省用首次适应视图时的 camera.scale */
5848
6229
  zoomBaseScale?: number
5849
- /**
5850
- * 自适应比例开关(默认 false):打开后没写联动指数的 pointZoomScale / lineZoomScale 按 1 算 ——
5851
- * 要素与地图同倍率,包围盒变大(相机比例变小)时节点 / 线宽跟着一起小,
5852
- * 节点大小与通道间距的比例不再被带跑;显式写过指数(哪怕写 0)以显式值为准。
5853
- */
5854
- zoomScaleAuto?: boolean
5855
6230
  /**
5856
6231
  * 大数据初始化是否从视图中心向外发散渲染(默认开)。
5857
6232
  * 开启后首屏只排中心附近的那一批,剩下的分帧往外补;关了就一次性排完。
5858
6233
  */
5859
6234
  progressiveInit?: boolean
6235
+ /**
6236
+ * 点聚合:true 用缺省档(半径 60px、至少 2 点、不限缩放),对象写法见 GisViewPointClusterOptions。
6237
+ * 只影响展示、拾取、快照与导出;原始 points、选中集与 getData() 不变,
6238
+ * listPoints({ visibleOnly: true }) 会跳过被聚合圆收起的成员,传 false 仍可列全。
6239
+ * 聚合期间发散初始化暂停;缩放超过 maxZoom 后恢复逐点显示。
6240
+ */
6241
+ pointCluster?: boolean | GisViewPointClusterOptions
5860
6242
  /** 是否绘制网格:与其它功能开关同一条口径,**缺省关**,写 showGrid: true 才画 */
5861
6243
  showGrid?: boolean
5862
6244
  gridColor?: string
@@ -5928,6 +6310,12 @@ export interface GisViewOptions {
5928
6310
  * Ctrl + 点击在 group / channel 下是整批取反,切换走 updateOptions 不用重排场景
5929
6311
  */
5930
6312
  channelSelectMode?: GisViewChannelSelectMode
6313
+ /**
6314
+ * 分组拐点拖动模式:'parallel'(缺省)沿用共用骨架 + 平行偏移,拐角相邻顶点可能随 miter 微调;
6315
+ * 'vertex' 只移动当前分组同一 pathIndex 的拐点(组内所有回线按相同世界增量),其他拐点保持不动。
6316
+ * 普通线路不受影响;切换走 updateOptions({ channelWaypointDragMode }),下一次拖动生效
6317
+ */
6318
+ channelWaypointDragMode?: GisViewChannelWaypointDragMode
5931
6319
 
5932
6320
  /**
5933
6321
  * 快捷键:框选、多选、加点、复制、粘贴、取消、删除、适应视图都可以在这里改
@@ -5961,6 +6349,11 @@ export interface GisViewOptions {
5961
6349
  * zoom 是相对「适应视图」的倍数(2 = 比适应近一倍),scale 是绝对的 像素 / 世界单位。
5962
6350
  */
5963
6351
  initialView?: GisViewInitialView | null
6352
+ /**
6353
+ * 适应视图时按可见节点间距兜底(默认关):true 用 minDistance 24 / maxZoom 不限,
6354
+ * 对象可改两个参数。只在首次默认适应与 fitView() 生效,显式 initialView.scale / zoom 优先。
6355
+ */
6356
+ fitSpacing?: boolean | GisViewFitSpacingOptions
5964
6357
  /**
5965
6358
  * onStats 的最小间隔(毫秒),默认 250,0 表示每帧都发。
5966
6359
  * 读数不需要 60Hz,节流能省下每帧一次的回调与对象分配(拖拽时尤其明显)。
@@ -6004,6 +6397,8 @@ export interface GisViewOptions {
6004
6397
  onSelect?: (payload: GisViewSelectPayload | null) => void
6005
6398
  /** 单击要素或空白处 */
6006
6399
  onClick?: (payload: GisViewClickPayload | null) => void
6400
+ /** 点中多成员聚合圆:载荷带 count / pointIds / bounds;不会同时触发 onClick,也不改选中集 */
6401
+ onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
6007
6402
  /** 双击要素或空白处 */
6008
6403
  onDblClick?: (payload: GisViewClickPayload | null) => void
6009
6404
  /** 点了一下标签(label.editable / lineLabel.editable 打开时):载荷里是这一条标签的类型、下标与当前覆盖 */
@@ -6023,8 +6418,13 @@ export interface GisViewOptions {
6023
6418
  onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6024
6419
  /** 左键 / 中键 / 右键抬起:与 onPointerDown 成对 */
6025
6420
  onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
6026
- /** 右键:点、线、空白都会发(要素信息在载荷里,要自己弹菜单就在这里 preventDefault) */
6421
+ /**
6422
+ * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
6423
+ * 载荷另带 channelContext;要自己弹菜单就在这里 preventDefault()。
6424
+ */
6027
6425
  onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
6426
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
6427
+ onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
6028
6428
  onHover?: (payload: GisViewHoverPayload) => void
6029
6429
  onCursor?: (payload: GisViewCursorPayload) => void
6030
6430
  /** 光标移动 / 移出画布:屏幕坐标、世界坐标与经纬度(配了 GeoJSON 底图才有 lngLat) */
@@ -6050,8 +6450,6 @@ export interface GisViewOptions {
6050
6450
  onRemove?: (payload: GisViewRemovePayload) => void
6051
6451
  /** 拐点新增、选中、删除与拖动 */
6052
6452
  onWaypointChange?: (payload: GisViewWaypointPayload) => void
6053
- /** 右键点中通道回线:给出分组上下文(几组 / 当前哪组 / 有哪些交互),点空白处给 null */
6054
- onChannelContextMenu?: (payload: GisViewChannelContextPayload | null, event: MouseEvent) => void
6055
6453
  /** 新增通道草稿:start / from / to / ready / cancel / commit / blocked,两个节点的信息与方案都在载荷里 */
6056
6454
  onChannelDraft?: (payload: GisViewChannelDraftPayload) => void
6057
6455
  /** 草稿里每点一次发一条:step 1 拿到起点、step 2 拿到终点(线路结束),载荷与 onChannelDraft 相同 */
@@ -6166,7 +6564,10 @@ export interface GisViewSearchResult {
6166
6564
  /**
6167
6565
  * focusOn 的目标(一个):搜索命中、要素写法、世界坐标(两个数 / `[x, y]` / `{ x, y }`)、
6168
6566
  * 一段世界坐标范围、通道写法(取通道范围)、`{ center: [x, y] }` 或 `{ lngLat: [经度, 纬度] }`
6169
- * (配了 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'`。
6170
6571
  */
6171
6572
  export type GisViewFocusTarget = GisViewSearchHit | GisViewFeatureKey | GisViewSelectionRefObject | string | number | GisViewCoordinate | GisViewBounds | { x: number, y: number } | { center: GisViewCoordinate } | { lngLat: GisViewCoordinate } | { longitude: number, latitude: number }
6172
6573
 
@@ -6203,6 +6604,13 @@ export interface GisViewExportImageOptions {
6203
6604
  quality?: number
6204
6605
  /** 导出倍率:位图相对画布 CSS 尺寸,缺省按设备像素比导(与屏幕一致);SVG 只影响宽高属性,缺省 1 */
6205
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
6206
6614
  /**
6207
6615
  * 背景:缺省 = 带背景(背景色 / 底图 / GeoJSON 区域填充与网格,与屏幕上一致);
6208
6616
  * false / 'none' / 'transparent' = 不带背景(透明底,上面那些都不画);
@@ -6753,6 +7161,20 @@ export interface GisViewSceneGraphic {
6753
7161
  preserveAspectRatio: string
6754
7162
  }
6755
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
+
6756
7178
  export interface GisViewSceneSnapshot {
6757
7179
  width: number
6758
7180
  height: number
@@ -6766,6 +7188,7 @@ export interface GisViewSceneSnapshot {
6766
7188
  /** 数据线路与节点装饰连接线(连接线也画在节点 / 装饰之前) */
6767
7189
  lines: GisViewSceneLine[]
6768
7190
  points: GisViewSceneNode[]
7191
+ clusters: GisViewSceneCluster[]
6769
7192
  backgroundPoints: GisViewSceneNode[]
6770
7193
  decorations: GisViewSceneNode[]
6771
7194
  waypoints: GisViewSceneNode[]
@@ -6986,7 +7409,7 @@ export interface GisViewInstance {
6986
7409
  setCamera(camera: Partial<GisViewCamera>): GisViewInstance
6987
7410
  getCamera(): GisViewCamera
6988
7411
  getBounds(): GisViewBounds
6989
- /** 缩放联动的基准比例(pointZoomScale / lineZoomScale / zoomScaleAuto 共用那一份):缺省是首次适应视图时的 camera.scale */
7412
+ /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
6990
7413
  getZoomBaseScale(): number
6991
7414
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),之后放大缩小都从它算倍数,返回 this */
6992
7415
  setZoomBaseScale(scale?: number): GisViewInstance
@@ -7071,7 +7494,7 @@ export interface GisViewInstance {
7071
7494
  createGeoMapper(options?: GisViewGeoMapperOptions): GisViewGeoMapper | null
7072
7495
  /** 直接把一份点 / 线 / 通道数据映射到 GeoJSON 坐标上(复制,不改原数据);没有 GeoJSON 底图时是 null */
7073
7496
  mapDataToGeoJson<T extends { points?: GisViewPoint[]; lines?: GisViewLine[]; channels?: GisViewChannel[] }>(data: T, options?: GisViewGeoMapperOptions): T | null
7074
- pick(x: number, y: number): GisViewPickResult | null
7497
+ pick(x: number, y: number): GisViewHitResult | null
7075
7498
  /**
7076
7499
  * 按浏览器客户端坐标拾取(鼠标事件里的 clientX / clientY):与指针事件载荷同一份读数,另加 target
7077
7500
  * ('point' / 'line' / 'channel')与 lngLat(配了 GeoJSON 底图才有);没命中返回 null。
@@ -7107,11 +7530,19 @@ export interface GisViewInstance {
7107
7530
  * getSelectionData 立刻就能读回来。认这些写法(见 GisViewSelectionRef):
7108
7531
  * ① 节点:id、`{ type: 'point', index: 3 }`、一批 id 与对象混着写;
7109
7532
  * ② 通道:`{ type: 'channel', channelId: 'channel-a' }` 选整条通道的回线,
7110
- * `{ channelId, groupId }` 选某一组,`{ channelId, lineIds: [...] }` 选通道里的某几条回线;
7533
+ * `{ channelId, groupId }` / `{ type: 'group', channelId, groupId }` 选某一组
7534
+ * (只给全局唯一的 groupId 也可以),`{ channelId, lineIds: [...] }` 选通道里的某几条回线;
7111
7535
  * ③ 线路:id 或 `{ type: 'line', index: 3 }`。
7112
7536
  * options.mode 给 'add' / 'toggle' / 'remove' 就在当前选中集上做加 / 取反 / 减
7113
7537
  */
7114
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
7115
7546
  /**
7116
7547
  * 取消选中:写法与 selectFeatures 完全一样(节点 / 通道 / 线路,一批可以混着写),
7117
7548
  * 把这些从当前选中集里去掉,其余选中原样留着 —— `deselect('p-1')` 取消一个节点、
@@ -7137,6 +7568,11 @@ export interface GisViewInstance {
7137
7568
  * bounds 走一次 getElementBounds(十万级选中下约 5 ms),只想问「选了哪几个」用 getSelections() 更省
7138
7569
  */
7139
7570
  getSelectionData(): GisViewSelectionData
7571
+ /**
7572
+ * 当前点击级联高亮的读数:来源、scope 与亮着的节点 / 线路;没有级联高亮(或功能关着)时是 null。
7573
+ * 它只读,不改变选中集;点空白处、换数据或关掉 cascadeHighlight 会收掉。
7574
+ */
7575
+ getCascadeHighlight(): GisViewCascadeHighlightInfo | null
7140
7576
  /** 按画布 CSS 像素矩形框选;options.selectionKinds 可临时覆盖全局类型过滤 */
7141
7577
  selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions): GisViewInstance
7142
7578
  /**
@@ -7188,6 +7624,14 @@ export interface GisViewInstance {
7188
7624
  * 并不了返回 ok: false 并另发一条 `phase: 'merge', ok: false` 的事件
7189
7625
  */
7190
7626
  mergePoints(source: GisViewPointRef, target: GisViewPointRef, options?: { originalEvent?: Event | null; item?: GisViewPoint }): GisViewMergeOutcome
7627
+ /**
7628
+ * 把一个节点拆成多份(mergePoints 的逆操作):第一份复用原下标与 id,其余追加到 points 末尾。
7629
+ * 每份可直接写节点字段或放进 item;lines 分配线路(不写时连在原节点上的线路跟第一份),
7630
+ * channels / channelFrom / channelTo 分配受影响通道的端点。没显式分配的通道跟随它第一条被分配过的成员线路。
7631
+ * 拆分后自环 / 零长度线路与两端相同的通道删掉;整次调用只记一条历史、只发一条 `splitPoint` 数据变更。
7632
+ * 返回 `{ ok, items, indexes, pointIds, linesChanged, removedLines, channelsChanged, removedChannels, changes, skipped }`
7633
+ */
7634
+ splitPoint(source: GisViewPointRef, parts: GisViewSplitPointPart[], options?: GisViewSplitPointOptions): GisViewSplitPointOutcome
7191
7635
  /**
7192
7636
  * 框选 / 多选之后一步把选中的节点并到一个目标上(接口调用):不指定 target 就自动挑「绑定线路最多」的那一个
7193
7637
  * (一样多取画得大的、再一样取下标小的);来源默认是除目标之外的选中节点,也可以直接用 options.sources 给定,
@@ -7314,7 +7758,8 @@ export interface GisViewInstance {
7314
7758
  /** 执行右键交互框里的动作,返回执行之后的上下文 */
7315
7759
  runChannelAction(actionId: GisViewChannelActionId, options?: { channelId?: string | number; groupId?: string | number; coordinate?: GisViewCoordinate; pathIndex?: number; size?: number }): GisViewChannelContext | null
7316
7760
  /**
7317
- * 进入「新增通道」:点第一个节点当起点,一条线跟随光标,点第二个节点发结束事件
7761
+ * 进入「新增通道」:缺省点第一个节点当起点,一条线跟随光标,点第二个节点发结束事件;
7762
+ * options.from 可以预指定起点,此后只需要再选终点
7318
7763
  * (phase: 'ready',载荷里带两个节点、hasChannel / hasGroup / groups / channel 与可选方案)。
7319
7764
  * 它只负责这条可视化示例路径 —— 真正的落地必须用 addChannel(或 addChannelGroupLines /
7320
7765
  * joinChannelGroupLines / addLine),不在事件里落地就用 endAddChannel / cancelAddChannel 收掉假通道。
@@ -7518,6 +7963,40 @@ export interface GisViewInstance {
7518
7963
  * (写法与 removePoints 一致:id / 下标 / { id } / { index });空数组无操作,返回实例本身。
7519
7964
  */
7520
7965
  clearMovedPoints(refs?: GisViewFeatureRef | GisViewFeatureRef[]): GisViewInstance
7966
+ /**
7967
+ * 相对上一次对账,成员 / 分组 / 拐点 / 端点 / 可见性或其余声明字段变过的通道。
7968
+ * 新加通道只补账不报变化,删掉的通道从账本清掉;整份换通道数据(updateData / updateOptions / applyChannels)
7969
+ * 之后以新数据为基准。返回项带 groups / 各 changed 标记 / fields / reasons。
7970
+ * options.reasons 只返回指定原因;options.ignoreGroups 忽略分组增删,只比较已有分组的拐点。
7971
+ */
7972
+ getChangedChannels(options?: GisViewChangedChannelOptions): GisViewChangedChannel[]
7973
+ /**
7974
+ * 通道变化对账:不传 / 传 null 全部对账,传一个或一批引用只对账这些(写法与 removePoints 一致);
7975
+ * 返回实例本身,认不出来的引用跳过并报一句提醒。
7976
+ */
7977
+ clearChangedChannels(refs?: GisViewFeatureRef | GisViewFeatureRef[]): GisViewInstance
7978
+ /**
7979
+ * 相对上一次对账,path / start / end、from / to、可见性或其余声明字段变过的线路。
7980
+ * 新加线路只补账不报变化,删掉的线路从账本同步清掉;整份换线路后以新数据为基准。
7981
+ * 通道里的回线只比较自己的声明;通道骨架变化由 getChangedChannels 负责。
7982
+ * options.reasons 只返回指定原因。
7983
+ */
7984
+ getChangedLines(options?: GisViewChangedLineOptions): GisViewChangedLine[]
7985
+ /**
7986
+ * 线路变化对账:不传 / 传 null 全部对账,传一个或一批引用只对账这些(写法与 removePoints 一致);
7987
+ * 返回实例本身,认不出来的引用跳过并报一句提醒。
7988
+ */
7989
+ clearChangedLines(refs?: GisViewFeatureRef | GisViewFeatureRef[]): GisViewInstance
7990
+ /**
7991
+ * 统一隐藏 / 显示节点、线路或通道:只改数据里的 visible,不删要素,分组 / 拐点 / 编辑状态都保留。
7992
+ * refs 收单个或一批(id / 下标 / { id } / { index }),也认 'selection';整次调用一条历史、一条 batch 数据变更。
7993
+ * 返回 `{ ok, kind, visible, indexes, ids, items, skipped }`
7994
+ */
7995
+ setFeatureVisible(kind: GisViewVisibilityKind, refs: GisViewVisibilityRefs, visible: boolean): GisViewSetVisibilityOutcome
7996
+ /** `setFeatureVisible(kind, refs, false)` 的快捷写法 */
7997
+ hideFeatures(kind: GisViewVisibilityKind, refs: GisViewVisibilityRefs): GisViewSetVisibilityOutcome
7998
+ /** `setFeatureVisible(kind, refs, true)` 的快捷写法(隐藏后原样恢复) */
7999
+ showFeatures(kind: GisViewVisibilityKind, refs: GisViewVisibilityRefs): GisViewSetVisibilityOutcome
7521
8000
  /**
7522
8001
  * 某个下标的节点当前在不在图上:被筛选 / visible: false 隐藏掉的不算,
7523
8002
  * 初始化发散渲染还没排到的那一部分也不算。
@@ -7548,6 +8027,10 @@ export interface GisViewInstance {
7548
8027
  getChannel(ref: GisViewFeatureRef): GisViewChannelSnapshot | null
7549
8028
  /** 按条件列节点快照(indexes / inView / limit / withScreen / visibleOnly):可见点读数的通用入口 */
7550
8029
  listPoints(options?: GisViewListOptions): GisViewListedPoint[]
8030
+ /** 当前点聚合的展示组(含 count: 1 的单成员):只读,原始 points / getData() 不变 */
8031
+ getClusters(): GisViewCluster[]
8032
+ /** 当前点聚合配置与运行时开关(缩放超过 maxZoom 后 active 为 false) */
8033
+ getPointCluster(): GisViewPointClusterReadout | null
7551
8034
  /** 按条件列线路快照(与 listPoints 同一套选项):通道回线带通道读数,另有 color / width */
7552
8035
  listLines(options?: GisViewListOptions): GisViewListedLine[]
7553
8036
  /** 一批要素的世界包围盒;一个都没对上(数据已经换过)返回 null */
@@ -7708,6 +8191,8 @@ export interface GisViewEngineOptions {
7708
8191
  lineSelectStyle?: GisViewLineStyle | null
7709
8192
  /** Ctrl 点击累加多选时的线样式:缺省沿用 lineSelectStyle */
7710
8193
  lineMultiSelectStyle?: GisViewLineStyle | null
8194
+ /** 点击级联高亮:true / 对象打开,false / null 关闭;详细写法见 GisViewOptions.cascadeHighlight */
8195
+ cascadeHighlight?: GisViewCascadeHighlightInput | null
7711
8196
  /** 没有配置状态样式时是否仍画内置强调(尺寸 / 宽度增幅与强调环);默认 false */
7712
8197
  defaultHighlight?: boolean
7713
8198
  /** 节点整体放大系数,默认 1 */
@@ -7720,12 +8205,14 @@ export interface GisViewEngineOptions {
7720
8205
  lineZoomScale?: number
7721
8206
  /** 缩放联动的基准比例,缺省用首次适应视图时的 camera.scale */
7722
8207
  zoomBaseScale?: number
7723
- /** 自适应比例开关:没写联动指数的那几项按 1(与地图同倍率)算,默认 false */
7724
- zoomScaleAuto?: boolean
7725
8208
  /** 大数据初始化是否从视图中心向外发散渲染,默认开 */
7726
8209
  progressiveInit?: boolean
8210
+ /** 点聚合:true 用缺省档,对象写法见 GisViewPointClusterOptions(只改展示 / 拾取 / 快照) */
8211
+ pointCluster?: boolean | GisViewPointClusterOptions
7727
8212
  /** 初始视图:首次拿到数据时相机落在哪里(缺省适应数据范围),结构见 GisViewInitialView */
7728
8213
  initialView?: GisViewInitialView | null
8214
+ /** 适应视图的节点间距兜底:true 用缺省档,对象可改 minDistance / maxZoom,默认关 */
8215
+ fitSpacing?: boolean | GisViewFitSpacingOptions
7729
8216
  /** onStats 的最小间隔(毫秒),默认 250,0 表示每帧都发 */
7730
8217
  statsInterval?: number
7731
8218
  /** 画质:档位名或 `{ mode, budgetMs, minScale }`(见 GisViewQualityOptions),只影响画哪些批次与分辨率 */
@@ -7750,7 +8237,7 @@ export interface GisViewEngineOptions {
7750
8237
  contextMenu?: boolean
7751
8238
  /**
7752
8239
  * 右键默认把浏览器的系统菜单收掉(组件接住右键时 preventDefault contextmenu)。
7753
- * 写 false 保留系统菜单:onContextMenu / onChannelContextMenu 照常发,只是不再挡浏览器自己弹菜单。
8240
+ * 写 false 保留系统菜单:onContextMenu 照常发,只是不再挡浏览器自己弹菜单。
7754
8241
  */
7755
8242
  preventContextMenu?: boolean
7756
8243
  /** 悬停拾取的移动阈值(CSS 像素):指针移动不超过它时不重算拾取,0 表示每次指针事件都重算;默认 2 */
@@ -7776,6 +8263,10 @@ export interface GisViewEngineOptions {
7776
8263
  * 切换走 setOptions / updateOptions 不用重排场景
7777
8264
  */
7778
8265
  channelSelectMode?: GisViewChannelSelectMode
8266
+ /** 分组拐点拖动模式:'parallel'(缺省)/ 'vertex',见 GisViewOptions.channelWaypointDragMode */
8267
+ channelWaypointDragMode?: GisViewChannelWaypointDragMode
8268
+ /** 线路是否跟随节点,缺省 true;关闭后节点退场时线路 / 通道停在最后一份坐标与解析尺寸 */
8269
+ lineFollowsNode?: boolean
7779
8270
 
7780
8271
  /** 快捷键:动作 -> 写法(框选、多选、加点、复制、粘贴、取消、删除、适应视图),没写的沿用默认值 */
7781
8272
  shortcuts?: GisViewShortcuts
@@ -7806,12 +8297,19 @@ export interface GisViewEngineOptions {
7806
8297
  */
7807
8298
  onSelect?: (payload: GisViewSelectPayload | null, detail?: { mode?: 'single' | 'multi' | 'box'; originalEvent?: Event | null }) => void
7808
8299
  onClick?: (payload: GisViewClickPayload | null) => void
8300
+ /** 点中多成员聚合圆(引擎不选中成员,普通点击回调不会同时触发) */
8301
+ onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
7809
8302
  onDblClick?: (payload: GisViewClickPayload | null) => void
7810
8303
  /** 左键 / 中键 / 右键按下与抬起:命中的要素、按钮与光标位置都在载荷里 */
7811
8304
  onPointerDown?: (payload: GisViewPointerPayload, event: PointerEvent) => void
7812
8305
  onPointerUp?: (payload: GisViewPointerPayload, event: PointerEvent) => void
7813
- /** 右键:点、线、空白都会发 */
8306
+ /**
8307
+ * 右键:点、线、通道、空白都会发这一条。命中通道回线时 action.target 为 'channel',
8308
+ * 载荷另带 channelContext(几组 / 当前哪组 / 能做什么),不再有单独的通道路由。
8309
+ */
7814
8310
  onContextMenu?: (payload: GisViewPointerPayload, event: MouseEvent) => void
8311
+ /** 点击级联高亮变了:载荷与 getCascadeHighlight() 同一份,收掉时是 null */
8312
+ onCascadeHighlight?: (payload: GisViewCascadeHighlightInfo | null) => void
7815
8313
  onPointDrag?: (payload: GisViewPointDragPayload) => void
7816
8314
  /** 复制节点:start / move / commit / end / cancel(剪贴板另有 clipboard) */
7817
8315
  onPointCopy?: (payload: GisViewPointCopyPayload | GisViewBatchCopyPayload) => void
@@ -7819,8 +8317,6 @@ export interface GisViewEngineOptions {
7819
8317
  onPointMerge?: (payload: GisViewPointMergePayload | GisViewMergeResult | GisViewMergeFailure | GisViewMergeSelectedPayload) => void
7820
8318
 
7821
8319
  onWaypointChange?: (payload: GisViewWaypointPayload) => void
7822
- /** 右键点中通道回线:给出分组上下文(几组 / 当前哪组 / 有哪些交互),点空白处给 null */
7823
- onChannelContextMenu?: (payload: GisViewChannelContextPayload | null, event: MouseEvent) => void
7824
8320
  /** 新增通道草稿:start / from / ready / cancel / commit / blocked / restart / pick */
7825
8321
  onChannelDraft?: (payload: GisViewChannelDraftPayload) => void
7826
8322
  /** 草稿里每点一次发一条:step 1 拿到起点、step 2 拿到终点(线路结束) */
@@ -7997,7 +8493,7 @@ export interface GisViewEngine {
7997
8493
  applyInitialView(): void
7998
8494
  resetView(): void
7999
8495
  getBounds(): GisViewBounds
8000
- /** 缩放联动的基准比例(pointZoomScale / lineZoomScale / zoomScaleAuto 共用那一份):缺省是首次适应视图时的 camera.scale */
8496
+ /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
8001
8497
  getZoomBaseScale(): number
8002
8498
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),返回落定的基准 */
8003
8499
  setZoomBaseScale(scale?: number): number
@@ -8009,6 +8505,12 @@ export interface GisViewEngine {
8009
8505
  getViewRect(): GisViewBounds
8010
8506
  /** 按条件列节点(只读快照,见 GisViewListOptions):面板读数 / 导出 / 校验用,十万级下别逐帧调 */
8011
8507
  listPoints(options?: GisViewListOptions): GisViewListedPoint[]
8508
+ /** 当前展示组(含 count: 1 的单成员):原始 points 不受影响 */
8509
+ getClusters(): GisViewCluster[]
8510
+ /** 覆盖层每帧同步数量文字用的轻量读数:只含多成员聚合圆 */
8511
+ getClusterLabels(): GisViewClusterLabel[]
8512
+ /** 当前点聚合配置与运行时开关 */
8513
+ getPointCluster(): GisViewPointClusterReadout
8012
8514
  /** 按条件列线路(只读快照):通道内的回线给的是骨架推导出来的折线,另带 color / width 与通道读数 */
8013
8515
  listLines(options?: GisViewListOptions): GisViewListedLine[]
8014
8516
  /** 一批要素的世界包围盒;一个都没对上返回 null */
@@ -8051,9 +8553,9 @@ export interface GisViewEngine {
8051
8553
  clientToWorld(clientX: number, clientY: number): [number, number]
8052
8554
  /** 世界坐标 → 客户端坐标(摆 DOM 浮层 / 菜单用) */
8053
8555
  worldToClient(x: number, y: number): [number, number]
8054
- pick(x: number, y: number): GisViewPickResult | null
8556
+ pick(x: number, y: number): GisViewHitResult | null
8055
8557
  /** 与组件实例的 pickAt 同一份:按浏览器客户端坐标拾取(引擎不等 DOM 事件,直接给 clientX / clientY) */
8056
- pickAtClient(clientX: number, clientY: number): GisViewPickResult | null
8558
+ pickAtClient(clientX: number, clientY: number): GisViewHitResult | null
8057
8559
  /** 程序化悬停(客户端坐标):让指针「停」在这儿,悬停高亮 / 光标 / onHover 一起更新,返回这一次的读数 */
8058
8560
  hoverAtClient(clientX: number, clientY: number): GisViewHoverPayload | null
8059
8561
  /** 取消程序化悬停:清掉高亮与读数并补发 onHover(null) */