gis-view-webgl2 0.1.13 → 0.1.15
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/dist/index.cjs +1 -1
- package/dist/index.d.ts +140 -60
- package/dist/index.js +1 -1
- package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +73 -5
- package/docs/GisView.md +49 -49
- 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 +87 -16
- package/docs/demos/ApiCoverageDemo.vue +1 -5
- package/docs/demos/BackendSyncDemo.vue +1 -2
- package/docs/demos/BackgroundDemo.vue +68 -1
- package/docs/demos/BasicDemo.vue +76 -76
- package/docs/demos/BatchAddDemo.vue +2 -1
- package/docs/demos/ChannelDemo.vue +1 -3
- package/docs/demos/ClusterDemo.vue +48 -1
- package/docs/demos/CopyMergeDemo.vue +899 -904
- package/docs/demos/DemoShell.vue +336 -336
- package/docs/demos/EventDemo.vue +300 -300
- package/docs/demos/ExtensionDemo.vue +200 -200
- package/docs/demos/GisViewDemo.vue +64 -64
- package/docs/demos/LabelDemo.vue +489 -489
- package/docs/demos/StyleDemo.vue +67 -67
- package/docs/demos/api-index.js +24 -29
- package/docs/demos/demos.js +92 -92
- package/docs/demos/gis-view-demo/useGisViewDemo.js +19 -14
- package/docs/demos/shared/demoData.js +107 -107
- package/docs/demos/shared/demoStyle.css +249 -249
- package/docs/format/02-/350/212/202/347/202/271/344/270/216/347/272/277/350/267/257.md +3 -3
- package/docs/format/03-/346/213/220/347/202/271/350/243/205/351/245/260/344/270/216/346/240/267/345/274/217.md +3 -0
- package/docs/from0/01-/345/205/210/346/212/212/345/234/260/345/233/276/346/203/263/346/270/205/346/245/232.md +8 -7
- package/docs/index.html +3 -3
- package/docs/internals/04-/347/233/270/346/234/272/345/235/220/346/240/207/344/270/216/345/203/217/347/264/240.md +6 -4
- package/docs/internals/14-/350/203/214/346/231/257/345/261/202.md +2 -2
- package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +36 -16
- package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +38 -84
- package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +36 -19
- 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 +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 -7
- package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +15 -15
- 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 +1 -1
- package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +6 -0
- package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +1 -1
- package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +2 -0
- package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +10 -8
- package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +11 -7
- package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +27 -8
- package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +27 -4
- 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 +3 -3
- package/docs/playground/index.html +1 -1
- package/docs/sample-document/345/255/227/346/256/265/350/257/246/350/247/243.md +2 -2
- package/docs/steps/check-doc-truth.mjs +1 -1
- package/docs/steps/selftest-actions.html +4 -4
- package/docs/steps/selftest-data.html +5 -5
- package/docs/steps/selftest-demos.html +1683 -1619
- package/docs/steps/selftest-docs.html +4 -4
- package/docs/steps/selftest-effects.html +1 -1
- package/docs/steps/selftest-features.html +548 -47
- package/docs/steps/selftest-full.html +566 -566
- package/docs/steps/selftest-labels.html +647 -647
- package/docs/steps/selftest-perf.html +2282 -2237
- package/docs/steps/selftest-select.html +53 -14
- package/docs/steps/step-10-full.js +1 -4
- package/docs/steps/step-12-events.js +1 -4
- package/package.json +43 -43
package/dist/index.d.ts
CHANGED
|
@@ -1303,6 +1303,8 @@ export interface GisViewPointDecoration {
|
|
|
1303
1303
|
size?: number
|
|
1304
1304
|
/** 填充 / 色调,缺省白色 */
|
|
1305
1305
|
color?: string
|
|
1306
|
+
/** 所属节点被选中时是否改用其最终选中色:SVG path 写 strokeColor,其余符号写 color;缺省 false */
|
|
1307
|
+
followSelectColor?: boolean
|
|
1306
1308
|
/** 描边色,缺省透明 */
|
|
1307
1309
|
strokeColor?: string
|
|
1308
1310
|
/** 描边宽度(CSS 像素),缺省 0 */
|
|
@@ -1352,9 +1354,9 @@ export interface GisViewPoint {
|
|
|
1352
1354
|
labels?: GisViewItemLabel | GisViewItemLabel[]
|
|
1353
1355
|
/** 这个点的悬浮提示内容:覆盖全局分类配置,false 表示这个点不显示提示 */
|
|
1354
1356
|
tooltip?: GisViewTooltipContent | false
|
|
1355
|
-
/**
|
|
1357
|
+
/** 是否可点击(悬停、选中与点击事件):逐点关掉;悬停 / 选中的总闸是 features.hover / features.select */
|
|
1356
1358
|
clickable?: boolean
|
|
1357
|
-
/**
|
|
1359
|
+
/** 是否可拖拽:总闸是 features.drag,节点写 false 可在总闸打开时逐个关掉 */
|
|
1358
1360
|
draggable?: boolean
|
|
1359
1361
|
/** 是否允许复制(按住复制快捷键点击 / 接口复制):false 时这个节点不出复制预览,缺省 true */
|
|
1360
1362
|
copyable?: boolean
|
|
@@ -1437,7 +1439,7 @@ export interface GisViewLine {
|
|
|
1437
1439
|
labels?: GisViewItemLabel | GisViewItemLabel[]
|
|
1438
1440
|
/** 这条线的悬浮提示内容:覆盖全局分类配置,false 表示这条线不显示提示 */
|
|
1439
1441
|
tooltip?: GisViewTooltipContent | false
|
|
1440
|
-
/**
|
|
1442
|
+
/** 是否可点击(悬停、选中与点击事件):逐条关掉;悬停 / 选中的总闸是 features.hover / features.select */
|
|
1441
1443
|
clickable?: boolean
|
|
1442
1444
|
/** 悬停到这条线上时的光标:覆盖 options.cursorStyle.line / channel */
|
|
1443
1445
|
cursor?: GisViewCursorValue
|
|
@@ -1449,7 +1451,7 @@ export interface GisViewLine {
|
|
|
1449
1451
|
selectStyle?: GisViewLineStyle
|
|
1450
1452
|
/** Ctrl 点击累加多选时的样式,按字段覆盖线自身样式,缺省沿用 selectStyle 与 options.lineMultiSelectStyle */
|
|
1451
1453
|
multiSelectStyle?: GisViewLineStyle
|
|
1452
|
-
/** 是否允许编辑拐点(Ctrl +
|
|
1454
|
+
/** 是否允许编辑拐点(Ctrl + 点击添加、拖动、删除):逐条关掉;总闸是 features.waypoint */
|
|
1453
1455
|
waypointEditable?: boolean
|
|
1454
1456
|
/** 这条线的热力图:false 不参与(保持自身配色,也不会退回所属通道的值),true / 对象同上 */
|
|
1455
1457
|
heatmap?: GisViewHeatmapOverride
|
|
@@ -1489,7 +1491,7 @@ export interface GisViewCascadeHighlightOptions {
|
|
|
1489
1491
|
/** 普通单击是否触发 / 更新级联高亮,缺省 true;关闭后这次单击只走选中,并清掉旧级联 */
|
|
1490
1492
|
triggerOnClick?: boolean
|
|
1491
1493
|
/**
|
|
1492
|
-
* Ctrl / ⌘ 多选或
|
|
1494
|
+
* Ctrl / ⌘ 多选或 features.multiSelect 的累加点击是否触发级联高亮,缺省 true。
|
|
1493
1495
|
* 关闭后多选只改变选中集,不改级联状态(并把旧级联收掉)
|
|
1494
1496
|
*/
|
|
1495
1497
|
triggerOnMultiSelect?: boolean
|
|
@@ -3011,10 +3013,13 @@ export interface GisViewResolvedGeoJson {
|
|
|
3011
3013
|
labels: GisViewResolvedBackgroundLabel[]
|
|
3012
3014
|
/** 实际落到画面上的旋转角(度,顺时针,已归一到 [-180, 180)) */
|
|
3013
3015
|
rotation: number
|
|
3016
|
+
/** geoJsonStyle.bounds / rotation 实际使用的缩放、平移与旋转;没有改位置时为 null */
|
|
3017
|
+
drawTransform: GisViewGeoDrawTransform | null
|
|
3014
3018
|
/** 缩放前的真实坐标范围(aspectScale 生效前):相机、fitView 与经纬度换算用它 */
|
|
3015
3019
|
rawBounds: GisViewBounds | null
|
|
3016
3020
|
/** 这份底图实际使用的 aspectScale(默认 0.75) */
|
|
3017
3021
|
aspectScale: number
|
|
3022
|
+
/** 最终画出来的轴对齐范围(含 aspectScale、geoJsonStyle.bounds 与 rotation) */
|
|
3018
3023
|
bounds: GisViewBounds | null
|
|
3019
3024
|
fills: number[]
|
|
3020
3025
|
fillBuckets: Array<{ color: [number, number, number, number]; first: number; count: number }>
|
|
@@ -3031,14 +3036,27 @@ export interface GisViewResolvedGeoJson {
|
|
|
3031
3036
|
shadow: { color: [number, number, number, number]; offsets: Array<[number, number]> } | null
|
|
3032
3037
|
}
|
|
3033
3038
|
|
|
3039
|
+
/** 解析后 GeoJSON 的最终摆放参数:先按 aspectScale 生成源范围,再缩放 / 平移 / 旋转到画面 */
|
|
3040
|
+
export interface GisViewGeoDrawTransform {
|
|
3041
|
+
scaleX: number
|
|
3042
|
+
scaleY: number
|
|
3043
|
+
offsetX: number
|
|
3044
|
+
offsetY: number
|
|
3045
|
+
/** 旋转中心(世界坐标) */
|
|
3046
|
+
center: [number, number]
|
|
3047
|
+
/** 顺时针角度(度) */
|
|
3048
|
+
rotation: number
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3034
3051
|
/** 经纬度 ↔ GeoJSON 画出来的世界坐标的换算(aspectScale 只压经度,围绕整体范围中心) */
|
|
3035
3052
|
export interface GisViewGeoProjection {
|
|
3036
3053
|
/** 缩放前的真实经纬度范围 */
|
|
3037
3054
|
rawBounds: GisViewBounds
|
|
3038
|
-
/**
|
|
3055
|
+
/** 最终画出来的世界范围(含 aspectScale、geoJsonStyle.bounds 与 rotation) */
|
|
3039
3056
|
bounds: GisViewBounds
|
|
3040
3057
|
aspectScale: number
|
|
3041
3058
|
center: [number, number]
|
|
3059
|
+
/** 合成后的 x / y 基准比例(旋转后不再等价于单一轴对齐仿射,优先用 project / unproject) */
|
|
3042
3060
|
scaleX: number
|
|
3043
3061
|
scaleY: number
|
|
3044
3062
|
/** 经纬度 → 画出来的世界坐标(与底图完全对齐) */
|
|
@@ -3049,8 +3067,8 @@ export interface GisViewGeoProjection {
|
|
|
3049
3067
|
|
|
3050
3068
|
/** 数据坐标 → GeoJSON 坐标的映射参数 */
|
|
3051
3069
|
export interface GisViewGeoMapperOptions {
|
|
3052
|
-
/** 'lngLat'
|
|
3053
|
-
mode?: 'lngLat' | 'fit' | 'scale'
|
|
3070
|
+
/** 'lngLat' 数据本身就是经纬度 / 'fit' 任意坐标系等比铺进 geojson 范围 / 'scale'(默认)经纬度基准上叠加比例与偏移 */
|
|
3071
|
+
mode?: 'lngLat' | 'fit' | 'world' | 'scale'
|
|
3054
3072
|
/** 在基准变换之上再叠一层比例:节点与 geojson 的大小比例属性,绕 center(缺省 geojson 中心) */
|
|
3055
3073
|
scale?: number
|
|
3056
3074
|
scaleX?: number
|
|
@@ -3059,9 +3077,21 @@ export interface GisViewGeoMapperOptions {
|
|
|
3059
3077
|
offsetX?: number
|
|
3060
3078
|
offsetY?: number
|
|
3061
3079
|
center?: [number, number]
|
|
3062
|
-
/** fit
|
|
3080
|
+
/** fit 模式的数据范围;不传就从节点、线路几何、通道 / 分组路径与固定坐标装饰算 */
|
|
3063
3081
|
bounds?: GisViewBounds | null
|
|
3064
|
-
data?: {
|
|
3082
|
+
data?: {
|
|
3083
|
+
points?: Array<{ x: number; y: number; decorations?: Array<{ at?: GisViewCoordinate }> }>
|
|
3084
|
+
lines?: Array<{
|
|
3085
|
+
path?: GisViewCoordinate[]
|
|
3086
|
+
start?: GisViewCoordinate
|
|
3087
|
+
end?: GisViewCoordinate
|
|
3088
|
+
decorations?: Array<{ at?: GisViewCoordinate; position?: GisViewLineDecorationPosition }>
|
|
3089
|
+
}>
|
|
3090
|
+
channels?: Array<{
|
|
3091
|
+
path?: GisViewCoordinate[]
|
|
3092
|
+
groups?: Array<{ path?: GisViewCoordinate[]; waypointOffsets?: Record<string, GisViewCoordinate> }>
|
|
3093
|
+
}>
|
|
3094
|
+
} | null
|
|
3065
3095
|
/** fit 模式四周留白(占 geojson 短边比例,0 ~ 0.45) */
|
|
3066
3096
|
padding?: number
|
|
3067
3097
|
/** fit 模式铺进哪份范围:'drawn'(默认,画出来的范围)/ 'raw'(aspectScale 之前的真实范围) */
|
|
@@ -3070,9 +3100,13 @@ export interface GisViewGeoMapperOptions {
|
|
|
3070
3100
|
aspectScale?: number
|
|
3071
3101
|
}
|
|
3072
3102
|
|
|
3073
|
-
/**
|
|
3103
|
+
/**
|
|
3104
|
+
* 数据坐标 → GeoJSON 坐标的映射器:map / unmap 换单个点,mapPoint / mapLine / mapChannel 换一份数据。
|
|
3105
|
+
* 坐标同时认 `[x, y]` 与 `{ x, y }`;mapLine / mapChannel 会换 path / start / end 与固定坐标装饰,
|
|
3106
|
+
* mapChannel 还会换分组 path,并把 waypointOffsets 当向量映射(不叠平移)。
|
|
3107
|
+
*/
|
|
3074
3108
|
export interface GisViewGeoMapper {
|
|
3075
|
-
mode: 'lngLat' | 'fit' | 'scale'
|
|
3109
|
+
mode: 'lngLat' | 'fit' | 'world' | 'scale'
|
|
3076
3110
|
projection: GisViewGeoProjection
|
|
3077
3111
|
pivot: [number, number]
|
|
3078
3112
|
scaleX: number
|
|
@@ -3185,6 +3219,24 @@ export interface GisViewPointClusterOptions {
|
|
|
3185
3219
|
minPoints?: number
|
|
3186
3220
|
/** 相机比例 / 基准比例超过它之后展开原始点;0(缺省)表示不设上限 */
|
|
3187
3221
|
maxZoom?: number
|
|
3222
|
+
/** 聚合圆 / 图标的填充色,缺省 '#2970db';SVG 图标的 currentColor 也取它 */
|
|
3223
|
+
color?: string
|
|
3224
|
+
/** 聚合圆描边色,缺省 '#ffffff';形状图标用自己的 strokeColor 时以图标为准 */
|
|
3225
|
+
strokeColor?: string
|
|
3226
|
+
/** 聚合圆描边宽度(CSS 像素),缺省 2,夹在 0 ~ 20 */
|
|
3227
|
+
strokeWidth?: number
|
|
3228
|
+
/** 聚合圆 / 图标的整体不透明度,缺省 1,夹在 0 ~ 1 */
|
|
3229
|
+
opacity?: number
|
|
3230
|
+
/** 数量文字颜色,缺省 '#ffffff' */
|
|
3231
|
+
textColor?: string
|
|
3232
|
+
/** 数量文字字号(CSS 像素);0(缺省)按聚合圆半径自动取 12 / 13 */
|
|
3233
|
+
fontSize?: number
|
|
3234
|
+
/** 聚合圆图标:内置 circle / square、SVG / 图片地址或自定义图元,缺省 'circle' */
|
|
3235
|
+
symbol?: GisViewSymbolInput
|
|
3236
|
+
/** 是否显示聚合数量文字,缺省 true;图标本身已经带数量时可以关掉 */
|
|
3237
|
+
showCount?: boolean
|
|
3238
|
+
/** 聚合圆整体尺寸倍数(含命中半径),缺省 1,夹在 0.25 ~ 4 */
|
|
3239
|
+
sizeScale?: number
|
|
3188
3240
|
}
|
|
3189
3241
|
|
|
3190
3242
|
/** getPointCluster() 的读数:归一化之后的配置 + 当前缩放档是否仍在聚合。 */
|
|
@@ -3203,6 +3255,17 @@ export interface GisViewCluster {
|
|
|
3203
3255
|
screen: [number, number]
|
|
3204
3256
|
radius: number
|
|
3205
3257
|
bounds: GisViewBounds
|
|
3258
|
+
/** 多成员聚合圆的样式读数;单成员组不带这些字段 */
|
|
3259
|
+
color?: string
|
|
3260
|
+
strokeColor?: string
|
|
3261
|
+
strokeWidth?: number
|
|
3262
|
+
opacity?: number
|
|
3263
|
+
textColor?: string
|
|
3264
|
+
/** 数量文字的实际字号(fontSize: 0 时是按半径算出来的 12 / 13) */
|
|
3265
|
+
fontSize?: number
|
|
3266
|
+
symbol?: GisViewSymbolInput
|
|
3267
|
+
showCount?: boolean
|
|
3268
|
+
sizeScale?: number
|
|
3206
3269
|
}
|
|
3207
3270
|
|
|
3208
3271
|
/** 多成员聚合圆的拾取结果:item 永远为 null,index 为 -1,不进入普通要素选中集。 */
|
|
@@ -3225,6 +3288,11 @@ export interface GisViewClusterLabel {
|
|
|
3225
3288
|
count: number
|
|
3226
3289
|
screen: [number, number]
|
|
3227
3290
|
radius: number
|
|
3291
|
+
/** 已经解析过的数量文字字号 */
|
|
3292
|
+
fontSize: number
|
|
3293
|
+
textColor: string
|
|
3294
|
+
/** false 时覆盖层不生成数量 DOM,读屏与导出一致 */
|
|
3295
|
+
showCount: boolean
|
|
3228
3296
|
}
|
|
3229
3297
|
|
|
3230
3298
|
/**
|
|
@@ -3522,8 +3590,8 @@ export type GisViewPointerActionType =
|
|
|
3522
3590
|
| 'click'
|
|
3523
3591
|
| 'pan'
|
|
3524
3592
|
| 'copy'
|
|
3525
|
-
| 'channelDraft'
|
|
3526
|
-
| 'decorationDraft'
|
|
3593
|
+
| 'channelDraft'
|
|
3594
|
+
| 'decorationDraft'
|
|
3527
3595
|
| 'drag'
|
|
3528
3596
|
| 'pointer'
|
|
3529
3597
|
|
|
@@ -5274,6 +5342,8 @@ export interface GisViewLineDecoration {
|
|
|
5274
5342
|
size?: number
|
|
5275
5343
|
/** 填充 / 色调:填进符号的 color,'currentColor' 一类的写法取的就是它;默认白色 */
|
|
5276
5344
|
color?: string
|
|
5345
|
+
/** 所属线路被选中时是否改用其最终选中色:SVG path 写 strokeColor,其余符号写 color;缺省 false */
|
|
5346
|
+
followSelectColor?: boolean
|
|
5277
5347
|
/** 描边色:符号里的 stroke: 'currentStrokeColor' 取的是它(默认透明,也就是不描边) */
|
|
5278
5348
|
strokeColor?: string
|
|
5279
5349
|
/** 描边宽度(CSS 像素),默认 0 */
|
|
@@ -5324,6 +5394,8 @@ export interface GisViewDecorationDraftOptions {
|
|
|
5324
5394
|
size?: number
|
|
5325
5395
|
/** 填充 / 色调,缺省白色 */
|
|
5326
5396
|
color?: string
|
|
5397
|
+
/** 提交后的装饰是否跟随所属要素选中色:SVG path 写 strokeColor,其余符号写 color;缺省 false */
|
|
5398
|
+
followSelectColor?: boolean
|
|
5327
5399
|
/** 描边色,缺省透明 */
|
|
5328
5400
|
strokeColor?: string
|
|
5329
5401
|
/** 描边宽度(CSS 像素),缺省 0 */
|
|
@@ -5415,6 +5487,7 @@ export interface GisViewDecorationDraftPayload {
|
|
|
5415
5487
|
strokeWidth: number
|
|
5416
5488
|
opacity: number
|
|
5417
5489
|
parallel: boolean
|
|
5490
|
+
followSelectColor: boolean
|
|
5418
5491
|
scope: GisViewDecorationDraftScope
|
|
5419
5492
|
maxDistance: number
|
|
5420
5493
|
maxPerLine: number
|
|
@@ -6157,6 +6230,7 @@ export type GisViewChannelHiddenLineLayout = 'preserve' | 'center'
|
|
|
6157
6230
|
/**
|
|
6158
6231
|
* 框选允许收哪几类要素:节点、独立线路、通道回线,以及线路 / 通道的端点口径。
|
|
6159
6232
|
* 通道回线只归 channel 这一档管;通道之外的普通线路归 line,两者可以任意组合。
|
|
6233
|
+
* line / channel 按实际折线路径与选框逐线段相交判定,包围盒只用于候选粗筛。
|
|
6160
6234
|
* `lineEndpoints` / `channelEndpoints` 要求线路 / 通道自己的两端节点都被框住才算命中,
|
|
6161
6235
|
* 只用于框选、`selectInBox` 与 `exportData({ scope: 'viewport' })`,不参与点击多选。
|
|
6162
6236
|
*/
|
|
@@ -6430,6 +6504,10 @@ export type GisViewFeatureName =
|
|
|
6430
6504
|
| 'hover'
|
|
6431
6505
|
/** 点击选中(onClick 与 select / selectInBox 这些接口入口不受它限制) */
|
|
6432
6506
|
| 'select'
|
|
6507
|
+
/** 不按修饰键的多选:普通点击累加 / 取反 */
|
|
6508
|
+
| 'multiSelect'
|
|
6509
|
+
/** 再次点击已选要素时取消选中 */
|
|
6510
|
+
| 'toggleSelect'
|
|
6433
6511
|
/** 框选(默认 Shift + 拖动,随 shortcuts.boxSelect 改变) */
|
|
6434
6512
|
| 'boxSelect'
|
|
6435
6513
|
/** 拖动节点(含整组拖动) */
|
|
@@ -6459,13 +6537,21 @@ export type GisViewFeatureName =
|
|
|
6459
6537
|
|
|
6460
6538
|
/**
|
|
6461
6539
|
* 功能开关表:**缺省全关** —— 什么都不写时只剩画布与数据,所有交互都要手动打开。
|
|
6462
|
-
*
|
|
6540
|
+
* 平移 / 缩放 / 悬停 / 选中 / 框选 / 多选 / 取反 / 拖拽 / 拐点只有这一个入口,没有顶层详细配置;
|
|
6541
|
+
* 没写 = 关。copy / merge / remove 与标签 / 提示 / 鹰眼图仍跟随各自的详细配置,
|
|
6463
6542
|
* 详细配置也没写时同样是关(标签 / 提示 / 鹰眼图这类「配了才有」:配了就等于手动打开);
|
|
6464
6543
|
* 写了 `true` 强制打开、写了 `false` 强制关闭(详细配置写 true 也没用)。
|
|
6465
6544
|
* 开关只决定「组件做不做某个交互」,不改变数据与样式:关掉 drag 之后节点还在、还能选中,只是拖不动;
|
|
6466
6545
|
* 关掉 label 之后标签图层不再产生 DOM,数据与样式一律不动。
|
|
6467
6546
|
*/
|
|
6468
|
-
|
|
6547
|
+
/**
|
|
6548
|
+
* `features` 里允许使用的详细配置别名:`draggable` 映射到 `drag`,`waypointEditable` 映射到 `waypoint`,
|
|
6549
|
+
* `interactive` 一次映射到 `pan` / `zoom` / `contextMenu`,`clickable` 一次映射到 `hover` / `select`。
|
|
6550
|
+
* 同一个对象里同时写了别名与规范名时规范名优先;别名只用于输入,`getFeatures()` 不返回别名键。
|
|
6551
|
+
*/
|
|
6552
|
+
export type GisViewFeatureAliasName = 'draggable' | 'waypointEditable' | 'interactive' | 'clickable'
|
|
6553
|
+
|
|
6554
|
+
export type GisViewFeatures = Partial<Record<GisViewFeatureName | GisViewFeatureAliasName, boolean>>
|
|
6469
6555
|
|
|
6470
6556
|
/**
|
|
6471
6557
|
* 开关的当前有效值:把「跟随详细配置」也解析成 true / false(getFeatures 与 onFeatureChange 给的就是这一份)。
|
|
@@ -6828,9 +6914,12 @@ export interface GisViewOptions {
|
|
|
6828
6914
|
* 功能开关:预设名('edit' / 'view' / 'static')、开关表或布尔值 ——
|
|
6829
6915
|
* **缺省全关**:什么都不写时只剩画布与数据,想要哪一项就手动打开哪一项。
|
|
6830
6916
|
* 'edit' 全开、'view' 一次打开查看类(能平移缩放、能悬停选中看提示,改不动数据)、
|
|
6831
|
-
* 'static'
|
|
6832
|
-
*
|
|
6833
|
-
*
|
|
6917
|
+
* 'static' 与缺省一致(全关)。交互权限**只有 features 一个入口**:拖拽 / 平移 / 缩放 / 悬停 /
|
|
6918
|
+
* 选中 / 框选 / 多选 / 取反 / 拐点都写在这里。旧的顶层 `draggable` / `interactive` / `clickable` /
|
|
6919
|
+
* `boxSelect` / `multiSelect` / `toggleSelect` / `waypointEditable` 已移除,传入会经 onWarning
|
|
6920
|
+
* 提示迁移并忽略;features 表内仍可用 `draggable` / `interactive` / `clickable` / `waypointEditable` 别名。
|
|
6921
|
+
* copy / merge / remove 与 label / tooltip / minimap 的详细配置仍负责参数与内容:
|
|
6922
|
+
* 写了 copy / merge / remove 等于打开对应能力,features 可再强制开关;标签 / 提示 / 鹰眼图「配了才有」。
|
|
6834
6923
|
* 运行时用 setFeatures() 换一份,getFeatures() 读当前有效值(把「跟随详细配置」也解析成 true / false)。
|
|
6835
6924
|
*/
|
|
6836
6925
|
features?: GisViewFeaturesInput
|
|
@@ -7089,44 +7178,16 @@ export interface GisViewOptions {
|
|
|
7089
7178
|
* 关掉之后交互 / 动画期与静止帧的画法完全一致(代价是十万级下慢 3 ~ 4 倍)。
|
|
7090
7179
|
*/
|
|
7091
7180
|
interactionNoMsaa?: boolean
|
|
7092
|
-
/**
|
|
7093
|
-
* 查看类交互的「详细配置手动打开」写法:写 true 打开拖拽平移 / 滚轮缩放 / 右键回调
|
|
7094
|
-
* (等价 features 的 pan / zoom / contextMenu),不写就是关(缺省全关)。
|
|
7095
|
-
*/
|
|
7096
|
-
interactive?: boolean
|
|
7097
|
-
/** 查看类交互的「详细配置手动打开」写法:写 true 打开悬停高亮与点击选中(等价 hover / select);要素自身可用 clickable: false 逐个关掉 */
|
|
7098
|
-
clickable?: boolean
|
|
7099
7181
|
/**
|
|
7100
7182
|
* 光标:按状态与悬停目标分别配置,写法支持 CSS 关键字与自定义图片(url / 热点),
|
|
7101
7183
|
* 还能配按住 Ctrl / ⌘ 时的另一套。不配时用 gis-view.css 里的 --gis-view-cursor-* 变量
|
|
7102
7184
|
*/
|
|
7103
7185
|
cursorStyle?: GisViewCursorStyle
|
|
7104
|
-
/** 点是否可拖拽,单个点可用 draggable 覆盖;**缺省关**(全关口径),要拖就写 draggable: true 或 features: { drag: true } */
|
|
7105
|
-
draggable?: boolean
|
|
7106
7186
|
/**
|
|
7107
7187
|
* 拖动节点时线路是否实时跟随:默认 true(拖动过程中线路端点一路跟着走)。
|
|
7108
7188
|
* 关掉之后拖动期间只移动节点本身,线路保持原样,停手(pointerup)时一次性更新到新位置。
|
|
7109
7189
|
*/
|
|
7110
7190
|
liveDrag?: boolean
|
|
7111
|
-
/** 是否允许按住框选快捷键(见 shortcuts.boxSelect,默认 Shift)拖动鼠标框选节点;**缺省关**,要框选就写 boxSelect: true */
|
|
7112
|
-
boxSelect?: boolean
|
|
7113
|
-
/**
|
|
7114
|
-
* 多选开关(**缺省关**):打开之后不用按修饰键,直接单击节点 / 线路就能取反累加选中
|
|
7115
|
-
* (与按住 shortcuts.multiSelect 点击同一套行为,命中时套用 multiSelectStyle);
|
|
7116
|
-
* 关着时多选仍走框选(boxSelect)与按住多选快捷键(默认 Ctrl / ⌘)。
|
|
7117
|
-
*/
|
|
7118
|
-
multiSelect?: boolean
|
|
7119
|
-
/**
|
|
7120
|
-
* 再次选中即取消(**缺省关**):打开后,普通点击已在选中集里的要素会把它取消;
|
|
7121
|
-
* Ctrl / ⌘ 先选中、再普通点击同一要素也同样取消。单击 / 双击两种 selectTrigger 都适用,
|
|
7122
|
-
* 双击会按一次操作处理(第一下取反、第二下保持),不会因为双击的两下连点而反复切换。
|
|
7123
|
-
* 命中通道回线时按 channelSelectMode 决定取消单条回线 / 当前分组 / 整条通道,其他选中项保留;
|
|
7124
|
-
* 该组 / 通道只选中一部分、或点到组内另一条回线时,也按同一展开范围整体取消;
|
|
7125
|
-
* 该组 / 通道已经完整选中时,即使 channelSelectMode 为 line 也整组 / 整条取消。
|
|
7126
|
-
* 这条取消路径不受 selectionKinds 限制;取消生效时同一来源的点击级联也会一起收掉。
|
|
7127
|
-
* 与 multiSelect 同时打开时沿用 multiSelect 的累加取反口径;运行时走 updateOptions({ toggleSelect })。
|
|
7128
|
-
*/
|
|
7129
|
-
toggleSelect?: boolean
|
|
7130
7191
|
/**
|
|
7131
7192
|
* 选中触发方式:缺省 'click'(单击选中);写 'dblClick' 后第一次点击只派发 onClick,
|
|
7132
7193
|
* 第二次(双击判定命中)才更新选中集,并同时派发 onClick 与 onDblClick。
|
|
@@ -7136,6 +7197,7 @@ export interface GisViewOptions {
|
|
|
7136
7197
|
/**
|
|
7137
7198
|
* 框选 / Ctrl 多选允许收哪几类要素:'point' 节点、'line' 独立线路、'channel' 通道回线,
|
|
7138
7199
|
* 另有 'lineEndpoints' / 'channelEndpoints' 只在框选时要求线路 / 通道两端节点都在框内;
|
|
7200
|
+
* 框选线路 / 通道时按实际折线路径逐线段判定,不用包围盒冒充命中;
|
|
7139
7201
|
* 可写数组任意组合,'all' / true 全开,false / null 全关。
|
|
7140
7202
|
* **不写时保留旧行为**:框选只收节点,Ctrl / 多选点击仍可收节点与线路;
|
|
7141
7203
|
* 写了之后框选与 Ctrl / 多选点击统一按这一份过滤(普通单选、toggleSelect 的取消与接口 select 不受限制)。
|
|
@@ -7152,8 +7214,8 @@ export interface GisViewOptions {
|
|
|
7152
7214
|
*/
|
|
7153
7215
|
selectionBoxPersistent?: boolean
|
|
7154
7216
|
/**
|
|
7155
|
-
* 选中的要素是否画在所有要素之上(默认 true):抬层的包括点击 / 拖动 /
|
|
7156
|
-
*
|
|
7217
|
+
* 选中的要素是否画在所有要素之上(默认 true):抬层的包括点击 / 拖动 / 待确认合并的节点、
|
|
7218
|
+
* 选中线路所在的整条通道,以及它们的 decorations —— 选中了就一定看得见,与 zIndex 无关;
|
|
7157
7219
|
* 关掉之后完全按 zIndex 与数据顺序绘制(十万级数据下抬层会让整份重排一次)
|
|
7158
7220
|
*/
|
|
7159
7221
|
selectionOnTop?: boolean
|
|
@@ -7185,11 +7247,6 @@ export interface GisViewOptions {
|
|
|
7185
7247
|
copy?: GisViewCopyOptions
|
|
7186
7248
|
/** 合并节点(**缺省关**:写了这份配置才算开):把一个节点拖到另一个节点上(考虑碰撞)时怎么确认与怎么并 */
|
|
7187
7249
|
merge?: GisViewMergeOptions
|
|
7188
|
-
/**
|
|
7189
|
-
* 是否允许编辑线路拐点:Ctrl + 点击添加、拖动移动、双击或 Delete 删除;**缺省关**,单条线可用 waypointEditable 覆盖。
|
|
7190
|
-
* `false`(以及 `features: { waypoint: false }`)会同时关闭新增、移动与删除;没有只关其中一项的细分开关
|
|
7191
|
-
*/
|
|
7192
|
-
waypointEditable?: boolean
|
|
7193
7250
|
/** 拐点显示时机:selected 只在线路被选中(或刚加过拐点)时显示,always 始终显示;默认 selected */
|
|
7194
7251
|
waypointVisibility?: 'selected' | 'always'
|
|
7195
7252
|
/** 拐点样式,缺省为小圆点 */
|
|
@@ -8110,8 +8167,12 @@ export interface GisViewSceneCluster {
|
|
|
8110
8167
|
fill: string
|
|
8111
8168
|
stroke: string
|
|
8112
8169
|
strokeWidth: number
|
|
8170
|
+
opacity: number
|
|
8113
8171
|
textColor: string
|
|
8114
8172
|
fontSize: number
|
|
8173
|
+
showCount: boolean
|
|
8174
|
+
/** 配了非缺省图标时的屏幕坐标符号原语;缺省圆仍按 fill / stroke 画 */
|
|
8175
|
+
icon?: GisViewSceneNode
|
|
8115
8176
|
}
|
|
8116
8177
|
|
|
8117
8178
|
export interface GisViewSceneSnapshot {
|
|
@@ -8131,7 +8192,10 @@ export interface GisViewSceneSnapshot {
|
|
|
8131
8192
|
points: GisViewSceneNode[]
|
|
8132
8193
|
clusters: GisViewSceneCluster[]
|
|
8133
8194
|
backgroundPoints: GisViewSceneNode[]
|
|
8195
|
+
/** 普通装饰(未随所属要素抬层) */
|
|
8134
8196
|
decorations: GisViewSceneNode[]
|
|
8197
|
+
/** 跟着选中线路 / 节点 / 选中线路端点抬层的装饰:画在 raisedLines 之后、raised 之前 */
|
|
8198
|
+
raisedDecorations: GisViewSceneNode[]
|
|
8135
8199
|
waypoints: GisViewSceneNode[]
|
|
8136
8200
|
/** 选中 / 拖动中的节点(画在最上面) */
|
|
8137
8201
|
raised: GisViewSceneNode[]
|
|
@@ -8490,6 +8554,19 @@ export interface GisViewInstance {
|
|
|
8490
8554
|
createGeoMapper(options?: GisViewGeoMapperOptions): GisViewGeoMapper | null
|
|
8491
8555
|
/** 直接把一份点 / 线 / 通道数据映射到 GeoJSON 坐标上(复制,不改原数据);没有 GeoJSON 底图时是 null */
|
|
8492
8556
|
mapDataToGeoJson<T extends { points?: GisViewPoint[]; lines?: GisViewLine[]; channels?: GisViewChannel[] }>(data: T, options?: GisViewGeoMapperOptions): T | null
|
|
8557
|
+
/**
|
|
8558
|
+
* 把当前网架的世界坐标 x / y 转成 GeoJSON 经纬度:不传 data 时转换当前 points / lines / channels。
|
|
8559
|
+
* 使用此刻最终画出来的底图投影(含 aspectScale、背景编辑后的 bounds 与 rotation);返回复制后的数据,原数据与视图都不变;
|
|
8560
|
+
* 没有 GeoJSON 底图时是 null。存档回灌用 mapLngLatToData(),不要跳过它直接把 x=经度 / y=纬度 的数据 updateData 回去。
|
|
8561
|
+
*/
|
|
8562
|
+
mapDataToLngLat<T extends { points?: GisViewPoint[]; lines?: GisViewLine[]; channels?: GisViewChannel[] } = { points: GisViewPoint[]; lines: GisViewLine[]; channels: GisViewChannel[] }>(data?: T, options?: GisViewGeoMapperOptions): T | null
|
|
8563
|
+
/**
|
|
8564
|
+
* mapDataToLngLat() 的逆变换:把 x / y 存着经纬度的 points / lines / channels 按当前底图投影写回世界坐标。
|
|
8565
|
+
* 覆盖线路路径 / 端点、固定坐标装饰、通道分组路径与 waypointOffsets 向量;返回副本,不改传入数据。
|
|
8566
|
+
* 没有 GeoJSON 底图时为 null。典型用法:`updateData(view.mapLngLatToData(saved))`;
|
|
8567
|
+
* 底图 bounds / rotation 改过时,经纬度会按调用当时最终画出来的底图重新落位。
|
|
8568
|
+
*/
|
|
8569
|
+
mapLngLatToData<T extends { points?: GisViewPoint[]; lines?: GisViewLine[]; channels?: GisViewChannel[] }>(data: T, options?: GisViewGeoMapperOptions): T | null
|
|
8493
8570
|
pick(x: number, y: number): GisViewHitResult | null
|
|
8494
8571
|
/**
|
|
8495
8572
|
* 按浏览器客户端坐标拾取(鼠标事件里的 clientX / clientY):与指针事件载荷同一份读数,另加 target
|
|
@@ -9309,9 +9386,9 @@ export interface GisViewEngineOptions {
|
|
|
9309
9386
|
networkOpacity?: number
|
|
9310
9387
|
/** 背景编辑模式(见 GisViewOptions.backgroundEditing):true 时屏蔽网架指针与数据快捷键,仅保留滚轮缩放 */
|
|
9311
9388
|
backgroundEditing?: boolean
|
|
9312
|
-
/**
|
|
9389
|
+
/** 引擎内部总闸:组件层固定为 true,具体权限由 features 换算出的 pan / zoom / contextMenu 等字段决定 */
|
|
9313
9390
|
interactive?: boolean
|
|
9314
|
-
/**
|
|
9391
|
+
/** 引擎内部总闸:组件层固定为 true,具体权限由 features 换算出的 hover / select 等字段决定 */
|
|
9315
9392
|
clickable?: boolean
|
|
9316
9393
|
/**
|
|
9317
9394
|
* 平移 / 缩放 / 悬停 / 选中 / 右键各自的开关(组件层的 features 就是按这几个字段下发的):
|
|
@@ -9334,7 +9411,7 @@ export interface GisViewEngineOptions {
|
|
|
9334
9411
|
hoverThreshold?: number
|
|
9335
9412
|
/** 光标配置:逐键合并,只想改一个分类时只写那一项即可 */
|
|
9336
9413
|
cursorStyle?: GisViewCursorStyle
|
|
9337
|
-
/**
|
|
9414
|
+
/** 点是否可拖拽(引擎内部字段):组件层由 features.drag 计算后下发,**缺省关** */
|
|
9338
9415
|
draggable?: boolean
|
|
9339
9416
|
/** 拖动节点时线路是否实时跟随,默认 true;false 表示停手后一次性更新线路 */
|
|
9340
9417
|
liveDrag?: boolean
|
|
@@ -9342,14 +9419,14 @@ export interface GisViewEngineOptions {
|
|
|
9342
9419
|
boxSelect?: boolean
|
|
9343
9420
|
/** 多选开关(**缺省关**):打开后不用按修饰键,直接单击要素就取反累加(与按住 shortcuts.multiSelect 点击同一套行为) */
|
|
9344
9421
|
multiSelect?: boolean
|
|
9345
|
-
/**
|
|
9422
|
+
/** 再次选中即取消(**缺省关**):组件层由 features.toggleSelect 下发 */
|
|
9346
9423
|
toggleSelect?: boolean
|
|
9347
9424
|
/** 框选 / Ctrl 多选允许的要素类型,写法与缺省口径见 GisViewOptions.selectionKinds */
|
|
9348
9425
|
selectionKinds?: GisViewSelectionKindsInput
|
|
9349
9426
|
selectionBoxStyle?: GisViewSelectionBoxStyle | null
|
|
9350
9427
|
/** 框选后保留矩形,并允许拖动矩形平移框内选中节点;缺省 false */
|
|
9351
9428
|
selectionBoxPersistent?: boolean
|
|
9352
|
-
/** 选中 / 拖动 /
|
|
9429
|
+
/** 选中 / 拖动 / 待确认合并的节点、选中通道以及它们的 decorations 是否画在所有要素之上,默认 true */
|
|
9353
9430
|
selectionOnTop?: boolean
|
|
9354
9431
|
/**
|
|
9355
9432
|
* 通道选中模式:点中通道里的一条回线时选中什么 —— 'line'(缺省)只选这一条、'group' 连它所在分组、
|
|
@@ -9370,7 +9447,7 @@ export interface GisViewEngineOptions {
|
|
|
9370
9447
|
copy?: GisViewCopyOptions
|
|
9371
9448
|
/** 合并节点的配置(**缺省关**:写了才算开):开关、触发时机、像素容差、确认方式与数据合并规则 */
|
|
9372
9449
|
merge?: GisViewMergeOptions
|
|
9373
|
-
/**
|
|
9450
|
+
/** 是否允许编辑拐点,**缺省关**:组件层由 features.waypoint 下发 */
|
|
9374
9451
|
waypointEditable?: boolean
|
|
9375
9452
|
waypointVisibility?: 'selected' | 'always'
|
|
9376
9453
|
waypointStyle?: GisViewPointStyle | null
|
|
@@ -9713,6 +9790,9 @@ export declare const createGisViewEngine: (canvas: HTMLCanvasElement, options?:
|
|
|
9713
9790
|
/** 全部开关名(顺序与界面一致),界面按它列复选框 */
|
|
9714
9791
|
export declare const FEATURE_NAMES: GisViewFeatureName[]
|
|
9715
9792
|
|
|
9793
|
+
/** 详细配置别名 -> 一个或多个规范开关;别名只在输入时展开,`getFeatures()` 不返回别名键 */
|
|
9794
|
+
export declare const FEATURE_ALIASES: Record<GisViewFeatureAliasName, GisViewFeatureName[]>
|
|
9795
|
+
|
|
9716
9796
|
/** 预设表:键是开关名、值是布尔;**没列出来的开关取 featureDefault**(全关;「配了才有」的那几项不给值) */
|
|
9717
9797
|
export declare const FEATURE_PRESETS: Record<GisViewFeaturePreset, GisViewFeatures>
|
|
9718
9798
|
|