gis-view-webgl2 0.1.5 → 0.1.7
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 +6 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +172 -8
- package/dist/index.js +1 -1
- package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +121 -0
- package/docs/GisView.md +1 -1
- 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 +117 -0
- package/docs/demos/LabelDemo.vue +2 -2
- package/docs/demos/MinimapDemo.vue +154 -1
- package/docs/demos/SearchFilterDemo.vue +113 -1
- package/docs/demos/StyleDemo.vue +1 -1
- package/docs/demos/api-index.js +22 -14
- package/docs/demos/demos.js +1 -1
- package/docs/demos/gis-view-demo/useGisViewDemo.js +2 -2
- package/docs/internals/13-/351/271/260/347/234/274/345/233/276.md +2 -0
- package/docs/internals/16-01-/344/274/230/345/214/226/344/270/216/345/217/226/350/210/215-/344/270/212.md +13 -2
- 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 +61 -1
- package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +5 -4
- package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +38 -10
- 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/07-/346/214/207/351/222/210/344/270/216/350/246/201/347/264/240/347/274/226/350/276/221.md +7 -6
- package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +59 -3
- package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +14 -1
- package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +23 -5
- 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 +16 -8
- package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +27 -2
- 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 +9 -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 +1 -1
- package/docs/steps/README.md +5 -5
- package/docs/steps/selftest-demos.html +105 -6
- package/docs/steps/selftest-docs.html +3 -3
- package/docs/steps/selftest-features.html +1 -1
- package/docs/steps/selftest-full.html +42 -1
- package/docs/steps/selftest-perf.html +600 -421
- package/docs/steps/selftest-select.html +168 -1
- 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
|
|
@@ -516,10 +530,16 @@ export interface GisViewMinimapOptions {
|
|
|
516
530
|
* 两者离得很远就是这样),只画正在看的那一份 —— 合并只会让两份都看不清
|
|
517
531
|
*/
|
|
518
532
|
extent?: GisViewMinimapExtent
|
|
533
|
+
/**
|
|
534
|
+
* 动态范围是否跟着当前可见内容重算:默认 false。首次拿到数据 / 底图范围后锁住世界范围,
|
|
535
|
+
* 筛选、删除、隐藏或新增内容都不会改小图的缩放与中心,外围内容消失时鹰眼图和视口框不会自己跳;
|
|
536
|
+
* 打开后才按当前可见数据与底图重新计算。显式改 extent(含直接写固定范围)始终立即生效。
|
|
537
|
+
*/
|
|
538
|
+
extentFollowContent?: boolean
|
|
519
539
|
/**
|
|
520
540
|
* `extent: 'auto'` 时是否允许范围跟着相机收窄:默认 false,始终按「数据 ∪ 底图」铺。
|
|
521
541
|
* 打开后,相机落在其中一份范围、而那份在合并结果里不足 6 像素时只画正在看的那一份;
|
|
522
|
-
*
|
|
542
|
+
* 相机进出这份范围时鹰眼图会重新计算包围盒;extentFollowContent 关闭时用的是锁定下来的那一份范围。
|
|
523
543
|
*/
|
|
524
544
|
extentFollowCamera?: boolean
|
|
525
545
|
/** 给小图容器再加一个类名(与内置的 gis-view__minimap 并列),方便用样式表改外观 */
|
|
@@ -2704,6 +2724,11 @@ export interface GisViewPickResult extends GisViewFeatureKey {
|
|
|
2704
2724
|
groupIndex?: number
|
|
2705
2725
|
/** 命中的是通道内的回线时,这一组的读数(成员、拐点数、骨架),结构与 getChannelGroups 的一项一致 */
|
|
2706
2726
|
group?: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
|
|
2727
|
+
/**
|
|
2728
|
+
* 命中的是通道内的回线时,同一通道全部分组的读数(按声明顺序,每项 groupIndex 是组号)。
|
|
2729
|
+
* `group` 是当前命中的那一组,`groups` 是整条通道的分组表;通道外的线路没有这两个字段。
|
|
2730
|
+
*/
|
|
2731
|
+
groups?: Array<GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }>
|
|
2707
2732
|
}
|
|
2708
2733
|
|
|
2709
2734
|
/** 点聚合配置:true 等价于开着一份缺省档;对象写法可逐项覆盖。 */
|
|
@@ -2772,8 +2797,46 @@ export type GisViewClusterClickPayload = GisViewClusterPickResult & {
|
|
|
2772
2797
|
action: GisViewPointerAction
|
|
2773
2798
|
}
|
|
2774
2799
|
|
|
2800
|
+
/**
|
|
2801
|
+
* 一条被选中的通道的上下文:通道本身、当前组与全部分组。
|
|
2802
|
+
* 单通道选中时这些字段直接摊平到选中载荷顶层;多通道时改为 channelContexts 里的一项,不会两处重复。
|
|
2803
|
+
*/
|
|
2804
|
+
export interface GisViewSelectionChannelContext {
|
|
2805
|
+
channelId: string | number
|
|
2806
|
+
channelIndex: number
|
|
2807
|
+
channel: GisViewChannel
|
|
2808
|
+
/** 当前组:真实点击 / selectAt 是命中的那一组;框选 / 按引用接口是选中集里第一条通道回线所在的组 */
|
|
2809
|
+
groupId: string | number
|
|
2810
|
+
groupIndex: number
|
|
2811
|
+
group: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
|
|
2812
|
+
/** 同一通道的全部分组(按声明顺序;同一条通道内与其他载荷项共享这一份数组) */
|
|
2813
|
+
groups: Array<GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }>
|
|
2814
|
+
/** 本次选中集里属于这条通道的回线下标 / id */
|
|
2815
|
+
lineIndexes: number[]
|
|
2816
|
+
lineIds: Array<string | number>
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
/** 选中载荷里的通道上下文字段:只有一条通道时摊平,多通道时只保留 channelContexts */
|
|
2820
|
+
export interface GisViewSelectionChannelFields {
|
|
2821
|
+
channelId?: string | number
|
|
2822
|
+
channelIndex?: number
|
|
2823
|
+
channel?: GisViewChannel
|
|
2824
|
+
groupId?: string | number
|
|
2825
|
+
groupIndex?: number
|
|
2826
|
+
group?: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
|
|
2827
|
+
groups?: Array<GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }>
|
|
2828
|
+
/** 选中集涉及多条通道时才有(按选中顺序);单通道不创建这一份,直接读顶层平铺字段 */
|
|
2829
|
+
channelContexts?: GisViewSelectionChannelContext[]
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
/** describeSelection 的返回值:要素读数 + 与选中载荷同一套通道上下文字段 */
|
|
2833
|
+
export interface GisViewDescribedSelection extends GisViewSelectionChannelFields {
|
|
2834
|
+
items: GisViewPickResult[]
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2775
2837
|
/** 选中事件载荷:点击选中为 0 / 1 个要素,Shift 框选为框内全部节点(随 shortcuts.boxSelect 改变) */
|
|
2776
|
-
export interface GisViewSelectPayload {
|
|
2838
|
+
export interface GisViewSelectPayload extends GisViewSelectionChannelFields {
|
|
2839
|
+
/** 选中项;通道回线只带 channelId / channelIndex / groupId / groupIndex 标量归属,分组读数看顶层或 channelContexts */
|
|
2777
2840
|
items: GisViewPickResult[]
|
|
2778
2841
|
/** 框选时的画布 CSS 像素矩形,点击选中为 null */
|
|
2779
2842
|
box: GisViewRect | null
|
|
@@ -2881,7 +2944,8 @@ export interface GisViewSelectionData {
|
|
|
2881
2944
|
* 选中集变更载荷:与 onSelect 的区别是这个只在「选中集真的变了」时发一条,
|
|
2882
2945
|
* 接口选中(select / clearSelection / selectInBox)也会发。
|
|
2883
2946
|
*/
|
|
2884
|
-
export interface GisViewSelectChangePayload extends GisViewSelectionInfo {
|
|
2947
|
+
export interface GisViewSelectChangePayload extends GisViewSelectionInfo, GisViewSelectionChannelFields {
|
|
2948
|
+
/** 与对应 onSelect 载荷共用同一批对象;通道回线不重复挂 group / groups */
|
|
2885
2949
|
items: GisViewPickResult[]
|
|
2886
2950
|
/** 框选时的矩形,其余为 null */
|
|
2887
2951
|
box: GisViewRect | null
|
|
@@ -3116,6 +3180,8 @@ export interface GisViewPointerPayload {
|
|
|
3116
3180
|
groupIndex?: number
|
|
3117
3181
|
/** 命中的是通道内的回线时,这一组的读数 */
|
|
3118
3182
|
group?: GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }
|
|
3183
|
+
/** 命中的是通道内的回线时,同一通道全部分组的读数;`group` 是当前这组,`groups` 是整条通道 */
|
|
3184
|
+
groups?: Array<GisViewChannelGroupInfo & { groupIndex: number; lineCount: number; waypointCount: number }>
|
|
3119
3185
|
/** 命中通道回线时的分组上下文:action.target 为 channel,按它直接渲染通道菜单 */
|
|
3120
3186
|
channelContext?: GisViewChannelContext
|
|
3121
3187
|
/** 命中多成员聚合时:聚合 id、成员数、成员下标 / id、包围盒与屏幕半径 */
|
|
@@ -3794,6 +3860,8 @@ export interface GisViewDataChangePayload {
|
|
|
3794
3860
|
lines: GisViewLine[]
|
|
3795
3861
|
channels: GisViewChannel[]
|
|
3796
3862
|
counts: { points: number; lines: number; channels: number }
|
|
3863
|
+
/** 数据修订号:每次数据变更 +1;只改全局配置 / 样式时不推,外部缓存据它决定要不要重算 */
|
|
3864
|
+
dataVersion: number
|
|
3797
3865
|
/** 动到 / 删掉的节点下标(单点更新是那一个,删除是删除前的下标升序,新增是它们在数组里的位置) */
|
|
3798
3866
|
index?: number
|
|
3799
3867
|
indexes?: number[]
|
|
@@ -5433,6 +5501,18 @@ export interface GisViewPointStyleSnapshot {
|
|
|
5433
5501
|
zIndex: number
|
|
5434
5502
|
}
|
|
5435
5503
|
|
|
5504
|
+
/** 一条线路解析之后的样式快照:getLineStyle() 的返回 */
|
|
5505
|
+
export interface GisViewLineStyleSnapshot {
|
|
5506
|
+
index: number
|
|
5507
|
+
/** 样式链(线路自身 > 规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale 与缩放联动 */
|
|
5508
|
+
width: number
|
|
5509
|
+
/** 解析后的 RGBA 颜色,四个分量都在 0 ~ 1 */
|
|
5510
|
+
color: [number, number, number, number]
|
|
5511
|
+
/** 0 ~ 1 */
|
|
5512
|
+
opacity: number
|
|
5513
|
+
zIndex: number
|
|
5514
|
+
}
|
|
5515
|
+
|
|
5436
5516
|
/** 合并时给的上下文:merge.createItem 会拿到它 */
|
|
5437
5517
|
export interface GisViewMergeContext {
|
|
5438
5518
|
sourceIndex: number
|
|
@@ -6535,6 +6615,16 @@ export interface GisViewOptions {
|
|
|
6535
6615
|
maxCanvasPixels?: number
|
|
6536
6616
|
ariaLabel?: string
|
|
6537
6617
|
onReady?: (payload: GisViewReadyPayload) => void
|
|
6618
|
+
/**
|
|
6619
|
+
* 本次选中操作:真实单击 / Ctrl 与 multiSelect 取反 / 框选 / selectAt 每次成功操作都发;
|
|
6620
|
+
* selectFeatures / deselect / focusOn({ select }) 等按引用接口只在选中集实际变化时发。
|
|
6621
|
+
* 清空与取反取没了时载荷是 null。onSelectChange 仍只在选中集实际变化时发。
|
|
6622
|
+
* 真实点击的派发顺序是 onClick → onSelect → onSelectChange;单通道选中时载荷顶层带
|
|
6623
|
+
* channelId / group / groups,多通道看 channelContexts。items 里的回线只带 channelId /
|
|
6624
|
+
* channelIndex / groupId / groupIndex 这些标量归属,不重复挂 group / groups;需要分组读数
|
|
6625
|
+
* 从顶层或 channelContexts 取。onSelect 与 onSelectChange 各自可独立订阅,两条载荷引用同一份
|
|
6626
|
+
* items 与分组数组,不会深拷贝;按只读使用,不要在回调里改载荷。
|
|
6627
|
+
*/
|
|
6538
6628
|
onSelect?: (payload: GisViewSelectPayload | null) => void
|
|
6539
6629
|
/** 单击要素或空白处 */
|
|
6540
6630
|
onClick?: (payload: GisViewClickPayload | null) => void
|
|
@@ -6610,8 +6700,11 @@ export interface GisViewOptions {
|
|
|
6610
6700
|
*/
|
|
6611
6701
|
onDataChange?: (payload: GisViewDataChangePayload) => void
|
|
6612
6702
|
/**
|
|
6613
|
-
*
|
|
6614
|
-
*
|
|
6703
|
+
* 选中集变化:覆盖所有来源(点击 / 框选 / selectFeatures / deselect / selectAt / selectInBox),
|
|
6704
|
+
* 且只在选中集真的变了时发一条;载荷带 ids / count / 各类型条数与来源 cause。
|
|
6705
|
+
* 与 onSelect 共用同一份选中集;需要「任何来源只通知一次」时优先订阅这一条。
|
|
6706
|
+
* 通道上下文与 onSelect 同一份:单通道摊平 channelId / group / groups,多通道给 channelContexts;
|
|
6707
|
+
* 不与 items 重复,两个事件共享同一批对象引用(按只读使用)。
|
|
6615
6708
|
*/
|
|
6616
6709
|
onSelectChange?: (payload: GisViewSelectChangePayload) => void
|
|
6617
6710
|
/**
|
|
@@ -6762,6 +6855,26 @@ export interface GisViewFocusOptions {
|
|
|
6762
6855
|
mode?: GisViewSelectMode
|
|
6763
6856
|
}
|
|
6764
6857
|
|
|
6858
|
+
/** 相机飞行的缓动:字符串预设,或 (progress 0~1) => eased 0~1 的自定义函数 */
|
|
6859
|
+
export type GisViewCameraEasing = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | ((progress: number) => number)
|
|
6860
|
+
|
|
6861
|
+
/** flyTo 的选项:目标解析、选中与缩放语义与 focusOn 完全一致,另加时长与缓动 */
|
|
6862
|
+
export interface GisViewFlyOptions extends GisViewFocusOptions {
|
|
6863
|
+
/** 飞行时长(毫秒),缺省 450;<= 0 时立即落位 */
|
|
6864
|
+
duration?: number
|
|
6865
|
+
/** 缓动,缺省 'ease-in-out';中心线性插值,比例按对数插值 */
|
|
6866
|
+
easing?: GisViewCameraEasing
|
|
6867
|
+
}
|
|
6868
|
+
|
|
6869
|
+
/** 相机飞行的实时读数:progress 是时间进度(0~1),不是缓动后的值 */
|
|
6870
|
+
export interface GisViewCameraAnimation {
|
|
6871
|
+
active: boolean
|
|
6872
|
+
progress: number
|
|
6873
|
+
duration: number
|
|
6874
|
+
from: GisViewCamera
|
|
6875
|
+
to: GisViewCamera
|
|
6876
|
+
}
|
|
6877
|
+
|
|
6765
6878
|
/** 导出图片的选项 */
|
|
6766
6879
|
export interface GisViewExportImageOptions {
|
|
6767
6880
|
/**
|
|
@@ -7382,6 +7495,10 @@ export interface GisViewInstance {
|
|
|
7382
7495
|
readonly el: HTMLElement
|
|
7383
7496
|
readonly canvas: HTMLCanvasElement
|
|
7384
7497
|
readonly gl: WebGL2RenderingContext | null
|
|
7498
|
+
/** 相机是否正在执行 flyTo 的飞行动画;只读,不触发重绘 */
|
|
7499
|
+
readonly cameraAnimating: boolean
|
|
7500
|
+
/** 数据修订号:数据变更后 +1;只改全局配置 / 样式不变,外部缓存与增量计算据此判断是否重算 */
|
|
7501
|
+
readonly dataVersion: number
|
|
7385
7502
|
/** 请求重画一帧:自定义 WebGL 层的数据源变了、组件自己不知道时调用 */
|
|
7386
7503
|
requestRender(): GisViewInstance
|
|
7387
7504
|
/**
|
|
@@ -7567,6 +7684,17 @@ export interface GisViewInstance {
|
|
|
7567
7684
|
* `{ select: true, mode }` 顺手把这些要素选上。认不出目标时什么都不做,返回实例便于链式调用。
|
|
7568
7685
|
*/
|
|
7569
7686
|
focusOn(target: GisViewFocusTargets, options?: GisViewFocusOptions): GisViewInstance
|
|
7687
|
+
/** 平滑飞向与 focusOn 相同的目标;duration / easing 只影响这一次调用 */
|
|
7688
|
+
flyTo(target: GisViewFocusTargets, options?: GisViewFlyOptions): GisViewInstance
|
|
7689
|
+
/**
|
|
7690
|
+
* 直接飞向一个相机目标 `{ center?, scale? }`:不写的那一项沿用当前相机,不经过要素解析。
|
|
7691
|
+
* duration / easing 与 flyTo 同义;参数非法时保持当前相机。
|
|
7692
|
+
*/
|
|
7693
|
+
flyToCamera(camera: GisViewCameraTarget, options?: GisViewFlyCameraOptions): GisViewInstance
|
|
7694
|
+
/** 停掉正在跑的相机飞行(停当前帧、不补跳终点);没有动画时是空操作 */
|
|
7695
|
+
stopCameraAnimation(): GisViewInstance
|
|
7696
|
+
/** 当前相机飞行读数;没有动画时 null */
|
|
7697
|
+
getCameraAnimation(): GisViewCameraAnimation | null
|
|
7570
7698
|
/** 按关键字搜索节点 / 线路 / 通道:只返回命中(不改数据、不改筛选、也不动视角),聚焦与选中交给使用方 */
|
|
7571
7699
|
search(input: string | GisViewSearchOptions): GisViewSearchResult
|
|
7572
7700
|
/**
|
|
@@ -7670,9 +7798,17 @@ export interface GisViewInstance {
|
|
|
7670
7798
|
/**
|
|
7671
7799
|
* 按浏览器客户端坐标拾取(鼠标事件里的 clientX / clientY):与指针事件载荷同一份读数,另加 target
|
|
7672
7800
|
* ('point' / 'line' / 'channel')与 lngLat(配了 GeoJSON 底图才有);没命中返回 null。
|
|
7801
|
+
* 命中通道回线时给 group(当前这一组)与 groups(同一通道的全部分组)。
|
|
7673
7802
|
* 只读 —— 不改选中、不动光标。自建浮层 / 自定义菜单 / 拖拽放下时「问一下这儿是什么」用它
|
|
7674
7803
|
*/
|
|
7675
7804
|
pickAt(clientX: number, clientY: number): GisViewPickAtResult | null
|
|
7805
|
+
/**
|
|
7806
|
+
* 按客户端坐标做一次「普通单击选中」:与画布点击共用命中顺序与选中状态,
|
|
7807
|
+
* 通道回线按 channelSelectMode 摊开。空白 / 聚合圆返回 null 且不改选中。
|
|
7808
|
+
* 立即生效,不等待 selectTrigger: 'dblClick',也不派发 onClick / onDblClick;选中集实际变化时发
|
|
7809
|
+
* onSelect / onSelectChange。已知节点 / 线路 id 时直接用 selectFeatures,不必先求坐标。
|
|
7810
|
+
*/
|
|
7811
|
+
selectAt(clientX: number, clientY: number): GisViewSelectPayload | null
|
|
7676
7812
|
/**
|
|
7677
7813
|
* 程序化悬停(参数就是鼠标事件里的 clientX / clientY):让指针「停」到这个位置上 ——
|
|
7678
7814
|
* 悬停高亮、光标与 onHover 都按它更新(外部列表 / 表格 hover 到某一行时联动高亮图上的要素)。
|
|
@@ -7699,7 +7835,8 @@ export interface GisViewInstance {
|
|
|
7699
7835
|
getLineChannel(ref: GisViewFeatureRef): GisViewLineChannelInfo | null
|
|
7700
7836
|
/**
|
|
7701
7837
|
* 让一批东西变成选中状态(接口选中):与点击选中走同一份 state,因此 getSelections / getSelectionData
|
|
7702
|
-
*
|
|
7838
|
+
* 立刻就能读回来。会同步选中样式与读数;选中集实际变化时发 onSelect 与 onSelectChange(cause: api)。
|
|
7839
|
+
* 认这些写法(见 GisViewSelectionRef):
|
|
7703
7840
|
* ① 节点:id、`{ type: 'point', index: 3 }`、一批 id 与对象混着写;
|
|
7704
7841
|
* ② 通道:`{ type: 'channel', channelId: 'channel-a' }` 选整条通道的回线,
|
|
7705
7842
|
* `{ channelId, groupId }` / `{ type: 'group', channelId, groupId }` 选某一组
|
|
@@ -7720,7 +7857,8 @@ export interface GisViewInstance {
|
|
|
7720
7857
|
* 把这些从当前选中集里去掉,其余选中原样留着 —— `deselect('p-1')` 取消一个节点、
|
|
7721
7858
|
* `deselect({ type: 'channel', channelId: 'channel-a' })` 取消整条通道的回线。
|
|
7722
7859
|
* 一个目标都不给(不传 / 传 null)等于取消全部(与 selectFeatures(null) 同一件事),
|
|
7723
|
-
*
|
|
7860
|
+
* 传空数组是「没有目标」,什么都不做;认不出来的条目跳过。改变选中集时发
|
|
7861
|
+
* onSelect 与 onSelectChange(cause: api)。
|
|
7724
7862
|
*/
|
|
7725
7863
|
deselect(refs?: GisViewSelectionRefs): GisViewInstance
|
|
7726
7864
|
/** 当前选中集的原始条目(`{ type, index, item, ... }`,与指针载荷同一份口径),不做整理、不读包围盒 */
|
|
@@ -8220,6 +8358,12 @@ export interface GisViewInstance {
|
|
|
8220
8358
|
* 拖拽落点预览拿它核对「预览与落地同一个尺寸」,合并取双方较大值走的也是这一份;下标不存在返回 null
|
|
8221
8359
|
*/
|
|
8222
8360
|
getPointStyle(index: number): GisViewPointStyleSnapshot | null
|
|
8361
|
+
/**
|
|
8362
|
+
* 线路解析之后的样式快照(width / color / opacity / zIndex):width 取样式链
|
|
8363
|
+
* (线路自身 > 规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale / 缩放联动与热力倍率;
|
|
8364
|
+
* 下标不存在时返回 null。鹰眼图沿用主图线路宽度时用的就是它。
|
|
8365
|
+
*/
|
|
8366
|
+
getLineStyle(index: number): GisViewLineStyleSnapshot | null
|
|
8223
8367
|
/** 按 id / 下标取一条线路(拾取载荷 + path / bounds / color / width);找不到返回 null */
|
|
8224
8368
|
getLine(ref: GisViewFeatureRef): GisViewLineInfo | null
|
|
8225
8369
|
/** 按 id / 下标取一条通道(数据那一份 + 成员表 + 分组上下文);找不到返回 null */
|
|
@@ -8502,11 +8646,17 @@ export interface GisViewEngineOptions {
|
|
|
8502
8646
|
onCursor?: (coordinate: [number, number] | null) => void
|
|
8503
8647
|
onHover?: (payload: GisViewHoverPayload) => void
|
|
8504
8648
|
/**
|
|
8649
|
+
* 点击 / 框选路径(真实点击 / Ctrl 多选 / 框选(含 selectInBox)/ 空白清空)与 selectAt 每次成功操作都发;
|
|
8650
|
+
* selectFeatures / deselect / focusOn({ select }) 等按引用接口只在选中集实际变化时发。
|
|
8651
|
+
* 要统一监听所有来源并且避免点击同一要素时重复通知,请用 onSelectChange。
|
|
8652
|
+
* 真实点击的顺序是 onClick → onSelect → onSelectChange;Ctrl / multiSelect 取反与框选没有 onClick,
|
|
8653
|
+
* 顺序是 onSelect → onSelectChange。单通道选中时载荷顶层带 channelId / group / groups,多通道看 channelContexts。
|
|
8654
|
+
* items 里的回线只有标量归属,不重复挂 group / groups;两条回调共享同一批对象引用。
|
|
8505
8655
|
* 载荷为 null(没有选中任何要素)时的补充读数:mode 说明这一下是哪一种选中方式 ——
|
|
8506
8656
|
* 'multi' 是 Ctrl 点击取反取没了、'box' 是框选没框到东西;originalEvent 是那一次指针事件
|
|
8507
8657
|
* (载荷里没有它时靠这一份读修饰键)。其余清空路径不带第二个参数
|
|
8508
8658
|
*/
|
|
8509
|
-
onSelect?: (payload: GisViewSelectPayload | null, detail?: { mode?: 'single' | 'multi' | 'box'; originalEvent?: Event | null }) => void
|
|
8659
|
+
onSelect?: (payload: GisViewSelectPayload | null, detail?: { mode?: 'single' | 'multi' | 'box'; originalEvent?: Event | null; defer?: boolean }) => void
|
|
8510
8660
|
onClick?: (payload: GisViewClickPayload | null) => void
|
|
8511
8661
|
/** 点中多成员聚合圆(引擎不选中成员,普通点击回调不会同时触发) */
|
|
8512
8662
|
onClusterClick?: (payload: GisViewClusterClickPayload, event: Event) => void
|
|
@@ -8553,6 +8703,8 @@ export interface GisViewEngine {
|
|
|
8553
8703
|
describe(selection: GisViewFeatureKey): GisViewPickResult | null
|
|
8554
8704
|
/** 批量把要素下标还原成拾取结果,框选与受控选中都用它 */
|
|
8555
8705
|
describeAll(selection: GisViewFeatureKey[]): GisViewPickResult[]
|
|
8706
|
+
/** 批量还原并补通道上下文:单通道摊平 channelId / group / groups,多通道给 channelContexts */
|
|
8707
|
+
describeSelection(selection: GisViewFeatureKey[], preferredGroupId?: string | number): GisViewDescribedSelection
|
|
8556
8708
|
/** 按画布 CSS 像素矩形框选,返回框内要素;第二段兼容旧的 Event 或 { selectionKinds, originalEvent } */
|
|
8557
8709
|
selectInBox(box: GisViewRect, options?: GisViewSelectInBoxOptions | Event | null): GisViewPickResult[]
|
|
8558
8710
|
/** 拐点增删改,insertIndex 缺省时按直线上离目标最近的线段插入 */
|
|
@@ -8679,6 +8831,8 @@ export interface GisViewEngine {
|
|
|
8679
8831
|
* 合并节点取双方最大尺寸、图标优先目标用的就是它;下标不存在时返回 null
|
|
8680
8832
|
*/
|
|
8681
8833
|
getPointStyle(index: number): GisViewPointStyleSnapshot | null
|
|
8834
|
+
/** 线路解析之后的样式快照(width / color / opacity / zIndex);下标不存在时返回 null */
|
|
8835
|
+
getLineStyle(index: number): GisViewLineStyleSnapshot | null
|
|
8682
8836
|
|
|
8683
8837
|
/** 某个下标的节点当前还在不在图上:被过滤 / 隐藏掉的不算 */
|
|
8684
8838
|
isPointVisible(index: number): boolean
|
|
@@ -8699,6 +8853,14 @@ export interface GisViewEngine {
|
|
|
8699
8853
|
forEachPointInView(rect: GisViewBounds, visit: (index: number, item: GisViewPoint, x: number, y: number, radius: number) => void | boolean): void
|
|
8700
8854
|
getCamera(): GisViewCamera
|
|
8701
8855
|
setCamera(camera: Partial<GisViewCamera>): void
|
|
8856
|
+
/** 只算目标相机、不动画面;视口还没量出来时返回 null */
|
|
8857
|
+
getCameraForBounds(bounds: GisViewBounds, padding?: number): GisViewCamera | null
|
|
8858
|
+
/** 相机飞行:target 是终点的 { center, scale },duration / easing 只影响这一次 */
|
|
8859
|
+
flyCamera(target: GisViewCamera, options?: Pick<GisViewFlyOptions, 'duration' | 'easing'>): boolean
|
|
8860
|
+
/** 停掉相机飞行,返回是否真的停了一条正在跑的动画 */
|
|
8861
|
+
stopCameraAnimation(): boolean
|
|
8862
|
+
getCameraAnimation(): GisViewCameraAnimation | null
|
|
8863
|
+
isCameraAnimating(): boolean
|
|
8702
8864
|
zoomBy(factor: number, origin?: [number, number]): void
|
|
8703
8865
|
zoomTo(scale: number, origin?: [number, number]): void
|
|
8704
8866
|
zoomToBounds(bounds: GisViewBounds, padding?: number): void
|
|
@@ -8771,6 +8933,8 @@ export interface GisViewEngine {
|
|
|
8771
8933
|
pick(x: number, y: number): GisViewHitResult | null
|
|
8772
8934
|
/** 与组件实例的 pickAt 同一份:按浏览器客户端坐标拾取(引擎不等 DOM 事件,直接给 clientX / clientY) */
|
|
8773
8935
|
pickAtClient(clientX: number, clientY: number): GisViewHitResult | null
|
|
8936
|
+
/** 与组件实例的 selectAt 同一份:按客户端坐标走一次普通单击选中(通道按 channelSelectMode 摊开) */
|
|
8937
|
+
selectAtClient(clientX: number, clientY: number): GisViewSelectPayload | null
|
|
8774
8938
|
/** 程序化悬停(客户端坐标):让指针「停」在这儿,悬停高亮 / 光标 / onHover 一起更新,返回这一次的读数 */
|
|
8775
8939
|
hoverAtClient(clientX: number, clientY: number): GisViewHoverPayload | null
|
|
8776
8940
|
/** 取消程序化悬停:清掉高亮与读数并补发 onHover(null) */
|