gis-view-webgl2 0.1.11 → 0.1.13

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 (54) hide show
  1. package/README.md +0 -24
  2. package/dist/gis-view.css +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +524 -33
  5. package/dist/index.js +1 -1
  6. package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +156 -8
  7. package/docs/GisView.md +6 -6
  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 +157 -7
  9. package/docs/demos/BackgroundDemo.vue +600 -0
  10. package/docs/demos/ChannelDemo.vue +145 -3
  11. package/docs/demos/StyleDemo.vue +280 -69
  12. package/docs/demos/api-index.js +35 -19
  13. package/docs/demos/demos.js +26 -18
  14. package/docs/demos/gis-view-demo/demo.css +76 -0
  15. package/docs/demos/gis-view-demo/panels/StylePanels.vue +24 -8
  16. package/docs/demos/gis-view-demo/panels/ViewPanels.vue +33 -3
  17. package/docs/demos/gis-view-demo/useGisViewDemo.js +236 -22
  18. package/docs/format/02-/350/212/202/347/202/271/344/270/216/347/272/277/350/267/257.md +1 -1
  19. 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 +3 -3
  20. package/docs/from0/06-/344/273/216/346/225/260/346/215/256/345/210/260/345/256/236/344/276/213-/350/247/243/346/236/220/345/261/202.md +13 -11
  21. package/docs/from0/15-/351/231/204/345/275/225-/345/270/270/351/207/217/351/200/237/346/237/245/344/270/216/350/270/251/345/235/221/346/270/205/345/215/225.md +1 -1
  22. package/docs/index.html +2 -2
  23. package/docs/internals/10-/350/247/204/345/210/231/346/235/241/344/273/266/344/270/216/347/212/266/346/200/201/346/240/267/345/274/217.md +3 -3
  24. package/docs/internals/13-/351/271/260/347/234/274/345/233/276.md +1 -1
  25. package/docs/internals/14-/350/203/214/346/231/257/345/261/202.md +1 -0
  26. package/docs/internals/15-03-/351/200/220/350/275/256/350/256/260/345/275/225-/346/200/247/350/203/275/344/270/216/344/277/256/345/244/215-/344/270/213.md +199 -0
  27. package/docs/internals/17-/350/260/203/350/257/225/344/270/216/346/211/251/345/261/225/345/273/272/350/256/256.md +1 -1
  28. package/docs/internals/18-/346/200/247/350/203/275/345/256/236/346/265/213/344/270/216WebGPU/350/257/204/344/274/260.md +32 -0
  29. package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +1 -1
  30. package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +217 -26
  31. 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 +2 -2
  32. package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +37 -4
  33. package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +58 -1
  34. package/docs/manual/11-/346/240/267/345/274/217/344/270/216/350/247/204/345/210/231.md +59 -8
  35. package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +1 -1
  36. package/docs/manual/13-/345/212/250/346/225/210/344/270/216/345/233/276/345/205/203.md +220 -2
  37. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +77 -16
  38. package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +30 -17
  39. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +11 -4
  40. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +17 -8
  41. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +128 -4
  42. package/docs/manual/19-/350/257/273/346/225/260/344/270/216/346/213/226/346/213/275/351/242/204/350/247/210.md +2 -2
  43. package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +13 -1
  44. 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 +4 -1
  45. package/docs/steps/index.html +1 -1
  46. package/docs/steps/selftest-demo.html +2 -2
  47. package/docs/steps/selftest-demos.html +626 -11
  48. package/docs/steps/selftest-docs.html +8 -4
  49. package/docs/steps/selftest-features.html +1428 -2
  50. package/docs/steps/selftest-perf.html +296 -25
  51. package/docs/steps/selftest-scale.html +61 -3
  52. package/docs/steps/selftest-select.html +303 -1
  53. package/docs/steps/step-06-style.js +3 -2
  54. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -334,13 +334,24 @@ export interface GisViewCursorStyle {
334
334
  }
335
335
  }
336
336
 
337
- /** 框选矩形样式:填充与边框分别配置 */
337
+ /** 框选矩形样式:填充与边框分别配置;div 模式还支持线型、圆角与自定义类名 */
338
338
  export interface GisViewSelectionBoxStyle {
339
339
  fill?: string
340
340
  fillOpacity?: number
341
341
  stroke?: string
342
- /** 边框线宽(CSS 像素) */
342
+ /** 边框线宽(CSS 像素);canvas 渲染时 0 表示不画边框 */
343
343
  strokeWidth?: number
344
+ /**
345
+ * 框选矩形的渲染方式:'canvas'(缺省,画在 WebGL)或 'div'(在画布上方挂一个 DOM 元素)。
346
+ * div 模式额外支持 borderStyle / radius / className;canvas 模式的边框恒为实线直角。
347
+ */
348
+ render?: 'canvas' | 'div'
349
+ /** div 模式追加的类名;与 .gis-view__selection-box 一起挂到边框元素上,便于整体换样式 */
350
+ className?: string
351
+ /** div 模式的边框线型,缺省 solid */
352
+ borderStyle?: 'solid' | 'dashed' | 'dotted'
353
+ /** div 模式的圆角(CSS 像素),缺省 0 */
354
+ radius?: number
344
355
  }
345
356
 
346
357
  /** 鹰眼图里的节点:颜色 + 半径(CSS 像素) */
