gis-view-webgl2 0.1.0 → 0.1.2
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.
- package/README.md +40 -8
- package/dist/gis-view.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1036 -249
- package/dist/index.js +1 -1
- package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +194 -0
- package/docs/GisView.md +9 -8
- package/docs/GisView/345/256/236/347/216/260/345/216/237/347/220/206.md +2 -2
- 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 +172 -0
- package/docs/api/index.html +545 -59
- package/docs/demos/BackendSyncDemo.vue +10 -8
- package/docs/demos/BasicDemo.vue +101 -101
- package/docs/demos/BatchAddDemo.vue +5 -5
- package/docs/demos/ChannelDemo.vue +617 -10
- package/docs/demos/ConnectDemo.vue +392 -0
- package/docs/demos/CopyMergeDemo.vue +980 -929
- package/docs/demos/DecorationDraftDemo.vue +1300 -0
- package/docs/demos/DemoShell.vue +569 -240
- package/docs/demos/DragDropDemo.vue +11 -11
- package/docs/demos/EffectsDemo.vue +6 -6
- package/docs/demos/EventDemo.vue +327 -327
- package/docs/demos/ExtensionDemo.vue +458 -0
- package/docs/demos/GisViewDemo.vue +61 -48
- package/docs/demos/GraphicDemo.vue +338 -0
- package/docs/demos/LabelDemo.vue +553 -497
- package/docs/demos/MinimapDemo.vue +358 -0
- package/docs/demos/PerfDemo.vue +29 -0
- package/docs/demos/SearchFilterDemo.vue +412 -0
- package/docs/demos/StyleDemo.vue +121 -121
- package/docs/demos/api-index.js +98 -77
- package/docs/demos/demos.js +159 -135
- package/docs/demos/shared/demoData.js +107 -107
- package/docs/demos/shared/demoStyle.css +249 -249
- package/docs/demos/shared/fakeBackend.js +93 -6
- 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 +28 -8
- package/docs/format/04-/351/200/232/351/201/223/344/270/216/346/240/207/347/255/276.md +5 -4
- package/docs/format/06-/345/257/274/345/205/245/345/257/274/345/207/272/344/270/216/346/240/207/345/207/206/346/226/207/346/241/243.md +8 -6
- 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 +6 -6
- package/docs/guide/sample-document.html +4 -4
- package/docs/index.html +180 -9
- package/docs/internals/11-/350/246/206/347/233/226/345/261/202/346/240/207/347/255/276/344/270/216/346/217/220/347/244/272.md +1 -1
- package/docs/internals/13-/351/271/260/347/234/274/345/233/276.md +3 -2
- 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 +16 -0
- package/docs/internals/16-03-/344/274/230/345/214/226/344/270/216/345/217/226/350/210/215-/344/270/213.md +11 -0
- 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
- package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +18 -4
- package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +110 -25
- package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +13 -8
- 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 +111 -10
- 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 +47 -9
- package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +17 -15
- package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +61 -11
- 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 +74 -7
- package/docs/manual/11-/346/240/267/345/274/217/344/270/216/350/247/204/345/210/231.md +3 -2
- package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +260 -3
- package/docs/manual/13-/345/212/250/346/225/210/344/270/216/345/233/276/345/205/203.md +6 -5
- package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +27 -14
- package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +142 -49
- package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +31 -29
- package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +55 -39
- package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +189 -64
- 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 +4 -4
- package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +42 -2
- 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 +22 -6
- package/docs/playground/index.html +5 -5
- package/docs/steps/README.md +14 -10
- package/docs/steps/check-doc-truth.mjs +1 -1
- package/docs/steps/selftest-actions.html +10 -10
- package/docs/steps/selftest-data.html +96 -14
- package/docs/steps/selftest-decoration.html +577 -0
- package/docs/steps/selftest-demo.html +6 -5
- package/docs/steps/selftest-demos.html +2201 -1612
- package/docs/steps/selftest-docs.html +89 -16
- package/docs/steps/selftest-effects.html +5 -5
- package/docs/steps/selftest-features.html +757 -86
- package/docs/steps/selftest-full.html +583 -583
- package/docs/steps/selftest-labels.html +1034 -652
- package/docs/steps/selftest-perf.html +1899 -1844
- package/docs/steps/selftest-scale.html +117 -7
- package/docs/steps/selftest-select.html +24 -17
- package/docs/steps/step-10-full.js +1 -1
- package/docs//346/216/245/345/217/243/345/215/217/350/256/256.md +167 -17
- package/docs//346/225/260/346/215/256/346/240/274/345/274/217.md +1 -1
- package/package.json +43 -43
- package/docs/demos/HistoryDemo.vue +0 -230
- package/docs/demos/InterfaceDemo.vue +0 -309
- package/docs/demos/SampleDemo.vue +0 -283
package/dist/index.d.ts
CHANGED
|
@@ -138,6 +138,20 @@ export type GisViewSymbol = GisViewCircleSymbol | GisViewSquareSymbol | GisViewI
|
|
|
138
138
|
/** 符号简写:'circle' / 'square'、注册过的自定义图元名字、图片地址、以 svg 标记开头的字符串 */
|
|
139
139
|
export type GisViewSymbolInput = GisViewSymbol | 'circle' | 'square' | string
|
|
140
140
|
|
|
141
|
+
/** 注册(或覆盖)一支自定义图元画笔;名字为空或画笔不是函数返回 false,不动注册表 */
|
|
142
|
+
export declare const registerSymbolPainter: (name: string, painter: GisViewSymbolPainter) => boolean
|
|
143
|
+
/**
|
|
144
|
+
* 带作用域地注册一支自定义图元画笔:返回清理函数,只在当前注册项仍是这支画笔时删除,
|
|
145
|
+
* 旧插件 / 旧视图卸载不会误删后来覆盖注册的同名画笔。参数不合法时抛 TypeError。
|
|
146
|
+
*/
|
|
147
|
+
export declare const defineSymbolPainter: (name: string, painter: GisViewSymbolPainter) => () => boolean
|
|
148
|
+
/** 注销一支自定义图元画笔,返回它之前是否在注册表里 */
|
|
149
|
+
export declare const unregisterSymbolPainter: (name: string) => boolean
|
|
150
|
+
/** 这个名字注册过没有 */
|
|
151
|
+
export declare const hasSymbolPainter: (name: string) => boolean
|
|
152
|
+
/** 当前注册着的自定义图元名字(按注册顺序) */
|
|
153
|
+
export declare const listSymbolPainters: () => string[]
|
|
154
|
+
|
|
141
155
|
export interface GisViewShadow {
|
|
142
156
|
color?: string
|
|
143
157
|
opacity?: number
|
|
@@ -419,6 +433,50 @@ export interface GisViewMinimapDrawInfo {
|
|
|
419
433
|
data: GisViewMinimapDrawData
|
|
420
434
|
/** 这一帧的底图(inherit 时是主视图解析好的那一份) */
|
|
421
435
|
background: GisViewBackground | null
|
|
436
|
+
/** 当前绘制阶段:数据前 / 数据后的自定义层,或兼容旧写法的最终 draw 钩子 */
|
|
437
|
+
stage: GisViewMinimapLayerStage
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/** 自定义层画在内置线路 / 节点之前还是之后;缺省 after 对应的 above-data */
|
|
441
|
+
export type GisViewMinimapLayerPlacement = 'below-data' | 'above-data'
|
|
442
|
+
/** 回调实际所处的绘制阶段;兼容旧写法的 draw 固定为 overlay */
|
|
443
|
+
export type GisViewMinimapLayerStage = GisViewMinimapLayerPlacement | 'overlay'
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* 鹰眼图自定义层:按 placement 分到内置数据前 / 后,组内再按 `order` 依次绘制;
|
|
447
|
+
* 旧 draw 钩子固定最后执行。适合把指北针、网格、业务标记拆成互不干扰的几层。
|
|
448
|
+
*/
|
|
449
|
+
export interface GisViewMinimapLayer {
|
|
450
|
+
/** 给这一层一个名字,便于配置与调试(绘制时不需要) */
|
|
451
|
+
id?: string
|
|
452
|
+
/** 叠放顺序:数值小的先画,相同 or 缺省按数组顺序 */
|
|
453
|
+
order?: number
|
|
454
|
+
/** 画在内置线路 / 节点之前(below-data)还是之后(above-data,默认) */
|
|
455
|
+
placement?: GisViewMinimapLayerPlacement
|
|
456
|
+
/** 临时关掉这一层而不必改数组内容 */
|
|
457
|
+
enabled?: boolean
|
|
458
|
+
/** 与 draw 钩子同一份入参:上下文已按备份像素比缩放,直接用 CSS 像素画 */
|
|
459
|
+
draw: (info: GisViewMinimapDrawInfo) => void
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/** 鹰眼图完成一次交互(长按为触发时)后的通知类型 */
|
|
463
|
+
export type GisViewMinimapInteractionType = 'box-drag' | 'select' | 'pan' | 'zoom' | 'wheel-main' | 'long-press'
|
|
464
|
+
|
|
465
|
+
/** 鹰眼图交互回调:一次手势结束时发一条(长按在触发时发),不在 pointermove 里逐帧触发 */
|
|
466
|
+
export interface GisViewMinimapInteractionInfo {
|
|
467
|
+
type: GisViewMinimapInteractionType
|
|
468
|
+
/** 触发这次交互的原始事件;长按回调保留 pointerdown,其余为 pointerup / wheel */
|
|
469
|
+
originalEvent: Event | null
|
|
470
|
+
/** 指针在小图里的 CSS 像素坐标 */
|
|
471
|
+
local: [number, number]
|
|
472
|
+
/** 同一个位置对应的世界坐标 */
|
|
473
|
+
world: [number, number]
|
|
474
|
+
/** 交互完成时小图自身的倍数 */
|
|
475
|
+
zoom: number
|
|
476
|
+
/** 当前小图铺开的世界范围 */
|
|
477
|
+
extent: GisViewBounds
|
|
478
|
+
camera: GisViewCamera | null
|
|
479
|
+
viewport: GisViewViewport | null
|
|
422
480
|
}
|
|
423
481
|
|
|
424
482
|
/**
|
|
@@ -455,8 +513,12 @@ export interface GisViewMinimapOptions {
|
|
|
455
513
|
* 拿到已缩放好的画布上下文、当前范围与 project / unproject,在小图上画标记、指北针这类东西
|
|
456
514
|
*/
|
|
457
515
|
draw?: (info: GisViewMinimapDrawInfo) => void
|
|
516
|
+
/** 可拆分的自定义绘制层:按 placement 分段、段内按 order,最后才轮到旧的 draw */
|
|
517
|
+
layers?: GisViewMinimapLayer[]
|
|
458
518
|
/** 小图容器的底色(CSS),默认 rgba(255, 255, 255, 0.92) */
|
|
459
519
|
backgroundStyle?: string
|
|
520
|
+
/** 小图画布备份像素比上限(默认 4):高分屏或宿主缩放很大时可降到 1 ~ 2 降低填充开销 */
|
|
521
|
+
maxPixelRatio?: number
|
|
460
522
|
borderColor?: string
|
|
461
523
|
borderWidth?: number
|
|
462
524
|
/** 圆角(CSS 像素),默认 6 */
|
|
@@ -516,6 +578,8 @@ export interface GisViewMinimapOptions {
|
|
|
516
578
|
selectStyle?: GisViewMinimapBoxStyle
|
|
517
579
|
/** 关掉后鹰眼图只看不动,默认 true */
|
|
518
580
|
interactive?: boolean
|
|
581
|
+
/** 一次手势完成后的通知(无位移的点击不发):框拖动 / 框选 / 小图平移 / 缩放 / 滚轮缩放主图 / 长按跟随 */
|
|
582
|
+
onInteraction?: (info: GisViewMinimapInteractionInfo) => void
|
|
519
583
|
/** 长按多久算「要移动视角」(毫秒),默认 180 */
|
|
520
584
|
longPressDelay?: number
|
|
521
585
|
/** 在小图上滚轮是否缩放主图(以光标处的世界坐标为锚点),默认 true;zoomable 打开时改由 Ctrl / ⌘ + 滚轮触发 */
|
|
@@ -903,6 +967,55 @@ export interface GisViewPointEffectReadout {
|
|
|
903
967
|
from: number
|
|
904
968
|
}
|
|
905
969
|
|
|
970
|
+
/** 节点装饰连接线:true 用默认样式,对象可覆盖颜色 / 线宽 / 透明度 / 虚线 */
|
|
971
|
+
export interface GisViewPointDecorationConnector {
|
|
972
|
+
color?: string
|
|
973
|
+
/** 线宽(CSS 像素),缺省 1 */
|
|
974
|
+
width?: number
|
|
975
|
+
/** 透明度,缺省 0.82 */
|
|
976
|
+
opacity?: number
|
|
977
|
+
/** true 等价于 lineType: 'dashed' */
|
|
978
|
+
dashed?: boolean
|
|
979
|
+
lineType?: 'solid' | 'dashed' | 'dotted'
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* 节点上的图片 / SVG 装饰:相对节点按屏幕像素偏移,或写死世界坐标。
|
|
984
|
+
* - `offset` / `distance + direction`:相对节点,缩放时保持同样的屏幕像素距离;
|
|
985
|
+
* - `at` / `anchor: 'fixed'`:世界坐标固定,节点移动不跟随;
|
|
986
|
+
* - `connector`:从节点中心画一条连接线到装饰中心。
|
|
987
|
+
*/
|
|
988
|
+
export interface GisViewPointDecoration {
|
|
989
|
+
/** 图片 / SVG / 内置形状,和节点的 symbol 写法一样 */
|
|
990
|
+
symbol: GisViewSymbolInput
|
|
991
|
+
/** 定位方式:offset 相对节点(缺省),fixed 写死世界坐标 */
|
|
992
|
+
anchor?: 'offset' | 'fixed'
|
|
993
|
+
/** 相对节点的屏幕像素偏移(x 向右、y 向下),优先于 distance / direction */
|
|
994
|
+
offset?: [number, number] | GisViewCoordinate
|
|
995
|
+
/** 离节点的屏幕像素距离,缺省 28 */
|
|
996
|
+
distance?: number
|
|
997
|
+
/** 相对方向:0 度向上、顺时针,缺省 0(正上方) */
|
|
998
|
+
direction?: number
|
|
999
|
+
/** 固定位置(世界坐标);给了它就按 fixed 处理,优先级最高 */
|
|
1000
|
+
at?: GisViewCoordinate
|
|
1001
|
+
/** 图标旋转角(度),缺省 0 */
|
|
1002
|
+
angle?: number
|
|
1003
|
+
/** 屏幕尺寸(CSS 像素),缺省 18 */
|
|
1004
|
+
size?: number
|
|
1005
|
+
/** 填充 / 色调,缺省白色 */
|
|
1006
|
+
color?: string
|
|
1007
|
+
/** 描边色,缺省透明 */
|
|
1008
|
+
strokeColor?: string
|
|
1009
|
+
/** 描边宽度(CSS 像素),缺省 0 */
|
|
1010
|
+
strokeWidth?: number
|
|
1011
|
+
/** 透明度,缺省 1 */
|
|
1012
|
+
opacity?: number
|
|
1013
|
+
/** 阴影,和节点一样 */
|
|
1014
|
+
shadow?: GisViewShadow
|
|
1015
|
+
/** 是否从节点中心画一条连接线,缺省不画 */
|
|
1016
|
+
connector?: boolean | GisViewPointDecorationConnector
|
|
1017
|
+
}
|
|
1018
|
+
|
|
906
1019
|
export interface GisViewPoint {
|
|
907
1020
|
id?: string | number
|
|
908
1021
|
x: number
|
|
@@ -921,6 +1034,8 @@ export interface GisViewPoint {
|
|
|
921
1034
|
opacity?: number
|
|
922
1035
|
shadow?: GisViewShadow
|
|
923
1036
|
visible?: boolean
|
|
1037
|
+
/** 这个节点上挂的图片 / SVG 装饰:可相对节点偏移、固定世界坐标,也可以带一条连接线 */
|
|
1038
|
+
decorations?: GisViewPointDecoration[]
|
|
924
1039
|
/** 这个点的标签是否显示:false 时即使启用了标签也不画 */
|
|
925
1040
|
labelVisible?: boolean
|
|
926
1041
|
/** 这个点的标签显隐策略:auto 智能隐藏、always 一直显示、hidden 不显示,缺省用 options.label.visibility */
|
|
@@ -1093,6 +1208,11 @@ export interface GisViewChannelGroup {
|
|
|
1093
1208
|
lineIds: Array<string | number>
|
|
1094
1209
|
/** 这一组自己的骨架拐点(两端锚定时只写中间拐点):新拆分出来的分组不带拐点,就是一条直线 */
|
|
1095
1210
|
path?: GisViewCoordinate[]
|
|
1211
|
+
/**
|
|
1212
|
+
* 刚性拐点偏移:键是分组骨架顶点序号(含首尾端点,从 0 起,只认中间拐点),值是这一组所有成员回线在该顶点的世界坐标增量。
|
|
1213
|
+
* `channelWaypointDragMode: 'vertex'` 拖出来的结果写在这里;不写或空对象就是普通平行骨架
|
|
1214
|
+
*/
|
|
1215
|
+
waypointOffsets?: Record<string, GisViewCoordinate>
|
|
1096
1216
|
}
|
|
1097
1217
|
|
|
1098
1218
|
/**
|
|
@@ -1104,6 +1224,12 @@ export interface GisViewChannel {
|
|
|
1104
1224
|
id?: string | number
|
|
1105
1225
|
/** 通道名:仅作业务标识,组件不渲染 */
|
|
1106
1226
|
name?: string
|
|
1227
|
+
/**
|
|
1228
|
+
* 是否显示这条通道:false 时整条通道与成员回线一起隐藏,数据、分组、拐点与编辑状态都保留,
|
|
1229
|
+
* 改回 true(或 `showFeatures('channel', ref)`)立即恢复;缺省 true。
|
|
1230
|
+
* 端点节点 `visible: false` 时通道也会整条隐藏,节点恢复后自动回来
|
|
1231
|
+
*/
|
|
1232
|
+
visible?: boolean
|
|
1107
1233
|
/** 通道内的线路 id,顺序即回线顺序(沿骨架左法线方向) */
|
|
1108
1234
|
lineIds: Array<string | number>
|
|
1109
1235
|
/**
|
|
@@ -1113,8 +1239,9 @@ export interface GisViewChannel {
|
|
|
1113
1239
|
*/
|
|
1114
1240
|
groups?: GisViewChannelGroup[]
|
|
1115
1241
|
/**
|
|
1116
|
-
*
|
|
1117
|
-
*
|
|
1242
|
+
* 可选。骨架折线(中心线):两端用 from / to 绑定点 id 时可以只写中间拐点,首尾顶点由节点坐标决定,
|
|
1243
|
+
* 不写就是两端直连;未锚定时写完整折线,完全缺省则取第一条回线自身的路径。
|
|
1244
|
+
* 配了 groups 时,第一组没写自己的 path 会回落到这里
|
|
1118
1245
|
*/
|
|
1119
1246
|
path?: GisViewCoordinate[]
|
|
1120
1247
|
/**
|
|
@@ -1184,6 +1311,8 @@ export interface GisViewChannelInfo {
|
|
|
1184
1311
|
to?: string | number
|
|
1185
1312
|
/** 两端是否都落在节点上:锚定的通道会跟着节点拖动走 */
|
|
1186
1313
|
anchored: boolean
|
|
1314
|
+
/** 分组刚性拐点偏移:与 groups[].waypointOffsets 同一份口径,没有偏移时是空对象 */
|
|
1315
|
+
waypointOffsets: Record<string, [number, number]>
|
|
1187
1316
|
/** 整条通道相邻回线的中心间距(世界单位),单回线通道为 0;分组之后各组共用这一套间距 */
|
|
1188
1317
|
spacing: number
|
|
1189
1318
|
}
|
|
@@ -1236,6 +1365,8 @@ export interface GisViewChannelGroupInfo {
|
|
|
1236
1365
|
skeleton: Array<[number, number]>
|
|
1237
1366
|
/** 骨架换算回声明用的中间拐点(两端锚定时不含首尾节点),可以直接写回 groups[].path */
|
|
1238
1367
|
path: Array<[number, number]>
|
|
1368
|
+
/** 刚性拐点偏移:与 groups[].waypointOffsets 同一份口径,可以直接写回声明 */
|
|
1369
|
+
waypointOffsets: Record<string, [number, number]>
|
|
1239
1370
|
}
|
|
1240
1371
|
|
|
1241
1372
|
/** getChannelGroupWaypoints 里的一条成员回线:偏移之后的折线与拐点(与图上画的一致) */
|
|
@@ -1270,6 +1401,8 @@ export interface GisViewChannelGroupWaypoints {
|
|
|
1270
1401
|
skeleton: Array<[number, number]>
|
|
1271
1402
|
/** 整组共用的中间拐点:给后端的 channel.group.path 就是这一份 */
|
|
1272
1403
|
path: Array<[number, number]>
|
|
1404
|
+
/** 刚性拐点偏移:需要把非平行拖动结果一起回传时写回 groups[].waypointOffsets */
|
|
1405
|
+
waypointOffsets: Record<string, [number, number]>
|
|
1273
1406
|
/** 组里每条回线偏移后的折线与拐点(同组同步之后「其他线路的拐点」读它) */
|
|
1274
1407
|
lines: GisViewChannelGroupLineWaypoints[]
|
|
1275
1408
|
}
|
|
@@ -1567,6 +1700,12 @@ export interface GisViewChannelDraftOptions {
|
|
|
1567
1700
|
linePropsByMember?: Array<Partial<GisViewLine> | undefined>
|
|
1568
1701
|
/** 第二段 lineItems(一条或一批):与 linePropsByMember 同义,给了几条这一段就加几条(circuits 按它对齐);每项也可以只写一个 id */
|
|
1569
1702
|
lineItems?: GisViewChannelLineItems
|
|
1703
|
+
/** 走线方式:'straight'(缺省,两端直连)/ 'orthogonal'(自动补一个先横后纵的 90° 拐点) */
|
|
1704
|
+
routing?: 'straight' | 'orthogonal'
|
|
1705
|
+
/** 中间拐点(不含两端):给了就按它折线;routing 的自动拐点只在没给有效拐点时补 */
|
|
1706
|
+
path?: GisViewCoordinate[]
|
|
1707
|
+
/** 本次草稿的预览样式:盖在全局 channelDraftStyle 之上,草稿结束即丢弃 */
|
|
1708
|
+
channelDraftStyle?: GisViewChannelDraftStyle
|
|
1570
1709
|
/**
|
|
1571
1710
|
* 交接模式:两个节点选完、发完 phase: 'ready' 就把草稿收掉(假通道当场消失、不补 cancel),
|
|
1572
1711
|
* 由使用方在事件里自己调 addChannel 落地;与 autoCommit 同时给时 autoCommit 先落地
|
|
@@ -1585,7 +1724,8 @@ export interface GisViewChannelDraftOptions {
|
|
|
1585
1724
|
|
|
1586
1725
|
/**
|
|
1587
1726
|
* 新增通道的交互载荷:start → from(选好起点,预览线跟随光标)→ ready(选好终点)→ commit / blocked,
|
|
1588
|
-
* 取消走 cancel
|
|
1727
|
+
* 取消走 cancel(已选起点后点空白也会直接取消),连续新增落地之后开下一段走 restart,
|
|
1728
|
+
* 还没选起点时点到空白 / 点回起点走 pick。
|
|
1589
1729
|
* 两个节点的信息(id / 名称 / 坐标)与可选方案(plan)在每个阶段都带着
|
|
1590
1730
|
*/
|
|
1591
1731
|
export interface GisViewChannelDraftPayload {
|
|
@@ -1625,6 +1765,12 @@ export interface GisViewChannelDraftPayload {
|
|
|
1625
1765
|
/** 第二段 lineItems(一条或一批):与 linePropsByMember 同一份写法,提交时一起交给 addChannel */
|
|
1626
1766
|
lineItems?: Array<Partial<GisViewLine> | undefined> | null
|
|
1627
1767
|
channelProps?: Partial<GisViewChannel>
|
|
1768
|
+
/** 这一次草稿实际生效的预览样式(全局配置 + 本次覆盖) */
|
|
1769
|
+
style: GisViewChannelDraftStyle
|
|
1770
|
+
/** 草稿的走线方式:直线 / 自动正交折线 */
|
|
1771
|
+
routing: 'straight' | 'orthogonal'
|
|
1772
|
+
/** 草稿的中间拐点(已选好两端时是实际会落地的那一份,正交路由的拐点也在这里);没有为 null */
|
|
1773
|
+
path: GisViewCoordinate[] | null
|
|
1628
1774
|
/** 两个节点都选好之后才有方案表,否则为 null */
|
|
1629
1775
|
plan: GisViewChannelAddPlan | null
|
|
1630
1776
|
options: GisViewChannelAddOption[]
|
|
@@ -1697,6 +1843,102 @@ export interface GisViewMovedPoint {
|
|
|
1697
1843
|
item: GisViewPoint
|
|
1698
1844
|
}
|
|
1699
1845
|
|
|
1846
|
+
/** 可整批隐藏 / 显示的要素类型 */
|
|
1847
|
+
export type GisViewVisibilityKind = 'point' | 'line' | 'channel'
|
|
1848
|
+
|
|
1849
|
+
/** 隐藏 / 显示的引用:单个 id / 下标 / `{ id }` / `{ index }`,一批,或当前选中集 `'selection'` */
|
|
1850
|
+
export type GisViewVisibilityRefs = GisViewFeatureRef | 'selection' | Array<GisViewFeatureRef | 'selection'>
|
|
1851
|
+
|
|
1852
|
+
/** 隐藏 / 显示时没认出来的引用 */
|
|
1853
|
+
export interface GisViewVisibilitySkip {
|
|
1854
|
+
ref: unknown
|
|
1855
|
+
reason: string
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
/** setFeatureVisible / hideFeatures / showFeatures 的返回:indexes 与 items 按数据顺序一一对应 */
|
|
1859
|
+
export interface GisViewSetVisibilityOutcome {
|
|
1860
|
+
ok: boolean
|
|
1861
|
+
reason: string | null
|
|
1862
|
+
kind: GisViewVisibilityKind
|
|
1863
|
+
visible: boolean
|
|
1864
|
+
/** 实际改到的下标(去重、按传入顺序) */
|
|
1865
|
+
indexes: number[]
|
|
1866
|
+
/** 对应的 id;要素没 id 时退回下标 */
|
|
1867
|
+
ids: Array<string | number>
|
|
1868
|
+
items: Array<GisViewPoint | GisViewLine | GisViewChannel>
|
|
1869
|
+
skipped: GisViewVisibilitySkip[]
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
/** 通道变化里的一组:成员与骨架都是当次读数的可比较快照 */
|
|
1873
|
+
export interface GisViewChangedChannelGroup {
|
|
1874
|
+
id: string | number | null
|
|
1875
|
+
lineIds: string[]
|
|
1876
|
+
path: GisViewCoordinate[] | null
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
/** 通道变化原因 */
|
|
1880
|
+
export type GisViewChangedChannelReason = 'groups' | 'members' | 'waypoints' | 'endpoints' | 'visibility' | 'fields'
|
|
1881
|
+
|
|
1882
|
+
/** getChangedChannels 的查询选项 */
|
|
1883
|
+
export interface GisViewChangedChannelOptions {
|
|
1884
|
+
/** 只返回带这些原因的变化(空数组 = 不返回任何变化);不传 = 全部原因 */
|
|
1885
|
+
reasons?: GisViewChangedChannelReason[]
|
|
1886
|
+
/**
|
|
1887
|
+
* 忽略分组结构的新增 / 删除 / 重排:不报 `groups`,也不把整组增删算成拐点变化;
|
|
1888
|
+
* 基准与当前都存在、且分组 `path` 真变过的,仍报 `waypoints`
|
|
1889
|
+
*/
|
|
1890
|
+
ignoreGroups?: boolean
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
/** getChangedChannels 的一项:相对上次通道对账发生了哪些变化 */
|
|
1894
|
+
export interface GisViewChangedChannel {
|
|
1895
|
+
index: number
|
|
1896
|
+
id: string | number | null
|
|
1897
|
+
item: GisViewChannel
|
|
1898
|
+
/** 当前分组读数(没写 groups 的通道按「一整组」折算) */
|
|
1899
|
+
groups: GisViewChangedChannelGroup[]
|
|
1900
|
+
groupsChanged: boolean
|
|
1901
|
+
waypointsChanged: boolean
|
|
1902
|
+
membersChanged: boolean
|
|
1903
|
+
endpointsChanged: boolean
|
|
1904
|
+
visibilityChanged: boolean
|
|
1905
|
+
fieldsChanged: boolean
|
|
1906
|
+
/** 除 id / lineIds / groups / path / from / to / visible 之外变过的字段名 */
|
|
1907
|
+
fields: string[]
|
|
1908
|
+
/** 变化原因:groups / members / waypoints / endpoints / visibility / fields */
|
|
1909
|
+
reasons: GisViewChangedChannelReason[]
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
/** 线路变化原因:path(path / start / end)、端点、可见性、其余字段 */
|
|
1913
|
+
export type GisViewChangedLineReason = 'path' | 'endpoints' | 'visibility' | 'fields'
|
|
1914
|
+
|
|
1915
|
+
/** getChangedLines 的查询选项 */
|
|
1916
|
+
export interface GisViewChangedLineOptions {
|
|
1917
|
+
/** 只返回带这些原因的变化(空数组 = 不返回任何变化);不传 = 全部原因 */
|
|
1918
|
+
reasons?: GisViewChangedLineReason[]
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
/** getChangedLines 的一项:相对上次线路对账发生了哪些变化 */
|
|
1922
|
+
export interface GisViewChangedLine {
|
|
1923
|
+
index: number
|
|
1924
|
+
id: string | number | null
|
|
1925
|
+
item: GisViewLine
|
|
1926
|
+
/** 当前声明的 path(没有 path 时为 null);线条几何还会看 start / end */
|
|
1927
|
+
path: GisViewCoordinate[] | null
|
|
1928
|
+
start: GisViewCoordinate | null
|
|
1929
|
+
end: GisViewCoordinate | null
|
|
1930
|
+
from: string | number | null
|
|
1931
|
+
to: string | number | null
|
|
1932
|
+
visible: boolean
|
|
1933
|
+
pathChanged: boolean
|
|
1934
|
+
endpointsChanged: boolean
|
|
1935
|
+
visibilityChanged: boolean
|
|
1936
|
+
fieldsChanged: boolean
|
|
1937
|
+
/** 除 id / start / end / path / from / to / visible 之外变过的字段名 */
|
|
1938
|
+
fields: string[]
|
|
1939
|
+
reasons: GisViewChangedLineReason[]
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1700
1942
|
/**
|
|
1701
1943
|
* addChannels 的返回:results 与传入顺序一一对应(失败的条目也在里面,按各自的 reason 读),
|
|
1702
1944
|
* count 是成功落地的条数;lineIds / channelIds 只列成功那几条的(顺序与 results 里成功的一致)。
|
|
@@ -1884,8 +2126,10 @@ export interface GisViewChannelAddInput {
|
|
|
1884
2126
|
*/
|
|
1885
2127
|
lineItems?: GisViewChannelLineItems
|
|
1886
2128
|
channelProps?: Partial<GisViewChannel>
|
|
1887
|
-
/**
|
|
2129
|
+
/** 中间拐点(不含两端):新建通道写进骨架,新建独立线路展开成完整 path;routing 为 orthogonal 时自动补拐点 */
|
|
1888
2130
|
path?: GisViewCoordinate[]
|
|
2131
|
+
/** 走线方式:'straight'(缺省)/ 'orthogonal'(自动补一个先横后纵的 90° 拐点) */
|
|
2132
|
+
routing?: 'straight' | 'orthogonal'
|
|
1889
2133
|
}
|
|
1890
2134
|
|
|
1891
2135
|
/** 第二段线路数据(新签名的 line_data / 旧写法的 lineItems 同一份):对象里的 id 就是回线 id(没写的自动编号),裸字符串 / 数字等价于 { id } */
|
|
@@ -1924,6 +2168,48 @@ export interface GisViewChannelDraftStyle {
|
|
|
1924
2168
|
width?: number
|
|
1925
2169
|
/** 两端圆点半径(CSS 像素),0 表示不画 */
|
|
1926
2170
|
dot?: number
|
|
2171
|
+
/** 端点圆点颜色,缺省沿用 color */
|
|
2172
|
+
dotColor?: string
|
|
2173
|
+
/** 预览线末端是否画方向箭头,缺省 false */
|
|
2174
|
+
arrow?: boolean
|
|
2175
|
+
/** 箭头大小(CSS 像素),缺省 12 */
|
|
2176
|
+
arrowSize?: number
|
|
2177
|
+
/** 箭头沿线的归一化位置:0 起点、0.5 中点、1 终点;单个数或数组都可,arrow 为 true 时生效 */
|
|
2178
|
+
arrowPositions?: number | number[]
|
|
2179
|
+
/** 箭头反向(默认从起点指向终点) */
|
|
2180
|
+
arrowReverse?: boolean
|
|
2181
|
+
/** 箭头颜色,缺省沿用 color */
|
|
2182
|
+
arrowColor?: string
|
|
2183
|
+
/** 通道预览的回线间距(CSS 像素,缺省 10):kind 为 channel 且 circuits > 1 时按它排平行回线 */
|
|
2184
|
+
circuitSpacing?: number
|
|
2185
|
+
/** 整条预览的透明度(0 ~ 1,缺省 1) */
|
|
2186
|
+
opacity?: number
|
|
2187
|
+
/**
|
|
2188
|
+
* 内置预览画完之后的自绘钩子:拿得到最终 GL 上下文、世界坐标路径与每条回线的路径,
|
|
2189
|
+
* 适合画自定义箭头 / 标记 / 光环;下一帧会重新调用,需要主动刷新时调用 context.requestRender()
|
|
2190
|
+
*/
|
|
2191
|
+
customDraw?: (context: GisViewChannelDraftDrawContext) => void
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
/** 草稿自绘钩子的上下文:几何都是世界坐标,投影用 project / unproject */
|
|
2195
|
+
export interface GisViewChannelDraftDrawContext {
|
|
2196
|
+
gl: WebGL2RenderingContext
|
|
2197
|
+
canvas: HTMLCanvasElement
|
|
2198
|
+
viewport: GisViewViewport
|
|
2199
|
+
camera: GisViewCamera
|
|
2200
|
+
/** 像素 / 世界单位(与 camera.scale 相同) */
|
|
2201
|
+
scale: number
|
|
2202
|
+
/** 解析后的完整折线(含两端) */
|
|
2203
|
+
path: GisViewCoordinate[]
|
|
2204
|
+
/** 每条回线的实际路径:单回线时只有一条,通道多回线时是平行偏移之后的那几条 */
|
|
2205
|
+
circuitPaths: GisViewCoordinate[][]
|
|
2206
|
+
circuits: number
|
|
2207
|
+
kind: 'channel' | 'line'
|
|
2208
|
+
phase: 'start' | 'from' | 'ready'
|
|
2209
|
+
style: GisViewChannelDraftStyle
|
|
2210
|
+
project(x: number, y: number): [number, number]
|
|
2211
|
+
unproject(x: number, y: number): [number, number]
|
|
2212
|
+
requestRender(): void
|
|
1927
2213
|
}
|
|
1928
2214
|
/** 通道成员表:只给成员下标与各自偏移,不复制几何(鹰眼图挑「只画一根」时的中间那条回线用它) */
|
|
1929
2215
|
export interface GisViewChannelMember {
|
|
@@ -2483,7 +2769,7 @@ export type GisViewPointerTarget = 'point' | 'line' | 'channel' | 'waypoint' | '
|
|
|
2483
2769
|
/**
|
|
2484
2770
|
* 一次指针操作的动作名。同一个名字在「按下 / 松开 / 点击」三条事件里含义略有不同:
|
|
2485
2771
|
* - onPointerDown 是「这一次按下打算做什么」(意图):'pan' / 'dragPoint' / 'dragWaypoint' / 'boxSelect' /
|
|
2486
|
-
* 'copy' / 'channelDraft'(点两次加通道)/ 'contextMenu'(右键)/ 'click'(左键按下,但下面没有可拖的东西);
|
|
2772
|
+
* 'copy' / 'channelDraft'(点两次加通道)/ 'decorationDraft'(动态装饰器草稿)/ 'contextMenu'(右键)/ 'click'(左键按下,但下面没有可拖的东西);
|
|
2487
2773
|
* - onPointerUp 是「刚做完的那一件事」:拖过就是拖动的名字,没拖就是 'click'(配合 action.moved 判读);
|
|
2488
2774
|
* - onClick / onDblClick 是真正发生的那一件:'select'(点中要素)/ 'click'(没开选中)/ 'dblClick'(双击);
|
|
2489
2775
|
* - 拐点、标签、选中集各有自己那一套:'addWaypoint' / 'dragWaypoint' / 'selectLabel' / 'dragLabel' /
|
|
@@ -2507,7 +2793,8 @@ export type GisViewPointerActionType =
|
|
|
2507
2793
|
| 'click'
|
|
2508
2794
|
| 'pan'
|
|
2509
2795
|
| 'copy'
|
|
2510
|
-
| 'channelDraft'
|
|
2796
|
+
| 'channelDraft'
|
|
2797
|
+
| 'decorationDraft'
|
|
2511
2798
|
| 'drag'
|
|
2512
2799
|
| 'pointer'
|
|
2513
2800
|
|
|
@@ -2955,6 +3242,8 @@ export interface GisViewPointMergePayload {
|
|
|
2955
3242
|
target: { index: number; item: GisViewPoint; coordinate: [number, number] }
|
|
2956
3243
|
/** 停在目标上的光标位置(画布 CSS 像素) */
|
|
2957
3244
|
screen: [number, number] | null
|
|
3245
|
+
/** 这一次合并是按哪种时机命中的,与 merge.trigger 同一口径 */
|
|
3246
|
+
trigger: GisViewMergeTrigger
|
|
2958
3247
|
originalEvent: Event | null
|
|
2959
3248
|
/** 按当前 keep 预演的影响读数(pending / confirm / state 有值;cancel 与对不上数据时为 null) */
|
|
2960
3249
|
impact: GisViewMergeImpact | null
|
|
@@ -3093,6 +3382,71 @@ export interface GisViewMergeSelectedOptions {
|
|
|
3093
3382
|
originalEvent?: Event | null
|
|
3094
3383
|
}
|
|
3095
3384
|
|
|
3385
|
+
/**
|
|
3386
|
+
* splitPoint 的一份节点定义:节点字段可直接写在顶层(id / x / y / name / style…),也可以放进 item;
|
|
3387
|
+
* lines / channels / channelFrom / channelTo 是会从节点字段里摘出来的分配指令,不会写进节点数据。
|
|
3388
|
+
*/
|
|
3389
|
+
export interface GisViewSplitPointPart extends Partial<GisViewPoint> {
|
|
3390
|
+
/** 新节点的字段(与顶层的节点字段合并,顶层优先) */
|
|
3391
|
+
item?: Partial<GisViewPoint>
|
|
3392
|
+
/** 分到这一份的线路(id / 下标 / { id } / { index }):不写时连在原节点上的线路跟第一份 */
|
|
3393
|
+
lines?: GisViewFeatureRef | GisViewFeatureRef[]
|
|
3394
|
+
/** 两端都分到这一份的受影响通道;把同一条通道写进两份时按 from / to 各去一份 */
|
|
3395
|
+
channels?: GisViewFeatureRef | GisViewFeatureRef[]
|
|
3396
|
+
/** 只把通道的 from 端分到这一份 */
|
|
3397
|
+
channelFrom?: GisViewFeatureRef | GisViewFeatureRef[]
|
|
3398
|
+
/** 只把通道的 to 端分到这一份 */
|
|
3399
|
+
channelTo?: GisViewFeatureRef | GisViewFeatureRef[]
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
/** splitPoint 的选项 */
|
|
3403
|
+
export interface GisViewSplitPointOptions {
|
|
3404
|
+
/** 第一份是否沿用来源节点的 id(缺省 true);false 时也给第一份生成 `${来源 id}-split-1` */
|
|
3405
|
+
keepSourceId?: boolean
|
|
3406
|
+
/** 这一步历史的标签,缺省「拆分节点」 */
|
|
3407
|
+
label?: string
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
/** 拆分时没认出来的线路 / 通道引用 */
|
|
3411
|
+
export interface GisViewSplitPointSkip {
|
|
3412
|
+
ref: unknown
|
|
3413
|
+
reason: string
|
|
3414
|
+
}
|
|
3415
|
+
|
|
3416
|
+
/**
|
|
3417
|
+
* 一次拆分的完整变更集:removedPoint 是拆分前的来源节点,points 是拆分后的全部节点,
|
|
3418
|
+
* lines / channels 是仍存在且受影响的最终数据,removedLines / removedChannels 是拆分前被删掉的数据。
|
|
3419
|
+
* 可直接作为后端事务的输入。
|
|
3420
|
+
*/
|
|
3421
|
+
export interface GisViewSplitPointChangeSet {
|
|
3422
|
+
removedPoint: GisViewPoint
|
|
3423
|
+
points: GisViewPoint[]
|
|
3424
|
+
lines: GisViewLine[]
|
|
3425
|
+
removedLines: GisViewLine[]
|
|
3426
|
+
channels: GisViewChannel[]
|
|
3427
|
+
removedChannels: GisViewChannel[]
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
/** splitPoint 的返回:ok 为 false 时 reason 说明原因,其余数组为空、changes 为 null */
|
|
3431
|
+
export interface GisViewSplitPointOutcome {
|
|
3432
|
+
ok: boolean
|
|
3433
|
+
reason: string | null
|
|
3434
|
+
source: { index: number; id: string | number | null; item: GisViewPoint } | null
|
|
3435
|
+
/** 拆分后的节点,第一份在原下标,其余按 indexes 追加 */
|
|
3436
|
+
items: GisViewPoint[]
|
|
3437
|
+
indexes: number[]
|
|
3438
|
+
pointIds: Array<string | number>
|
|
3439
|
+
linesChanged: number
|
|
3440
|
+
removedLines: number
|
|
3441
|
+
removedLineIds: Array<string | number>
|
|
3442
|
+
removedLineIndexes: number[]
|
|
3443
|
+
channelsChanged: number
|
|
3444
|
+
removedChannels: number
|
|
3445
|
+
removedChannelIds: Array<string | number>
|
|
3446
|
+
skipped: { lines: GisViewSplitPointSkip[]; channels: GisViewSplitPointSkip[] }
|
|
3447
|
+
changes: GisViewSplitPointChangeSet | null
|
|
3448
|
+
}
|
|
3449
|
+
|
|
3096
3450
|
/** 定位一个节点:id、数组下标,或带 id / index 的对象(`{ id: 'a' }` / `{ index: 2 }`) */
|
|
3097
3451
|
export type GisViewPointRef = string | number | { id: string | number } | { index: number }
|
|
3098
3452
|
|
|
@@ -3139,13 +3493,13 @@ export interface GisViewRemoveSelectedOutcome {
|
|
|
3139
3493
|
}
|
|
3140
3494
|
|
|
3141
3495
|
/**
|
|
3142
|
-
*
|
|
3496
|
+
* patchPoints / patchLines 里的一条:给一个定位(id / 下标 / `{ id }` / `{ index }`,与公共补丁一起用),
|
|
3143
3497
|
* 或者「定位 + 自己这一份补丁」(`{ id: 'a', name: 'A' }`)—— id / index 之外的字段就是这一条的补丁
|
|
3144
3498
|
*/
|
|
3145
3499
|
export type GisViewUpdateItemEntry<T> = GisViewPointRef | (Partial<T> & { id?: string | number; index?: number })
|
|
3146
3500
|
|
|
3147
3501
|
/**
|
|
3148
|
-
*
|
|
3502
|
+
* patchPoints / patchLines 的返回:改完的那几条按 indexes / items 对应列出(items 是数据里的新对象),
|
|
3149
3503
|
* 认不出来的定位在 skipped 里(不影响其余条目)。一次调用只发一条数据变更。
|
|
3150
3504
|
*/
|
|
3151
3505
|
export interface GisViewUpdateItemsOutcome<T = GisViewPoint | GisViewLine> {
|
|
@@ -3162,7 +3516,6 @@ export type GisViewDataChangeType =
|
|
|
3162
3516
|
| 'updateData'
|
|
3163
3517
|
| 'updatePoints'
|
|
3164
3518
|
| 'updateLines'
|
|
3165
|
-
| 'updateChannels'
|
|
3166
3519
|
| 'updateOptions'
|
|
3167
3520
|
| 'updateBackground'
|
|
3168
3521
|
| 'updatePoint'
|
|
@@ -3172,6 +3525,7 @@ export type GisViewDataChangeType =
|
|
|
3172
3525
|
| 'copyPoint'
|
|
3173
3526
|
| 'copyPoints'
|
|
3174
3527
|
| 'mergePoints'
|
|
3528
|
+
| 'splitPoint'
|
|
3175
3529
|
| 'waypoint'
|
|
3176
3530
|
| 'addChannel'
|
|
3177
3531
|
| 'addChannels'
|
|
@@ -3304,6 +3658,45 @@ export interface GisViewEngineStats {
|
|
|
3304
3658
|
/** 动画是否还在排下一帧:静止画面是按需渲染的,这时候是 false */
|
|
3305
3659
|
animating: boolean
|
|
3306
3660
|
quality: GisViewQualityState
|
|
3661
|
+
/**
|
|
3662
|
+
* 大数据展示模式的有效读数(组件的 getStats() / onStats / onRender 会带上;纯引擎实例没有这一项)。
|
|
3663
|
+
* active 为 true 时标签走避让 / 截断档,线路动点与节点涟漪暂停。
|
|
3664
|
+
*/
|
|
3665
|
+
dense?: GisViewDenseState
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
/** 大数据展示模式的三种档位:auto 按阈值自动切,on / off 强制打开或关闭 */
|
|
3669
|
+
export type GisViewDenseMode = 'auto' | 'on' | 'off'
|
|
3670
|
+
|
|
3671
|
+
/**
|
|
3672
|
+
* denseMode 的对象写法:阈值都按「正数才生效」处理,不写用内置缺省。
|
|
3673
|
+
* `visibleThreshold` 是视口内节点数,`densityThreshold` 是每百万 CSS 像素的节点数,
|
|
3674
|
+
* `pointThreshold` 是整份数据的节点总数;任意一项越线就进入 dense。
|
|
3675
|
+
*/
|
|
3676
|
+
export interface GisViewDenseModeOptions {
|
|
3677
|
+
mode?: GisViewDenseMode
|
|
3678
|
+
/** 视口内可见节点达到多少个进入密集档,默认 4000 */
|
|
3679
|
+
visibleThreshold?: number
|
|
3680
|
+
/** 每百万 CSS 像素的可见节点密度阈值,默认 3000 */
|
|
3681
|
+
densityThreshold?: number
|
|
3682
|
+
/** 数据总节点数阈值,默认 50000(只看总量,不要求同屏) */
|
|
3683
|
+
pointThreshold?: number
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
/** denseMode 的入参:布尔值 true / false 等价于 'on' / 'off' */
|
|
3687
|
+
export type GisViewDenseModeInput = boolean | GisViewDenseMode | GisViewDenseModeOptions
|
|
3688
|
+
|
|
3689
|
+
/** 大数据展示模式的读数:getStats().dense / onStats / onRender 的 dense 字段 */
|
|
3690
|
+
export interface GisViewDenseState {
|
|
3691
|
+
mode: GisViewDenseMode
|
|
3692
|
+
active: boolean
|
|
3693
|
+
/** 这次判定的依据(checking 表示还在等首帧 / 发散渲染铺完) */
|
|
3694
|
+
reason: 'manual-on' | 'manual-off' | 'total' | 'visible' | 'density' | 'below-threshold' | 'checking'
|
|
3695
|
+
/** 最近一次量到的可见节点数(只数到触发阈值;按总量触发时是 null) */
|
|
3696
|
+
visiblePoints: number | null
|
|
3697
|
+
visibleThreshold: number
|
|
3698
|
+
densityThreshold: number
|
|
3699
|
+
pointThreshold: number
|
|
3307
3700
|
}
|
|
3308
3701
|
|
|
3309
3702
|
/** 渲染帧回调载荷:onStats 的读数 + 帧序号 / 节流间隔 / 时刻与当前相机 */
|
|
@@ -3356,6 +3749,20 @@ export type GisViewConditionOperator = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte'
|
|
|
3356
3749
|
*/
|
|
3357
3750
|
export type GisViewConditionOperatorTest = (value: unknown) => (current: unknown) => boolean
|
|
3358
3751
|
|
|
3752
|
+
/** 注册一个自定义条件运算符;名字为空、与内置重名或工厂不是函数时返回 false */
|
|
3753
|
+
export declare const registerConditionOperator: (name: string, test: GisViewConditionOperatorTest) => boolean
|
|
3754
|
+
/**
|
|
3755
|
+
* 带作用域地注册一个自定义条件运算符:返回清理函数,只在当前注册项仍是这个工厂时删除,
|
|
3756
|
+
* 同名被后注册覆盖时旧清理函数不会误删。参数不合法或撞内置名时抛 TypeError。
|
|
3757
|
+
*/
|
|
3758
|
+
export declare const defineConditionOperator: (name: string, test: GisViewConditionOperatorTest) => () => boolean
|
|
3759
|
+
/** 注销一个自定义条件运算符,返回它之前是否在注册表里;内置运算符不能用它摘掉 */
|
|
3760
|
+
export declare const unregisterConditionOperator: (name: string) => boolean
|
|
3761
|
+
/** 这个名字能不能用(内置或注册过的自定义) */
|
|
3762
|
+
export declare const hasConditionOperator: (name: string) => boolean
|
|
3763
|
+
/** 当前能用哪些运算符:内置 14 个在前,自定义按注册顺序跟在后面 */
|
|
3764
|
+
export declare const listConditionOperators: () => string[]
|
|
3765
|
+
|
|
3359
3766
|
/**
|
|
3360
3767
|
* 显式条件:`{ field: 'vnkv', op: 'gte', value: 500 }`,op 缺省为 eq,not 取反。
|
|
3361
3768
|
* field 支持 `props.vnkv` 这样的嵌套路径。
|
|
@@ -3478,6 +3885,8 @@ export interface GisViewItemLabel {
|
|
|
3478
3885
|
style?: Record<string, string>
|
|
3479
3886
|
/** 线路标签是否与线路方向平行(点的标签忽略这一项) */
|
|
3480
3887
|
parallel?: boolean
|
|
3888
|
+
/** 这一条是否参与避让:false 时即使全局开启 labelOptimize / avoidOverlap 也始终按候选落点画出;缺省跟随全局 */
|
|
3889
|
+
avoidOverlap?: boolean
|
|
3481
3890
|
/**
|
|
3482
3891
|
* 这一条撞上别的标签之后怎么避让:`shift`(默认)主动换锚点 / 沿线挪,`hide` 直接不显示。
|
|
3483
3892
|
* 只在顶层 `labelOptimize: true` 且这条的 `avoidOverlap` 不为 false 时生效;只和底图区域文字重叠时仍按软冲突照画。
|
|
@@ -3487,6 +3896,10 @@ export interface GisViewItemLabel {
|
|
|
3487
3896
|
visibility?: GisViewLabelVisibility
|
|
3488
3897
|
/** 整条不画(等于 visibility: 'hidden');false 表示撤回隐藏覆盖 */
|
|
3489
3898
|
hidden?: boolean
|
|
3899
|
+
/** 这一条标签能不能拖:逐条覆盖 options.label / lineLabel 里的同名开关 */
|
|
3900
|
+
draggable?: boolean
|
|
3901
|
+
/** 这一条标签能不能点选:逐条覆盖 options.label / lineLabel 里的同名开关 */
|
|
3902
|
+
editable?: boolean
|
|
3490
3903
|
/** 这条标签是运行时加的(addLabel),导出时带上它便于整份回显 */
|
|
3491
3904
|
added?: boolean
|
|
3492
3905
|
className?: string
|
|
@@ -3726,8 +4139,10 @@ export interface GisViewLabelPatch {
|
|
|
3726
4139
|
export interface GisViewLabelInfo {
|
|
3727
4140
|
/** 这一条要素上的哪一条标签 */
|
|
3728
4141
|
id: string
|
|
3729
|
-
/**
|
|
4142
|
+
/** 当下画出来的内容(DOM 里的那一份:模板 / 函数算完之后的结果;html 时保留标记本身) */
|
|
3730
4143
|
content: string
|
|
4144
|
+
/** 这一条当下是否按 HTML 渲染(html: true 才有子节点;false 永远是纯文本) */
|
|
4145
|
+
html: boolean
|
|
3731
4146
|
/** 当下生效的锚点(点八向 / 线沿线位置),算不出来时是 null */
|
|
3732
4147
|
position: GisViewLabelPosition | GisViewLineLabelPosition | null
|
|
3733
4148
|
className: string | null
|
|
@@ -3892,12 +4307,12 @@ export interface GisViewLabelListItem {
|
|
|
3892
4307
|
id: string
|
|
3893
4308
|
/** 这一条是哪来的:'config' 配置里定义的 / 'data' 数据里写的 / 'runtime' 运行时加的(与事件载荷里的 GisViewLabelInfo.source 同一口径) */
|
|
3894
4309
|
source: 'config' | 'data' | 'runtime'
|
|
3895
|
-
/**
|
|
4310
|
+
/** 这一条当下生效的内容(运行时覆盖优先,模板 / 函数原样给出),没写是 null */
|
|
3896
4311
|
content: GisViewLabelContent | GisViewLineLabelContent | null
|
|
3897
4312
|
html: boolean
|
|
3898
4313
|
className: string | null
|
|
3899
4314
|
position: GisViewLabelPosition | GisViewLineLabelPosition | null
|
|
3900
|
-
/**
|
|
4315
|
+
/** 当下生效的偏移(像素):运行时拖出来的优先,否则用声明里的;都没有是 [0, 0] */
|
|
3901
4316
|
offset: [number, number]
|
|
3902
4317
|
style: Record<string, string> | null
|
|
3903
4318
|
/** 线路标签:这一条是否与线路平行;节点标签恒为 false */
|
|
@@ -4075,6 +4490,210 @@ export interface GisViewLineDecoration {
|
|
|
4075
4490
|
shadow?: GisViewShadow
|
|
4076
4491
|
}
|
|
4077
4492
|
|
|
4493
|
+
/** 动态装饰器草稿的作用域:单条线路 / 命中线所在分组 / 整条通道(不在通道里时都退回单条) */
|
|
4494
|
+
export type GisViewDecorationDraftScope = 'line' | 'group' | 'channel'
|
|
4495
|
+
|
|
4496
|
+
/** 动态装饰器草稿要命中哪一类要素:线路、节点,或两类同时开启 */
|
|
4497
|
+
export type GisViewDecorationDraftTarget = 'line' | 'point' | 'both'
|
|
4498
|
+
|
|
4499
|
+
/** 节点装饰的位置来源:相对节点偏移 / 固定世界坐标 / 当前鼠标位置;落地关系另由 anchor 决定 */
|
|
4500
|
+
export type GisViewDecorationDraftPointPlacement = 'offset' | 'fixed' | 'pointer'
|
|
4501
|
+
|
|
4502
|
+
/**
|
|
4503
|
+
* 节点装饰的落地关系:
|
|
4504
|
+
* - follow:保留相对节点的屏幕偏移,节点移动 / 画布缩放时跟着节点;
|
|
4505
|
+
* - fixed:保留世界坐标,节点移动后仍停在原处。
|
|
4506
|
+
* 缺省由 placement 推导:offset → follow,fixed / pointer → fixed。
|
|
4507
|
+
*/
|
|
4508
|
+
export type GisViewDecorationDraftPointAnchor = 'follow' | 'fixed'
|
|
4509
|
+
|
|
4510
|
+
/** 同一目标位置出现重复装饰时:offset 自动让开,reject 直接不允许添加 */
|
|
4511
|
+
export type GisViewDecorationDraftDuplicateStrategy = 'offset' | 'reject'
|
|
4512
|
+
|
|
4513
|
+
/** 动态装饰器草稿的阶段:start(开启)→ hover(命中跟随)/ leave(移出目标)→ ready(松手命中)→ commit / cancel */
|
|
4514
|
+
export type GisViewDecorationDraftPhase = 'start' | 'hover' | 'leave' | 'ready' | 'update' | 'commit' | 'cancel'
|
|
4515
|
+
|
|
4516
|
+
/**
|
|
4517
|
+
* 动态装饰器草稿的配置:图标 / 大小 / 配色与真实线路、节点装饰同一套写法。
|
|
4518
|
+
* `target` 决定命中线路 / 节点 / 两类同时;线路侧 `parallel` 决定是否跟着方向转、`scope` 决定一次给哪些线路都挂上,
|
|
4519
|
+
* `maxPerLine` / `allowedLines` / `allowedChannels` / `allowedGroups` 限定线路目标;
|
|
4520
|
+
* 节点侧 `placement` 决定位置来源(相对偏移 / 固定坐标 / 鼠标位置),`anchor` 决定落地后跟随节点还是固定世界坐标;
|
|
4521
|
+
* `maxPerPoint` / `allowedPoints` 限定节点目标。
|
|
4522
|
+
* 两边都受 `allowDuplicate` / `duplicateStrategy` / `duplicateDistance` 的重复策略约束。
|
|
4523
|
+
*/
|
|
4524
|
+
export interface GisViewDecorationDraftOptions {
|
|
4525
|
+
/** 命中类型,缺省 'line'(保持原有线路装饰器行为) */
|
|
4526
|
+
target?: GisViewDecorationDraftTarget
|
|
4527
|
+
/** 图片 / SVG / 内置形状,缺省 'circle' */
|
|
4528
|
+
symbol?: GisViewSymbolInput
|
|
4529
|
+
/** 屏幕尺寸(CSS 像素),缺省 18 */
|
|
4530
|
+
size?: number
|
|
4531
|
+
/** 填充 / 色调,缺省白色 */
|
|
4532
|
+
color?: string
|
|
4533
|
+
/** 描边色,缺省透明 */
|
|
4534
|
+
strokeColor?: string
|
|
4535
|
+
/** 描边宽度(CSS 像素),缺省 0 */
|
|
4536
|
+
strokeWidth?: number
|
|
4537
|
+
/** 透明度,缺省 1 */
|
|
4538
|
+
opacity?: number
|
|
4539
|
+
/** 阴影,和节点一样 */
|
|
4540
|
+
shadow?: GisViewShadow
|
|
4541
|
+
/** 是否跟着线路方向转,缺省 false(保持水平) */
|
|
4542
|
+
parallel?: boolean
|
|
4543
|
+
/** 作用域,缺省 'line' */
|
|
4544
|
+
scope?: GisViewDecorationDraftScope
|
|
4545
|
+
/** 离线路多远算命中(屏幕像素),缺省 14;只有贴近线路时才出现预览 */
|
|
4546
|
+
maxDistance?: number
|
|
4547
|
+
/** 每条线路最多允许多少个 decoration(按 `lines[].decorations.length` 计),0 / 缺省 = 不限 */
|
|
4548
|
+
maxPerLine?: number
|
|
4549
|
+
/** 每个节点最多允许多少个 decoration(按 `points[].decorations.length` 计),0 / 缺省 = 不限 */
|
|
4550
|
+
maxPerPoint?: number
|
|
4551
|
+
/** 允许挂装饰的线路 id;空数组 / 缺省表示不限制这一类 */
|
|
4552
|
+
allowedLines?: Array<string | number>
|
|
4553
|
+
/** 允许挂装饰的通道 id;空数组 / 缺省表示不限制这一类 */
|
|
4554
|
+
allowedChannels?: Array<string | number>
|
|
4555
|
+
/** 允许挂装饰的分组 id;空数组 / 缺省表示不限制这一类 */
|
|
4556
|
+
allowedGroups?: Array<string | number>
|
|
4557
|
+
/** 允许挂装饰的节点 id;空数组 / 缺省表示不限制这一类 */
|
|
4558
|
+
allowedPoints?: Array<string | number>
|
|
4559
|
+
/** 节点位置来源,缺省 'offset'(相对节点偏移) */
|
|
4560
|
+
placement?: GisViewDecorationDraftPointPlacement
|
|
4561
|
+
/** 落地关系,缺省由 placement 推导:offset → follow,fixed / pointer → fixed */
|
|
4562
|
+
anchor?: GisViewDecorationDraftPointAnchor
|
|
4563
|
+
/** 相对节点的屏幕像素偏移(x 向右、y 向下),优先于 distance / direction */
|
|
4564
|
+
offset?: [number, number] | GisViewCoordinate
|
|
4565
|
+
/** 相对节点的屏幕像素距离,缺省 28 */
|
|
4566
|
+
distance?: number
|
|
4567
|
+
/** 相对方向:0 度向上、顺时针,缺省 0(正上方) */
|
|
4568
|
+
direction?: number
|
|
4569
|
+
/** placement 为 fixed 时的世界坐标;缺省落在节点中心 */
|
|
4570
|
+
at?: GisViewCoordinate
|
|
4571
|
+
/** 节点装饰旋转角(度),缺省 0 */
|
|
4572
|
+
angle?: number
|
|
4573
|
+
/** 节点装饰连接线:true 用默认样式,对象可覆盖颜色 / 线宽 / 透明度 / 虚线 */
|
|
4574
|
+
connector?: boolean | GisViewPointDecorationConnector
|
|
4575
|
+
/** 是否允许同一目标位置上重复添加,缺省 true(保持原有行为) */
|
|
4576
|
+
allowDuplicate?: boolean
|
|
4577
|
+
/** allowDuplicate 为 false 时:offset 自动让开(缺省),reject 直接拦下 */
|
|
4578
|
+
duplicateStrategy?: GisViewDecorationDraftDuplicateStrategy
|
|
4579
|
+
/** 重复判定容差(屏幕像素),缺省 8 */
|
|
4580
|
+
duplicateDistance?: number
|
|
4581
|
+
/** 触发这次草稿的原始事件(begin / update 时可选带进来) */
|
|
4582
|
+
originalEvent?: Event | null
|
|
4583
|
+
}
|
|
4584
|
+
|
|
4585
|
+
/** 草稿作用域展开之后的一条目标线路:线路 id 与它在通道 / 分组里的归属 */
|
|
4586
|
+
export interface GisViewDecorationDraftLineTarget {
|
|
4587
|
+
lineIndex: number
|
|
4588
|
+
lineId: string | number
|
|
4589
|
+
channelId: string | number | null
|
|
4590
|
+
groupId: string | number | null
|
|
4591
|
+
channelIndex: number | null
|
|
4592
|
+
/** 这条线路当前已有的 decoration 数(maxPerLine 判断用) */
|
|
4593
|
+
existingCount: number
|
|
4594
|
+
}
|
|
4595
|
+
|
|
4596
|
+
/** 草稿命中的节点目标:节点 id 与已有装饰数(maxPerPoint 判断用) */
|
|
4597
|
+
export interface GisViewDecorationDraftPointTarget {
|
|
4598
|
+
pointIndex: number
|
|
4599
|
+
pointId: string | number
|
|
4600
|
+
/** 这个节点当前已有的 decoration 数 */
|
|
4601
|
+
existingCount: number
|
|
4602
|
+
x: number
|
|
4603
|
+
y: number
|
|
4604
|
+
}
|
|
4605
|
+
|
|
4606
|
+
/**
|
|
4607
|
+
* 动态装饰器草稿的事件载荷(options.onDecorationDraft / on('decorationDraft') 共用)。
|
|
4608
|
+
* phase 为 leave / cancel 时命中相关的字段为 null;targets 是这一次会挂到哪些线路(单条 / 分组 / 整条通道)。
|
|
4609
|
+
*/
|
|
4610
|
+
export interface GisViewDecorationDraftPayload {
|
|
4611
|
+
phase: GisViewDecorationDraftPhase
|
|
4612
|
+
/** 归一化之后的草稿配置 */
|
|
4613
|
+
options: GisViewDecorationDraftOptions
|
|
4614
|
+
/** 符号类型名(circle / square / svg / image),面板读数用 */
|
|
4615
|
+
symbol: string
|
|
4616
|
+
/** 原始符号写法(可直接写进 decorations[].symbol) */
|
|
4617
|
+
symbolInput: GisViewSymbolInput
|
|
4618
|
+
size: number
|
|
4619
|
+
color: string | null
|
|
4620
|
+
strokeColor: string | null
|
|
4621
|
+
strokeWidth: number
|
|
4622
|
+
opacity: number
|
|
4623
|
+
parallel: boolean
|
|
4624
|
+
scope: GisViewDecorationDraftScope
|
|
4625
|
+
maxDistance: number
|
|
4626
|
+
maxPerLine: number
|
|
4627
|
+
maxPerPoint: number
|
|
4628
|
+
allowedLines: Array<string | number>
|
|
4629
|
+
allowedChannels: Array<string | number>
|
|
4630
|
+
allowedGroups: Array<string | number>
|
|
4631
|
+
allowedPoints: Array<string | number>
|
|
4632
|
+
target: GisViewDecorationDraftTarget
|
|
4633
|
+
placement: GisViewDecorationDraftPointPlacement
|
|
4634
|
+
anchor: GisViewDecorationDraftPointAnchor
|
|
4635
|
+
connector: boolean | GisViewPointDecorationConnector | null
|
|
4636
|
+
allowDuplicate: boolean
|
|
4637
|
+
duplicateStrategy: GisViewDecorationDraftDuplicateStrategy
|
|
4638
|
+
duplicateDistance: number
|
|
4639
|
+
/** 本次预览是否因为不允许重复而自动让开了位置 */
|
|
4640
|
+
duplicateAdjusted: boolean
|
|
4641
|
+
/** 最近一次命中的目标为什么不可用:limit(满额)/ not-allowed(白名单)/ targets-missing(目标已不在)/ duplicate(重复) */
|
|
4642
|
+
blockedReason: string | null
|
|
4643
|
+
/** 沿线比例(0~1);离开目标线时为 null */
|
|
4644
|
+
position: number | null
|
|
4645
|
+
/** 指针的画布 CSS 像素坐标 */
|
|
4646
|
+
screen: [number, number] | null
|
|
4647
|
+
/** 图标预览的屏幕坐标(节点装饰的固定 / 偏移位置也在这里) */
|
|
4648
|
+
decorationScreen: [number, number] | null
|
|
4649
|
+
/** 图标最终的世界坐标(线路为沿线落点,节点为吸附位置) */
|
|
4650
|
+
world: [number, number] | null
|
|
4651
|
+
/** 图标当前的屏幕旋转角(弧度;线路 parallel 或节点装饰 angle 换算后) */
|
|
4652
|
+
angle: number
|
|
4653
|
+
lineIndex: number | null
|
|
4654
|
+
lineId: string | number | null
|
|
4655
|
+
item: GisViewLine | null
|
|
4656
|
+
channelId: string | number | null
|
|
4657
|
+
groupId: string | number | null
|
|
4658
|
+
channelIndex: number | null
|
|
4659
|
+
/** 命中的线路读数(nearestLineAt 同一份),离开目标线时为 null */
|
|
4660
|
+
hit: GisViewNearestLine | null
|
|
4661
|
+
/** 本次命中的类型;离开目标时为 null */
|
|
4662
|
+
hitKind: 'line' | 'point' | null
|
|
4663
|
+
/** 与 hitKind 相同(便于面板按 targetKind 读数) */
|
|
4664
|
+
targetKind: 'line' | 'point' | null
|
|
4665
|
+
/** 命中的节点下标 / id / 数据;命中线路时为 null */
|
|
4666
|
+
pointIndex: number | null
|
|
4667
|
+
pointId: string | number | null
|
|
4668
|
+
pointItem: GisViewPoint | null
|
|
4669
|
+
pointHit: GisViewNearestPoint | null
|
|
4670
|
+
targets: GisViewDecorationDraftLineTarget[]
|
|
4671
|
+
pointTargets: GisViewDecorationDraftPointTarget[]
|
|
4672
|
+
lineTargetCount: number
|
|
4673
|
+
pointTargetCount: number
|
|
4674
|
+
/** 本次会写入的目标总数(线路目标 + 节点目标) */
|
|
4675
|
+
targetCount: number
|
|
4676
|
+
/** 与 targetCount 相同,commit 事件里便于统一读数 */
|
|
4677
|
+
count: number
|
|
4678
|
+
/** 归一化之后的真实装饰字段,commit 时逐条写进 decorations */
|
|
4679
|
+
decoration: GisViewLineDecoration | null
|
|
4680
|
+
/** 命中节点时归一化之后的真实装饰字段 */
|
|
4681
|
+
pointDecoration: GisViewPointDecoration | null
|
|
4682
|
+
originalEvent: Event | null
|
|
4683
|
+
}
|
|
4684
|
+
|
|
4685
|
+
/** commitDecorationDraft 的结果:ok 为 false 时 reason 说明原因(no-draft / no-target / limit / not-allowed / targets-missing / duplicate) */
|
|
4686
|
+
export interface GisViewDecorationCommitResult {
|
|
4687
|
+
ok: boolean
|
|
4688
|
+
reason?: string
|
|
4689
|
+
count: number
|
|
4690
|
+
targets: GisViewDecorationDraftLineTarget[]
|
|
4691
|
+
decorations: GisViewLineDecoration[]
|
|
4692
|
+
pointTargets: GisViewDecorationDraftPointTarget[]
|
|
4693
|
+
pointDecorations: GisViewPointDecoration[]
|
|
4694
|
+
draft?: GisViewDecorationDraftPayload
|
|
4695
|
+
}
|
|
4696
|
+
|
|
4078
4697
|
/** 悬浮提示内容:模板字符串(`{name}` / `{vnkv}`)或返回文本 / 元素 / null 的函数 */
|
|
4079
4698
|
export type GisViewTooltipContent = string | ((payload: GisViewPickResult) => string | HTMLElement | number | null | undefined)
|
|
4080
4699
|
|
|
@@ -4423,10 +5042,17 @@ export interface GisViewInitialView {
|
|
|
4423
5042
|
}
|
|
4424
5043
|
|
|
4425
5044
|
/**
|
|
4426
|
-
*
|
|
5045
|
+
* 插件:视图建好之后调用一次,拿到实例本身与带 apiVersion 的上下文;返回 { destroy } 时会挂进实例的 destroy。
|
|
4427
5046
|
* 写一次插件,之后换项目直接复用,不必把「URL 同步 / 自建图例 / 业务操作」再抄一遍。
|
|
4428
5047
|
*/
|
|
4429
|
-
export
|
|
5048
|
+
export interface GisViewPluginContext {
|
|
5049
|
+
/** 插件 API 版本:当前为 1;以后只做加字段的向后兼容扩展 */
|
|
5050
|
+
readonly apiVersion: 1
|
|
5051
|
+
/** 与插件第一个参数相同,方便统一改写成只收一个上下文对象 */
|
|
5052
|
+
readonly view: GisViewInstance
|
|
5053
|
+
}
|
|
5054
|
+
|
|
5055
|
+
export type GisViewPlugin = (view: GisViewInstance, context: GisViewPluginContext) => void | { destroy?: () => void }
|
|
4430
5056
|
|
|
4431
5057
|
/**
|
|
4432
5058
|
* 快捷键写法(大小写不敏感,多个用 + 连接):
|
|
@@ -4537,7 +5163,16 @@ export interface GisViewMergeOptions {
|
|
|
4537
5163
|
* **缺省关**:写了这份 merge 配置才算开(`enabled: false` 显式关掉),也可以由 features.merge 强制
|
|
4538
5164
|
*/
|
|
4539
5165
|
enabled?: boolean
|
|
4540
|
-
/**
|
|
5166
|
+
/**
|
|
5167
|
+
* 拖拽合并的触发时机:
|
|
5168
|
+
* - `'collision'`(缺省):两个节点画在屏幕上的半径之和以内就算碰上,响应更早;
|
|
5169
|
+
* - `'center'`:拖动的节点中心点进入目标节点的屏幕区域(目标节点半径)时才触发,比碰撞更晚、更稳。
|
|
5170
|
+
* 两种都再叠加 `distance` 的像素容差。
|
|
5171
|
+
*/
|
|
5172
|
+
trigger?: GisViewMergeTrigger
|
|
5173
|
+
/**
|
|
5174
|
+
* 额外的像素容差(CSS 像素):`'collision'` 加在两个节点屏幕半径之和上,`'center'` 加在目标节点半径上,默认 0
|
|
5175
|
+
*/
|
|
4541
5176
|
distance?: number
|
|
4542
5177
|
/**
|
|
4543
5178
|
* 确认方式:组件不弹任何对话框,只把载荷交给使用方 ——
|
|
@@ -4560,6 +5195,8 @@ export interface GisViewMergeOptions {
|
|
|
4560
5195
|
createItem?: (source: GisViewPoint, target: GisViewPoint, context: GisViewMergeContext) => GisViewPoint
|
|
4561
5196
|
}
|
|
4562
5197
|
|
|
5198
|
+
/** 拖拽合并的触发时机:两个节点的屏幕半径相碰 / 拖动节点中心进入目标节点区域 */
|
|
5199
|
+
export type GisViewMergeTrigger = 'collision' | 'center'
|
|
4563
5200
|
|
|
4564
5201
|
/** 通道选中模式:点中通道里的一条回线时选中什么 */
|
|
4565
5202
|
export type GisViewChannelSelectMode =
|
|
@@ -4570,6 +5207,13 @@ export type GisViewChannelSelectMode =
|
|
|
4570
5207
|
/** 整条通道(所有分组的回线)一起选 */
|
|
4571
5208
|
| 'channel'
|
|
4572
5209
|
|
|
5210
|
+
/** 分组拐点拖动模式:普通线路永远只动自己,这里只影响通道里的一组回线 */
|
|
5211
|
+
export type GisViewChannelWaypointDragMode =
|
|
5212
|
+
/** 缺省:改共用骨架,组内回线按平行偏移重算;拐角处相邻顶点可能随 miter 微调 */
|
|
5213
|
+
| 'parallel'
|
|
5214
|
+
/** 只把同组同一 pathIndex 的拐点按相同世界增量平移,其他拐点(含相邻顶点)保持不动 */
|
|
5215
|
+
| 'vertex'
|
|
5216
|
+
|
|
4573
5217
|
/**
|
|
4574
5218
|
* 框选 / Ctrl 多选允许收哪几类要素:节点、独立线路、通道回线。
|
|
4575
5219
|
* 通道回线只归 channel 这一档管;通道之外的普通线路归 line,两者可以任意组合。
|
|
@@ -4590,7 +5234,7 @@ export interface GisViewSelectInBoxOptions {
|
|
|
4590
5234
|
originalEvent?: Event | null
|
|
4591
5235
|
}
|
|
4592
5236
|
|
|
4593
|
-
/**
|
|
5237
|
+
/** resolvePointMerge / payload.confirm 的参数:保留哪一端,以及最终节点(可只给要改的字段) */
|
|
4594
5238
|
export interface GisViewPointMergeConfirmOptions {
|
|
4595
5239
|
keep?: GisViewMergeKeep
|
|
4596
5240
|
item?: Partial<GisViewPoint> | null
|
|
@@ -5076,6 +5720,8 @@ export interface GisViewEventMap {
|
|
|
5076
5720
|
channelContextMenu: { payload: GisViewChannelContextPayload | null; event: MouseEvent }
|
|
5077
5721
|
channelDraft: GisViewChannelDraftPayload
|
|
5078
5722
|
channelDraftClick: GisViewChannelDraftPayload
|
|
5723
|
+
/** 动态装饰器草稿:start / hover / leave / ready / update / commit / cancel */
|
|
5724
|
+
decorationDraft: GisViewDecorationDraftPayload
|
|
5079
5725
|
/** 分组变化:拆分 / 合并 / 挪线 / 新建组 / 整份声明换(updateChannel),action.type 说明这一笔是什么 */
|
|
5080
5726
|
channelGroupChange: GisViewChannelGroupChangePayload
|
|
5081
5727
|
dataChange: GisViewDataChangePayload
|
|
@@ -5110,6 +5756,110 @@ export type GisViewEventListener<K extends GisViewEventName> = (payload: GisView
|
|
|
5110
5756
|
/** `on('*', fn)` 的回调:载荷类型随事件名变化,第二个参数说明这次是哪一条 */
|
|
5111
5757
|
export type GisViewAnyEventListener = (payload: GisViewEventMap[GisViewEventName], name: GisViewEventName) => void
|
|
5112
5758
|
|
|
5759
|
+
/** 扩展图形类型:SVG 路径 / 图片 / 外部 Canvas */
|
|
5760
|
+
export type GisViewGraphicType = 'path' | 'image' | 'canvas'
|
|
5761
|
+
|
|
5762
|
+
/** 图形的锚点:九宫格名字,或 [x, y](0~1,[0.5, 0.5] 是中心) */
|
|
5763
|
+
export type GisViewGraphicAnchor =
|
|
5764
|
+
| 'center' | 'top' | 'bottom' | 'left' | 'right'
|
|
5765
|
+
| 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
5766
|
+
| [number, number]
|
|
5767
|
+
|
|
5768
|
+
/** 图形的路径 / 图片样式(与直接写在图形对象上的同名字段等价,直接字段优先) */
|
|
5769
|
+
export interface GisViewGraphicStyle {
|
|
5770
|
+
fill?: string
|
|
5771
|
+
stroke?: string
|
|
5772
|
+
lineWidth?: number
|
|
5773
|
+
strokeWidth?: number
|
|
5774
|
+
opacity?: number
|
|
5775
|
+
lineCap?: 'butt' | 'round' | 'square'
|
|
5776
|
+
lineJoin?: 'miter' | 'round' | 'bevel'
|
|
5777
|
+
lineDash?: number[]
|
|
5778
|
+
dash?: number[]
|
|
5779
|
+
dashOffset?: number
|
|
5780
|
+
fillRule?: 'nonzero' | 'evenodd'
|
|
5781
|
+
preserveAspectRatio?: string
|
|
5782
|
+
width?: number
|
|
5783
|
+
height?: number
|
|
5784
|
+
}
|
|
5785
|
+
|
|
5786
|
+
/**
|
|
5787
|
+
* 一个扩展图形(类似 ECharts 的 graphic):画在 WebGL 画布之上、标签之下,
|
|
5788
|
+
* 不参与拾取、不进节点 / 线路数据。`x` / `y` 是世界坐标(也可以写 `position: [x, y]`);
|
|
5789
|
+
* 默认是屏幕像素尺寸,`scaleWithView: true` 时宽高按世界单位随相机缩放。
|
|
5790
|
+
*/
|
|
5791
|
+
export interface GisViewGraphic {
|
|
5792
|
+
id?: string | number
|
|
5793
|
+
type?: GisViewGraphicType
|
|
5794
|
+
x?: number
|
|
5795
|
+
y?: number
|
|
5796
|
+
position?: [number, number]
|
|
5797
|
+
width?: number
|
|
5798
|
+
height?: number
|
|
5799
|
+
anchor?: GisViewGraphicAnchor
|
|
5800
|
+
offset?: [number, number]
|
|
5801
|
+
rotation?: number
|
|
5802
|
+
scale?: number | [number, number]
|
|
5803
|
+
opacity?: number
|
|
5804
|
+
visible?: boolean
|
|
5805
|
+
zIndex?: number
|
|
5806
|
+
scaleWithView?: boolean
|
|
5807
|
+
d?: string
|
|
5808
|
+
path?: string
|
|
5809
|
+
viewBox?: string | [number, number, number, number]
|
|
5810
|
+
fill?: string
|
|
5811
|
+
stroke?: string
|
|
5812
|
+
strokeWidth?: number
|
|
5813
|
+
lineCap?: 'butt' | 'round' | 'square'
|
|
5814
|
+
lineJoin?: 'miter' | 'round' | 'bevel'
|
|
5815
|
+
lineDash?: number[]
|
|
5816
|
+
dash?: number[]
|
|
5817
|
+
dashOffset?: number
|
|
5818
|
+
fillRule?: 'nonzero' | 'evenodd'
|
|
5819
|
+
style?: GisViewGraphicStyle
|
|
5820
|
+
src?: string
|
|
5821
|
+
href?: string
|
|
5822
|
+
image?: string
|
|
5823
|
+
alt?: string
|
|
5824
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | ''
|
|
5825
|
+
referrerPolicy?: ReferrerPolicy
|
|
5826
|
+
preserveAspectRatio?: string
|
|
5827
|
+
canvas?: HTMLCanvasElement
|
|
5828
|
+
element?: HTMLCanvasElement
|
|
5829
|
+
}
|
|
5830
|
+
|
|
5831
|
+
/** WebGL 自定义层 draw 回调的上下文:画在组件内置内容之后,坐标是最终画布的设备像素 */
|
|
5832
|
+
export interface GisViewWebGLLayerDrawContext {
|
|
5833
|
+
gl: WebGL2RenderingContext
|
|
5834
|
+
/** 最终画布:width / height 是绘制缓冲尺寸(CSS 尺寸乘 pixelRatio) */
|
|
5835
|
+
canvas: HTMLCanvasElement
|
|
5836
|
+
viewport: GisViewViewport
|
|
5837
|
+
camera: GisViewCamera
|
|
5838
|
+
/** 第几帧(从 1 开始),用来做按帧推进的自定义动画 */
|
|
5839
|
+
frame: number
|
|
5840
|
+
/** 世界坐标 → 画布 CSS 像素 */
|
|
5841
|
+
project(x: number, y: number): [number, number]
|
|
5842
|
+
/** 画布 CSS 像素 → 世界坐标 */
|
|
5843
|
+
unproject(x: number, y: number): [number, number]
|
|
5844
|
+
/** 外部数据变了时请求下一帧(层内动画也可以每帧调用) */
|
|
5845
|
+
requestRender(): void
|
|
5846
|
+
}
|
|
5847
|
+
|
|
5848
|
+
/**
|
|
5849
|
+
* WebGL 自定义层:直接拿组件的 WebGL2 上下文画自己的东西(标记、特效、调试几何…)。
|
|
5850
|
+
* 每层开画前会重置到默认帧缓冲、全画布 viewport 与 SRC_ALPHA / ONE_MINUS_SRC_ALPHA 混合;
|
|
5851
|
+
* 层不影响数据、拾取、标签与导出,只在屏幕上叠加。
|
|
5852
|
+
*/
|
|
5853
|
+
export interface GisViewWebGLLayer {
|
|
5854
|
+
/** 层 id:同 id 再加会覆盖;不写自动生成 */
|
|
5855
|
+
id?: string | number
|
|
5856
|
+
/** 绘制顺序,从小到大(缺省 0);同 order 保持加入顺序 */
|
|
5857
|
+
order?: number
|
|
5858
|
+
/** false 时跳过这一层(缺省 true) */
|
|
5859
|
+
enabled?: boolean
|
|
5860
|
+
draw(context: GisViewWebGLLayerDrawContext): void
|
|
5861
|
+
}
|
|
5862
|
+
|
|
5113
5863
|
export interface GisViewOptions {
|
|
5114
5864
|
/**
|
|
5115
5865
|
* 功能开关:预设名('edit' / 'view' / 'static')、开关表或布尔值 ——
|
|
@@ -5135,6 +5885,13 @@ export interface GisViewOptions {
|
|
|
5135
5885
|
* 缺省 'high',与从前完全一致。运行时 setQuality() 换档、getQuality() 读当前档位与最近一帧耗时。
|
|
5136
5886
|
*/
|
|
5137
5887
|
quality?: GisViewQualityOptions
|
|
5888
|
+
/**
|
|
5889
|
+
* 大数据展示模式:`'auto'`(缺省)按视口内可见节点数、屏幕密度与数据总量自动切;
|
|
5890
|
+
* `'on'` / `'off'` / true / false 强制开关;对象写法可改三档阈值(见 GisViewDenseModeOptions)。
|
|
5891
|
+
* 进入密集档后标签自动走避让 / 截断(等价 labelOptimize: true),线路动点与节点涟漪暂停;
|
|
5892
|
+
* 运行时用 updateOptions({ denseMode }) 切换,当前有效值与判定依据看 getStats().dense。
|
|
5893
|
+
*/
|
|
5894
|
+
denseMode?: GisViewDenseModeInput
|
|
5138
5895
|
/**
|
|
5139
5896
|
* 渲染后端开关:'auto'(缺省)/ 'webgl2' / 'webgpu',布尔值 true / false 等价于 'webgpu' / 'webgl2'。
|
|
5140
5897
|
* 当前实装的绘制后端只有 WebGL2 —— 第 18 章量得很清楚:十万级下换 WebGPU 省不到填充率与
|
|
@@ -5148,7 +5905,7 @@ export interface GisViewOptions {
|
|
|
5148
5905
|
* 这里是全局缺省,逐条线路的 lines[].effect / 逐点 points[].effect 覆盖它(写法见 GisViewLineEffect /
|
|
5149
5906
|
* GisViewPointEffect)。不配 = 没有全局缺省(数据里自己配了 effect 的照样动);
|
|
5150
5907
|
* `false` / `{ enabled: false }` = 一处关掉所有动画(连逐要素配好的也一起关)。
|
|
5151
|
-
* 运行时
|
|
5908
|
+
* 运行时 updateOptions({ effects }) 换一份、getEffects() 读归一化之后的配置、getLineEffects() 读这一帧动点的位置。
|
|
5152
5909
|
*/
|
|
5153
5910
|
effects?: GisViewEffectsInput
|
|
5154
5911
|
/**
|
|
@@ -5189,6 +5946,8 @@ export interface GisViewOptions {
|
|
|
5189
5946
|
channelGroupMaxLines?: number
|
|
5190
5947
|
/** 新增通道草稿线的样式(跟随光标的那条预览线) */
|
|
5191
5948
|
channelDraftStyle?: GisViewChannelDraftStyle
|
|
5949
|
+
/** WebGL 自定义层:内置内容之后按 order 绘制;运行时用 addWebGLLayer / updateWebGLLayer 等维护 */
|
|
5950
|
+
webglLayers?: GisViewWebGLLayer[]
|
|
5192
5951
|
background?: GisViewBackground
|
|
5193
5952
|
pointStyle?: GisViewPointStyle
|
|
5194
5953
|
lineStyle?: GisViewLineStyle
|
|
@@ -5221,12 +5980,26 @@ export interface GisViewOptions {
|
|
|
5221
5980
|
* 只管「画不画、画哪几条」:`visibility` / `when` / 拖拽 / 编辑 / 样式与动画都不受影响
|
|
5222
5981
|
*/
|
|
5223
5982
|
labelOptimize?: boolean
|
|
5983
|
+
/**
|
|
5984
|
+
* 纯文本标签的渲染方式,缺省 `auto`:
|
|
5985
|
+
* - `auto`:强制显示档下,视口里的纯文本标签达到 1024 条时自动改画到单张 Canvas;
|
|
5986
|
+
* 需要 DOM 的标签(`html: true`、函数返回元素、可拖拽 / 可编辑)仍逐条建节点。
|
|
5987
|
+
* - `dom`:始终逐条建 `.gis-view__label`,保持旧行为。
|
|
5988
|
+
* 画布档不改变标签内容、锚点与显隐,只减少高密度场景的 DOM 数量。
|
|
5989
|
+
*/
|
|
5990
|
+
labelRender?: 'auto' | 'dom'
|
|
5224
5991
|
/**
|
|
5225
5992
|
* 标签的运行时状态(`getLabelStates()` 的那一份:拖过的偏移、改过的内容与样式、运行时加的标签、隐藏覆盖):
|
|
5226
5993
|
* 创建 / `updateOptions` 时喂回来就回显,与 `setLabelStates(states)` 同一条路。
|
|
5227
5994
|
* `exportData({ format: 'input' })` 的结果里叫 `labelStates`,原样接上即可完成存档 → 回灌
|
|
5228
5995
|
*/
|
|
5229
5996
|
labelStates?: GisViewLabelState[]
|
|
5997
|
+
/**
|
|
5998
|
+
* 与节点无关的扩展图形:在画布之上、标签之下绘制 SVG 路径 / 图片 / Canvas,
|
|
5999
|
+
* 支持世界坐标锚点、旋转、透明度、zIndex 与随视图缩放。运行时用 addGraphic / addGraphics /
|
|
6000
|
+
* updateGraphic / removeGraphic / clearGraphics 增删改;exportImage 的 PNG / SVG 都会带上这一层。
|
|
6001
|
+
*/
|
|
6002
|
+
graphics?: GisViewGraphic[]
|
|
5230
6003
|
/** 悬停提示:配了就按这个配置显示,点 / 线 / 通道可分别配置内容 */
|
|
5231
6004
|
tooltip?: GisViewTooltipOptions
|
|
5232
6005
|
/** 初始筛选条件,等价于创建之后调用 setFilter;可以写完整格式,也可以只给节点条件 */
|
|
@@ -5357,6 +6130,12 @@ export interface GisViewOptions {
|
|
|
5357
6130
|
* Ctrl + 点击在 group / channel 下是整批取反,切换走 updateOptions 不用重排场景
|
|
5358
6131
|
*/
|
|
5359
6132
|
channelSelectMode?: GisViewChannelSelectMode
|
|
6133
|
+
/**
|
|
6134
|
+
* 分组拐点拖动模式:'parallel'(缺省)沿用共用骨架 + 平行偏移,拐角相邻顶点可能随 miter 微调;
|
|
6135
|
+
* 'vertex' 只移动当前分组同一 pathIndex 的拐点(组内所有回线按相同世界增量),其他拐点保持不动。
|
|
6136
|
+
* 普通线路不受影响;切换走 updateOptions({ channelWaypointDragMode }),下一次拖动生效
|
|
6137
|
+
*/
|
|
6138
|
+
channelWaypointDragMode?: GisViewChannelWaypointDragMode
|
|
5360
6139
|
|
|
5361
6140
|
/**
|
|
5362
6141
|
* 快捷键:框选、多选、加点、复制、粘贴、取消、删除、适应视图都可以在这里改
|
|
@@ -5367,7 +6146,10 @@ export interface GisViewOptions {
|
|
|
5367
6146
|
copy?: GisViewCopyOptions
|
|
5368
6147
|
/** 合并节点(**缺省关**:写了这份配置才算开):把一个节点拖到另一个节点上(考虑碰撞)时怎么确认与怎么并 */
|
|
5369
6148
|
merge?: GisViewMergeOptions
|
|
5370
|
-
/**
|
|
6149
|
+
/**
|
|
6150
|
+
* 是否允许编辑线路拐点:Ctrl + 点击添加、拖动移动、双击或 Delete 删除;**缺省关**,单条线可用 waypointEditable 覆盖。
|
|
6151
|
+
* `false`(以及 `features: { waypoint: false }`)会同时关闭新增、移动与删除;没有只关其中一项的细分开关
|
|
6152
|
+
*/
|
|
5371
6153
|
waypointEditable?: boolean
|
|
5372
6154
|
/** 拐点显示时机:selected 只在线路被选中(或刚加过拐点)时显示,always 始终显示;默认 selected */
|
|
5373
6155
|
waypointVisibility?: 'selected' | 'always'
|
|
@@ -5398,7 +6180,7 @@ export interface GisViewOptions {
|
|
|
5398
6180
|
*/
|
|
5399
6181
|
renderEmitInterval?: number
|
|
5400
6182
|
/**
|
|
5401
|
-
*
|
|
6183
|
+
* 插件:视图建好之后依次调用 `plugin(view, context)`(context 带 apiVersion / view),用来把跨项目复用的逻辑
|
|
5402
6184
|
* (URL 同步、业务快捷操作、自建图例…)封装成一份;返回值里的 destroy 会在 view.destroy() 时回调。
|
|
5403
6185
|
*/
|
|
5404
6186
|
plugins?: GisViewPlugin[]
|
|
@@ -5482,6 +6264,8 @@ export interface GisViewOptions {
|
|
|
5482
6264
|
onChannelDraft?: (payload: GisViewChannelDraftPayload) => void
|
|
5483
6265
|
/** 草稿里每点一次发一条:step 1 拿到起点、step 2 拿到终点(线路结束),载荷与 onChannelDraft 相同 */
|
|
5484
6266
|
onChannelDraftClick?: (payload: GisViewChannelDraftPayload) => void
|
|
6267
|
+
/** 动态装饰器草稿:鼠标在线路上跟随 / 移出 / 松手 ready,以及 update / commit / cancel */
|
|
6268
|
+
onDecorationDraft?: (payload: GisViewDecorationDraftPayload) => void
|
|
5485
6269
|
/** 分组变化:拆分 / 合并 / 挪线 / 新建组 / 整份声明换(updateChannel),action.type 说明这一笔是什么 */
|
|
5486
6270
|
onChannelGroupChange?: (payload: GisViewChannelGroupChangePayload) => void
|
|
5487
6271
|
onCameraChange?: (camera: GisViewCamera) => void
|
|
@@ -5677,48 +6461,6 @@ export interface GisViewExportSelectionResult {
|
|
|
5677
6461
|
lineIndexes: number[]
|
|
5678
6462
|
}
|
|
5679
6463
|
|
|
5680
|
-
/**
|
|
5681
|
-
* exportSelectionData 的选项:选中口径与 exportSelection 完全一致(不给 points 就用当前选中集里的节点,
|
|
5682
|
-
* 线路取两端都在导出集里的那些),但出的是一份份业务表口径的记录,按 parts 多选。
|
|
5683
|
-
*/
|
|
5684
|
-
export interface GisViewExportSelectionDataOptions {
|
|
5685
|
-
/** 要导出的节点(id / 下标 / `{ id }` / `{ index }`,单个或数组);缺省用当前选中集里的节点 */
|
|
5686
|
-
points?: GisViewFeatureRef | GisViewFeatureRef[]
|
|
5687
|
-
/** 要导出的线路:缺省取两端都在导出集里的那些(withLines: false 表示不要线路) */
|
|
5688
|
-
lines?: GisViewFeatureRef | GisViewFeatureRef[]
|
|
5689
|
-
/** 要导出的通道:缺省取成员里有导出线路的那些通道 */
|
|
5690
|
-
channels?: GisViewFeatureRef | GisViewFeatureRef[]
|
|
5691
|
-
/** 是否带上「两端都在这批节点里」的线路(含通道回线),缺省 true;显式给了 lines 时以 lines 为准 */
|
|
5692
|
-
withLines?: boolean
|
|
5693
|
-
/** 要哪几份(多选,见 GisViewExportPart);缺省四份都要,选了通道 / 线路会自动带上拐点 */
|
|
5694
|
-
parts?: GisViewExportPart | GisViewExportPart[]
|
|
5695
|
-
/** 拐点要不要连没编辑过的分组一起列(同 exportParallelGroups 的 all),缺省 false */
|
|
5696
|
-
all?: boolean
|
|
5697
|
-
/** 额外挂到结果上的字段(同导出数据的 extra) */
|
|
5698
|
-
extra?: Record<string, unknown>
|
|
5699
|
-
}
|
|
5700
|
-
|
|
5701
|
-
/**
|
|
5702
|
-
* exportSelectionData 的返回:只带上 parts 选中的那几份(选通道 / 线路时 parallelGroups 会自动在内),
|
|
5703
|
-
* 每份与同名的分项导出同一口径 —— points 是 station_data 那一套、lines 是 line_data、
|
|
5704
|
-
* channels 是 channel_data、parallelGroups 是 parallel_groups,直接回写业务表。
|
|
5705
|
-
*/
|
|
5706
|
-
export interface GisViewExportSelectionDataResult extends GisViewExportMeta {
|
|
5707
|
-
/** ok 为 false 时说明原因(没有选中的节点 / 没找到要导出的节点) */
|
|
5708
|
-
reason: string | null
|
|
5709
|
-
points?: GisViewStationRecord[]
|
|
5710
|
-
lines?: GisViewLineRecord[]
|
|
5711
|
-
channels?: GisViewChannelRecord[]
|
|
5712
|
-
parallelGroups?: GisViewParallelGroup[]
|
|
5713
|
-
/** 这次带了哪几份(view 口径的键名,含自动补上的 parallelGroups) */
|
|
5714
|
-
parts: Array<'points' | 'lines' | 'channels' | 'parallelGroups'>
|
|
5715
|
-
counts: { points: number; lines: number; channels: number; parallelGroups: number }
|
|
5716
|
-
/** 导出用的节点 / 线路 / 通道下标(升序,可以直接交给别的接口继续用) */
|
|
5717
|
-
pointIndexes: number[]
|
|
5718
|
-
lineIndexes: number[]
|
|
5719
|
-
channelIndexes: number[]
|
|
5720
|
-
}
|
|
5721
|
-
|
|
5722
6464
|
/** 定位一条线路 / 一条通道 / 一个分组:与 GisViewPointRef 同一种写法(id、下标或 `{ id }` / `{ index }`) */
|
|
5723
6465
|
export type GisViewFeatureRef = string | number | { id: string | number } | { index: number }
|
|
5724
6466
|
|
|
@@ -5852,68 +6594,21 @@ export interface GisViewChannelRecord {
|
|
|
5852
6594
|
[key: string]: unknown
|
|
5853
6595
|
}
|
|
5854
6596
|
|
|
5855
|
-
/**
|
|
5856
|
-
export
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
/** 要不要带 show_station_list / show_station_data(站内母线清单,new.json 里就在节点表隔壁),缺省 true */
|
|
5860
|
-
showStation?: boolean
|
|
5861
|
-
/** new.json 的 tc_file_path / warning_msg 两列,缺省是空串 / 空数组,也可以走 extra 给 */
|
|
5862
|
-
tcFilePath?: string
|
|
5863
|
-
warningMsg?: unknown[]
|
|
5864
|
-
tc_file_path?: string
|
|
5865
|
-
warning_msg?: unknown[]
|
|
5866
|
-
}
|
|
6597
|
+
/** 内置的五档导出格式;自定义名字用 registerExportFormat 注册 */
|
|
6598
|
+
export type GisViewBuiltinExportFormat = 'view' | 'new' | 'test' | 'input' | 'full'
|
|
6599
|
+
/** exportData 认的格式名:内置五档,或注册过的自定义名字 */
|
|
6600
|
+
export type GisViewExportFormat = GisViewBuiltinExportFormat | (string & {})
|
|
5867
6601
|
|
|
5868
|
-
/**
|
|
5869
|
-
export
|
|
5870
|
-
station_data: GisViewStationRecord[]
|
|
5871
|
-
counts: { points: number }
|
|
5872
|
-
max_lat?: number | null
|
|
5873
|
-
min_lat?: number | null
|
|
5874
|
-
max_lon?: number | null
|
|
5875
|
-
min_lon?: number | null
|
|
5876
|
-
show_station_list?: unknown[]
|
|
5877
|
-
show_station_data?: unknown[][]
|
|
5878
|
-
tc_file_path?: string
|
|
5879
|
-
warning_msg?: unknown[]
|
|
5880
|
-
}
|
|
5881
|
-
|
|
5882
|
-
/** exportPointData 的返回:test.json 的 point_data */
|
|
5883
|
-
export interface GisViewExportPointDataResult extends GisViewExportMeta {
|
|
5884
|
-
point_data: GisViewPointRecord[]
|
|
5885
|
-
counts: { points: number }
|
|
5886
|
-
}
|
|
5887
|
-
|
|
5888
|
-
/** exportLineData 的返回:test.json 的 line_data */
|
|
5889
|
-
export interface GisViewExportLineDataResult extends GisViewExportMeta {
|
|
5890
|
-
line_data: GisViewLineRecord[]
|
|
5891
|
-
counts: { lines: number }
|
|
5892
|
-
}
|
|
5893
|
-
|
|
5894
|
-
/** exportChannelData 的返回:new.json 的 channel_data(counts.lines 是这些通道里回线的总数) */
|
|
5895
|
-
export interface GisViewExportChannelDataResult extends GisViewExportMeta {
|
|
5896
|
-
channel_data: GisViewChannelRecord[]
|
|
5897
|
-
counts: { channels: number; lines: number }
|
|
5898
|
-
}
|
|
6602
|
+
/** 导出范围:all 全量、viewport 当前视口、selection 当前选中集(exportData 的统一入口) */
|
|
6603
|
+
export type GisViewExportScope = 'all' | 'viewport' | 'selection'
|
|
5899
6604
|
|
|
5900
|
-
/**
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
* true:把当前所有通道分组(以及通道外带折线的线路)都列出来,声明里原本就写了拐点的也在
|
|
5905
|
-
*/
|
|
5906
|
-
all?: boolean
|
|
5907
|
-
}
|
|
5908
|
-
|
|
5909
|
-
/** exportParallelGroups 的返回:test.json 的 parallel_groups */
|
|
5910
|
-
export interface GisViewExportParallelGroupsResult extends GisViewExportMeta {
|
|
5911
|
-
parallel_groups: GisViewParallelGroup[]
|
|
5912
|
-
counts: { parallelGroups: number; waypoints: number }
|
|
5913
|
-
}
|
|
5914
|
-
|
|
5915
|
-
/** 导出数据的选项:format 决定要哪一套列名,points / lines / channels 三个筛选搭着用 */
|
|
6605
|
+
/**
|
|
6606
|
+
* 导出数据的选项:`scope` 决定导哪一块,`format` 决定要哪一套列名,
|
|
6607
|
+
* `parts` 决定要哪些分项,points / lines / channels 三个筛选搭着用。
|
|
6608
|
+
*/
|
|
5916
6609
|
export interface GisViewExportDataOptions extends GisViewExportFilterOptions {
|
|
6610
|
+
/** 导出范围,缺省 'all';selected / visible 之类的同义词在运行时也认 */
|
|
6611
|
+
scope?: GisViewExportScope
|
|
5917
6612
|
/**
|
|
5918
6613
|
* 要哪一套:'view'(缺省,节点 / 线路 / 通道 / 拐点分组四份,JS 风格的键名)/
|
|
5919
6614
|
* 'new'(new.json 口径的整份:station_data + channel_data + 四至范围那几列)/
|
|
@@ -5922,27 +6617,64 @@ export interface GisViewExportDataOptions extends GisViewExportFilterOptions {
|
|
|
5922
6617
|
* updateData + updateOptions 回显,是回灌 / 存档用的那一档)/
|
|
5923
6618
|
* 'full'(标准数据文档,见 GisViewDocument:format / version / points / lines / channels /
|
|
5924
6619
|
* labelStates / view / filter 八列,与 createGisView / importData 的整份入参是同一份写法,
|
|
5925
|
-
* 「导出 → 存下来 → 读回来 →
|
|
6620
|
+
* 「导出 → 存下来 → 读回来 → 再导出」逐字节相同);
|
|
6621
|
+
* 也可以是 registerExportFormat 注册过的自定义名字
|
|
5926
6622
|
*/
|
|
5927
|
-
format?:
|
|
6623
|
+
format?: GisViewExportFormat
|
|
5928
6624
|
/**
|
|
5929
6625
|
* 要哪几份(多选,见 GisViewExportPart):不写是四份都要(老行为),写了只出选中的那几份;
|
|
5930
6626
|
* 选了通道或线路会自动带上拐点。'new' 口径里线路折在 channel_data 里、'test' 口径里通道写在
|
|
5931
6627
|
* 回线的 channel_id 列上,这两种口径下「要线路 / 通道」会带上对应那一份
|
|
5932
6628
|
*/
|
|
5933
6629
|
parts?: GisViewExportPart | GisViewExportPart[]
|
|
5934
|
-
/** format 为 'view' / 'test'
|
|
6630
|
+
/** format 为 'view' / 'test' 时拐点分组要不要连没编辑过的分组一起列 */
|
|
5935
6631
|
all?: boolean
|
|
5936
6632
|
/** format 为 'new' 时 new.json 的 tc_file_path / warning_msg 两列 */
|
|
5937
6633
|
tcFilePath?: string
|
|
5938
6634
|
warningMsg?: unknown[]
|
|
6635
|
+
/** format 为 'new' 时要不要带四至范围(max_lat / min_lat / max_lon / min_lon),缺省带 */
|
|
6636
|
+
box?: boolean
|
|
6637
|
+
/** format 为 'new' 时要不要带 show_station_list / show_station_data,缺省带 */
|
|
6638
|
+
showStation?: boolean
|
|
6639
|
+
/** scope 为 'viewport' 时视口外扩的屏幕 CSS 像素,缺省 0 */
|
|
6640
|
+
margin?: number
|
|
6641
|
+
/** scope 为 'viewport' 时直接给一份世界矩形替掉当前视口 */
|
|
6642
|
+
rect?: GisViewBounds
|
|
6643
|
+
}
|
|
6644
|
+
|
|
6645
|
+
/**
|
|
6646
|
+
* 自定义导出器拿到的上下文:document 已经按标准文档做过深拷贝、坐标归一与 JSON 安全,
|
|
6647
|
+
* counts 与 documentCounts(document) 同一份;warnings 可以继续追加,exportData 会统一走 onWarning。
|
|
6648
|
+
* 返回值就是 exportData 的返回值,必须是同步的普通数据(不能返回 Promise)。
|
|
6649
|
+
*/
|
|
6650
|
+
export interface GisViewExportFormatContext {
|
|
6651
|
+
view: GisViewInstance
|
|
6652
|
+
document: GisViewDocument
|
|
6653
|
+
counts: GisViewDocumentCounts
|
|
6654
|
+
options: GisViewExportDataOptions & { format: string }
|
|
6655
|
+
parts: GisViewExportPart[]
|
|
6656
|
+
warnings: string[]
|
|
5939
6657
|
}
|
|
5940
6658
|
|
|
6659
|
+
/** 自定义导出器的函数签名;Result 由调用方按自己的 DTO 指定 */
|
|
6660
|
+
export type GisViewExportFormatAdapter<Result = unknown> = (context: GisViewExportFormatContext) => Result
|
|
6661
|
+
|
|
5941
6662
|
/**
|
|
5942
6663
|
* exportData 的返回:format 决定带上哪几组键(认键名就知道是哪一套)。
|
|
5943
6664
|
* counts 四份都有,warnings 是没找到的 id 这类提示
|
|
5944
6665
|
*/
|
|
5945
6666
|
export interface GisViewExportDataResult extends GisViewExportMeta {
|
|
6667
|
+
/** 这次实际用的导出范围 */
|
|
6668
|
+
scope?: GisViewExportScope
|
|
6669
|
+
/** scope 为 'selection' 时:成功为 null,没有可导出的节点时为原因 */
|
|
6670
|
+
reason?: string | null
|
|
6671
|
+
/** scope 为 'selection' 时导出的节点 / 线路 / 通道下标 */
|
|
6672
|
+
pointIndexes?: number[]
|
|
6673
|
+
lineIndexes?: number[]
|
|
6674
|
+
channelIndexes?: number[]
|
|
6675
|
+
/** scope 为 'viewport' 时这次筛用的世界矩形与屏幕像素外扩 */
|
|
6676
|
+
viewRect?: GisViewBounds
|
|
6677
|
+
margin?: number
|
|
5946
6678
|
/**
|
|
5947
6679
|
* format 为 'view'(缺省):节点 / 线路 / 通道(new.json 口径的业务记录);
|
|
5948
6680
|
* format 为 'input':与 createGisView 入参同构的当前数据副本(拖过的点、改过的拐点、
|
|
@@ -5979,28 +6711,6 @@ export interface GisViewExportDataResult extends GisViewExportMeta {
|
|
|
5979
6711
|
parts?: Array<'points' | 'lines' | 'channels' | 'parallelGroups'>
|
|
5980
6712
|
}
|
|
5981
6713
|
|
|
5982
|
-
/**
|
|
5983
|
-
* exportViewportData 的选项:与 exportData 同一套写法,范围改由视口决定 ——
|
|
5984
|
-
* points / lines / channels 这三个筛选这一档不认(写了也按视口来),要放宽 / 换范围用 margin / rect
|
|
5985
|
-
*/
|
|
5986
|
-
export interface GisViewExportViewportOptions extends GisViewExportDataOptions {
|
|
5987
|
-
/** 视口外再往外扩多少**屏幕 CSS 像素**:贴着边的一圈也带上(按当前 scale 换算),缺省 0 */
|
|
5988
|
-
margin?: number
|
|
5989
|
-
/** 直接给一份世界矩形替掉当前视口(写法同 getViewRect(),也认 listPoints / listLines 的 inView 那一份) */
|
|
5990
|
-
rect?: GisViewBounds
|
|
5991
|
-
}
|
|
5992
|
-
|
|
5993
|
-
/** 视口导出多带的读数:这次筛用的世界矩形与屏幕像素外扩 */
|
|
5994
|
-
export interface GisViewExportViewportMeta {
|
|
5995
|
-
/** 这次筛用的世界矩形(含 margin 换算过来的外扩) */
|
|
5996
|
-
viewRect: GisViewBounds
|
|
5997
|
-
/** 实际生效的屏幕像素外扩,缺省 0 */
|
|
5998
|
-
margin: number
|
|
5999
|
-
}
|
|
6000
|
-
|
|
6001
|
-
/** exportViewportData 的返回:exportData 那一份读数(format 决定带哪几组键)+ viewRect / margin 两条位置读数 */
|
|
6002
|
-
export interface GisViewExportViewportResult extends GisViewExportDataResult, GisViewExportViewportMeta {}
|
|
6003
|
-
|
|
6004
6714
|
|
|
6005
6715
|
/**
|
|
6006
6716
|
* 标准数据文档的一份视图落位:相机那一列(`view.camera`,导出时写全,读回来就在同一屏)。
|
|
@@ -6223,6 +6933,34 @@ export interface GisViewSceneRegion {
|
|
|
6223
6933
|
* 当前画面的矢量快照:屏幕坐标(CSS 像素)的纯数据,交给 buildSceneSvg 就是一份 SVG。
|
|
6224
6934
|
* 画序与 WebGL 那一帧一致:背景 → 底图 → 区域 → 网格 → 线 → 点 → 背景点 → 装饰 → 拐点 → 抬层的点 → 标签。
|
|
6225
6935
|
*/
|
|
6936
|
+
/** 矢量快照里的扩展图形(屏幕坐标;href 是图片地址 / Canvas 的 PNG data URL) */
|
|
6937
|
+
export interface GisViewSceneGraphic {
|
|
6938
|
+
id: string
|
|
6939
|
+
type: GisViewGraphicType
|
|
6940
|
+
x: number
|
|
6941
|
+
y: number
|
|
6942
|
+
left: number
|
|
6943
|
+
top: number
|
|
6944
|
+
width: number
|
|
6945
|
+
height: number
|
|
6946
|
+
anchor: [number, number]
|
|
6947
|
+
rotation: number
|
|
6948
|
+
scale: [number, number]
|
|
6949
|
+
opacity: number
|
|
6950
|
+
d: string
|
|
6951
|
+
viewBox: [number, number, number, number]
|
|
6952
|
+
fill: string
|
|
6953
|
+
stroke: string
|
|
6954
|
+
strokeWidth: number
|
|
6955
|
+
lineCap: string
|
|
6956
|
+
lineJoin: string
|
|
6957
|
+
lineDash: number[]
|
|
6958
|
+
dashOffset: number
|
|
6959
|
+
fillRule: string
|
|
6960
|
+
href: string | null
|
|
6961
|
+
preserveAspectRatio: string
|
|
6962
|
+
}
|
|
6963
|
+
|
|
6226
6964
|
export interface GisViewSceneSnapshot {
|
|
6227
6965
|
width: number
|
|
6228
6966
|
height: number
|
|
@@ -6233,6 +6971,7 @@ export interface GisViewSceneSnapshot {
|
|
|
6233
6971
|
/** 网格(关了网格或带了透明背景时为 null) */
|
|
6234
6972
|
grid: { d: string; color: string } | null
|
|
6235
6973
|
regions: GisViewSceneRegion[]
|
|
6974
|
+
/** 数据线路与节点装饰连接线(连接线也画在节点 / 装饰之前) */
|
|
6236
6975
|
lines: GisViewSceneLine[]
|
|
6237
6976
|
points: GisViewSceneNode[]
|
|
6238
6977
|
backgroundPoints: GisViewSceneNode[]
|
|
@@ -6240,6 +6979,8 @@ export interface GisViewSceneSnapshot {
|
|
|
6240
6979
|
waypoints: GisViewSceneNode[]
|
|
6241
6980
|
/** 选中 / 拖动中的节点(画在最上面) */
|
|
6242
6981
|
raised: GisViewSceneNode[]
|
|
6982
|
+
/** 扩展图形(画在标签之前;直接读 engine.snapshotScene 时没有这一列) */
|
|
6983
|
+
graphics?: GisViewSceneGraphic[]
|
|
6243
6984
|
labels: GisViewLabelBox[]
|
|
6244
6985
|
}
|
|
6245
6986
|
|
|
@@ -6256,6 +6997,22 @@ export interface GisViewInstance {
|
|
|
6256
6997
|
readonly el: HTMLElement
|
|
6257
6998
|
readonly canvas: HTMLCanvasElement
|
|
6258
6999
|
readonly gl: WebGL2RenderingContext | null
|
|
7000
|
+
/** 请求重画一帧:自定义 WebGL 层的数据源变了、组件自己不知道时调用 */
|
|
7001
|
+
requestRender(): GisViewInstance
|
|
7002
|
+
/**
|
|
7003
|
+
* 加一个 WebGL 自定义绘制层(同 id 覆盖):draw 在内置内容之后、最终画布上执行。
|
|
7004
|
+
* 返回卸载函数;层只影响画面,不参与拾取 / 场景解析 / 数据导出。
|
|
7005
|
+
* 同 id 后来被别的层覆盖时,旧卸载函数不会误删新层
|
|
7006
|
+
*/
|
|
7007
|
+
addWebGLLayer(layer: GisViewWebGLLayer): () => void
|
|
7008
|
+
/** 改一个 WebGL 层(order / enabled / draw),返回改后的读数;id 不存在时 null */
|
|
7009
|
+
updateWebGLLayer(id: string | number, patch: Partial<GisViewWebGLLayer>): GisViewWebGLLayer | null
|
|
7010
|
+
/** 删一个 WebGL 层,返回删掉的读数;id 不存在时 null */
|
|
7011
|
+
removeWebGLLayer(id: string | number): GisViewWebGLLayer | null
|
|
7012
|
+
/** 清空全部 WebGL 层,返回清掉的条数 */
|
|
7013
|
+
clearWebGLLayers(): number
|
|
7014
|
+
/** 当前 WebGL 层读数(按 order 排好) */
|
|
7015
|
+
getWebGLLayers(): GisViewWebGLLayer[]
|
|
6259
7016
|
updateOptions(options?: GisViewOptions, replace?: boolean): GisViewInstance
|
|
6260
7017
|
/**
|
|
6261
7018
|
* 改全局点样式的某几个字段(字段级合并,不写的保持原来那一份;传 null 清掉整份全局点样式):
|
|
@@ -6273,20 +7030,10 @@ export interface GisViewInstance {
|
|
|
6273
7030
|
* 第三个参数给 channels 时连通道一起换 —— 切场景(场站与通道整批变了)一次换完、只发一条数据变更。
|
|
6274
7031
|
* 也收单对象写法:`updateData({ points, lines, channels })` 只换给出的那几列 ——
|
|
6275
7032
|
* 接口返回的数据先在调用方映射成这三列(见 demo 里的做法),再整份喂进来。
|
|
7033
|
+
* 只换通道声明时写 `updateData({ channels })`(场站与回线数据不动)。
|
|
6276
7034
|
*/
|
|
6277
7035
|
updateData(points?: GisViewPoint[], lines?: GisViewLine[], channels?: GisViewChannel[]): GisViewInstance
|
|
6278
7036
|
updateData(payload: GisViewDocumentSource): GisViewInstance
|
|
6279
|
-
/**
|
|
6280
|
-
* 整份换通道声明(回线怎么分组、骨架拐点在哪):场站与回线数据一个都不动,引擎按新声明重排一遍。
|
|
6281
|
-
* 与 updateChannel 的分工:那一条是按 id 给某一条通道打补丁(定向),这一条是全换、点不出某一条;
|
|
6282
|
-
* 声明里的 `lineIds` 同样是通道成员的整表 —— 落地前逐条与 `groups` 调和(写了非空 `lineIds`
|
|
6283
|
-
* 就以它为准、`groups` 按它收窄;「只写 groups」的声明原样保留);
|
|
6284
|
-
* 声明里没写分组 id 时引擎按「单组用通道 id、多组 通道id::序号」补,并把补好的分组(含拐点路径)与对齐后的成员表
|
|
6285
|
-
* 写回数据副本;声明里认不出的成员 id、重名的分组 id 各报一句 warning,不静默
|
|
6286
|
-
*/
|
|
6287
|
-
updateChannels(channels?: GisViewChannel[]): GisViewInstance
|
|
6288
|
-
updatePoints(points?: GisViewPoint[]): GisViewInstance
|
|
6289
|
-
updateLines(lines?: GisViewLine[]): GisViewInstance
|
|
6290
7037
|
/**
|
|
6291
7038
|
* 整份喂回一份数据 / 一份标准文档(`exportData` 的五种格式都认,最标准的是 `format: 'full'` 那一份):
|
|
6292
7039
|
* 顶层出哪一列就应用哪一列,没出的列一个都不动 —— points / lines / channels / labelStates / view / filter
|
|
@@ -6372,6 +7119,20 @@ export interface GisViewInstance {
|
|
|
6372
7119
|
resetLabel(kind: GisViewLabelKind, ref: GisViewFeatureRef, labelId?: string): boolean
|
|
6373
7120
|
/** 恢复某一类(不写则两类都恢复)标签的默认:返回清掉几条状态 */
|
|
6374
7121
|
resetLabels(kind?: GisViewLabelKind): number
|
|
7122
|
+
/** 新增一个扩展图形(世界坐标上的 SVG 路径 / 图片 / Canvas):id 已存在时按更新覆盖 */
|
|
7123
|
+
addGraphic(graphic: GisViewGraphic): GisViewGraphic | null
|
|
7124
|
+
/** 批量新增扩展图形:返回实际加进去的读数数组 */
|
|
7125
|
+
addGraphics(graphics: GisViewGraphic | GisViewGraphic[]): GisViewGraphic[]
|
|
7126
|
+
/** 改一个扩展图形(patch 与创建写法一致):id 不存在时返回 null */
|
|
7127
|
+
updateGraphic(id: string | number, patch: Partial<GisViewGraphic>): GisViewGraphic | null
|
|
7128
|
+
/** 删一个扩展图形:返回删掉的读数;id 不存在时返回 null */
|
|
7129
|
+
removeGraphic(id: string | number): GisViewGraphic | null
|
|
7130
|
+
/** 清空全部扩展图形:返回清掉的条数 */
|
|
7131
|
+
clearGraphics(): number
|
|
7132
|
+
/** 读一个扩展图形(副本,没有时 null) */
|
|
7133
|
+
getGraphic(id: string | number): GisViewGraphic | null
|
|
7134
|
+
/** 现在有哪些扩展图形(按 zIndex、再按加入顺序) */
|
|
7135
|
+
getGraphics(): GisViewGraphic[]
|
|
6375
7136
|
updateBackground(background?: GisViewBackground): GisViewInstance
|
|
6376
7137
|
/**
|
|
6377
7138
|
* 把当前画面导出成图片(data URL):画布内容 + DOM 标签合成到一张 2D 画布上。
|
|
@@ -6386,46 +7147,18 @@ export interface GisViewInstance {
|
|
|
6386
7147
|
*/
|
|
6387
7148
|
exportSelection(options?: GisViewExportSelectionOptions): Promise<GisViewExportSelectionResult>
|
|
6388
7149
|
/**
|
|
6389
|
-
*
|
|
6390
|
-
*
|
|
6391
|
-
*
|
|
6392
|
-
*/
|
|
6393
|
-
exportSelectionData(options?: GisViewExportSelectionDataOptions): GisViewExportSelectionDataResult
|
|
6394
|
-
/**
|
|
6395
|
-
* 一次把数据按概念分好:节点 / 线路 / 通道 / 拐点分组四份互不混在一起,一次拿走(都是拷贝,改它不影响组件内部那一份)。
|
|
7150
|
+
* 统一导出入口:`scope` 决定导全量(all,缺省)/ 视口(viewport)/ 选中(selection),
|
|
7151
|
+
* `parts` 决定要场站 / 线路 / 通道 / 拐点里的哪几份,其余筛选与 format 照旧。
|
|
7152
|
+
* 一次把数据按概念分好:节点 / 线路 / 通道 / 拐点分组四份互不混在一起(都是拷贝,改它不影响组件内部那一份)。
|
|
6396
7153
|
* 缺省给 { points, lines, channels, parallelGroups };format: 'new' 给 new.json 口径的整份
|
|
6397
7154
|
* (station_data + channel_data + 四至范围那几列);format: 'test' 给 test.json 口径的整份
|
|
6398
7155
|
* (point_data + line_data + parallel_groups);format: 'full' 给一份标准数据文档(单独一条重载,
|
|
6399
|
-
* 返回 GisViewDocument 本身,八列齐全、没有 ok / counts / warnings
|
|
7156
|
+
* 返回 GisViewDocument 本身,八列齐全、没有 ok / counts / warnings 这些读数);
|
|
7157
|
+
* format 是 registerExportFormat 注册过的名字时,走自定义导出器,返回它的结果(可写泛型指定 DTO)
|
|
6400
7158
|
*/
|
|
6401
7159
|
exportData(options: GisViewExportDataOptions & { format: 'full' }): GisViewDocument
|
|
7160
|
+
exportData<Result = GisViewExportDataResult>(options: GisViewExportDataOptions & { format: string }): Result
|
|
6402
7161
|
exportData(options?: GisViewExportDataOptions): GisViewExportDataResult
|
|
6403
|
-
/**
|
|
6404
|
-
* 导出**视口内**的数据:节点 / 线路 / 通道先按当前可视范围(getViewRect())筛一遍再出 ——
|
|
6405
|
-
* 可见判定与图上画出来的那一份、与 listPoints / listLines 的 inView 完全一致(被筛选 / 隐藏、
|
|
6406
|
-
* 发散渲染还没铺到的不算);通道取「成员回线有一条在视口里」的那些,分组一起跟着走。
|
|
6407
|
-
* 其余参数与 exportData 同写(format / parts / labels / box…),margin 是屏幕 CSS 像素的外扩、
|
|
6408
|
-
* rect 可以直接给一份世界矩形;返回里多带 viewRect / margin 两条读数
|
|
6409
|
-
*/
|
|
6410
|
-
exportViewportData(options: GisViewExportViewportOptions & { format: 'full' }): GisViewDocument & GisViewExportViewportMeta
|
|
6411
|
-
exportViewportData(options?: GisViewExportViewportOptions): GisViewExportViewportResult
|
|
6412
|
-
/**
|
|
6413
|
-
* 导出节点数据(new.json 的 station_data 口径):id / 名称 / 电压 / 经纬度 + 站内母线那几列
|
|
6414
|
-
* (bus_name_list / bus_id_list / trafo_* / feedin_relation_*),其余业务列原样透传;
|
|
6415
|
-
* 一并给 new.json 顶上那几列:四至范围(box,缺省给)与 show_station_list / show_station_data
|
|
6416
|
-
*/
|
|
6417
|
-
exportStationData(options?: GisViewExportStationDataOptions): GisViewExportStationDataResult
|
|
6418
|
-
/** 导出节点数据(test.json 的 point_data 口径):同一份节点换一套列名(带 zone_id / zone_name) */
|
|
6419
|
-
exportPointData(options?: GisViewExportFilterOptions): GisViewExportPointDataResult
|
|
6420
|
-
/**
|
|
6421
|
-
* 导出线路数据(test.json 的 line_data 口径):通道回线带上 channel_id / channel_name /
|
|
6422
|
-
* parallel_group_id 与第几回,coords_list 是当下画出来的折线(含平行偏移)
|
|
6423
|
-
*/
|
|
6424
|
-
exportLineData(options?: GisViewExportFilterOptions): GisViewExportLineDataResult
|
|
6425
|
-
/** 导出通道数据(new.json 的 channel_data 口径):一条通道一行,回线在 line_data 里,整条通道的路由在 coords 里 */
|
|
6426
|
-
exportChannelData(options?: GisViewExportFilterOptions): GisViewExportChannelDataResult
|
|
6427
|
-
/** 导出拐点分组(test.json 的 parallel_groups 口径):与通道数据分开取,直接回写业务数据 */
|
|
6428
|
-
exportParallelGroups(options?: GisViewExportParallelGroupsOptions): GisViewExportParallelGroupsResult
|
|
6429
7162
|
/**
|
|
6430
7163
|
* 当前画面的矢量快照(屏幕坐标的线 / 点 / 标签 / 背景 / 网格):导出 SVG 或自拼别的矢量格式时用它。
|
|
6431
7164
|
* 与 WebGL 那一帧读同一份解析结果,所以颜色 / 线宽 / 线型与画面一致;引擎还没准备好时是 null
|
|
@@ -6471,11 +7204,6 @@ export interface GisViewInstance {
|
|
|
6471
7204
|
setMinimapZoom(zoom: number): GisViewInstance
|
|
6472
7205
|
/** 在当前倍数上再乘一个系数,origin 是鹰眼图内的 CSS 像素锚点,缺省取小图中心 */
|
|
6473
7206
|
zoomMinimapBy(factor: number, origin?: [number, number]): GisViewInstance
|
|
6474
|
-
/**
|
|
6475
|
-
* 换动画效果的整体配置(写法与 options.effects 一致,见 GisViewEffectsOptions):
|
|
6476
|
-
* 样式类快路径 —— 重解析要素、不重铺数据,逐要素的 effect 在这一次重解析里定下来。
|
|
6477
|
-
*/
|
|
6478
|
-
setEffects(effects: GisViewEffectsInput): GisViewInstance
|
|
6479
7207
|
/** 当前生效的动画效果配置(归一化之后的读数):没配的那一层是 null */
|
|
6480
7208
|
getEffects(): GisViewEffectsReadout
|
|
6481
7209
|
/**
|
|
@@ -6582,12 +7310,6 @@ export interface GisViewInstance {
|
|
|
6582
7310
|
* 「点了一条回线,想知道它属于哪条通道 / 哪一组」用它一句问清。
|
|
6583
7311
|
*/
|
|
6584
7312
|
getLineChannel(ref: GisViewFeatureRef): GisViewLineChannelInfo | null
|
|
6585
|
-
/**
|
|
6586
|
-
* 接口选中(换一份选中集):单选传 id,多选传数组,null / 空数组清空。
|
|
6587
|
-
* 写法与 selectFeatures 一致 —— 数组里可以混着写 id 与对象(见 GisViewSelectionRef),
|
|
6588
|
-
* options.mode 也给同一份('add' / 'toggle' / 'remove')
|
|
6589
|
-
*/
|
|
6590
|
-
select(refs: GisViewSelectionRefs, options?: GisViewSelectOptions): GisViewInstance
|
|
6591
7313
|
/**
|
|
6592
7314
|
* 让一批东西变成选中状态(接口选中):与点击选中走同一份 state,因此 getSelections / getSelectionData
|
|
6593
7315
|
* getSelectionData 立刻就能读回来。认这些写法(见 GisViewSelectionRef):
|
|
@@ -6602,7 +7324,7 @@ export interface GisViewInstance {
|
|
|
6602
7324
|
* 取消选中:写法与 selectFeatures 完全一样(节点 / 通道 / 线路,一批可以混着写),
|
|
6603
7325
|
* 把这些从当前选中集里去掉,其余选中原样留着 —— `deselect('p-1')` 取消一个节点、
|
|
6604
7326
|
* `deselect({ type: 'channel', channelId: 'channel-a' })` 取消整条通道的回线。
|
|
6605
|
-
* 一个目标都不给(不传 / 传 null)等于取消全部(与
|
|
7327
|
+
* 一个目标都不给(不传 / 传 null)等于取消全部(与 selectFeatures(null) 同一件事),
|
|
6606
7328
|
* 传空数组是「没有目标」,什么都不做;认不出来的条目跳过
|
|
6607
7329
|
*/
|
|
6608
7330
|
deselect(refs?: GisViewSelectionRefs): GisViewInstance
|
|
@@ -6619,7 +7341,7 @@ export interface GisViewInstance {
|
|
|
6619
7341
|
* 当前画布上选中的数据(一次取全):ids / count 与各类型条数(通道回线按通道算一个)、
|
|
6620
7342
|
* 要素本身 points / lines / channels 三个数组、下标清单 pointIndexes / lineIndexes、
|
|
6621
7343
|
* items(与 getSelections() 同一份)与世界包围盒 bounds(空选中时 null)。
|
|
6622
|
-
* 单击、Ctrl 多选、框选与接口选中(
|
|
7344
|
+
* 单击、Ctrl 多选、框选与接口选中(selectFeatures / selectInBox)都是同一份 state,不挑选中来源;
|
|
6623
7345
|
* bounds 走一次 getElementBounds(十万级选中下约 5 ms),只想问「选了哪几个」用 getSelections() 更省
|
|
6624
7346
|
*/
|
|
6625
7347
|
getSelectionData(): GisViewSelectionData
|
|
@@ -6674,6 +7396,14 @@ export interface GisViewInstance {
|
|
|
6674
7396
|
* 并不了返回 ok: false 并另发一条 `phase: 'merge', ok: false` 的事件
|
|
6675
7397
|
*/
|
|
6676
7398
|
mergePoints(source: GisViewPointRef, target: GisViewPointRef, options?: { originalEvent?: Event | null; item?: GisViewPoint }): GisViewMergeOutcome
|
|
7399
|
+
/**
|
|
7400
|
+
* 把一个节点拆成多份(mergePoints 的逆操作):第一份复用原下标与 id,其余追加到 points 末尾。
|
|
7401
|
+
* 每份可直接写节点字段或放进 item;lines 分配线路(不写时连在原节点上的线路跟第一份),
|
|
7402
|
+
* channels / channelFrom / channelTo 分配受影响通道的端点。没显式分配的通道跟随它第一条被分配过的成员线路。
|
|
7403
|
+
* 拆分后自环 / 零长度线路与两端相同的通道删掉;整次调用只记一条历史、只发一条 `splitPoint` 数据变更。
|
|
7404
|
+
* 返回 `{ ok, items, indexes, pointIds, linesChanged, removedLines, channelsChanged, removedChannels, changes, skipped }`
|
|
7405
|
+
*/
|
|
7406
|
+
splitPoint(source: GisViewPointRef, parts: GisViewSplitPointPart[], options?: GisViewSplitPointOptions): GisViewSplitPointOutcome
|
|
6677
7407
|
/**
|
|
6678
7408
|
* 框选 / 多选之后一步把选中的节点并到一个目标上(接口调用):不指定 target 就自动挑「绑定线路最多」的那一个
|
|
6679
7409
|
* (一样多取画得大的、再一样取下标小的);来源默认是除目标之外的选中节点,也可以直接用 options.sources 给定,
|
|
@@ -6689,10 +7419,6 @@ export interface GisViewInstance {
|
|
|
6689
7419
|
* 可以改、也可以 cancel()),组件随后把数据并起来;false 让拖动的节点与跟随它的线路回原位(两站都能取消)
|
|
6690
7420
|
*/
|
|
6691
7421
|
resolvePointMerge(confirmed?: boolean, options?: GisViewPointMergeConfirmOptions): GisViewPointMergePayload | null
|
|
6692
|
-
/** 确认待确认的合并(resolvePointMerge(true) 的别名):可指定保留来源 / 目标并改写最终节点 */
|
|
6693
|
-
confirmPointMerge(options?: GisViewPointMergeConfirmOptions): GisViewPointMergePayload | null
|
|
6694
|
-
/** 取消待确认的合并(resolvePointMerge(false) 的别名):拖动的节点回原位,数据不动 */
|
|
6695
|
-
cancelPointMerge(): GisViewPointMergePayload | null
|
|
6696
7422
|
/** 合并落地之后收掉引擎里的合并状态(mergePoints 已经调过,自己接界面时用得到) */
|
|
6697
7423
|
commitPointMerge(): boolean
|
|
6698
7424
|
/** 合并并不了:把拖动的节点还原回原位并收掉状态(silent 为 true 时不补发 cancel 载荷) */
|
|
@@ -6814,6 +7540,8 @@ export interface GisViewInstance {
|
|
|
6814
7540
|
beginAddChannel(options?: GisViewChannelDraftOptions): GisViewInstance
|
|
6815
7541
|
/** 当前新增通道草稿:两个节点的信息与可选方案,没有草稿时为 null */
|
|
6816
7542
|
getAddChannelDraft(): GisViewChannelDraftPayload | null
|
|
7543
|
+
/** 改当前草稿的预览样式(字段级合并,传 null 回到全局 channelDraftStyle);没有草稿时什么也不做 */
|
|
7544
|
+
updateAddChannelStyle(patch?: GisViewChannelDraftStyle | null): GisViewInstance
|
|
6817
7545
|
/** 开下一段草稿:连续模式落地时内部自动调用,也可以手动调(没有草稿就按 options 重新进来) */
|
|
6818
7546
|
continueAddChannel(options?: GisViewChannelDraftOptions): GisViewInstance
|
|
6819
7547
|
/** 取消新增通道(草稿期间按 Esc 等价;会补一条 phase: 'cancel') */
|
|
@@ -6902,7 +7630,7 @@ export interface GisViewInstance {
|
|
|
6902
7630
|
* (id / index 之外的字段就是这一条的补丁),或者 `patchPoints(['a', 'b'], { status: 1 })`
|
|
6903
7631
|
* 把同一份补丁盖到一批节点上。认不出来的记进 skipped,不影响其余条目;
|
|
6904
7632
|
* 返回 `{ ok, indexes, items, count, skipped }`,只记一条历史、只发一条 updatePoints 数据变更。
|
|
6905
|
-
* 与
|
|
7633
|
+
* 与 `updateData({ points })` 的分工:那一条是整份替换节点数据,这里只动点到的这几条
|
|
6906
7634
|
*/
|
|
6907
7635
|
patchPoints(entries: GisViewUpdateItemEntry<GisViewPoint> | Array<GisViewUpdateItemEntry<GisViewPoint>>, patch?: Partial<GisViewPoint>): GisViewUpdateItemsOutcome<GisViewPoint>
|
|
6908
7636
|
/**
|
|
@@ -6912,11 +7640,11 @@ export interface GisViewInstance {
|
|
|
6912
7640
|
*/
|
|
6913
7641
|
patchLines(entries: GisViewUpdateItemEntry<GisViewLine> | Array<GisViewUpdateItemEntry<GisViewLine>>, patch?: Partial<GisViewLine>): GisViewUpdateItemsOutcome<GisViewLine>
|
|
6914
7642
|
/**
|
|
6915
|
-
* 改某个通道的数据(分组、宽度、端点等)并重渲染(与整份换声明的
|
|
7643
|
+
* 改某个通道的数据(分组、宽度、端点等)并重渲染(与整份换声明的 `updateData({ channels })` 一对):
|
|
6916
7644
|
* 成员表没变时只把成员回线换成新几何,成员表换了(改 lineIds)整份重解析。
|
|
6917
7645
|
* 补丁里的 lineIds 是通道成员的整表 —— 增删线路就是改它:写回声明前与 groups 调和
|
|
6918
7646
|
* (不在表里的成员从各组剔掉、空组去掉,表里没落进组的成员补进第一组,组剔完回「整条通道一组」);
|
|
6919
|
-
* 建视图 /
|
|
7647
|
+
* 建视图 / updateOptions / updateData / importData 这些整份提交的入口逐条同一份口径;
|
|
6920
7648
|
* 补丁里写 groups / lineIds 时写完把引擎那边的最终声明(分组 id、拐点路径)写回数据副本、
|
|
6921
7649
|
* 成员表对齐到各组(拆分 / 挪组之后 lineIds 仍覆盖得上),
|
|
6922
7650
|
* 并补一条 channelGroups 变更(与 splitChannelGroups / mergeChannelGroups 同一份口径),
|
|
@@ -6936,24 +7664,10 @@ export interface GisViewInstance {
|
|
|
6936
7664
|
* 不属于这条通道的条目跳过并报一句 warning(同一个条目只提醒一次)
|
|
6937
7665
|
*/
|
|
6938
7666
|
updateChannel(id: string | number, patch: Partial<GisViewChannel>, linePatches?: GisViewChannelLinePatch | GisViewChannelLinePatch[], lineIds?: string | number | Array<string | number>): GisViewInstance
|
|
6939
|
-
/**
|
|
6940
|
-
* 逐要素的细粒度改法:一个方法只改一样东西,改完就走 updatePoint / updateLine / updateChannel
|
|
6941
|
-
* 的定向更新那条路(只重排受影响的一小片、只发一条数据变更、只落一步历史)。
|
|
6942
|
-
* 要素没找到时不抛错:发一条 warning(同一个 id 只提醒一次)并原样返回,链式调用不断。
|
|
6943
|
-
*/
|
|
6944
|
-
/** 只改一个节点的屏幕大小(CSS 像素,再乘 pointSizeScale 与缩放档位) */
|
|
6945
|
-
setPointSize(id: string | number, size: number): GisViewInstance
|
|
6946
|
-
/** 只换一个节点的图标(内置形状 / 图片 / 自定义 SVG):传 null 清掉逐点符号,回落到规则与 pointStyle */
|
|
6947
|
-
setPointSymbol(id: string | number, symbol: GisViewSymbolInput | null): GisViewInstance
|
|
6948
|
-
/** 只改一个节点的填充色(悬停 / 选中样式与热力图仍然压过它) */
|
|
6949
|
-
setPointColor(id: string | number, color: string): GisViewInstance
|
|
7667
|
+
/** 逐要素的复合改法:同时处理多种字段、通道分组或成员回线时用这些入口;单项字段直接用 updatePoint / updateLine / updateChannel */
|
|
6950
7668
|
/** 挪一个节点:`movePoint('n1', { x, y })` / `movePoint('n1', [x, y])` / `movePoint('n1', x, y)` 都认,绑定线路与锚定通道跟着重排 */
|
|
6951
7669
|
movePoint(id: string | number, coordinate: GisViewCoordinate): GisViewInstance
|
|
6952
7670
|
movePoint(id: string | number, x: number, y: number): GisViewInstance
|
|
6953
|
-
/** 只改一条线路的线宽(CSS 像素,再乘 lineWidthScale) */
|
|
6954
|
-
setLineWidth(id: string | number, width: number): GisViewInstance
|
|
6955
|
-
/** 只改一条线路的颜色 */
|
|
6956
|
-
setLineColor(id: string | number, color: string): GisViewInstance
|
|
6957
7671
|
/** 整份换一条线路的拐点:只写中间拐点、不含首尾两端(单个坐标 = 只留一个拐点,空数组 = 拉直),两端按节点 / start / end 补齐;通道里的回线改的是它所在分组的骨架 */
|
|
6958
7672
|
setLineWaypoints(id: string | number, coordinates: GisViewCoordinate | GisViewCoordinate[]): GisViewInstance
|
|
6959
7673
|
/** 一条线路上挂着的装饰(图片 / SVG 标记)清单:要素没找到时给空数组,给的是副本 */
|
|
@@ -6966,20 +7680,32 @@ export interface GisViewInstance {
|
|
|
6966
7680
|
updateLineDecoration(id: string | number, decorationIndex: number, patch: Partial<GisViewLineDecoration>): GisViewLineDecoration | null
|
|
6967
7681
|
/** 摘掉一条线路上的某一个装饰(剩下的保持原顺序):返回被摘掉的那一条,没找到返回 null */
|
|
6968
7682
|
removeLineDecoration(id: string | number, decorationIndex: number): GisViewLineDecoration | null
|
|
6969
|
-
/**
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
/**
|
|
6976
|
-
|
|
6977
|
-
/**
|
|
6978
|
-
|
|
6979
|
-
/**
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
7683
|
+
/** 一个节点上挂着的装饰清单:节点没找到时给空数组,给的是副本 */
|
|
7684
|
+
getPointDecorations(id: string | number): GisViewPointDecoration[]
|
|
7685
|
+
/** 整份换一个节点的装饰清单(空数组 = 全摘掉),写法与 points[].decorations 一致 */
|
|
7686
|
+
setPointDecorations(id: string | number, decorations: GisViewPointDecoration[]): GisViewInstance
|
|
7687
|
+
/** 给一个节点加一个装饰(追加在末尾):返回加进去的那一条,节点没找到 / 写法不对时返回 null */
|
|
7688
|
+
addPointDecoration(id: string | number, decoration: GisViewPointDecoration): GisViewPointDecoration | null
|
|
7689
|
+
/** 改一个节点上的某一个装饰(按 decorations 的顺序数,只合并这一条的字段):返回改完的那一条,没找到返回 null */
|
|
7690
|
+
updatePointDecoration(id: string | number, decorationIndex: number, patch: Partial<GisViewPointDecoration>): GisViewPointDecoration | null
|
|
7691
|
+
/** 摘掉一个节点上的某一个装饰(剩下的保持原顺序):返回被摘掉的那一条,没找到返回 null */
|
|
7692
|
+
removePointDecoration(id: string | number, decorationIndex: number): GisViewPointDecoration | null
|
|
7693
|
+
/**
|
|
7694
|
+
* 动态装饰器模式:`target` 决定命中线路 / 节点 / 两类同时;开启后鼠标移到目标附近出现临时图标,
|
|
7695
|
+
* 移出目标立即消失;左键松开仍命中才发 `decorationDraft` 的 ready(空白处 / 不允许的目标不发)。
|
|
7696
|
+
* 临时图标不写数据:确认调 `commitDecorationDraft`(整批一次 dataChange + 一条历史),取消调 `cancelDecorationDraft`。
|
|
7697
|
+
* 线路:`parallel` 决定是否跟着切向转,`scope` 取 'line' / 'group' / 'channel' 决定挂到哪些线路。
|
|
7698
|
+
* 节点:`placement` 取 offset / fixed / pointer,`connector` 决定是否从节点中心画连接线。
|
|
7699
|
+
*/
|
|
7700
|
+
beginDecorationDraft(options?: GisViewDecorationDraftOptions): GisViewDecorationDraftPayload | null
|
|
7701
|
+
/** 当前草稿读数(与 onDecorationDraft 同一份;没有草稿时 null) */
|
|
7702
|
+
getDecorationDraft(): GisViewDecorationDraftPayload | null
|
|
7703
|
+
/** 改草稿的图标 / 大小 / 方向 / 作用域:命中中的预览与后续提交都用新值 */
|
|
7704
|
+
updateDecorationDraft(patch?: Partial<GisViewDecorationDraftOptions>): GisViewDecorationDraftPayload | null
|
|
7705
|
+
/** 把当前假装饰转成真实数据:逐条追加 decorations,整批一次 dataChange、一条历史 */
|
|
7706
|
+
commitDecorationDraft(overrides?: Partial<GisViewDecorationDraftOptions> & { position?: number }): GisViewDecorationCommitResult
|
|
7707
|
+
/** 取消当前假装饰(Esc 等价):只清预览并发 cancel,数据一个字节都不动 */
|
|
7708
|
+
cancelDecorationDraft(options?: { originalEvent?: Event | null }): GisViewDecorationDraftPayload | null
|
|
6983
7709
|
/** 只改一条通道的回线线宽:成员回线与通道声明一起改(一次 batch,只发一条数据变更、只落一步历史) */
|
|
6984
7710
|
setChannelLineWidth(id: string | number, lineWidth: number): GisViewInstance
|
|
6985
7711
|
/** 整份换一条通道的逐回线颜色:成员回线与通道声明一起改,颜色不够时按顺序循环取,只给一个就整条通道一个色 */
|
|
@@ -6991,7 +7717,6 @@ export interface GisViewInstance {
|
|
|
6991
7717
|
* 完整格式 `{ points, lines, cascade, worker }`;只筛节点时可以简写成节点条件本身。
|
|
6992
7718
|
*/
|
|
6993
7719
|
setFilter(filter: GisViewFilterInput | null): GisViewInstance
|
|
6994
|
-
clearFilter(): GisViewInstance
|
|
6995
7720
|
/** 当前筛选条件(简写已经归一成 `{ points: 条件 }`),没设过返回 null */
|
|
6996
7721
|
getFilter(): GisViewFilter | null
|
|
6997
7722
|
/** 最近一次筛选结果:Worker 计算时在结果回来之后才会有值 */
|
|
@@ -7001,7 +7726,7 @@ export interface GisViewInstance {
|
|
|
7001
7726
|
/**
|
|
7002
7727
|
* 相对上一次对账,位置变过的节点(拖动 / updatePoint / patchPoints / 撤销都算):按 id 去重,
|
|
7003
7728
|
* 返回 `{ index, id, x, y, item }` 的数组。被删掉的节点不在返回里(账本顺手清掉),
|
|
7004
|
-
* 整份换数据(updateData /
|
|
7729
|
+
* 整份换数据(updateData / updateOptions 里换 points)之后以新数据为基准。
|
|
7005
7730
|
*/
|
|
7006
7731
|
getMovedPoints(): GisViewMovedPoint[]
|
|
7007
7732
|
/**
|
|
@@ -7009,6 +7734,40 @@ export interface GisViewInstance {
|
|
|
7009
7734
|
* (写法与 removePoints 一致:id / 下标 / { id } / { index });空数组无操作,返回实例本身。
|
|
7010
7735
|
*/
|
|
7011
7736
|
clearMovedPoints(refs?: GisViewFeatureRef | GisViewFeatureRef[]): GisViewInstance
|
|
7737
|
+
/**
|
|
7738
|
+
* 相对上一次对账,成员 / 分组 / 拐点 / 端点 / 可见性或其余声明字段变过的通道。
|
|
7739
|
+
* 新加通道只补账不报变化,删掉的通道从账本清掉;整份换通道数据(updateData / updateOptions / applyChannels)
|
|
7740
|
+
* 之后以新数据为基准。返回项带 groups / 各 changed 标记 / fields / reasons。
|
|
7741
|
+
* options.reasons 只返回指定原因;options.ignoreGroups 忽略分组增删,只比较已有分组的拐点。
|
|
7742
|
+
*/
|
|
7743
|
+
getChangedChannels(options?: GisViewChangedChannelOptions): GisViewChangedChannel[]
|
|
7744
|
+
/**
|
|
7745
|
+
* 通道变化对账:不传 / 传 null 全部对账,传一个或一批引用只对账这些(写法与 removePoints 一致);
|
|
7746
|
+
* 返回实例本身,认不出来的引用跳过并报一句提醒。
|
|
7747
|
+
*/
|
|
7748
|
+
clearChangedChannels(refs?: GisViewFeatureRef | GisViewFeatureRef[]): GisViewInstance
|
|
7749
|
+
/**
|
|
7750
|
+
* 相对上一次对账,path / start / end、from / to、可见性或其余声明字段变过的线路。
|
|
7751
|
+
* 新加线路只补账不报变化,删掉的线路从账本同步清掉;整份换线路后以新数据为基准。
|
|
7752
|
+
* 通道里的回线只比较自己的声明;通道骨架变化由 getChangedChannels 负责。
|
|
7753
|
+
* options.reasons 只返回指定原因。
|
|
7754
|
+
*/
|
|
7755
|
+
getChangedLines(options?: GisViewChangedLineOptions): GisViewChangedLine[]
|
|
7756
|
+
/**
|
|
7757
|
+
* 线路变化对账:不传 / 传 null 全部对账,传一个或一批引用只对账这些(写法与 removePoints 一致);
|
|
7758
|
+
* 返回实例本身,认不出来的引用跳过并报一句提醒。
|
|
7759
|
+
*/
|
|
7760
|
+
clearChangedLines(refs?: GisViewFeatureRef | GisViewFeatureRef[]): GisViewInstance
|
|
7761
|
+
/**
|
|
7762
|
+
* 统一隐藏 / 显示节点、线路或通道:只改数据里的 visible,不删要素,分组 / 拐点 / 编辑状态都保留。
|
|
7763
|
+
* refs 收单个或一批(id / 下标 / { id } / { index }),也认 'selection';整次调用一条历史、一条 batch 数据变更。
|
|
7764
|
+
* 返回 `{ ok, kind, visible, indexes, ids, items, skipped }`
|
|
7765
|
+
*/
|
|
7766
|
+
setFeatureVisible(kind: GisViewVisibilityKind, refs: GisViewVisibilityRefs, visible: boolean): GisViewSetVisibilityOutcome
|
|
7767
|
+
/** `setFeatureVisible(kind, refs, false)` 的快捷写法 */
|
|
7768
|
+
hideFeatures(kind: GisViewVisibilityKind, refs: GisViewVisibilityRefs): GisViewSetVisibilityOutcome
|
|
7769
|
+
/** `setFeatureVisible(kind, refs, true)` 的快捷写法(隐藏后原样恢复) */
|
|
7770
|
+
showFeatures(kind: GisViewVisibilityKind, refs: GisViewVisibilityRefs): GisViewSetVisibilityOutcome
|
|
7012
7771
|
/**
|
|
7013
7772
|
* 某个下标的节点当前在不在图上:被筛选 / visible: false 隐藏掉的不算,
|
|
7014
7773
|
* 初始化发散渲染还没排到的那一部分也不算。
|
|
@@ -7067,14 +7826,12 @@ export interface GisViewInstance {
|
|
|
7067
7826
|
nearestLineAt(x: number, y: number, options?: GisViewNearestLineOptions): GisViewNearestLine | null
|
|
7068
7827
|
/**
|
|
7069
7828
|
* 拖拽落点预览:拖拽期间就把「松手之后会长成什么」按规则画到地图上,返回解析后的读数
|
|
7070
|
-
* (图标尺寸 / 颜色 / 符号、线宽…);传 null
|
|
7829
|
+
* (图标尺寸 / 颜色 / 符号、线宽…);传 null 清掉。
|
|
7071
7830
|
* 预览与落地走同一条样式链、同一个符号 store,因此读数里的 size 与落地后 getPointStyle() 一个是同一个数
|
|
7072
7831
|
*/
|
|
7073
7832
|
setDropPreview(preview: GisViewDropPreviewInput | null): GisViewDropPreview | null
|
|
7074
7833
|
/** 当前落点预览的读数(没有预览时 null) */
|
|
7075
7834
|
getDropPreview(): GisViewDropPreview | null
|
|
7076
|
-
/** 清掉落点预览:与 setDropPreview(null) 同一条路 */
|
|
7077
|
-
clearDropPreview(): GisViewInstance
|
|
7078
7835
|
/* 事件订阅 / 功能开关 / 历史:自建界面直接接的三个入口 */
|
|
7079
7836
|
/**
|
|
7080
7837
|
* 订阅事件(与 options 里的回调同一条,同一个事件可以挂多条):返回取消订阅的函数。
|
|
@@ -7175,6 +7932,8 @@ export interface GisViewEngineOptions {
|
|
|
7175
7932
|
channelGroupMaxLines?: number
|
|
7176
7933
|
/** 新增通道草稿线的样式(跟随光标的那条预览线) */
|
|
7177
7934
|
channelDraftStyle?: GisViewChannelDraftStyle
|
|
7935
|
+
/** WebGL 自定义层:与 GisViewOptions.webglLayers 同一份写法 */
|
|
7936
|
+
webglLayers?: GisViewWebGLLayer[]
|
|
7178
7937
|
background?: GisViewBackground
|
|
7179
7938
|
pointStyle?: GisViewPointStyle
|
|
7180
7939
|
lineStyle?: GisViewLineStyle
|
|
@@ -7267,12 +8026,14 @@ export interface GisViewEngineOptions {
|
|
|
7267
8026
|
* 切换走 setOptions / updateOptions 不用重排场景
|
|
7268
8027
|
*/
|
|
7269
8028
|
channelSelectMode?: GisViewChannelSelectMode
|
|
8029
|
+
/** 分组拐点拖动模式:'parallel'(缺省)/ 'vertex',见 GisViewOptions.channelWaypointDragMode */
|
|
8030
|
+
channelWaypointDragMode?: GisViewChannelWaypointDragMode
|
|
7270
8031
|
|
|
7271
8032
|
/** 快捷键:动作 -> 写法(框选、多选、加点、复制、粘贴、取消、删除、适应视图),没写的沿用默认值 */
|
|
7272
8033
|
shortcuts?: GisViewShortcuts
|
|
7273
8034
|
/** 复制节点的配置(**缺省关**:写了才算开):开关、落点偏移、id 生成与数据定制 */
|
|
7274
8035
|
copy?: GisViewCopyOptions
|
|
7275
|
-
/**
|
|
8036
|
+
/** 合并节点的配置(**缺省关**:写了才算开):开关、触发时机、像素容差、确认方式与数据合并规则 */
|
|
7276
8037
|
merge?: GisViewMergeOptions
|
|
7277
8038
|
/** 是否允许编辑拐点,**缺省关** */
|
|
7278
8039
|
waypointEditable?: boolean
|
|
@@ -7316,6 +8077,8 @@ export interface GisViewEngineOptions {
|
|
|
7316
8077
|
onChannelDraft?: (payload: GisViewChannelDraftPayload) => void
|
|
7317
8078
|
/** 草稿里每点一次发一条:step 1 拿到起点、step 2 拿到终点(线路结束) */
|
|
7318
8079
|
onChannelDraftClick?: (payload: GisViewChannelDraftPayload) => void
|
|
8080
|
+
/** 动态装饰器草稿:鼠标在线路上跟随 / 移出 / 松手 ready,以及 update / commit / cancel */
|
|
8081
|
+
onDecorationDraft?: (payload: GisViewDecorationDraftPayload) => void
|
|
7319
8082
|
/** 分组变化:拆分 / 合并 / 挪线 / 新建组 / 整份声明换(updateChannel) */
|
|
7320
8083
|
onChannelGroupChange?: (payload: GisViewChannelGroupChangePayload) => void
|
|
7321
8084
|
onStats?: (stats: GisViewEngineStats) => void
|
|
@@ -7370,6 +8133,8 @@ export interface GisViewEngine {
|
|
|
7370
8133
|
getParallelGroups(): GisViewParallelGroup[]
|
|
7371
8134
|
/** 通道运行时状态:骨架、回线偏移与每条回线的折线 */
|
|
7372
8135
|
getChannels(): GisViewChannelInfo[]
|
|
8136
|
+
/** 单条通道运行时状态:只复制这一组;channelId 找不到时可按 channels 下标兜底 */
|
|
8137
|
+
getChannel(channelId?: string | number | null, channelIndex?: number): GisViewChannelInfo | null
|
|
7373
8138
|
/** 通道成员表:成员回线下标与各自的横向偏移,不复制几何(自建覆盖层按通道分流绘制用它) */
|
|
7374
8139
|
getChannelMembers(): GisViewChannelMembers[]
|
|
7375
8140
|
/** 通道分组现状:不传 channelId 返回所有分组 */
|
|
@@ -7413,6 +8178,8 @@ export interface GisViewEngine {
|
|
|
7413
8178
|
chain?: boolean
|
|
7414
8179
|
kind?: 'channel' | 'line'
|
|
7415
8180
|
circuits?: number
|
|
8181
|
+
/** 换这一段草稿的预览样式(字段级合并;null 回到全局 channelDraftStyle,不传就沿用) */
|
|
8182
|
+
channelDraftStyle?: GisViewChannelDraftStyle | null
|
|
7416
8183
|
/** 换一份逐条回线的属性(不传就沿用这一段草稿原来的) */
|
|
7417
8184
|
linePropsByMember?: Array<Partial<GisViewLine> | undefined>
|
|
7418
8185
|
/** 换这一段草稿的交接模式(不传就沿用) */
|
|
@@ -7425,6 +8192,12 @@ export interface GisViewEngine {
|
|
|
7425
8192
|
cancelChannelDraft(options?: { silent?: boolean }): GisViewChannelDraftPayload | null
|
|
7426
8193
|
/** 静默收掉草稿:提交之后调用,不发取消事件 */
|
|
7427
8194
|
clearChannelDraft(): void
|
|
8195
|
+
/** 动态装饰器草稿:开启 / 改选项 / 取读数 / 交出当前结果(不写数据)/ 取消 */
|
|
8196
|
+
beginDecorationDraft(options?: GisViewDecorationDraftOptions): GisViewDecorationDraftPayload | null
|
|
8197
|
+
getDecorationDraft(): GisViewDecorationDraftPayload | null
|
|
8198
|
+
updateDecorationDraft(patch?: Partial<GisViewDecorationDraftOptions>): GisViewDecorationDraftPayload | null
|
|
8199
|
+
takeDecorationDraft(overrides?: Partial<GisViewDecorationDraftOptions> & { position?: number }): GisViewDecorationDraftPayload | null
|
|
8200
|
+
cancelDecorationDraft(options?: { originalEvent?: Event | null }): GisViewDecorationDraftPayload | null
|
|
7428
8201
|
/** 单个节点的定向更新:只重解析这一个节点,绑定线 / 锚定通道跟着重排;结构变了返回 true(调用方此时看得到整份重排) */
|
|
7429
8202
|
updatePoint(index: number, item: GisViewPoint): boolean
|
|
7430
8203
|
/** 单条线路的定向更新:只重排这一条;身份 / 绑定变了时整份重排并返回 true */
|
|
@@ -7503,7 +8276,7 @@ export interface GisViewEngine {
|
|
|
7503
8276
|
*/
|
|
7504
8277
|
snapshotScene(options?: GisViewSceneSnapshotOptions): GisViewSceneSnapshot
|
|
7505
8278
|
getStats(): GisViewEngineStats
|
|
7506
|
-
/** 换动画效果的整体配置(与组件实例的
|
|
8279
|
+
/** 换动画效果的整体配置(与组件实例的 updateOptions({ effects }) 同一条路) */
|
|
7507
8280
|
setEffects(effects: GisViewEffectsInput): void
|
|
7508
8281
|
/** 当前生效的动画效果配置(归一化之后的读数) */
|
|
7509
8282
|
getEffects(): GisViewEffectsReadout
|
|
@@ -7747,9 +8520,6 @@ export declare const createGisEventBus: (host?: GisViewEventBusHost) => GisViewE
|
|
|
7747
8520
|
/** 全部可订阅事件名(顺序与组件一致,末尾的 `'*'` 表示「全部事件」) */
|
|
7748
8521
|
export declare const EVENT_NAMES: GisViewEventNameInput[]
|
|
7749
8522
|
|
|
7750
|
-
/** 把任意条件输入编成一个判定函数:给不经过视图的批量过滤复用同一套条件语言 */
|
|
7751
|
-
export declare const createConditionMatcher: (input: GisViewConditionInput) => (item: unknown, index?: number) => boolean
|
|
7752
|
-
|
|
7753
8523
|
/** 筛选完整格式的保留键:顶层出现其中之一就不再按「只筛节点」的简写解释 */
|
|
7754
8524
|
export declare const FILTER_FORM_KEYS: string[]
|
|
7755
8525
|
|
|
@@ -7847,6 +8617,23 @@ export declare const normalizeDocument: (input: unknown, options?: GisViewNormal
|
|
|
7847
8617
|
/** 文档里各列有多少条(拐点 = 线路 path 的中间顶点 + 各分组 path) */
|
|
7848
8618
|
export declare const documentCounts: (document: GisViewDocument | null | undefined) => GisViewDocumentCounts
|
|
7849
8619
|
|
|
8620
|
+
/* ---------- 自定义导出格式(export-formats.js) ---------- */
|
|
8621
|
+
|
|
8622
|
+
/** 注册一个同步导出器;内置名(含大小写变体)、空名或非函数返回 false,同一个自定义名重复注册以后一次为准 */
|
|
8623
|
+
export declare const registerExportFormat: <Result = unknown>(name: string, adapter: GisViewExportFormatAdapter<Result>) => boolean
|
|
8624
|
+
/**
|
|
8625
|
+
* 带作用域地定义自定义导出格式:注册成功返回清理函数,适合在插件 / 组件挂载时注册、卸载时注销。
|
|
8626
|
+
* 清理函数只在当前注册项仍是自己那次定义时删除(同名重复注册且 adapter 相同也算新的一次,不会误删后来覆盖注册的同名适配器),重复调用返回 false。
|
|
8627
|
+
* 名字为空或撞内置保留格式(含大小写变体)时抛 TypeError。
|
|
8628
|
+
*/
|
|
8629
|
+
export declare const defineExportFormat: <Result = unknown>(name: string, adapter: GisViewExportFormatAdapter<Result>) => () => boolean
|
|
8630
|
+
/** 注销一个自定义导出格式,返回它之前是否注册着;内置格式永远返回 false */
|
|
8631
|
+
export declare const unregisterExportFormat: (name: string) => boolean
|
|
8632
|
+
/** 这个名字现在能不能直接交给 exportData(内置五档或已注册的自定义格式) */
|
|
8633
|
+
export declare const hasExportFormat: (name: string) => boolean
|
|
8634
|
+
/** 当前可用的全部导出格式:内置五档在前,自定义按注册顺序跟在后面 */
|
|
8635
|
+
export declare const listExportFormats: () => string[]
|
|
8636
|
+
|
|
7850
8637
|
/* ---------- 渲染后端开关(renderer.js) ---------- */
|
|
7851
8638
|
|
|
7852
8639
|
/** renderer 认的三档写法(与 options.renderer 同一套) */
|