gis-view-webgl2 0.1.4 → 0.1.6
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 +10 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +225 -20
- package/dist/index.js +1 -1
- package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +109 -0
- package/docs/GisView.md +53 -53
- 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 +91 -0
- package/docs/demos/ConnectDemo.vue +114 -3
- package/docs/demos/MinimapDemo.vue +216 -17
- package/docs/demos/SearchFilterDemo.vue +113 -1
- package/docs/demos/api-index.js +28 -20
- package/docs/demos/demos.js +1 -1
- package/docs/demos/gis-view-demo/GisViewDemoStage.vue +25 -16
- package/docs/demos/gis-view-demo/useGisViewDemo.js +27 -16
- package/docs/index.html +3 -3
- package/docs/internals/13-/351/271/260/347/234/274/345/233/276.md +8 -5
- package/docs/internals/16-01-/344/274/230/345/214/226/344/270/216/345/217/226/350/210/215-/344/270/212.md +18 -5
- 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 -1
- package/docs/internals/18-/346/200/247/350/203/275/345/256/236/346/265/213/344/270/216WebGPU/350/257/204/344/274/260.md +73 -1
- package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +14 -5
- package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +2 -2
- package/docs/manual/05-/347/224/273/350/264/250/344/270/216/346/211/271/351/207/217/346/233/264/346/226/260.md +1 -1
- package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +1 -1
- 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 +423 -3
- package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +99 -30
- package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +12 -7
- package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +14 -6
- package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +137 -6
- 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 -0
- package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +8 -3
- 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 +6 -3
- package/docs/steps/README.md +6 -6
- package/docs/steps/selftest-demos.html +252 -9
- package/docs/steps/selftest-docs.html +3 -3
- package/docs/steps/selftest-full.html +357 -13
- package/docs/steps/selftest-perf.html +599 -382
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,20 @@ export interface GisViewCamera {
|
|
|
13
13
|
scale: number
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/** 直接飞相机时的目标:两项都可省略,没写的那一项沿用当前相机 */
|
|
17
|
+
export interface GisViewCameraTarget {
|
|
18
|
+
center?: [number, number]
|
|
19
|
+
scale?: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** flyToCamera 的选项:时长与缓动,语义与 flyTo 完全一致 */
|
|
23
|
+
export interface GisViewFlyCameraOptions {
|
|
24
|
+
/** 飞行时长(毫秒),缺省 450;<= 0 时立即落位 */
|
|
25
|
+
duration?: number
|
|
26
|
+
/** 缓动,缺省 'ease-in-out';中心线性插值,比例按对数插值 */
|
|
27
|
+
easing?: GisViewCameraEasing
|
|
28
|
+
}
|
|
29
|
+
|
|
16
30
|
export interface GisViewViewport {
|
|
17
31
|
/** 视口的 CSS 宽度(**布局像素**:宿主用 CSS zoom / transform 放大时,它不变、视觉尺寸才变) */
|
|
18
32
|
cssWidth: number
|
|
@@ -489,9 +503,21 @@ export interface GisViewMinimapOptions {
|
|
|
489
503
|
/** 尺寸(CSS 像素),默认 168 × 120 */
|
|
490
504
|
width?: number
|
|
491
505
|
height?: number
|
|
506
|
+
/** 贴近主视图(或 container 指定的外部宿主)的哪个角,默认 bottom-right */
|
|
492
507
|
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
493
508
|
/** 距离容器边缘的间距(CSS 像素),默认 12 */
|
|
494
509
|
margin?: number
|
|
510
|
+
/**
|
|
511
|
+
* 相对 position 那个角的位移(CSS 像素,[x, y]):x 正数向右、y 正数向下。
|
|
512
|
+
* 四角配置都按同一直觉换算,updateOptions 改它就能动态移动整张鹰眼图。
|
|
513
|
+
*/
|
|
514
|
+
offset?: [number, number]
|
|
515
|
+
/**
|
|
516
|
+
* 外部宿主:HTMLElement 或 CSS 选择器。给了就把小图根节点挂到它里面,position / margin / offset
|
|
517
|
+
* 都相对这个元素;外部宿主需要 position: relative(或 absolute / fixed)才能让绝对定位按它算。
|
|
518
|
+
* 不写 / 选择器找不到时回落到主视图根节点;运行时换容器会移动同一个根节点,不重建画布。
|
|
519
|
+
*/
|
|
520
|
+
container?: HTMLElement | string | null
|
|
495
521
|
/**
|
|
496
522
|
* 小图背景:'inherit'(默认)画主视图那一份(底色 / 图片 / GeoJSON,含区域配色与文字);
|
|
497
523
|
* false / 'none' 不画;字符串是容器底色(旧写法);对象是与 background 同结构的独立配置
|
|
@@ -504,6 +530,18 @@ export interface GisViewMinimapOptions {
|
|
|
504
530
|
* 两者离得很远就是这样),只画正在看的那一份 —— 合并只会让两份都看不清
|
|
505
531
|
*/
|
|
506
532
|
extent?: GisViewMinimapExtent
|
|
533
|
+
/**
|
|
534
|
+
* 动态范围是否跟着当前可见内容重算:默认 false。首次拿到数据 / 底图范围后锁住世界范围,
|
|
535
|
+
* 筛选、删除、隐藏或新增内容都不会改小图的缩放与中心,外围内容消失时鹰眼图和视口框不会自己跳;
|
|
536
|
+
* 打开后才按当前可见数据与底图重新计算。显式改 extent(含直接写固定范围)始终立即生效。
|
|
537
|
+
*/
|
|
538
|
+
extentFollowContent?: boolean
|
|
539
|
+
/**
|
|
540
|
+
* `extent: 'auto'` 时是否允许范围跟着相机收窄:默认 false,始终按「数据 ∪ 底图」铺。
|
|
541
|
+
* 打开后,相机落在其中一份范围、而那份在合并结果里不足 6 像素时只画正在看的那一份;
|
|
542
|
+
* 相机进出这份范围时鹰眼图会重新计算包围盒;extentFollowContent 关闭时用的是锁定下来的那一份范围。
|
|
543
|
+
*/
|
|
544
|
+
extentFollowCamera?: boolean
|
|
507
545
|
/** 给小图容器再加一个类名(与内置的 gis-view__minimap 并列),方便用样式表改外观 */
|
|
508
546
|
className?: string
|
|
509
547
|
/** 直接落到小图容器上的内联样式(中划线 / CSS 变量键与驼峰键都认);换配置时上一轮写过、这一轮没写的键会被清掉 */
|
|
@@ -515,7 +553,10 @@ export interface GisViewMinimapOptions {
|
|
|
515
553
|
draw?: (info: GisViewMinimapDrawInfo) => void
|
|
516
554
|
/** 可拆分的自定义绘制层:按 placement 分段、段内按 order,最后才轮到旧的 draw */
|
|
517
555
|
layers?: GisViewMinimapLayer[]
|
|
518
|
-
/**
|
|
556
|
+
/**
|
|
557
|
+
* 小图容器的底色(CSS),默认 rgba(255, 255, 255, 0.92)。显式设置时它接管画布底色:
|
|
558
|
+
* 继承的底图仍画图片 / GeoJSON,但不再用主图的不透明底色盖住它。
|
|
559
|
+
*/
|
|
519
560
|
backgroundStyle?: string
|
|
520
561
|
/** 小图画布备份像素比上限(默认 4):高分屏或宿主缩放很大时可降到 1 ~ 2 降低填充开销 */
|
|
521
562
|
maxPixelRatio?: number
|
|
@@ -529,12 +570,18 @@ export interface GisViewMinimapOptions {
|
|
|
529
570
|
lineStyle?: GisViewMinimapLineStyle
|
|
530
571
|
/**
|
|
531
572
|
* 节点规则:按属性给小图上的节点定颜色 / 半径 / 形状 / 层级(条件语言与主图一样)。
|
|
532
|
-
*
|
|
573
|
+
* 不配时沿用主图样式链:颜色 / 描边色 / 层级取规则,尺寸与符号取引擎最终解析结果
|
|
574
|
+
* (点自身 > 主图 pointRules > 主图 pointStyle),圆、方、图片与 SVG 图标都会画出来
|
|
533
575
|
*/
|
|
534
576
|
pointRules?: GisViewMinimapPointRule[]
|
|
535
|
-
/** 线路规则:按属性给小图上的线路定颜色 / 线宽 / 透明度 / 层级,不配时沿用主图 lineRules
|
|
577
|
+
/** 线路规则:按属性给小图上的线路定颜色 / 线宽 / 透明度 / 层级,不配时沿用主图 lineRules(颜色 / 透明度)与样式链线宽 */
|
|
536
578
|
lineRules?: GisViewMinimapLineRule[]
|
|
537
|
-
/**
|
|
579
|
+
/**
|
|
580
|
+
* 没有自己的规则时是否沿用主图样式,默认 true:节点连尺寸与图标一起沿用,线路沿用颜色 / 透明度 / 线宽;
|
|
581
|
+
* 沿用尺寸时按小图与主图 CSS 视口宽高的较小比例缩放,独立于主图相机倍数与小图自身倍数;
|
|
582
|
+
* 小图自身多次放大时再按 pointZoomScale / lineZoomScale 联动;
|
|
583
|
+
* 显式 false 表示小图只用 pointStyle / lineStyle
|
|
584
|
+
*/
|
|
538
585
|
inheritRules?: boolean
|
|
539
586
|
/**
|
|
540
587
|
* 小图自己的热力图:不写就沿用主图的 options.heatmap(两边的色带与取的值完全一致,自动值域也按同一份数据算),
|
|
@@ -551,24 +598,24 @@ export interface GisViewMinimapOptions {
|
|
|
551
598
|
* 主视图筛选出来的隐藏结果本来就带联动,这里管的是小图自己挡掉的那部分
|
|
552
599
|
*/
|
|
553
600
|
cascade?: GisViewFilterCascade
|
|
554
|
-
/** 节点半径的整体倍数(与主视图的 pointSizeScale
|
|
601
|
+
/** 节点半径的整体倍数(与主视图的 pointSizeScale 同名同义,常数倍数):自有规则与沿用主图的节点都乘这一份,默认 1 */
|
|
555
602
|
pointSizeScale?: number
|
|
556
|
-
/** 线路宽度的整体倍数(与主视图的 lineWidthScale
|
|
603
|
+
/** 线路宽度的整体倍数(与主视图的 lineWidthScale 同名同义):自有规则与沿用主图的线路都乘这一份,默认 1 */
|
|
557
604
|
lineWidthScale?: number
|
|
558
605
|
/**
|
|
559
606
|
* 小图自身的倍数对节点半径的放大指数(0 表示不跟随,1 表示同倍率放大),默认 0。
|
|
560
607
|
* 只在小图真的放大过才看得出来:zoomable 关着、或者倍数还在 1(刚好铺满)时是恒等系数;
|
|
561
|
-
*
|
|
608
|
+
* 沿用主图规则的节点也按这一份联动;主图相机倍数不会改变它们的大小
|
|
562
609
|
*/
|
|
563
610
|
pointZoomScale?: number
|
|
564
|
-
/** 小图自身的倍数对线路宽度的放大指数(0 表示不跟随),默认 0;同样只在小图倍数 ≠ 1
|
|
611
|
+
/** 小图自身的倍数对线路宽度的放大指数(0 表示不跟随),默认 0;同样只在小图倍数 ≠ 1 时起作用,沿用主图线宽也按它联动 */
|
|
565
612
|
lineZoomScale?: number
|
|
566
613
|
/**
|
|
567
|
-
*
|
|
568
|
-
* 0.5 是主视图放大 4 倍、小图节点放大 2
|
|
614
|
+
* 主视图的地图倍数对**小图自有规则 / 样式**节点半径的放大指数:0(默认)不跟随,1 与主视图同倍率放大,
|
|
615
|
+
* 0.5 是主视图放大 4 倍、小图节点放大 2 倍。沿用主图规则的节点不吃这一份(尺寸只跟视口比例与小图自身倍数)
|
|
569
616
|
*/
|
|
570
617
|
pointMapZoomScale?: number
|
|
571
|
-
/**
|
|
618
|
+
/** 主视图的地图倍数对**小图自有规则 / 样式**线路宽度的放大指数(0 不跟随、1 同倍率);沿用主图线宽不吃这一份 */
|
|
572
619
|
lineMapZoomScale?: number
|
|
573
620
|
/** 地图倍数联动的基准比例,缺省取主视图首次适应视图时的比例(与主视图 zoomBaseScale 同源) */
|
|
574
621
|
mapZoomBaseScale?: number
|
|
@@ -582,9 +629,9 @@ export interface GisViewMinimapOptions {
|
|
|
582
629
|
onInteraction?: (info: GisViewMinimapInteractionInfo) => void
|
|
583
630
|
/** 长按多久算「要移动视角」(毫秒),默认 180 */
|
|
584
631
|
longPressDelay?: number
|
|
585
|
-
/** 在小图上滚轮是否缩放主图(以光标处的世界坐标为锚点),默认 true;zoomable
|
|
632
|
+
/** 在小图上滚轮是否缩放主图(以光标处的世界坐标为锚点),默认 true;zoomable: true 时改由 Ctrl / ⌘ + 滚轮触发 */
|
|
586
633
|
wheelZoom?: boolean
|
|
587
|
-
/** 鹰眼图自身的倍数:1
|
|
634
|
+
/** 鹰眼图自身的倍数:1(默认)是「刚好铺满小图」;手动缩放时由滚轮 / setMinimapZoom 改,跟随主图时它是基准倍数 */
|
|
588
635
|
zoom?: number
|
|
589
636
|
/** 倍数下限与上限,默认 0.5 / 8 */
|
|
590
637
|
minZoom?: number
|
|
@@ -595,16 +642,26 @@ export interface GisViewMinimapOptions {
|
|
|
595
642
|
zoomInStep?: number
|
|
596
643
|
/** 只覆盖「缩小」一侧的步进倍率,缺省用 zoomStep */
|
|
597
644
|
zoomOutStep?: number
|
|
598
|
-
/** 是否允许缩放鹰眼图自身(滚轮,锚点落在光标处),默认 false;打开后滚轮不再缩放主图(改为 Ctrl / ⌘ + 滚轮) */
|
|
599
|
-
zoomable?: boolean
|
|
600
645
|
/**
|
|
601
|
-
*
|
|
646
|
+
* 缩放模式,默认 false(关闭):
|
|
647
|
+
* - true:手动缩放鹰眼图自身,滚轮以光标为锚点,滚轮不再缩放主图(改为 Ctrl / ⌘ + 滚轮);
|
|
648
|
+
* - 'follow':整体显示范围跟随主图倍数变化,滚轮仍然缩放主图;与 true 互斥。
|
|
649
|
+
*/
|
|
650
|
+
zoomable?: boolean | 'follow'
|
|
651
|
+
/**
|
|
652
|
+
* `zoomable: 'follow'` 时主图相对基准倍数的指数:1(默认)同倍率,0.5 表示主图放大 4 倍、鹰眼图放大 2 倍,
|
|
653
|
+
* 0 表示鹰眼图倍数不随主图变化。最终倍数仍夹在 minZoom ~ maxZoom 之间。
|
|
654
|
+
*/
|
|
655
|
+
followZoomScale?: number
|
|
656
|
+
/**
|
|
657
|
+
* 小图空白处(视口框之外)拖动的动作:
|
|
602
658
|
* pan(默认)平移小图内容,box 直接拉出框选矩形(松手后主图显示框住的区域)。
|
|
603
|
-
*
|
|
659
|
+
* box 不依赖 zoomable;只有手动缩放(zoomable: true)时,按住 Ctrl / ⌘ 才会切换成另一个动作。
|
|
604
660
|
*/
|
|
605
661
|
dragAction?: 'pan' | 'box'
|
|
606
662
|
/**
|
|
607
|
-
* 通道是否画出全部回线,默认 true;关掉(false
|
|
663
|
+
* 通道是否画出全部回线,默认 true;关掉(false)时一个通道分组只画一根代表线:
|
|
664
|
+
* 按当前可见成员逐顶点取平均,双回线落在两根正中间(而不是固定挑上面 / 左边那一根)。
|
|
608
665
|
* 通道多、底图挤的时候关掉更清爽,通道位置与走向仍然看得出来。
|
|
609
666
|
*/
|
|
610
667
|
channelCircuits?: boolean
|
|
@@ -2216,6 +2273,50 @@ export interface GisViewChannelAddSpec {
|
|
|
2216
2273
|
group?: GisViewChannelAddGroup | GisViewChannelAddGroup[]
|
|
2217
2274
|
}
|
|
2218
2275
|
|
|
2276
|
+
/**
|
|
2277
|
+
* commitAddChannel 的对象入参:可以写一份新通道 / 新线路,也可以放在 channel / line / lines 里逐段给。
|
|
2278
|
+
* - 直接通道对象必须带 lineIds:每个 id 生成一条新回线,groups 是分组声明;通道 id 不参与回线 id。
|
|
2279
|
+
* - 直接线路对象的业务字段透传到 lineProps;path 是中间拐点,首尾仍取 from / to。
|
|
2280
|
+
* - 容器里的 line 缺省是独立线路,lines / lineData / lineItems 才是成员回线表,且 lines 优先;
|
|
2281
|
+
* 空数组不覆盖草稿。channel.lineIds 只在没有成员回线表时当 id 种子。
|
|
2282
|
+
* - 对象里的端点、id、名称、路径、样式与分组优先于草稿;没写的字段仍沿用当前草稿。
|
|
2283
|
+
* - 容器顶层的 channel.lineProps 目前不参与合并;公共字段写顶层 lineProps,单条写 lines[i]。
|
|
2284
|
+
*/
|
|
2285
|
+
export interface GisViewChannelAddCommitInput extends Partial<GisViewChannelAddInput> {
|
|
2286
|
+
/** 本次新增的通道对象(lineIds 会作为新回线 id 种子;groups 作为分组声明) */
|
|
2287
|
+
channel?: GisViewChannel
|
|
2288
|
+
/** 本次新增的一条线路对象(写了它就按独立线路提交) */
|
|
2289
|
+
line?: GisViewLine
|
|
2290
|
+
/** 本次新增的回线对象 / 数据(一条或一批,与 lineData / lineItems 同义) */
|
|
2291
|
+
lines?: GisViewChannelLineData
|
|
2292
|
+
/** lines 的别名(与 addChannel 的第二段同一个写法) */
|
|
2293
|
+
lineData?: GisViewChannelLineData
|
|
2294
|
+
/** 新通道的分组声明(与 channel.groups 同义) */
|
|
2295
|
+
channelGroups?: GisViewChannelAddGroup | GisViewChannelAddGroup[]
|
|
2296
|
+
/** channelGroups 的别名(与 addChannel 的第三段同一个写法) */
|
|
2297
|
+
group?: GisViewChannelAddGroup | GisViewChannelAddGroup[]
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
/** 新增通道草稿端点示例点单端的样式:只写哪几项就覆盖哪几项 */
|
|
2301
|
+
export interface GisViewChannelDraftDotStyle {
|
|
2302
|
+
/** 这一端是否画示例点,默认 true */
|
|
2303
|
+
show?: boolean
|
|
2304
|
+
/** 示例点半径(CSS 像素),缺省用 dot */
|
|
2305
|
+
size?: number
|
|
2306
|
+
/** 示例点颜色,缺省用 dots.color / dotColor / color */
|
|
2307
|
+
color?: string
|
|
2308
|
+
/** 形状,缺省 circle */
|
|
2309
|
+
shape?: 'circle' | 'square'
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
/** 草稿两端示例点的共同样式;from / to 可以分别覆盖 */
|
|
2313
|
+
export interface GisViewChannelDraftDots extends GisViewChannelDraftDotStyle {
|
|
2314
|
+
/** 起点的单独设置(优先于这一层的共同设置) */
|
|
2315
|
+
from?: GisViewChannelDraftDotStyle
|
|
2316
|
+
/** 终点的单独设置(优先于这一层的共同设置) */
|
|
2317
|
+
to?: GisViewChannelDraftDotStyle
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2219
2320
|
/** 新增通道草稿线的样式:跟随光标的那条预览线 */
|
|
2220
2321
|
export interface GisViewChannelDraftStyle {
|
|
2221
2322
|
color?: string
|
|
@@ -2225,6 +2326,16 @@ export interface GisViewChannelDraftStyle {
|
|
|
2225
2326
|
dot?: number
|
|
2226
2327
|
/** 端点圆点颜色,缺省沿用 color */
|
|
2227
2328
|
dotColor?: string
|
|
2329
|
+
/**
|
|
2330
|
+
* 两端示例点:false 两个都不画,true / 不写按 dot 与 dotColor 画;对象可统一设置 size / color / shape / show,
|
|
2331
|
+
* 并用 from / to 分别覆盖。示例点始终画在真正点中的节点中心(不受多回线偏移影响)。
|
|
2332
|
+
*/
|
|
2333
|
+
dots?: boolean | GisViewChannelDraftDots
|
|
2334
|
+
/**
|
|
2335
|
+
* 示例线路的绘制层级:'above'(默认,画在真实节点之后)或 'below-points'(线 / 箭头 / customDraw 先画,
|
|
2336
|
+
* 再盖真实节点);端点示例点始终在节点之后画,确保看得见。
|
|
2337
|
+
*/
|
|
2338
|
+
layer?: 'above' | 'below-points'
|
|
2228
2339
|
/** 预览线末端是否画方向箭头,缺省 false */
|
|
2229
2340
|
arrow?: boolean
|
|
2230
2341
|
/** 箭头大小(CSS 像素),缺省 12 */
|
|
@@ -3703,6 +3814,8 @@ export interface GisViewDataChangePayload {
|
|
|
3703
3814
|
lines: GisViewLine[]
|
|
3704
3815
|
channels: GisViewChannel[]
|
|
3705
3816
|
counts: { points: number; lines: number; channels: number }
|
|
3817
|
+
/** 数据修订号:每次数据变更 +1;只改全局配置 / 样式时不推,外部缓存据它决定要不要重算 */
|
|
3818
|
+
dataVersion: number
|
|
3706
3819
|
/** 动到 / 删掉的节点下标(单点更新是那一个,删除是删除前的下标升序,新增是它们在数组里的位置) */
|
|
3707
3820
|
index?: number
|
|
3708
3821
|
indexes?: number[]
|
|
@@ -5342,6 +5455,18 @@ export interface GisViewPointStyleSnapshot {
|
|
|
5342
5455
|
zIndex: number
|
|
5343
5456
|
}
|
|
5344
5457
|
|
|
5458
|
+
/** 一条线路解析之后的样式快照:getLineStyle() 的返回 */
|
|
5459
|
+
export interface GisViewLineStyleSnapshot {
|
|
5460
|
+
index: number
|
|
5461
|
+
/** 样式链(线路自身 > 规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale 与缩放联动 */
|
|
5462
|
+
width: number
|
|
5463
|
+
/** 解析后的 RGBA 颜色,四个分量都在 0 ~ 1 */
|
|
5464
|
+
color: [number, number, number, number]
|
|
5465
|
+
/** 0 ~ 1 */
|
|
5466
|
+
opacity: number
|
|
5467
|
+
zIndex: number
|
|
5468
|
+
}
|
|
5469
|
+
|
|
5345
5470
|
/** 合并时给的上下文:merge.createItem 会拿到它 */
|
|
5346
5471
|
export interface GisViewMergeContext {
|
|
5347
5472
|
sourceIndex: number
|
|
@@ -6671,6 +6796,26 @@ export interface GisViewFocusOptions {
|
|
|
6671
6796
|
mode?: GisViewSelectMode
|
|
6672
6797
|
}
|
|
6673
6798
|
|
|
6799
|
+
/** 相机飞行的缓动:字符串预设,或 (progress 0~1) => eased 0~1 的自定义函数 */
|
|
6800
|
+
export type GisViewCameraEasing = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | ((progress: number) => number)
|
|
6801
|
+
|
|
6802
|
+
/** flyTo 的选项:目标解析、选中与缩放语义与 focusOn 完全一致,另加时长与缓动 */
|
|
6803
|
+
export interface GisViewFlyOptions extends GisViewFocusOptions {
|
|
6804
|
+
/** 飞行时长(毫秒),缺省 450;<= 0 时立即落位 */
|
|
6805
|
+
duration?: number
|
|
6806
|
+
/** 缓动,缺省 'ease-in-out';中心线性插值,比例按对数插值 */
|
|
6807
|
+
easing?: GisViewCameraEasing
|
|
6808
|
+
}
|
|
6809
|
+
|
|
6810
|
+
/** 相机飞行的实时读数:progress 是时间进度(0~1),不是缓动后的值 */
|
|
6811
|
+
export interface GisViewCameraAnimation {
|
|
6812
|
+
active: boolean
|
|
6813
|
+
progress: number
|
|
6814
|
+
duration: number
|
|
6815
|
+
from: GisViewCamera
|
|
6816
|
+
to: GisViewCamera
|
|
6817
|
+
}
|
|
6818
|
+
|
|
6674
6819
|
/** 导出图片的选项 */
|
|
6675
6820
|
export interface GisViewExportImageOptions {
|
|
6676
6821
|
/**
|
|
@@ -7291,6 +7436,10 @@ export interface GisViewInstance {
|
|
|
7291
7436
|
readonly el: HTMLElement
|
|
7292
7437
|
readonly canvas: HTMLCanvasElement
|
|
7293
7438
|
readonly gl: WebGL2RenderingContext | null
|
|
7439
|
+
/** 相机是否正在执行 flyTo 的飞行动画;只读,不触发重绘 */
|
|
7440
|
+
readonly cameraAnimating: boolean
|
|
7441
|
+
/** 数据修订号:数据变更后 +1;只改全局配置 / 样式不变,外部缓存与增量计算据此判断是否重算 */
|
|
7442
|
+
readonly dataVersion: number
|
|
7294
7443
|
/** 请求重画一帧:自定义 WebGL 层的数据源变了、组件自己不知道时调用 */
|
|
7295
7444
|
requestRender(): GisViewInstance
|
|
7296
7445
|
/**
|
|
@@ -7476,6 +7625,17 @@ export interface GisViewInstance {
|
|
|
7476
7625
|
* `{ select: true, mode }` 顺手把这些要素选上。认不出目标时什么都不做,返回实例便于链式调用。
|
|
7477
7626
|
*/
|
|
7478
7627
|
focusOn(target: GisViewFocusTargets, options?: GisViewFocusOptions): GisViewInstance
|
|
7628
|
+
/** 平滑飞向与 focusOn 相同的目标;duration / easing 只影响这一次调用 */
|
|
7629
|
+
flyTo(target: GisViewFocusTargets, options?: GisViewFlyOptions): GisViewInstance
|
|
7630
|
+
/**
|
|
7631
|
+
* 直接飞向一个相机目标 `{ center?, scale? }`:不写的那一项沿用当前相机,不经过要素解析。
|
|
7632
|
+
* duration / easing 与 flyTo 同义;参数非法时保持当前相机。
|
|
7633
|
+
*/
|
|
7634
|
+
flyToCamera(camera: GisViewCameraTarget, options?: GisViewFlyCameraOptions): GisViewInstance
|
|
7635
|
+
/** 停掉正在跑的相机飞行(停当前帧、不补跳终点);没有动画时是空操作 */
|
|
7636
|
+
stopCameraAnimation(): GisViewInstance
|
|
7637
|
+
/** 当前相机飞行读数;没有动画时 null */
|
|
7638
|
+
getCameraAnimation(): GisViewCameraAnimation | null
|
|
7479
7639
|
/** 按关键字搜索节点 / 线路 / 通道:只返回命中(不改数据、不改筛选、也不动视角),聚焦与选中交给使用方 */
|
|
7480
7640
|
search(input: string | GisViewSearchOptions): GisViewSearchResult
|
|
7481
7641
|
/**
|
|
@@ -7492,6 +7652,8 @@ export interface GisViewInstance {
|
|
|
7492
7652
|
getZoomBaseScale(): number
|
|
7493
7653
|
/** 重定缩放联动的基准比例:不传就取当下相机的比例(把现在这一屏当成「原样大小」),之后放大缩小都从它算倍数,返回 this */
|
|
7494
7654
|
setZoomBaseScale(scale?: number): GisViewInstance
|
|
7655
|
+
/** 鹰眼图根节点(没配 minimap 时为 null):拖动整张图 / 绑定自定义手势时拿它 */
|
|
7656
|
+
getMinimapElement(): HTMLElement | null
|
|
7495
7657
|
/** 鹰眼图自身的倍数:1 是「刚好铺满小图」 */
|
|
7496
7658
|
getMinimapZoom(): number
|
|
7497
7659
|
/** 设置鹰眼图的倍数(夹在 minimap.minZoom ~ maxZoom 之间),内容重新跟着数据范围居中 */
|
|
@@ -7856,8 +8018,35 @@ export interface GisViewInstance {
|
|
|
7856
8018
|
cancelAddChannel(): GisViewInstance
|
|
7857
8019
|
/** 结束新增草稿并收掉视图上的示例假通道 / 线路(静默,不补 cancel):提前结束不新建就用它 */
|
|
7858
8020
|
endAddChannel(): GisViewInstance
|
|
7859
|
-
/**
|
|
7860
|
-
|
|
8021
|
+
/**
|
|
8022
|
+
* 提交已 ready 的新增草稿(autoCommit 时由组件内部调用)。input 有五类写法:
|
|
8023
|
+
* 1. 不传 / null:用草稿的 preferred;
|
|
8024
|
+
* 2. 旧 resolution:字符串,或只含 type / groupId / groupIndex / channelId 的对象;
|
|
8025
|
+
* 3. 直接线路对象:无 lineIds,且有 from / to / path / kind: 'line' / start / end 之一;
|
|
8026
|
+
* 4. 直接通道对象:lineIds 为数组,缺省按 newChannel 落地;
|
|
8027
|
+
* 5. 容器:{ channel, line, lines, lineData, lineItems, channelGroups, group, channelProps, lineProps, resolution, ... }。
|
|
8028
|
+
*
|
|
8029
|
+
* 字段优先级:from / to = 顶层 → channel → line → lineItems 中第一个对象项 → 草稿;
|
|
8030
|
+
* path = 顶层 → line → channel → 草稿;分组 = channelGroups → group → channel.groups;
|
|
8031
|
+
* 容器 lineProps = 草稿 → 顶层 → line.lineProps → lines[i](不读 channel.lineProps);
|
|
8032
|
+
* channelProps = 草稿 → channel 上的业务字段 → 顶层 channelProps。直接通道对象自己的 lineProps 会生效。
|
|
8033
|
+
*
|
|
8034
|
+
* 直接通道默认新建;要并进已有通道 / 分组,用容器并显式写 resolution。
|
|
8035
|
+
* ready 里的方案对象带 enabled / count / lineIds 等读数,不能整条回传,只取
|
|
8036
|
+
* `{ type, groupId, groupIndex, channelId }` 子集。调用前草稿必须 ready,否则返回 ok: false 且不写数据。
|
|
8037
|
+
*
|
|
8038
|
+
* ```ts
|
|
8039
|
+
* view.commitAddChannel({
|
|
8040
|
+
* resolution: { type: 'joinGroup', groupId: 'corridor-1::2' },
|
|
8041
|
+
* lines: [{ id: 'join-1', color: '#dd4b2e' }, { id: 'join-2' }],
|
|
8042
|
+
* lineProps: { width: 2.4 }
|
|
8043
|
+
* })
|
|
8044
|
+
* ```
|
|
8045
|
+
*/
|
|
8046
|
+
commitAddChannel(
|
|
8047
|
+
input?: GisViewChannelAddInput['resolution'] | GisViewChannel | GisViewLine | GisViewChannelAddCommitInput,
|
|
8048
|
+
options?: { auto?: boolean; continuous?: boolean; originalEvent?: Event | null }
|
|
8049
|
+
): GisViewChannelAddResult
|
|
7861
8050
|
/** 两个节点之间的新增方案:新通道 / 新分组 / 并进某一组 / 无法添加(kind 为 'line' 时方案表是空的) */
|
|
7862
8051
|
getChannelAddOptions(from: string | number, to: string | number, count?: number, kind?: 'channel' | 'line'): GisViewChannelAddPlan | null
|
|
7863
8052
|
/**
|
|
@@ -8100,6 +8289,12 @@ export interface GisViewInstance {
|
|
|
8100
8289
|
* 拖拽落点预览拿它核对「预览与落地同一个尺寸」,合并取双方较大值走的也是这一份;下标不存在返回 null
|
|
8101
8290
|
*/
|
|
8102
8291
|
getPointStyle(index: number): GisViewPointStyleSnapshot | null
|
|
8292
|
+
/**
|
|
8293
|
+
* 线路解析之后的样式快照(width / color / opacity / zIndex):width 取样式链
|
|
8294
|
+
* (线路自身 > 规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale / 缩放联动与热力倍率;
|
|
8295
|
+
* 下标不存在时返回 null。鹰眼图沿用主图线路宽度时用的就是它。
|
|
8296
|
+
*/
|
|
8297
|
+
getLineStyle(index: number): GisViewLineStyleSnapshot | null
|
|
8103
8298
|
/** 按 id / 下标取一条线路(拾取载荷 + path / bounds / color / width);找不到返回 null */
|
|
8104
8299
|
getLine(ref: GisViewFeatureRef): GisViewLineInfo | null
|
|
8105
8300
|
/** 按 id / 下标取一条通道(数据那一份 + 成员表 + 分组上下文);找不到返回 null */
|
|
@@ -8559,6 +8754,8 @@ export interface GisViewEngine {
|
|
|
8559
8754
|
* 合并节点取双方最大尺寸、图标优先目标用的就是它;下标不存在时返回 null
|
|
8560
8755
|
*/
|
|
8561
8756
|
getPointStyle(index: number): GisViewPointStyleSnapshot | null
|
|
8757
|
+
/** 线路解析之后的样式快照(width / color / opacity / zIndex);下标不存在时返回 null */
|
|
8758
|
+
getLineStyle(index: number): GisViewLineStyleSnapshot | null
|
|
8562
8759
|
|
|
8563
8760
|
/** 某个下标的节点当前还在不在图上:被过滤 / 隐藏掉的不算 */
|
|
8564
8761
|
isPointVisible(index: number): boolean
|
|
@@ -8579,6 +8776,14 @@ export interface GisViewEngine {
|
|
|
8579
8776
|
forEachPointInView(rect: GisViewBounds, visit: (index: number, item: GisViewPoint, x: number, y: number, radius: number) => void | boolean): void
|
|
8580
8777
|
getCamera(): GisViewCamera
|
|
8581
8778
|
setCamera(camera: Partial<GisViewCamera>): void
|
|
8779
|
+
/** 只算目标相机、不动画面;视口还没量出来时返回 null */
|
|
8780
|
+
getCameraForBounds(bounds: GisViewBounds, padding?: number): GisViewCamera | null
|
|
8781
|
+
/** 相机飞行:target 是终点的 { center, scale },duration / easing 只影响这一次 */
|
|
8782
|
+
flyCamera(target: GisViewCamera, options?: Pick<GisViewFlyOptions, 'duration' | 'easing'>): boolean
|
|
8783
|
+
/** 停掉相机飞行,返回是否真的停了一条正在跑的动画 */
|
|
8784
|
+
stopCameraAnimation(): boolean
|
|
8785
|
+
getCameraAnimation(): GisViewCameraAnimation | null
|
|
8786
|
+
isCameraAnimating(): boolean
|
|
8582
8787
|
zoomBy(factor: number, origin?: [number, number]): void
|
|
8583
8788
|
zoomTo(scale: number, origin?: [number, number]): void
|
|
8584
8789
|
zoomToBounds(bounds: GisViewBounds, padding?: number): void
|