@@ -408,6 +419,8 @@ export interface GisViewMinimapLineRuleStyle {
408
419
  export interface GisViewMinimapPointRule {
409
420
  when?: GisViewConditionInput<GisViewPoint>
410
421
  style: GisViewMinimapPointRuleStyle
422
+ /** 优先级:缺省 false(规则只补点自身没写的字段);true 时这条规则写了的字段压过点自身字段 */
423
+ override?: boolean
411
424
  name?: string
412
425
  }
413
426
 
@@ -415,6 +428,8 @@ export interface GisViewMinimapPointRule {
415
428
  export interface GisViewMinimapLineRule {
416
429
  when?: GisViewConditionInput<GisViewLine>
417
430
  style: GisViewMinimapLineRuleStyle
431
+ /** 优先级:缺省 false(规则只补线自身没写的字段);true 时这条规则写了的字段压过线自身字段 */
432
+ override?: boolean
418
433
  name?: string
419
434
  }
420
435
 
@@ -579,7 +594,7 @@ export interface GisViewMinimapOptions {
579
594
  /**
580
595
  * 节点规则:按属性给小图上的节点定颜色 / 半径 / 形状 / 层级(条件语言与主图一样)。
581
596
  * 不配时沿用主图样式链:颜色 / 描边色 / 层级取规则,尺寸与符号取引擎最终解析结果
582
- * (点自身 > 主图 pointRules > 主图 pointStyle),圆、方、图片与 SVG 图标都会画出来
597
+ * (override 规则 > 点自身 > 普通规则 > 主图 pointStyle),圆、方、图片与 SVG 图标都会画出来
583
598
  */
584
599
  pointRules?: GisViewMinimapPointRule[]
585
600
  /** 线路规则:按属性给小图上的线路定颜色 / 线宽 / 透明度 / 层级,不配时沿用主图 lineRules(颜色 / 透明度)与样式链线宽 */
@@ -807,6 +822,225 @@ export interface GisViewEngineHeatDensity {
807
822
  /** 一次烘焙的耗时(毫秒) */
808
823
  ms: number
809
824
  }
825
+
826
+ /** 图例形态:ruler / continuous 是连续色带 + 刻度,piecewise 是分段色块 */
827
+ export type GisViewVisualMapType = 'ruler' | 'continuous' | 'piecewise'
828
+ export type GisViewVisualMapOrientation = 'vertical' | 'horizontal'
829
+ export type GisViewVisualMapPositionName = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
830
+ /** 落选值怎么处理:只退热力 / 连对应网架一起隐藏 / 不做内置效果 */
831
+ export type GisViewVisualMapOutOfRange = 'heatmap' | 'network' | 'none'
832
+ /** 图例四边定位:数字按 CSS 像素,字符串原样作为 CSS 长度(例如 '50%');缺省左下角 */
833
+ export interface GisViewVisualMapPosition {
834
+ top?: number | string
835
+ right?: number | string
836
+ bottom?: number | string
837
+ left?: number | string
838
+ }
839
+ /** 图例外层的内联样式:普通 CSS 属性或 --gis-view-visual-map-* 变量 */
840
+ export type GisViewVisualMapStyle = Record<string, string | number | null | undefined>
841
+
842
+ /** 分段图例的一段:范围写法与 ECharts 的 pieces 一致,支持 gte / gt / lte / lt / min / max */
843
+ export interface GisViewVisualMapPiece {
844
+ gte?: number
845
+ gt?: number
846
+ lte?: number
847
+ lt?: number
848
+ min?: number
849
+ max?: number
850
+ /** 自定义这一段显示的文字;不写按范围自动格式化 */
851
+ label?: string
852
+ /** 自定义这一段色块的颜色;不写按色带在区间中点的颜色取 */
853
+ color?: string
854
+ }
855
+
856
+ /** 图例 formatter 的读数:连续刻度与分段色块都会走同一份 */
857
+ export interface GisViewVisualMapFormatterInfo {
858
+ value: number
859
+ min: number
860
+ max: number
861
+ ratio: number
862
+ type: 'ruler' | 'piecewise'
863
+ target: GisViewHeatmapTarget
864
+ field: string
865
+ index?: number
866
+ piece?: GisViewVisualMapPiece
867
+ }
868
+
869
+ /** 自定义图例回调可用的读数与受控交互入口 */
870
+ export interface GisViewVisualMapRenderContext {
871
+ type: 'ruler' | 'piecewise'
872
+ target: GisViewHeatmapTarget
873
+ field: string
874
+ domain: [number, number]
875
+ colors: string[]
876
+ stops: number[] | null
877
+ opacity: number | [number, number]
878
+ orient: GisViewVisualMapOrientation
879
+ title: string
880
+ unit: string
881
+ ticks: GisViewVisualMapTick[]
882
+ pieces: GisViewVisualMapValuePiece[]
883
+ selectedMode: 'single' | 'multiple' | false
884
+ calculable: boolean
885
+ outOfRange: GisViewVisualMapOutOfRange
886
+ /** 当前选中的分段下标;连续尺恒为空数组 */
887
+ selected: number[]
888
+ /** 当前区间(数值,低值在前);未开启 calculable 时为 null */
889
+ range: [number, number] | null
890
+ /** 当前区间在色带上的比例(0 ~ 1,低比例在前) */
891
+ rangeRatios: [number, number] | null
892
+ root: HTMLElement
893
+ body: HTMLElement
894
+ titleElement: HTMLElement
895
+ /** 把 0 ~ 1 的色带比例换成数值 */
896
+ valueAt(ratio: number): number
897
+ /** 按图例的 precision / formatter / unit 格式化数值 */
898
+ formatValue(value: number): string
899
+ /** 设置分段选择;返回是否发生变化 */
900
+ setSelection(selected: number[] | Record<string, boolean>): boolean
901
+ /** 设置数值区间;返回是否发生变化 */
902
+ setRange(range: [number, number]): boolean
903
+ /** 分段图例清空选择,连续尺恢复完整区间 */
904
+ clearSelection(): boolean
905
+ /** 用当前状态主动触发 onChange */
906
+ emitChange(reason?: 'piece' | 'range' | 'api'): void
907
+ }
908
+
909
+ /** 图例交互回调:只有用户操作 / 自定义渲染主动调用时触发,受控配置更新不回声 */
910
+ export interface GisViewVisualMapChangePayload {
911
+ type: 'ruler' | 'piecewise'
912
+ target: GisViewHeatmapTarget
913
+ field: string
914
+ domain: [number, number]
915
+ interactive: boolean
916
+ selectedMode: 'single' | 'multiple' | false
917
+ calculable: boolean
918
+ outOfRange: GisViewVisualMapOutOfRange
919
+ selected: number[]
920
+ range: [number, number] | null
921
+ rangeRatios: [number, number] | null
922
+ element: HTMLElement
923
+ source: 'user' | 'api'
924
+ reason: 'piece' | 'range' | 'api'
925
+ originalEvent: Event | null
926
+ }
927
+
928
+ /**
929
+ * 图例(visualMap):参考 ECharts 的 visualMap,把热力图的色带画成带刻度的尺或分段色块。
930
+ * 配置对象本身即开关;不写时一个 DOM 节点都不产生。字段 / 值域 / 颜色默认跟随 heatmap,
931
+ * 也能在自己的配置里覆盖成一条独立图例。不写 target 时,展示值域取 heatmap 启用目标中
932
+ * 第一个能扫到数值的那一类,当前分段 / 区间却门控 heatmap 的全部启用目标(同一 field);
933
+ * 显式 target 才只作用这一类。默认继承主图热力的鹰眼图同步门控,显式 minimap.heatmap 仍独立。
934
+ * outOfRange 决定落选值是只回普通样式、连对应网架一起隐藏,还是不做内置效果;数据、筛选与分组不变。
935
+ */
936
+ export interface GisViewVisualMap {
937
+ /** 关掉这一份配置(等价于不配 visualMap) */
938
+ enabled?: boolean
939
+ /** 'ruler'(缺省,continuous 同义)连续尺 / 'piecewise' 分段色块 */
940
+ type?: GisViewVisualMapType
941
+ /**
942
+ * 展示值域使用哪一类要素:显式写只门控这一类;不写时跟随 heatmap 的全部启用目标,
943
+ * 展示值域按 point → line → channel 选第一个真正有数值的目标(都缺值时回落第一个启用目标)。
944
+ */
945
+ target?: GisViewHeatmapTarget
946
+ /** 取值字段:不写跟随 heatmap.field,没有 heatmap 时按 'value' 自动扫数据 */
947
+ field?: string
948
+ /** 显式值域 [起, 止];反向写就是颜色反向。不写 / 'auto' 按当前数据自动算 */
949
+ domain?: [number, number] | 'auto'
950
+ /** ECharts 写法的单端覆盖:只给一端时另一端仍按自动值域取 */
951
+ min?: number
952
+ max?: number
953
+ /** 渐变色(至少两段),不写跟随 heatmap.colors,最后回落到内置色带 */
954
+ colors?: string[]
955
+ /** 色标位置(0 ~ 1,与 colors 一一对应) */
956
+ stops?: number[]
957
+ /** 色带透明度,写法与 heatmap.opacity 一致 */
958
+ opacity?: number | [number, number]
959
+ title?: string
960
+ /** 每个数值后面追加的单位(自定义 formatter 时不自动追加) */
961
+ unit?: string
962
+ orient?: GisViewVisualMapOrientation
963
+ /** 四角名或四边定位对象,缺省 'bottom-left' */
964
+ position?: GisViewVisualMapPositionName | GisViewVisualMapPosition
965
+ /** 连续尺色带的宽度 / 高度(CSS 像素);横向时缺省 200 × 14,纵向时 14 × 160 */
966
+ width?: number
967
+ height?: number
968
+ /** 连续尺的刻度数,同时也是不写 pieces 时的自动分段数(2 ~ 12,缺省 5) */
969
+ tickCount?: number
970
+ /** 打开图例交互:分段可点选,连续尺默认出现可拖动的区间;当前选区会实时门控图例作用目标上同 field 的热力上色 / 光晕 / 密度;缺省 false */
971
+ interactive?: boolean
972
+ /** 落选值处理:'heatmap'(缺省,只退热力、网架回普通样式)/ 'network'(对应点 / 独立线路 / 通道从画布与拾取中隐藏,未写 target 时三类同时生效)/ 'none'(只保留 onChange) */
973
+ outOfRange?: GisViewVisualMapOutOfRange
974
+ /** 分段选择方式:single 单选 / multiple(或 true)多选;不写时 interactive 默认 multiple */
975
+ selectedMode?: 'single' | 'multiple' | boolean | null
976
+ /** 初始选中分段:下标数组,或按下标 / 标签映射的布尔对象;未选中的分段不参与图例作用目标上同 field 的热力;不写默认全选 */
977
+ selected?: number[] | Record<string, boolean> | null
978
+ /** 连续尺初始区间 [低, 高];区间外的值不参与图例作用目标上同 field 的热力;不写且 calculable 时是完整值域 */
979
+ range?: [number, number] | null
980
+ /** 连续尺是否显示可拖动的区间手柄;interactive 时缺省 true,显式 false 可关掉 */
981
+ calculable?: boolean
982
+ /** 数字固定小数位;不写按值域跨度自动选 */
983
+ precision?: number
984
+ /**
985
+ * 文字格式:函数收到数值与读数;字符串支持 {value} / {min} / {max} / {unit} / {title} / {field}
986
+ * 占位符。函数返回空串时这一项仍占位,只是不显示文字。
987
+ */
988
+ formatter?: string | ((value: number, info: GisViewVisualMapFormatterInfo) => string)
989
+ /** piecewise 的分段;不写按值域与 tickCount 等分 */
990
+ pieces?: GisViewVisualMapPiece[]
991
+ /**
992
+ * 完全自定义图例:返回 DOM 节点 / DocumentFragment / HTML 字符串,或直接往 context.body 里追加节点。
993
+ * 内置标题会隐藏;容器定位与 pointer-events 仍沿用图例根节点。
994
+ */
995
+ render?: (context: GisViewVisualMapRenderContext) => Node | string | null | void
996
+ /** 分段点选 / 区间拖动后的回调;图例自身已同步门控热力,这里用于额外业务联动;受控配置更新不会反过来触发它 */
997
+ onChange?: (payload: GisViewVisualMapChangePayload) => void
998
+ /** 挂载容器(元素或选择器),不写挂到组件根节点;选择器找不到时也回落到组件根节点 */
999
+ container?: string | HTMLElement
1000
+ /** 追加在根节点上的 class(位置 / 颜色也可以用 CSS 变量整体覆盖) */
1001
+ className?: string
1002
+ /** 直接写在这层 DOM 上的内联样式 */
1003
+ style?: GisViewVisualMapStyle
1004
+ }
1005
+
1006
+ /** 图例上一根刻度的读数 */
1007
+ export interface GisViewVisualMapTick {
1008
+ value: number
1009
+ ratio: number
1010
+ label: string
1011
+ }
1012
+
1013
+ /** 图例上一个分段的读数 */
1014
+ export interface GisViewVisualMapValuePiece {
1015
+ low: number | null
1016
+ high: number | null
1017
+ label: string
1018
+ color: string
1019
+ ratio: number
1020
+ }
1021
+
1022
+ /** getVisualMap() 的读数:值域、色带与当前显示的刻度 / 分段 */
1023
+ export interface GisViewVisualMapReadout {
1024
+ type: 'ruler' | 'piecewise'
1025
+ /** 实际用于展示值域的目标;未写 target 且前一类缺值时可能是 line / channel */
1026
+ target: GisViewHeatmapTarget
1027
+ field: string
1028
+ domain: [number, number]
1029
+ colors: string[]
1030
+ orient: GisViewVisualMapOrientation
1031
+ title: string
1032
+ unit: string
1033
+ interactive: boolean
1034
+ selectedMode: 'single' | 'multiple' | false
1035
+ calculable: boolean
1036
+ outOfRange: GisViewVisualMapOutOfRange
1037
+ selected: number[]
1038
+ range: [number, number] | null
1039
+ rangeRatios: [number, number] | null
1040
+ ticks: GisViewVisualMapTick[]
1041
+ pieces: GisViewVisualMapValuePiece[]
1042
+ }
1043
+
810
1044
  /**
811
1045
  * 线路动画(沿线跑动的图标,ECharts 的 `lines.effect` 那一类):配在 options.effects.line 上作为全局缺省,
812
1046
  * 逐条线路用 lines[].effect 覆盖它 —— `false` / `null` 关掉这一条,`true` 用全局那一份(全局没配就用缺省值),
@@ -1244,6 +1478,7 @@ export type GisViewCascadeHighlightScope = 'points' | 'both'
1244
1478
  /**
1245
1479
  * 点击级联高亮:点击节点时高亮它和直接相连的节点 / 线路,点击线路或通道时高亮这条线的两端。
1246
1480
  * 它与选中集完全分开 —— 不写 selectionKeys、不改 selected,样式也不走悬停 / 选中那一套。
1481
+ * 通过 toggleSelect / Ctrl 取反 / deselect / selectFeatures 的 remove 或清空取消选中时,级联会一起收掉。
1247
1482
  * true 等价于 { enabled: true, scope: 'both' };不配或 false 都是关闭。
1248
1483
  */
1249
1484
  export interface GisViewCascadeHighlightOptions {
@@ -1341,6 +1576,8 @@ export type GisViewChannelOffsetMode = 'tangent' | 'inset'
1341
1576
  export interface GisViewChannelGroup {
1342
1577
  /** 分组 id:缺省时第一组用通道 id,第 n 组用 `${通道 id}::${n}`(n 从 2 起) */
1343
1578
  id?: string | number
1579
+ /** 这一组是否显示,缺省 true;隐藏后成员、骨架与拐点都保留,改回 true 原样恢复 */
1580
+ visible?: boolean
1344
1581
  /** 这一组的线路 id,至少一条;同一条线只能出现在一组里,没列出来的并回第一组 */
1345
1582
  lineIds: Array<string | number>
1346
1583
  /** 这一组自己的骨架拐点(两端锚定时只写中间拐点):新拆分出来的分组不带拐点,就是一条直线 */
@@ -1437,6 +1674,8 @@ export interface GisViewChannelInfo {
1437
1674
  channelId: string | number
1438
1675
  /** 通道在 channels 数组里的下标 */
1439
1676
  channelIndex: number
1677
+ /** 这一组当前是否显示;隐藏组的成员不出现在图上,但几何与拐点仍保留 */
1678
+ visible: boolean
1440
1679
  /** 通道内线路在 lines 数组里的下标,顺序与回线顺序一致 */
1441
1680
  lineIndexes: number[]
1442
1681
  /** 骨架折线(中心线) */
@@ -1462,6 +1701,8 @@ export interface GisViewChannelMembers {
1462
1701
  channelId: string | number
1463
1702
  /** 通道在 channels 数组里的下标(热力图这类按通道取值时用它) */
1464
1703
  channelIndex: number
1704
+ /** 这一组当前是否显示 */
1705
+ visible: boolean
1465
1706
  /** 成员回线在 lines 数组里的下标 */
1466
1707
  lineIndexes: number[]
1467
1708
  /** 每条成员回线的横向偏移(世界单位,与 lineIndexes 一一对应) */
@@ -1492,6 +1733,8 @@ export interface GisViewChannelGroupInfo {
1492
1733
  channelIndex: number
1493
1734
  /** 分组 id */
1494
1735
  id: string | number
1736
+ /** 这一组当前是否显示 */
1737
+ visible: boolean
1495
1738
  /** 这一组的线路在 lines 数组里的下标 */
1496
1739
  lineIndexes: number[]
1497
1740
  /** 这一组的线路 id */
@@ -1553,6 +1796,8 @@ export interface GisViewChannelContextGroup {
1553
1796
  channelId: string | number
1554
1797
  /** 分组在通道里的序号(从 0 起,顺序即声明顺序) */
1555
1798
  index: number
1799
+ /** 这一组当前是否显示 */
1800
+ visible: boolean
1556
1801
  /** 这一组的回线 id */
1557
1802
  lineIds: Array<string | number>
1558
1803
  /** 这一组的回线在 lines 数组里的下标 */
@@ -2050,10 +2295,26 @@ export interface GisViewMovedPoint {
2050
2295
  }
2051
2296
 
2052
2297
  /** 可整批隐藏 / 显示的要素类型 */
2053
- export type GisViewVisibilityKind = 'point' | 'line' | 'channel'
2298
+ export type GisViewVisibilityKind = 'point' | 'line' | 'channel' | 'group'
2299
+
2300
+ /**
2301
+ * 分组引用的定位写法:通道认 channelId / channelIndex,分组认 groupId / groupIndex;
2302
+ * 也可以只写 id(分组 id 在整个视图里唯一时)。直接给字符串 / 数字时按分组 id 找。
2303
+ */
2304
+ export interface GisViewChannelGroupVisibilityRef {
2305
+ channelId?: string | number
2306
+ channelIndex?: number
2307
+ groupId?: string | number
2308
+ groupIndex?: number
2309
+ /** 分组 id 的简写;与 groupId 同时写时以 groupId 为准 */
2310
+ id?: string | number
2311
+ }
2312
+
2313
+ /** 分组之外,其余类型沿用要素引用 */
2314
+ export type GisViewVisibilityRef = GisViewFeatureRef | GisViewChannelGroupVisibilityRef
2054
2315
 
2055
2316
  /** 隐藏 / 显示的引用:单个 id / 下标 / `{ id }` / `{ index }`,一批,或当前选中集 `'selection'` */
2056
- export type GisViewVisibilityRefs = GisViewFeatureRef | 'selection' | Array<GisViewFeatureRef | 'selection'>
2317
+ export type GisViewVisibilityRefs = GisViewVisibilityRef | 'selection' | Array<GisViewVisibilityRef | 'selection'>
2057
2318
 
2058
2319
  /** 隐藏 / 显示时没认出来的引用 */
2059
2320
  export interface GisViewVisibilitySkip {
@@ -2072,12 +2333,16 @@ export interface GisViewSetVisibilityOutcome {
2072
2333
  /** 对应的 id;要素没 id 时退回下标 */
2073
2334
  ids: Array<string | number>
2074
2335
  items: Array<GisViewPoint | GisViewLine | GisViewChannel>
2336
+ /** kind 为 'group' 时受影响的分组读数;其余类型为空数组 */
2337
+ groups: GisViewChannelGroupInfo[]
2075
2338
  skipped: GisViewVisibilitySkip[]
2076
2339
  }
2077
2340
 
2078
2341
  /** 通道变化里的一组:成员与骨架都是当次读数的可比较快照 */
2079
2342
  export interface GisViewChangedChannelGroup {
2080
2343
  id: string | number | null
2344
+ /** 这一组当前是否显示 */
2345
+ visible: boolean
2081
2346
  lineIds: string[]
2082
2347
  path: GisViewCoordinate[] | null
2083
2348
  }
@@ -2573,6 +2838,17 @@ export interface GisViewGeoJsonStyle {
2573
2838
  strokeWidth?: number
2574
2839
  /** y 轴比例,与 ECharts 的 geo.aspectScale 一致:默认 0.75;坐标不是经纬度时传 1 */
2575
2840
  aspectScale?: number
2841
+ /**
2842
+ * 画出来的目标世界范围:填了就按这份矩形把整份 GeoJSON 独立缩放 / 平移到指定位置,
2843
+ * 因此可以不改原始 GeoJSON 就调整宽高比与大小;不写时沿用数据范围与 aspectScale 的结果。
2844
+ * rawBounds 仍保留原始坐标范围,经纬度投影与 data 映射口径不变。
2845
+ */
2846
+ bounds?: GisViewBounds
2847
+ /**
2848
+ * 绕 bounds 中心顺时针旋转的角度(度,缺省 0):只旋转画出来的 GeoJSON,不改原数据;
2849
+ * rawBounds 仍是原始坐标范围,bounds 与 getResolvedBackground().geoJson.bounds 是旋转后的轴对齐外框。
2850
+ */
2851
+ rotation?: number
2576
2852
  /** 区域名从 properties 的哪个字段取,默认 'name' */
2577
2853
  nameProperty?: string
2578
2854
  /** 区域文字:配了就显示 */
@@ -2602,6 +2878,88 @@ export interface GisViewBackground {
2602
2878
  opacity?: number
2603
2879
  }
2604
2880
 
2881
+ /** 内置背景编辑器的描边 / 手柄样式(都是 CSS 像素,改完立刻作用在覆盖层上) */
2882
+ export interface GisViewBackgroundEditorStyle {
2883
+ /** 轮廓、旋转连线与手柄颜色 */
2884
+ color?: string
2885
+ /** 背景面的填充色;不想要填充可写 'transparent' */
2886
+ fill?: string
2887
+ /** 轮廓与旋转连线宽度 */
2888
+ lineWidth?: number
2889
+ /** 轮廓 / 连线是否虚线 */
2890
+ dashed?: boolean
2891
+ /** 缩放手柄边长 */
2892
+ handleSize?: number
2893
+ /** 缩放手柄形状 */
2894
+ handleShape?: 'circle' | 'square'
2895
+ }
2896
+
2897
+ /** beginBackgroundEdit 的配置:背景类型从当前 background 自动识别(同时有图片时优先图片) */
2898
+ export interface GisViewBackgroundEditorOptions {
2899
+ /** 是否锁宽高比;true 只出四角,false 出四角 + 四边中点 */
2900
+ aspectLocked?: boolean
2901
+ /** 是否显示旋转点(true 时手柄数再 +1) */
2902
+ rotation?: boolean
2903
+ /** 按住 Shift 时的旋转吸附角(度);0 关闭 */
2904
+ snapAngle?: number
2905
+ /** 拖缩放时的最小屏幕尺寸(CSS 像素) */
2906
+ minSize?: number
2907
+ /** 旋转点离上边的附加距离(CSS 像素) */
2908
+ rotationDistance?: number
2909
+ /** 进入时是否把背景放回视野 */
2910
+ fitView?: boolean
2911
+ /** fitView / updateBackgroundEdit({ fitView: true }) 的留白 */
2912
+ fitPadding?: number
2913
+ /** 是否显示底部操作提示 */
2914
+ showHint?: boolean
2915
+ style?: GisViewBackgroundEditorStyle
2916
+ /** 编辑器驱动的每次变化(移动 / 缩放 / 旋转 / 配置)回调 */
2917
+ onChange?: (state: GisViewBackgroundEditorState) => void
2918
+ /** 一次拖动手势结束时回调 */
2919
+ onEnd?: (state: GisViewBackgroundEditorState) => void
2920
+ }
2921
+
2922
+ /** 内置背景编辑器的实时读数:rotation 是角度(度,顺时针),rotationEnabled 才控制旋转点显隐 */
2923
+ export interface GisViewBackgroundEditorState {
2924
+ active: true
2925
+ backgroundType: 'image' | 'geojson'
2926
+ aspectLocked: boolean
2927
+ rotationEnabled: boolean
2928
+ /** 当前角度(度,顺时针,-180 ~ 180) */
2929
+ rotation: number
2930
+ center: [number, number]
2931
+ width: number
2932
+ height: number
2933
+ handleCount: number
2934
+ backgroundEditing: boolean
2935
+ snapAngle: number
2936
+ minSize: number
2937
+ rotationDistance: number
2938
+ showHint: boolean
2939
+ fitView: boolean
2940
+ fitPadding: number
2941
+ style: Required<GisViewBackgroundEditorStyle>
2942
+ }
2943
+
2944
+ /** updateBackgroundEdit 的增量:rotation 写布尔值切旋转点,写数字等价于 angle */
2945
+ export interface GisViewBackgroundEditorPatch {
2946
+ aspectLocked?: boolean
2947
+ rotation?: boolean | number
2948
+ angle?: number
2949
+ snapAngle?: number
2950
+ minSize?: number
2951
+ rotationDistance?: number
2952
+ fitView?: boolean
2953
+ fitPadding?: number
2954
+ showHint?: boolean
2955
+ style?: GisViewBackgroundEditorStyle
2956
+ center?: [number, number]
2957
+ width?: number
2958
+ height?: number
2959
+ onChange?: (state: GisViewBackgroundEditorState) => void
2960
+ onEnd?: (state: GisViewBackgroundEditorState) => void
2961
+ }
2962
+
2605
2963
  /** 解析后的背景图片:quad 是四个顶点的 [x, y, u, v](左上 / 右上 / 左下 / 右下),直接喂给渲染管线 */
2606
2964
  export interface GisViewResolvedBackgroundImage {
2607
2965
  /** 解码后的图片元素(Canvas2D 侧画缩略图用),WebGL 侧只用 texture */
@@ -2651,6 +3009,8 @@ export interface GisViewResolvedGeoJsonRegion {
2651
3009
  export interface GisViewResolvedGeoJson {
2652
3010
  regions: GisViewResolvedGeoJsonRegion[]
2653
3011
  labels: GisViewResolvedBackgroundLabel[]
3012
+ /** 实际落到画面上的旋转角(度,顺时针,已归一到 [-180, 180)) */
3013
+ rotation: number
2654
3014
  /** 缩放前的真实坐标范围(aspectScale 生效前):相机、fitView 与经纬度换算用它 */
2655
3015
  rawBounds: GisViewBounds | null
2656
3016
  /** 这份底图实际使用的 aspectScale(默认 0.75) */
@@ -3134,7 +3494,7 @@ export type GisViewPointerTarget = 'point' | 'line' | 'channel' | 'cluster' | 'w
3134
3494
 
3135
3495
  /**
3136
3496
  * 一次指针操作的动作名。同一个名字在「按下 / 松开 / 点击」三条事件里含义略有不同:
3137
- * - onPointerDown 是「这一次按下打算做什么」(意图):'pan' / 'dragPoint' / 'dragWaypoint' / 'boxSelect' /
3497
+ * - onPointerDown 是「这一次按下打算做什么」(意图):'pan' / 'dragPoint' / 'dragSelectionBox' / 'dragWaypoint' / 'boxSelect' /
3138
3498
  * 'copy' / 'channelDraft'(点两次加通道)/ 'decorationDraft'(动态装饰器草稿)/ 'contextMenu'(右键)/ 'click'(左键按下,但下面没有可拖的东西);
3139
3499
  * - onPointerUp 是「刚做完的那一件事」:拖过就是拖动的名字,没拖就是 'click'(配合 action.moved 判读);
3140
3500
  * - onClick / onDblClick 是真正发生的那一件:'select'(点中要素)/ 'click'(没开选中)/ 'dblClick'(双击);
@@ -3152,6 +3512,8 @@ export type GisViewPointerActionType =
3152
3512
  | 'selectWaypoint'
3153
3513
  | 'dragWaypoint'
3154
3514
  | 'dragPoint'
3515
+ /** 拖动保持中的框选矩形:连同框内选中的节点一起平移 */
3516
+ | 'dragSelectionBox'
3155
3517
  | 'clusterClick'
3156
3518
  | 'dragLabel'
3157
3519
  | 'selectLabel'
@@ -4181,20 +4543,32 @@ export type GisViewConditionInput<T = never> =
4181
4543
  /** 条件判定函数:不传字段即不按条件过滤,数组表示「并且」 */
4182
4544
  export declare const createConditionMatcher: <T = never>(input: GisViewConditionInput<T>) => (item: T, index?: number) => boolean
4183
4545
 
4184
- /** 点的批量样式规则:条件命中就套用 style,只补点自身没写的字段 */
4546
+ /**
4547
+ * 点的批量样式规则:条件命中就套用 style。
4548
+ * 缺省只补点自身没写的字段;写 `override: true` 时这条规则的字段压过点自身字段,
4549
+ * 但仍低于悬停 / 选中 / 框选状态样式与热力图。
4550
+ */
4185
4551
  export interface GisViewPointRule {
4186
4552
  /** 命中条件,缺省命中全部点 */
4187
4553
  when?: GisViewConditionInput<GisViewPoint>
4188
4554
  /** 命中的点按字段套用的样式:颜色、大小、符号、描边、透明度、阴影、绘制层级(zIndex) */
4189
4555
  style: GisViewPointStyle
4556
+ /** 优先级:缺省 false(规则只补点自身没写的字段);true 时这条规则的样式压过点自身字段 */
4557
+ override?: boolean
4190
4558
  /** 规则名,仅作标识 */
4191
4559
  name?: string
4192
4560
  }
4193
4561
 
4194
- /** 线的批量样式规则:条件命中就套用 style,只补线自身没写的字段 */
4562
+ /**
4563
+ * 线的批量样式规则:条件命中就套用 style。
4564
+ * 缺省只补线自身没写的字段;写 `override: true` 时这条规则的字段压过线自身字段,
4565
+ * 但仍低于悬停 / 选中 / 框选状态样式与热力图。
4566
+ */
4195
4567
  export interface GisViewLineRule {
4196
4568
  when?: GisViewConditionInput<GisViewLine>
4197
4569
  style: GisViewLineStyle
4570
+ /** 优先级:缺省 false(规则只补线自身没写的字段);true 时这条规则的样式压过线自身字段 */
4571
+ override?: boolean
4198
4572
  name?: string
4199
4573
  }
4200
4574
 
@@ -5305,14 +5679,14 @@ export interface GisViewChannelSnapshot {
5305
5679
  }
5306
5680
 
5307
5681
 
5308
- /** getPointSpacing() 的端点:可见节点在原始 points 里的 id、下标与数据对象 */
5682
+ /** getPointSpacing() / getPointsSpacing() 的端点:节点在原始 points 里的 id、下标与数据对象 */
5309
5683
  export interface GisViewPointSpacingNode {
5310
5684
  id: string | number
5311
5685
  index: number
5312
5686
  item: GisViewPoint
5313
5687
  }
5314
5688
 
5315
- /** getPointSpacing() 的一对节点:distance 是当前相机比例下的 CSS 像素 */
5689
+ /** getPointSpacing() / getPointsSpacing() 的一对节点:distance 是当前相机比例下的 CSS 像素 */
5316
5690
  export interface GisViewPointSpacingPair {
5317
5691
  from: GisViewPointSpacingNode
5318
5692
  to: GisViewPointSpacingNode
@@ -5320,11 +5694,12 @@ export interface GisViewPointSpacingPair {
5320
5694
  }
5321
5695
 
5322
5696
  /**
5323
- * getPointSpacing() 的读数:当前可见节点的最近正距离与最远距离,单位都是 CSS 像素,
5324
- * 与 fitSpacing 同一套屏幕口径,并随当前相机比例换算。筛选 / 隐藏后的节点不参与。
5697
+ * getPointSpacing() / getPointsSpacing() 的读数:一组节点的最近正距离与最远距离,单位都是 CSS 像素,
5698
+ * 与 fitSpacing 同一套屏幕口径,并随当前相机比例换算。前者统计当前可见节点;
5699
+ * 后者只统计显式传入的节点,筛选 / 隐藏不影响。
5325
5700
  */
5326
5701
  export interface GisViewPointSpacing {
5327
- /** 当前参与统计的可见节点数 */
5702
+ /** 当前参与统计的节点数 */
5328
5703
  count: number
5329
5704
  /** 最近两个不同位置节点之间的 CSS 像素距离;不足两个节点或全部重合时为 null */
5330
5705
  minDistance: number | null
@@ -5447,7 +5822,7 @@ export interface GisViewDropPreviewInput {
5447
5822
  screen?: [number, number]
5448
5823
  /** 落点钉住的世界坐标;只给 screen 时按当前相机换算 */
5449
5824
  world?: [number, number]
5450
- /** 准备落地的要素字段:走与真实要素完全相同的样式链(规则 -> 全局样式 -> 这一份的字段) */
5825
+ /** 准备落地的要素字段:走与真实要素完全相同的样式链(override 规则 > 这一份的字段 > 普通规则 > 全局样式) */
5451
5826
  item?: Partial<GisViewPoint> & Partial<GisViewLine>
5452
5827
  /** line / channel 预览的起点(世界坐标):缺省就是落点,那样画不出线段 */
5453
5828
  from?: [number, number]
@@ -5502,16 +5877,17 @@ export interface GisViewInitialView {
5502
5877
 
5503
5878
  /**
5504
5879
  * 适应视图的节点间距兜底:普通「铺满数据范围」让最近节点在屏幕上挤在一起时,
5505
- * 按 minDistance 反推一个更高的相机比例;节点分布太散、最远节点铺得过开时,
5506
- * 按 maxDistance 把比例压回来。minDistance / maxDistance 二选一,
5880
+ * minDistance 按 `minDistance / 最近正世界距离` 精确反推相机比例,放大或缩小都会覆盖普通适应;
5881
+ * 节点分布太散、最远节点铺得过开时,maxDistance 只会把普通适应比例压回来。
5882
+ * minDistance / maxDistance 二选一,
5507
5883
  * 同时给时只启用 maxDistance;相机中心始终沿用普通适应的包围盒中心。
5508
5884
  */
5509
5885
  export interface GisViewFitSpacingOptions {
5510
- /** 距离模式一:可见节点中心之间的最小屏幕距离(CSS 像素),默认 24;与 maxDistance 二选一 */
5886
+ /** 距离模式一:可见节点中心之间的精确屏幕距离(CSS 像素),默认 24;与 maxDistance 二选一 */
5511
5887
  minDistance?: number
5512
5888
  /** 距离模式二:可见节点里最远一对的中心距不超过这个屏幕距离(CSS 像素);与 minDistance 二选一,同时给时只启用它 */
5513
5889
  maxDistance?: number
5514
- /** 相对普通适应比例的最大放大倍数,默认 0(不限,只受 maxScale 约束);正数表示上限 */
5890
+ /** @deprecated 兼容旧配置保留;不再限制 minDistance / maxDistance,实际比例只由 minScale / maxScale 最终夹取 */
5515
5891
  maxZoom?: number
5516
5892
  }
5517
5893
 
@@ -5524,8 +5900,24 @@ export interface GisViewPluginContext {
5524
5900
  readonly apiVersion: 1
5525
5901
  /** 与插件第一个参数相同,方便统一改写成只收一个上下文对象 */
5526
5902
  readonly view: GisViewInstance
5903
+ /** 这个插件作用域自己的中止信号:view.use() 返回的卸载函数或实例 destroy() 调用时 abort */
5904
+ readonly signal: AbortSignal
5905
+ /**
5906
+ * 登记一个自动清理函数:插件卸载 / 实例销毁时按登记顺序的倒序执行。
5907
+ * 返回的函数用于提前执行并摘掉这一项(幂等,重复调用只执行一次)。
5908
+ */
5909
+ onCleanup(cleanup: () => void): () => void
5910
+ /** 订阅视图事件并自动退订;返回的函数可提前退订(幂等) */
5911
+ on<K extends GisViewEventName>(name: K, handler: GisViewEventListener<K>): () => void
5912
+ on(name: GisViewEventWildcard, handler: GisViewAnyEventListener): () => void
5913
+ /** 注册实例命令并自动注销;同名覆盖时旧注销函数不会误删新命令 */
5914
+ registerCommand<Payload = unknown, Value = unknown>(name: string, handler: GisViewCommandHandler<Payload, Value>): () => void
5527
5915
  }
5528
5916
 
5917
+ /**
5918
+ * 插件返回值只需要 destroy;第二个参数是插件作用域上下文(signal / 自动清理)。
5919
+ * 旧写法 `view => ({ destroy })` 不受影响。
5920
+ */
5529
5921
  export type GisViewPlugin = (view: GisViewInstance, context: GisViewPluginContext) => void | { destroy?: () => void }
5530
5922
 
5531
5923
  /** 实例命令的上下文:注册表属于这个视图,handler 里拿它就能继续调实例方法 */
@@ -5625,7 +6017,7 @@ export interface GisViewCopyOptions {
5625
6017
  /** 合并前的一个节点样式快照:getPointStyle() 的返回,合并取尺寸 / 图标用的就是它 */
5626
6018
  export interface GisViewPointStyleSnapshot {
5627
6019
  index: number
5628
- /** 样式链(节点自身 > 规则 > pointStyle)定下来的尺寸,含 sizeScale,不含状态样式与热力倍率 */
6020
+ /** 样式链(override 规则 > 节点自身 > 普通规则 > pointStyle)定下来的尺寸,含 sizeScale,不含状态样式与热力倍率 */
5629
6021
  size: number
5630
6022
  /** 样式链定下来的图标(没配就是 undefined) */
5631
6023
  symbol: GisViewSymbolInput | undefined
@@ -5635,7 +6027,7 @@ export interface GisViewPointStyleSnapshot {
5635
6027
  /** 一条线路解析之后的样式快照:getLineStyle() 的返回 */
5636
6028
  export interface GisViewLineStyleSnapshot {
5637
6029
  index: number
5638
- /** 样式链(线路自身 > 规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale 与缩放联动 */
6030
+ /** 样式链(override 规则 > 线路自身 > 普通规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale 与缩放联动 */
5639
6031
  width: number
5640
6032
  /** 解析后的 RGBA 颜色,四个分量都在 0 ~ 1 */
5641
6033
  color: [number, number, number, number]
@@ -5759,6 +6151,9 @@ export type GisViewChannelWaypointDragMode =
5759
6151
  /** 只把同组同一 pathIndex 的拐点按相同世界增量平移,其他拐点(含相邻顶点)保持不动 */
5760
6152
  | 'vertex'
5761
6153
 
6154
+ /** 隐藏部分回线后的车道排布:保留原槽位,或让剩余可见回线在通道宽度内重新居中 */
6155
+ export type GisViewChannelHiddenLineLayout = 'preserve' | 'center'
6156
+
5762
6157
  /**
5763
6158
  * 框选允许收哪几类要素:节点、独立线路、通道回线,以及线路 / 通道的端点口径。
5764
6159
  * 通道回线只归 channel 这一档管;通道之外的普通线路归 line,两者可以任意组合。
@@ -6154,6 +6549,7 @@ export interface GisViewOptionChangePayload {
6154
6549
  channels: boolean
6155
6550
  filter: boolean
6156
6551
  minimap: boolean
6552
+ visualMap: boolean
6157
6553
  features: boolean
6158
6554
  quality: boolean
6159
6555
  history: boolean
@@ -6523,9 +6919,9 @@ export interface GisViewOptions {
6523
6919
  background?: GisViewBackground
6524
6920
  pointStyle?: GisViewPointStyle
6525
6921
  lineStyle?: GisViewLineStyle
6526
- /** 点的批量样式规则:按顺序命中覆盖,只补点自身没写的字段 */
6922
+ /** 点的批量样式规则:按顺序命中覆盖;缺省只补空位,单条可写 override: true 压过点自身字段 */
6527
6923
  pointRules?: GisViewPointRule[]
6528
- /** 线的批量样式规则:按顺序命中覆盖,只补线自身没写的字段 */
6924
+ /** 线的批量样式规则:按顺序命中覆盖;缺省只补空位,单条可写 override: true 压过线自身字段 */
6529
6925
  lineRules?: GisViewLineRule[]
6530
6926
  /**
6531
6927
  * 热力图:按字段的数值给节点 / 线路 / 通道回线取色带颜色,并可按同一个值缩放尺寸(节点看 size、线路看 width)。
@@ -6533,6 +6929,14 @@ export interface GisViewOptions {
6533
6929
  * 鹰眼图默认沿用这一份,也能用 minimap.heatmap 单独换一份或关掉
6534
6930
  */
6535
6931
  heatmap?: GisViewHeatmap | null
6932
+ /**
6933
+ * 图例:参考 ECharts visualMap,把热力图的色带画成带刻度的连续尺(ruler / continuous)或分段色块(piecewise)。
6934
+ * 不写 / null 时零 DOM;默认跟随 heatmap 的字段、自动值域与颜色,也能独立给 domain / colors。
6935
+ * 不写 target 时展示值域取第一类有数值的目标,交互选区门控 heatmap 全部启用目标上同 field 的
6936
+ * 热力上色、光晕与密度;显式 target 只门控这一类。不删除数据、不改筛选;
6937
+ * 只改图例配置仍只重画这一层,不触发引擎场景重排或标签重排
6938
+ */
6939
+ visualMap?: GisViewVisualMap | null
6536
6940
  /**
6537
6941
  * 节点标签:配了就按这个配置渲染,内容、位置、数量与显隐都可配。
6538
6942
  * 写数组就是「一个节点上显示多条标签」:数组里每一条各自有内容 / 位置 / 样式 / 显隐,
@@ -6611,7 +7015,7 @@ export interface GisViewOptions {
6611
7015
  /**
6612
7016
  * 点击级联高亮(默认关):点击节点时亮起它和直接相连的节点;scope 为 both 时连线路一起亮,
6613
7017
  * 点击线路 / 通道回线时亮起两端节点。它不进选中集,样式与悬停 / 选中分开配置,
6614
- * 当前亮起的清单用 getCascadeHighlight() 读。
7018
+ * 当前亮起的清单用 getCascadeHighlight() 读;取消选中时同步收掉,不会留下级联残影。
6615
7019
  */
6616
7020
  cascadeHighlight?: GisViewCascadeHighlightInput
6617
7021
  /** 没有配置状态样式时,是否仍用尺寸 / 宽度增幅画出内置强调;默认 false(不配样式就不改变外观) */
@@ -6648,6 +7052,23 @@ export interface GisViewOptions {
6648
7052
  pointCluster?: boolean | GisViewPointClusterOptions
6649
7053
  /** 是否绘制网格:与其它功能开关同一条口径,**缺省关**,写 showGrid: true 才画 */
6650
7054
  showGrid?: boolean
7055
+ /**
7056
+ * 网架整体显隐:false 时节点、线路、通道、装饰、动画与标签全部不画,只保留背景、网格与自定义 WebGL 层。
7057
+ * 适合先铺数据、再加 / 调背景;缺省 true。运行时用 updateOptions({ networkVisible }) 一键切换。
7058
+ */
7059
+ networkVisible?: boolean
7060
+ /**
7061
+ * 网架整体不透明度(0 ~ 1,缺省 1):在每类要素自身 opacity 之后再乘一层,背景不受影响。
7062
+ * 与 networkVisible 分开:要完全看不见用 networkVisible: false,只想压淡网架调这一项。
7063
+ */
7064
+ networkOpacity?: number
7065
+ /**
7066
+ * 背景编辑模式:true 时节点、线路、通道的悬停、点击、选中、拖拽、框选、右键与数据快捷键全部停用,
7067
+ * 但滚轮缩放照常可用,方便让网架和背景一起放大缩小后只调整背景。缺省 false。
7068
+ * 背景本身的移动 / 旋转 / 缩放可用内置 beginBackgroundEdit() / updateBackgroundEdit() / endBackgroundEdit(),
7069
+ * 也可由使用方编辑界面自行调用 updateBackground() 完成。
7070
+ */
7071
+ backgroundEditing?: boolean
6651
7072
  gridColor?: string
6652
7073
  /** 网格线的屏幕目标间距(像素),实际步长吸附到 1 / 2 / 5 × 10^n */
6653
7074
  gridSize?: number
@@ -6695,6 +7116,17 @@ export interface GisViewOptions {
6695
7116
  * 关着时多选仍走框选(boxSelect)与按住多选快捷键(默认 Ctrl / ⌘)。
6696
7117
  */
6697
7118
  multiSelect?: boolean
7119
+ /**
7120
+ * 再次选中即取消(**缺省关**):打开后,普通点击已在选中集里的要素会把它取消;
7121
+ * Ctrl / ⌘ 先选中、再普通点击同一要素也同样取消。单击 / 双击两种 selectTrigger 都适用,
7122
+ * 双击会按一次操作处理(第一下取反、第二下保持),不会因为双击的两下连点而反复切换。
7123
+ * 命中通道回线时按 channelSelectMode 决定取消单条回线 / 当前分组 / 整条通道,其他选中项保留;
7124
+ * 该组 / 通道只选中一部分、或点到组内另一条回线时,也按同一展开范围整体取消;
7125
+ * 该组 / 通道已经完整选中时,即使 channelSelectMode 为 line 也整组 / 整条取消。
7126
+ * 这条取消路径不受 selectionKinds 限制;取消生效时同一来源的点击级联也会一起收掉。
7127
+ * 与 multiSelect 同时打开时沿用 multiSelect 的累加取反口径;运行时走 updateOptions({ toggleSelect })。
7128
+ */
7129
+ toggleSelect?: boolean
6698
7130
  /**
6699
7131
  * 选中触发方式:缺省 'click'(单击选中);写 'dblClick' 后第一次点击只派发 onClick,
6700
7132
  * 第二次(双击判定命中)才更新选中集,并同时派发 onClick 与 onDblClick。
@@ -6706,13 +7138,19 @@ export interface GisViewOptions {
6706
7138
  * 另有 'lineEndpoints' / 'channelEndpoints' 只在框选时要求线路 / 通道两端节点都在框内;
6707
7139
  * 可写数组任意组合,'all' / true 全开,false / null 全关。
6708
7140
  * **不写时保留旧行为**:框选只收节点,Ctrl / 多选点击仍可收节点与线路;
6709
- * 写了之后框选与 Ctrl / 多选点击统一按这一份过滤(普通单选与接口 select 不受限制)。
7141
+ * 写了之后框选与 Ctrl / 多选点击统一按这一份过滤(普通单选、toggleSelect 的取消与接口 select 不受限制)。
6710
7142
  * 两个端点口径只影响框选,不会因为写进同一份数组就让 Ctrl 点击去猜端点。
6711
7143
  * 运行时走 updateOptions({ selectionKinds })。
6712
7144
  */
6713
7145
  selectionKinds?: GisViewSelectionKindsInput
6714
- /** 框选矩形样式 */
7146
+ /** 框选矩形样式;render: 'div' 时可用 className / borderStyle / radius 整体换外观 */
6715
7147
  selectionBoxStyle?: GisViewSelectionBoxStyle
7148
+ /**
7149
+ * 框选结束后是否保留矩形(缺省 false)。保留时在框内按下并拖动会把框内选中的节点整组平移,
7150
+ * 线路与通道随节点更新;选中集变化、清空或调用 clearSelectionBox() 时自动收起。
7151
+ * 运行时走 updateOptions({ selectionBoxPersistent })。
7152
+ */
7153
+ selectionBoxPersistent?: boolean
6716
7154
  /**
6717
7155
  * 选中的要素是否画在所有要素之上(默认 true):抬层的包括点击 / 拖动 / 待确认合并的节点,
6718
7156
  * 以及选中线路所在的整条通道 —— 选中了就一定看得见,与 zIndex 无关;
@@ -6731,6 +7169,12 @@ export interface GisViewOptions {
6731
7169
  * 普通线路不受影响;切换走 updateOptions({ channelWaypointDragMode }),下一次拖动生效
6732
7170
  */
6733
7171
  channelWaypointDragMode?: GisViewChannelWaypointDragMode
7172
+ /**
7173
+ * 隐藏回线时车道怎么排:'preserve'(缺省)保留原来的车道槽位,'center' 让剩余可见回线
7174
+ * 在整条通道宽度内重新居中。隐藏的通道分组按整组处理。
7175
+ * 运行时走 updateOptions({ channelHiddenLineLayout })。
7176
+ */
7177
+ channelHiddenLineLayout?: GisViewChannelHiddenLineLayout
6734
7178
 
6735
7179
  /**
6736
7180
  * 快捷键:框选、多选、加点、复制、粘贴、取消、删除、适应视图都可以在这里改
@@ -6752,7 +7196,9 @@ export interface GisViewOptions {
6752
7196
  waypointStyle?: GisViewPointStyle
6753
7197
  /** 拐点被选中时的样式:没有配置(且 defaultHighlight 为 false)时选中不改变外观 */
6754
7198
  waypointSelectStyle?: GisViewPointStyle
7199
+ /** 相机比例下限(像素 / 世界单位),默认 0.002 */
6755
7200
  minScale?: number
7201
+ /** 相机比例上限(像素 / 世界单位),默认 1000000000;显式值仍会限制 fitSpacing 能达到的间距 */
6756
7202
  maxScale?: number
6757
7203
  /** 适应视图时四周留白(CSS 像素) */
6758
7204
  fitPadding?: number
@@ -6769,8 +7215,8 @@ export interface GisViewOptions {
6769
7215
  */
6770
7216
  initialView?: GisViewInitialView | null
6771
7217
  /**
6772
- * 适应视图时按可见节点间距兜底(默认关):true 用 minDistance 24 / maxZoom 不限,
6773
- * 对象在 minDistance / maxDistance 中二选一,另可改 maxZoom。只在首次默认适应与 fitView() 生效,
7218
+ * 适应视图时按可见节点间距兜底(默认关):true 用精确的 minDistance 24,
7219
+ * 对象在 minDistance / maxDistance 中二选一。只在首次默认适应与 fitView() 生效,
6774
7220
  * 显式 initialView.scale / zoom 优先。
6775
7221
  */
6776
7222
  fitSpacing?: boolean | GisViewFitSpacingOptions
@@ -7848,6 +8294,18 @@ export interface GisViewInstance {
7848
8294
  /** 现在有哪些扩展图形(按 zIndex、再按加入顺序) */
7849
8295
  getGraphics(): GisViewGraphic[]
7850
8296
  updateBackground(background?: GisViewBackground): GisViewInstance
8297
+ /**
8298
+ * 进入内置背景编辑:在根节点里挂一层编辑覆盖层,移动、四角 / 八向缩放与可选旋转都由组件接管。
8299
+ * 图片写回 image.corners,GeoJSON 写回 geoJsonStyle.bounds + rotation;其它背景字段原样保留。
8300
+ * 进入期间 backgroundEditing 自动打开,退出时恢复进入前的值。没有背景时不做任何事并走 onWarning。
8301
+ */
8302
+ beginBackgroundEdit(options?: GisViewBackgroundEditorOptions): GisViewInstance
8303
+ /** 运行中改编辑器配置或背景几何(center / width / height / angle);返回实例 */
8304
+ updateBackgroundEdit(patch: GisViewBackgroundEditorPatch): GisViewInstance
8305
+ /** 退出内置背景编辑并移除覆盖层;编辑后的背景保留,backgroundEditing 恢复进入前的值 */
8306
+ endBackgroundEdit(): GisViewInstance
8307
+ /** 当前编辑读数;没有开启编辑器时返回 null */
8308
+ getBackgroundEdit(): GisViewBackgroundEditorState | null
7851
8309
  /**
7852
8310
  * 把当前画面导出成图片(data URL):画布内容 + DOM 标签合成到一张 2D 画布上。
7853
8311
  * 默认按设备像素导出(跟屏幕上一样清晰),也可以给 scale 指定倍率。
@@ -7933,6 +8391,12 @@ export interface GisViewInstance {
7933
8391
  * 少于两个可见节点时为 null,全部重合时 nearest 为 null、maxDistance 为 0。
7934
8392
  */
7935
8393
  getPointSpacing(): GisViewPointSpacing
8394
+ /**
8395
+ * 指定一组节点的整体最近正距离 / 最远距离(CSS 像素,和 fitSpacing 同一套屏幕口径)。
8396
+ * refs 支持单个或数组、id / 下标 / `{ id }` / `{ index }`;重复引用去重,非法引用忽略。
8397
+ * 与 getPointSpacing() 不同,被筛选 / 隐藏的显式节点照样参与统计。
8398
+ */
8399
+ getPointsSpacing(refs: GisViewFeatureRef | GisViewFeatureRef[]): GisViewPointSpacing
7936
8400
  /** 缩放联动的基准比例(pointZoomScale / lineZoomScale 共用那一份):缺省是首次适应视图时的 camera.scale */
7937
8401
  getZoomBaseScale(): number
7938
8402
  /** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),之后放大缩小都从它算倍数,返回 this */
@@ -7941,6 +8405,10 @@ export interface GisViewInstance {
7941
8405
  getIdleTime(): number
7942
8406
  /** 鹰眼图根节点(没配 minimap 时为 null):拖动整张图 / 绑定自定义手势时拿它 */
7943
8407
  getMinimapElement(): HTMLElement | null
8408
+ /** 图例根节点(没配 visualMap 或 enabled: false 时为 null) */
8409
+ getVisualMapElement(): HTMLElement | null
8410
+ /** 当前图例读数:值域、色带与刻度 / 分段;没配时为 null */
8411
+ getVisualMap(): GisViewVisualMapReadout | null
7944
8412
  /** 鹰眼图自身的倍数:1 是「刚好铺满小图」 */
7945
8413
  getMinimapZoom(): number
7946
8414
  /** 设置鹰眼图的倍数(夹在 minimap.minZoom ~ maxZoom 之间),内容重新跟着数据范围居中 */
@@ -8086,7 +8554,7 @@ export interface GisViewInstance {
8086
8554
  * `deselect({ type: 'channel', channelId: 'channel-a' })` 取消整条通道的回线。
8087
8555
  * 一个目标都不给(不传 / 传 null)等于取消全部(与 selectFeatures(null) 同一件事),
8088
8556
  * 传空数组是「没有目标」,什么都不做;认不出来的条目跳过。改变选中集时发
8089
- * onSelect 与 onSelectChange(cause: api)。
8557
+ * onSelect 与 onSelectChange(cause: api);这一次真的移除了选中项时,点击级联也一起收掉。
8090
8558
  */
8091
8559
  deselect(refs?: GisViewSelectionRefs): GisViewInstance
8092
8560
  /**
@@ -8118,11 +8586,15 @@ export interface GisViewInstance {
8118
8586
  getSelectionData(): GisViewSelectionData
8119
8587
  /**
8120
8588
  * 当前点击级联高亮的读数:来源、scope 与亮着的节点 / 线路;没有级联高亮(或功能关着)时是 null。
8121
- * 它只读,不改变选中集;点空白处、换数据或关掉 cascadeHighlight 会收掉。
8589
+ * 它只读,不改变选中集;取消选中、点空白处、换数据或关掉 cascadeHighlight 会收掉。
8122
8590
  */
8123
8591
  getCascadeHighlight(): GisViewCascadeHighlightInfo | null
8124
8592
  /** 按画布 CSS 像素矩形框选;options.selectionKinds 可临时覆盖全局类型过滤 */
8125
8593
  selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions): GisViewInstance
8594
+ /** 收起当前保留的框选矩形;只动矩形,不改变选中集 */
8595
+ clearSelectionBox(): GisViewInstance
8596
+ /** 当前保留的框选矩形(画布 CSS 像素,已归整为左上角 + 宽高);没有时返回 null */
8597
+ getSelectionBox(): GisViewRect | null
8126
8598
  /**
8127
8599
  * 开始复制一个节点:给 id / index 就直接出预览(`commit: true` 出预览即落地,`follow: true` 跟随鼠标),
8128
8600
  * 不给来源就是「先点按钮再选节点」模式 —— 下一次点中的节点作为来源、复制到它旁边。
@@ -8607,13 +9079,15 @@ export interface GisViewInstance {
8607
9079
  getPoint(ref: GisViewFeatureRef): GisViewPointInfo | null
8608
9080
  /**
8609
9081
  * 节点解析之后的样式快照(size / symbol / zIndex):size 与 symbol 取样式链
8610
- * (节点自身 > 规则 > pointStyle)定下来的那一份,含 sizeScale、不含悬停 / 选中样式与热力倍率 ——
9082
+ * (override 规则 > 节点自身 > 普通规则 > pointStyle)定下来的那一份,
9083
+ * 含 sizeScale、不含悬停 / 选中样式与热力倍率 ——
8611
9084
  * 拖拽落点预览拿它核对「预览与落地同一个尺寸」,合并取双方较大值走的也是这一份;下标不存在返回 null
8612
9085
  */
8613
9086
  getPointStyle(index: number): GisViewPointStyleSnapshot | null
8614
9087
  /**
8615
9088
  * 线路解析之后的样式快照(width / color / opacity / zIndex):width 取样式链
8616
- * (线路自身 > 规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale / 缩放联动与热力倍率;
9089
+ * (override 规则 > 线路自身 > 普通规则 > lineStyle)定下来的原始线宽,
9090
+ * 不含 lineWidthScale / 缩放联动与热力倍率;
8617
9091
  * 下标不存在时返回 null。鹰眼图沿用主图线路宽度时用的就是它。
8618
9092
  */
8619
9093
  getLineStyle(index: number): GisViewLineStyleSnapshot | null
@@ -8819,7 +9293,7 @@ export interface GisViewEngineOptions {
8819
9293
  pointCluster?: boolean | GisViewPointClusterOptions
8820
9294
  /** 初始视图:首次拿到数据时相机落在哪里(缺省适应数据范围),结构见 GisViewInitialView */
8821
9295
  initialView?: GisViewInitialView | null
8822
- /** 适应视图的节点间距兜底:true 用缺省档,对象可改 minDistance / maxZoom,默认关 */
9296
+ /** 适应视图的节点间距兜底:true 用 minDistance 24,对象在 minDistance / maxDistance 中二选一,默认关 */
8823
9297
  fitSpacing?: boolean | GisViewFitSpacingOptions
8824
9298
  /** onStats 的最小间隔(毫秒),默认 250,0 表示每帧都发 */
8825
9299
  statsInterval?: number
@@ -8829,6 +9303,12 @@ export interface GisViewEngineOptions {
8829
9303
  gridSize?: number
8830
9304
  /** 是否绘制网格,**缺省关**(见 GisViewOptions.showGrid) */
8831
9305
  showGrid?: boolean
9306
+ /** 网架整体显隐,**缺省开**(见 GisViewOptions.networkVisible):false 时只留背景、网格与自定义 WebGL 层 */
9307
+ networkVisible?: boolean
9308
+ /** 网架整体不透明度(0 ~ 1,缺省 1),在逐要素 opacity 之后相乘;背景不受影响 */
9309
+ networkOpacity?: number
9310
+ /** 背景编辑模式(见 GisViewOptions.backgroundEditing):true 时屏蔽网架指针与数据快捷键,仅保留滚轮缩放 */
9311
+ backgroundEditing?: boolean
8832
9312
  /** 写 true 打开拖拽平移 / 滚轮缩放 / 右键回调(= pan / zoom / contextMenu),**缺省关** */
8833
9313
  interactive?: boolean
8834
9314
  /** 写 true 打开悬停拾取与点击选中(= hover / select),**缺省关** */
@@ -8862,9 +9342,13 @@ export interface GisViewEngineOptions {
8862
9342
  boxSelect?: boolean
8863
9343
  /** 多选开关(**缺省关**):打开后不用按修饰键,直接单击要素就取反累加(与按住 shortcuts.multiSelect 点击同一套行为) */
8864
9344
  multiSelect?: boolean
9345
+ /** 再次选中即取消(**缺省关**),语义见 GisViewOptions.toggleSelect */
9346
+ toggleSelect?: boolean
8865
9347
  /** 框选 / Ctrl 多选允许的要素类型,写法与缺省口径见 GisViewOptions.selectionKinds */
8866
9348
  selectionKinds?: GisViewSelectionKindsInput
8867
9349
  selectionBoxStyle?: GisViewSelectionBoxStyle | null
9350
+ /** 框选后保留矩形,并允许拖动矩形平移框内选中节点;缺省 false */
9351
+ selectionBoxPersistent?: boolean
8868
9352
  /** 选中 / 拖动 / 待确认合并的节点与选中通道是否画在所有要素之上,默认 true */
8869
9353
  selectionOnTop?: boolean
8870
9354
  /**
@@ -8875,6 +9359,8 @@ export interface GisViewEngineOptions {
8875
9359
  channelSelectMode?: GisViewChannelSelectMode
8876
9360
  /** 分组拐点拖动模式:'parallel'(缺省)/ 'vertex',见 GisViewOptions.channelWaypointDragMode */
8877
9361
  channelWaypointDragMode?: GisViewChannelWaypointDragMode
9362
+ /** 隐藏回线后的车道排布,见 GisViewOptions.channelHiddenLineLayout;缺省 preserve */
9363
+ channelHiddenLineLayout?: GisViewChannelHiddenLineLayout
8878
9364
  /** 线路是否跟随节点,缺省 true;关闭后节点退场时线路 / 通道停在最后一份坐标与解析尺寸 */
8879
9365
  lineFollowsNode?: boolean
8880
9366
 
@@ -8962,6 +9448,10 @@ export interface GisViewEngine {
8962
9448
  describeSelection(selection: GisViewFeatureKey[], preferredGroupId?: string | number): GisViewDescribedSelection
8963
9449
  /** 按画布 CSS 像素矩形框选,返回框内要素 */
8964
9450
  selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions): GisViewPickResult[]
9451
+ /** 收起框选矩形;只动矩形,不改变选中集 */
9452
+ clearSelectionBox(): void
9453
+ /** 当前框选矩形的副本;没有时返回 null */
9454
+ getSelectionBox(): GisViewRect | null
8965
9455
  /** 拐点增删改,insertIndex 缺省时按直线上离目标最近的线段插入 */
8966
9456
  insertWaypoint(lineIndex: number, coordinate: GisViewCoordinate, insertIndex?: number): GisViewWaypointPayload | null
8967
9457
  /** 删除指定线路上的拐点 */
@@ -9091,7 +9581,8 @@ export interface GisViewEngine {
9091
9581
  getPointRadius(index: number): number
9092
9582
  /**
9093
9583
  * 节点解析之后的样式快照(size / symbol / zIndex):size 与 symbol 取样式链
9094
- * (节点自身 > 规则 > pointStyle)定下来的那一份,不含悬停 / 选中样式与热力倍率 ——
9584
+ * (override 规则 > 节点自身 > 普通规则 > pointStyle)定下来的那一份,
9585
+ * 不含悬停 / 选中样式与热力倍率 ——
9095
9586
  * 合并节点取双方最大尺寸、图标优先目标用的就是它;下标不存在时返回 null
9096
9587
  */
9097
9588
  getPointStyle(index: number): GisViewPointStyleSnapshot | null