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
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
pointSize: 3
|
|
357
357
|
}
|
|
358
358
|
},
|
|
359
|
-
|
|
359
|
+
features: { waypoint: true },
|
|
360
360
|
onWarning: (payload) => {
|
|
361
361
|
viewWarns += 1
|
|
362
362
|
print('⚠ ' + (typeof payload === 'string' ? payload : payload?.message ?? JSON.stringify(payload)), 'warn')
|
|
@@ -146,7 +146,7 @@ fc1-Ⅲ f1 [0,60] ──[60,50]──[92,52]──→ f2 [120,60] 两回(ch
|
|
|
146
146
|
| --- | --- |
|
|
147
147
|
| 首尾**要写全** | 只写中间几个点会被首尾替换掉、直接退化成两端直连;想要 3 个拐点就写 5 个顶点(示例里 11 条独立线路有 5 条是这种折线) |
|
|
148
148
|
| 端点跟着节点走 | `path[0]` / `path[path.length - 1]` 的数值只是「声明时的坐标」;节点一拖,端点自动跟到新坐标,中间那些拐点一个都不动 |
|
|
149
|
-
| 能不能拖是另一回事 | 逐条看 `waypointEditable
|
|
149
|
+
| 能不能拖是另一回事 | 逐条看 `waypointEditable`(还要打开 `features: { waypoint: true }`):示例里 `fl1` / `fl2` / `fl3` 是 `true`,可以直接在图上拖拐点;`fl4`…`fl11` 只画折线、不可编辑 |
|
|
150
150
|
| 拖过之后它就在 path 里 | 拐点没有单独的一列,改完就是新的 `lines[].path`;导出 `input` / `full` 口径都写这一列(业务口径的 `parallel_groups` / `createChannels` 那份见 `docs/数据格式.md`) |
|
|
151
151
|
| 通道回线**没有** path | `channel-fcX-Y` 这 11 条自己不写 `path`(示例里整个键都不出现)—— 它们的走线由所属分组的骨架 `path` 平行偏移推导,拐点在**分组**上(见上一节) |
|
|
152
152
|
|
|
@@ -230,7 +230,7 @@ fc1-Ⅲ f1 [0,60] ──[60,50]──[92,52]──→ f2 [120,60] 两回(ch
|
|
|
230
230
|
| `dash` 或 `lineType` | `[number, number, number, number]` 或预设名 | `fl6` 的 `[12, 4, 2, 4]`;`fl4` `dashed`;`fl8` `dotted`;`fl11` `dashdot` | 线型:`[实线长, 空档长, 第二段实线长, 第二段空档长]`(`0` 表示没有第二段),预设名有 `solid` / `dashed` / `dotted` / `dashdot`;两个都写时 `dash` 优先 |
|
|
231
231
|
| `join` | `'round' \| 'miter' \| 'bevel'` | `fl1` 的 `round` | 折线拐角 / 端点的接头样式(`round` 时实线端点补圆头) |
|
|
232
232
|
| `path` | `[x, y][]` | 见「线路的拐点」 | 整条折线:首尾是端点、中间是拐点;不写就按 `from` / `to` 两端直连 |
|
|
233
|
-
| `waypointEditable` | `boolean` | `fl1` / `fl2` / `fl3` 为 `true` |
|
|
233
|
+
| `waypointEditable` | `boolean` | `fl1` / `fl2` / `fl3` 为 `true` | 这条线的拐点能不能拖(还要打开 `features: { waypoint: true }`) |
|
|
234
234
|
| `visible` | `boolean` | `fl11` 显式写了 `true` | `false` = 整条不画(绑在它身上的标签也不画) |
|
|
235
235
|
| `labels` | `array \| object` | 11 条独立线路共 16 条 | 线路标签:字段与节点标签同一套,多了 `position`(沿线位置:`0 ~ 1` 比例、`'75%'`、`{ distance: 30 }` 世界单位)与 `parallel`(是否跟着线路方向转,朝左自动翻半圈) |
|
|
236
236
|
| `decorations` | `array` | 11 条独立线路共 15 个 | 线路上的标记(图片 / SVG),见下 |
|
|
@@ -121,4 +121,4 @@ const dropped = known.filter(name => !tableKeys.includes(name) && !intro.include
|
|
|
121
121
|
check(dropped.length === 0, `白名单键 × options 一章(${known.length} 个)`, dropped.join(' '))
|
|
122
122
|
|
|
123
123
|
console.log(fail.length ? `\n文档值对账:有 ${fail.length} 处不一致` : '\n文档值对账:全部一致')
|
|
124
|
-
process.exit(fail.length ? 1 : 0)
|
|
124
|
+
process.exit(fail.length ? 1 : 0)
|
|
@@ -65,16 +65,16 @@
|
|
|
65
65
|
// 这一页测的全是查看 + 编辑类交互:查看类(平移 / 缩放 / 悬停 / 选中 / 右键 / 键盘)
|
|
66
66
|
// 与编辑类(拖拽 / 框选 / 拐点 / 通道右键)都显式打开
|
|
67
67
|
// (缺省口径是全关:只剩画布与数据,见 src/gis-view/features.js)
|
|
68
|
-
draggable: true,
|
|
69
|
-
boxSelect: true,
|
|
70
|
-
waypointEditable: true,
|
|
71
68
|
features: {
|
|
72
69
|
pan: true,
|
|
73
70
|
zoom: true,
|
|
74
71
|
hover: true,
|
|
75
72
|
select: true,
|
|
76
73
|
contextMenu: true,
|
|
77
|
-
keyboard: true
|
|
74
|
+
keyboard: true,
|
|
75
|
+
drag: true,
|
|
76
|
+
boxSelect: true,
|
|
77
|
+
waypoint: true
|
|
78
78
|
},
|
|
79
79
|
label: { enabled: true, content: '{name}', editable: true, draggable: true, maxCount: 8 },
|
|
80
80
|
lineLabel: { enabled: true, content: '{name}', editable: true, draggable: true, maxCount: 8 },
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
lines: [{ id: 'nl', from: 'n1', to: 'n2' }, { id: 'cl1', from: 'f1', to: 'f2' }, { id: 'cl2', from: 'f1', to: 'f2' }],
|
|
382
382
|
channels: [{ id: 'vch', from: 'f1', to: 'f2', lineIds: ['cl1', 'cl2'], path: [[4010, 12]] }]
|
|
383
383
|
}
|
|
384
|
-
const viewportView = createGisView(box(), { ...viewportScene,
|
|
384
|
+
const viewportView = createGisView(box(), { ...viewportScene, features: { waypoint: true } })
|
|
385
385
|
viewportView.addChannelGroupWaypoint('vch')
|
|
386
386
|
viewportView.setCamera({ center: [20, 0], scale: 1 })
|
|
387
387
|
const viewRect = viewportView.getViewRect()
|
|
@@ -476,7 +476,7 @@
|
|
|
476
476
|
points: [{ id: 'ga', x: 0, y: 0 }, { id: 'gb', x: 10, y: 0 }, { id: 'gc', x: 20, y: 0 }],
|
|
477
477
|
lines: [{ id: 'gl', from: 'ga', to: 'gb' }],
|
|
478
478
|
channels: [{ id: 'gch', from: 'ga', to: 'gb', lineIds: ['gl'], path: [] }],
|
|
479
|
-
|
|
479
|
+
features: { waypoint: true }
|
|
480
480
|
})
|
|
481
481
|
const addedLines = growView.addLines([{ id: 'gl2', from: 'gb', to: 'gc' }, { id: 'gl3', from: 'ga', to: 'gc' }])
|
|
482
482
|
check('addLines 一次追加多条线路', addedLines.ok && addedLines.count === 2 && growView.getData().lines.length === 3, JSON.stringify(addedLines.indexes))
|
|
@@ -487,10 +487,10 @@
|
|
|
487
487
|
check('addChannelGroups 一次给已有通道加多组(逐组回线 + 新分组 id)', addedGroups.ok && addedGroups.count === 2 && addedGroups.lineIds.length === 2 && addedGroups.groupIds.join(',') === 'gch-b,gch-c' && growView.getChannelGroups('gch').length === 3, JSON.stringify({ groups: addedGroups.groupIds, read: growView.getChannelGroups('gch').length }))
|
|
488
488
|
const addedWaypoints = growView.addWaypoints('gl', [[2, 0], [8, 0]])
|
|
489
489
|
check('addWaypoints 一次插多个拐点,线路数据变成四个顶点', addedWaypoints.ok && addedWaypoints.count === 2 && (growView.getData().lines[0].path?.length ?? 0) === 4, JSON.stringify(growView.getData().lines[0].path))
|
|
490
|
-
growView.
|
|
490
|
+
growView.setFeatures({ waypoint: false })
|
|
491
491
|
const blockedWaypoints = growView.addWaypoints('gl', [[4, 0]])
|
|
492
|
-
check('addWaypoints 在引擎拒绝(
|
|
493
|
-
growView.
|
|
492
|
+
check('addWaypoints 在引擎拒绝(features: { waypoint: false })时不虚报成功', !blockedWaypoints.ok && blockedWaypoints.count === 0 && blockedWaypoints.coordinates.length === 0 && (growView.getData().lines[0].path?.length ?? 0) === 4, JSON.stringify(blockedWaypoints))
|
|
493
|
+
growView.setFeatures({ waypoint: true })
|
|
494
494
|
growView.destroy()
|
|
495
495
|
|
|
496
496
|
view.destroy()
|