gis-view-webgl2 0.1.3 → 0.1.5
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 +17 -14
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +252 -37
- package/dist/index.js +1 -1
- package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +79 -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 +66 -0
- package/docs/api/index.html +22 -8
- package/docs/demos/ApiCoverageDemo.vue +1 -1
- package/docs/demos/ConnectDemo.vue +114 -3
- package/docs/demos/ExtensionDemo.vue +69 -12
- package/docs/demos/MinimapDemo.vue +62 -16
- package/docs/demos/SearchFilterDemo.vue +13 -11
- package/docs/demos/api-index.js +26 -21
- package/docs/demos/demos.js +1 -1
- package/docs/demos/gis-view-demo/GisViewDemoCardHeader.vue +1 -0
- package/docs/demos/gis-view-demo/GisViewDemoStage.vue +25 -16
- package/docs/demos/gis-view-demo/panels/OpsPanels.vue +2 -2
- package/docs/demos/gis-view-demo/useGisViewDemo.js +36 -25
- package/docs/index.html +41 -4
- package/docs/internals/13-/351/271/260/347/234/274/345/233/276.md +6 -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 +5 -3
- 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 +12 -0
- package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +29 -6
- package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +7 -6
- package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +24 -3
- 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 +169 -62
- package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +32 -3
- package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +12 -8
- package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +13 -9
- package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +156 -12
- 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 +3 -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 +11 -5
- package/docs/steps/README.md +8 -8
- package/docs/steps/selftest-demos.html +173 -12
- package/docs/steps/selftest-docs.html +33 -4
- package/docs/steps/selftest-features.html +91 -10
- package/docs/steps/selftest-full.html +315 -12
- package/docs/steps/selftest-perf.html +39 -1
- package/docs/steps/selftest-scale.html +98 -0
- package/docs/steps/selftest-select.html +90 -0
- package/package.json +1 -1
package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md
CHANGED
|
@@ -35,13 +35,14 @@
|
|
|
35
35
|
| `zoomIn(step?)` / `zoomOut(step?)` / `zoomBy(factor, origin?)` | 相对缩放,`origin` 为画布 CSS 像素锚点(缺省视口中心) |
|
|
36
36
|
| `zoomTo(scale, origin?)` | 直接设成指定比例(像素 / 世界单位) |
|
|
37
37
|
| `zoomToBounds(bounds, padding?)` | 把一段世界坐标矩形适应到视图内,退化成一点时只居中不改比例 |
|
|
38
|
-
| `focusOn(target, options?)` | 把视角移到目标上:单条(搜索命中 / 要素 id / `{ type: 'point' \| 'line' \| 'channel', id \| index }` / `{ channelId }` 整条通道 / `{ type: 'group', channelId?, groupId }` / 坐标 / 矩形 / `{ lngLat }`)或**一批**(数组取整体包围盒 —— 搜到三个节点就是这三个点的中心当屏幕中心);字符串先节点后线路,裸字符串不表示通道,同 id 用 `type` 消歧,分组必须显式写 `type: 'group'`(全局唯一 `groupId`
|
|
39
|
-
| `search(keyword \| options)` | 按关键字搜索节点 / 线路 /
|
|
38
|
+
| `focusOn(target, options?)` | 把视角移到目标上:单条(搜索命中 / 要素 id / `{ type: 'point' \| 'line' \| 'channel', id \| index }` / `{ channelId }` 整条通道 / `{ type: 'group', channelId?, groupId }` / 坐标 / 矩形 / `{ lngLat }`)或**一批**(数组取整体包围盒 —— 搜到三个节点就是这三个点的中心当屏幕中心);字符串先节点后线路,裸字符串不表示通道,同 id 用 `type` 消歧,分组必须显式写 `type: 'group'`(全局唯一 `groupId` 可省略通道)。**缺省只居中、比例一点不动**;`options.zoom: true` 才按解析出的真实范围适配(节点 / 线路 / 通道 / 分组共用这一条,不额外放大),`scale` 优先级高于 `zoom`。`options` 还认 `center: true`(显式只居中,与缺省一致)、`padding`、`maxZoom`、`select`(顺带选中这批,`mode` 决定怎么并进当前选中集) |
|
|
39
|
+
| `search(keyword \| options)` | 按关键字搜索节点 / 线路 / 通道 / 通道分组并返回命中:`scope` 认复数的 `points` / `lines` / `channels` / `groups`,也认与 `focusOn` 一致的单数别名 `point` / `line` / `channel` / `group`;结果分 `points` / `lines` / `channels` / `groups` 四类,分组命中带 `channelIndex` / `groupId` / `groupIndex`,可直接交给 `focusOn` / `selectFeatures`。**不动视角**:要不要聚焦由调用方自己调 `focusOn`,见「搜索与定位」 |
|
|
40
40
|
| `searchAsync(keyword \| options)` | 同一份口径的异步版:数据量大时把扫描放进 Worker(10 万点 / 10 万线下同步要占主线程 40 ms 上下的那一段),返回 `Promise<GisViewSearchResult>`;结果带 `worker` 与 `stale` 两个字段,见「异步搜索」 |
|
|
41
41
|
| `setCamera(camera)` / `getCamera()` | 读写 `{ center, scale }` |
|
|
42
42
|
| `getZoomBaseScale()` / `setZoomBaseScale(scale?)` | 读 / 重定**缩放联动的基准比例**(缺省是首次适应视图时的比例):不传参数就取当下相机的比例 —— 把现在这一屏当成「原样大小」,之后放大缩小都从它算倍数;配合 `pointZoomScale` / `lineZoomScale` 使用 |
|
|
43
43
|
| `getBounds()` | 数据范围(没有点时回退到背景 GeoJSON 的 `rawBounds`,也就是 `aspectScale` 之前的真实经纬度范围) |
|
|
44
44
|
| `getViewRect()` | 当前可视范围的世界坐标矩形;自建缩略图 / 坐标读数用它换算视口框,内置鹰眼图见「鹰眼图」 |
|
|
45
|
+
| `getMinimapElement()` | 鹰眼图根节点(没配 `minimap` 时为 `null`):接整图拖动或自定义手势;配合 `minimap.container` 挂到外部宿主时拿到的仍是同一根节点 |
|
|
45
46
|
| `getMinimapZoom()` / `setMinimapZoom(zoom)` / `zoomMinimapBy(factor, origin?)` | 读 / 写鹰眼图自身的倍数:`set` 夹在 `minimap.minZoom` ~ `maxZoom` 之间,`zoomMinimapBy` 以画布 CSS 像素 `origin` 为锚点缩放(缺省小图中心),没配 `minimap` 时是空操作 |
|
|
46
47
|
| `getPoint(ref)` | 按 id / 下标 / `{ id }` / `{ index }` 取一个节点:拾取载荷(`item` / `x` / `y` / `layer` / `layerRank`)之外再给一份屏幕半径 `radius`;找不到返回 `null`。自建读数面板、右键菜单用它,省掉「自己遍历 `getData()` + 算投影」那一段 |
|
|
47
48
|
| `getLine(ref)` | 取一条线路:拾取载荷 + `path` / `bounds` / `color` / `width`(与 `listLines()` 的一项同一份口径),通道回线还带 `channelId` / `groupId` / `channelIndex`;找不到返回 `null` |
|
|
@@ -109,7 +110,7 @@
|
|
|
109
110
|
| `addWaypoints(lineId, coordinates, options?)` | 一次给一条线路插多个拐点:按数组顺序插入,多个拐点合成**一步历史**;坐标写错的条目跳过,返回 `{ ok, reason, count, lineId, lineIndex, coordinates }`(`coordinates` 是实际插入成功的坐标),线路不存在或 `waypointEditable: false` 时 `ok: false` |
|
|
110
111
|
| `getWaypoints(lineIndex?)` | 当前显示中的拐点(受 `waypointVisibility` 影响),带坐标与选中态 |
|
|
111
112
|
| `getChannels()` | 通道运行时状态:骨架折线、每条回线的偏移、推导出来的折线路径与间距;分组之后一个通道的每个分组各一条,带 `channelId` / `channelIndex`(`id` 是分组 id) |
|
|
112
|
-
| `getChannelMembers()` |
|
|
113
|
+
| `getChannelMembers()` | 通道成员表:每个通道的成员下标与各自的偏移(不复制几何),需要按通道分流绘制时用它(内置鹰眼图的「一个通道只画一根」按它取当前可见成员,再逐顶点平均成居中代表线) |
|
|
113
114
|
| `getChannelGroups(channelId?)` | 通道分组现状:每组的成员(下标 + 线路 id)、骨架与可以直接写回声明的中间拐点(`path`);不传 `channelId` 返回所有分组,见「通道分组」 |
|
|
114
115
|
| `getChannelGroupWaypoints(channelId?, groupId?)` | 一个分组的拐点现状:整组共用的骨架与中间拐点(`path`,给后端就是这一份)+ 组里每条回线按各自车道偏移后的折线与拐点(`lines[].waypoints`);`channelId` 不传取「当前分组」所在的通道、`groupId` 不传取第一组,见「分组拐点」 |
|
|
115
116
|
| `splitChannelGroups(channelId, groups)` | 重设通道分组:每组至少一条线路,第一组沿用当前拐点,新拆出来的分组不带拐点 |
|
|
@@ -123,13 +124,13 @@
|
|
|
123
124
|
| `addChannelGroupWaypoint(channelId, groupId?, coordinate?)` | 给某个分组加拐点、把这一组单独拉走:不给坐标就按默认位置放一个(第 n 组沿法线往外让 n 档),其余分组一根拐点都不动,见「分组拐点」 |
|
|
124
125
|
| `removeChannelGroupWaypoint(channelId, groupId?, pathIndex?)` | 删掉某个分组的拐点(缺省删最后一个) |
|
|
125
126
|
| `runChannelAction(actionId, options?)` | 执行右键交互框里的动作:`select-group` / `deselect-group` / `add-waypoint` / `remove-waypoint` / `split` / `merge`(`options` 带 `channelId` / `groupId` / `coordinate` / `pathIndex` / `size`),返回执行之后的上下文 |
|
|
126
|
-
| `beginAddChannel(options?)` | 进入「新增通道」:缺省点两个节点选起点 / 终点,或由 `options.from` 预指定起点、只需再点终点;`options` 还支持 `kind`(`'channel'` 新建通道 / `'line'` 新建独立线路,缺省 `'channel'`)/ `circuits`(一次加几条,缺省 1)/ `autoCommit` / `continuous` / `chain` / `name` / `lineId` / `id` / `lineProps` / `linePropsByMember` / `lineItems`(第二段,连同线路一起新建)/ `routing`(`'straight'` / `'orthogonal'`)/ `path`(中间拐点)/ `channelProps` / `channelDraftStyle
|
|
127
|
+
| `beginAddChannel(options?)` | 进入「新增通道」:缺省点两个节点选起点 / 终点,或由 `options.from` 预指定起点、只需再点终点;`options` 还支持 `kind`(`'channel'` 新建通道 / `'line'` 新建独立线路,缺省 `'channel'`)/ `circuits`(一次加几条,缺省 1)/ `autoCommit` / `continuous` / `chain` / `name` / `lineId` / `id` / `lineProps` / `linePropsByMember` / `lineItems`(第二段,连同线路一起新建)/ `routing`(`'straight'` / `'orthogonal'`)/ `path`(中间拐点)/ `channelProps` / `channelDraftStyle`(本次草稿的预览样式,含 `dots` / `layer`)/ `handoff`(交接模式:ready 发完收起草稿,自己调 `addChannel` 落地)/ `select`(点中的节点顺手选中)/ `originalEvent`,见「新增通道」 |
|
|
127
128
|
| `getAddChannelDraft()` | 当前新增通道草稿(两个节点的信息与可选方案),没有草稿时为 `null` |
|
|
128
|
-
| `updateAddChannelStyle(patch?)` | 字段级合并当前草稿的预览样式(`color` / `width` / `dot` / `dotColor` / `arrow` / `arrowSize` / `arrowPositions` / `arrowReverse` / `arrowColor` / `circuitSpacing` / `opacity` / `customDraw`);传 `null` 回到全局 `channelDraftStyle`,没有草稿时什么也不做 |
|
|
129
|
+
| `updateAddChannelStyle(patch?)` | 字段级合并当前草稿的预览样式(`color` / `width` / `dot` / `dotColor` / `dots` / `layer` / `arrow` / `arrowSize` / `arrowPositions` / `arrowReverse` / `arrowColor` / `circuitSpacing` / `opacity` / `customDraw`);传 `null` 回到全局 `channelDraftStyle`,没有草稿时什么也不做 |
|
|
129
130
|
| `continueAddChannel(options?)` | 开下一段草稿:连续模式落地时内部自动调(发 `phase: 'restart'`),也可以手动调;草稿已经退出时按 `options` 重新进来 |
|
|
130
131
|
| `cancelAddChannel()` | 取消新增通道(草稿期间按 Esc 等价,会补一条 `phase: 'cancel'`) |
|
|
131
132
|
| `endAddChannel()` | 结束新增通道:静默收掉视图上的示例假通道 / 线路(不补 `cancel` 事件),数据一个字节都不改 —— 结束事件里决定「不新建了」就用它 |
|
|
132
|
-
| `commitAddChannel(
|
|
133
|
+
| `commitAddChannel(input?, options?)` | 把已 `ready` 的草稿落到数据上。`input` 有五类:不传(用草稿 `preferred`)、旧 resolution(字符串,或只含 `type` / `groupId` / `groupIndex` / `channelId` 的对象)、直接线路对象(有 `from` / `to` / `path` / `kind: 'line'` 等线路形状)、直接通道对象(必须有 `lineIds`,缺省新建通道)、容器 `{ channel?, line?, lines?, lineData?, lineItems?, channelGroups?, group?, channelProps?, lineProps?, resolution?, ... }`。对象字段优先、没写的沿用草稿;`line` 缺省表示独立线路,`lines` 才是成员回线表;直接通道对象缺省新建,直接线路对象缺省按独立线路落地,要并进已有分组必须用容器并显式写 `resolution`。`options?: { auto?, continuous?, originalEvent? }` 只影响本次事件与连续草稿。方案读数不能整条回传,只取 `{ type, groupId, groupIndex, channelId }`。完整字段优先级与示例见「10 通道编辑与新增」的 `commitAddChannel` / 对象直传 |
|
|
133
134
|
| `getChannelAddOptions(from, to, count?, kind?)` | 两个节点之间的新增方案:新通道 / 新分组 / 并进某一组 / 无法添加;`count` 是这一次要加的回数(余量按它判),`kind: 'line'` 时方案表为空(独立线路不挑方案) |
|
|
134
135
|
| `getChannelBetween(from, to)` | 两个节点之间的通道读数(只读):有通道时 `hasChannel: true`,`channelId` / `channelIndex` / `groupCount` / `currentGroupId` 与 `groups` / `group` / `channel`(id / name / lineIds / 分组明细)都给全;没有通道时 `hasChannel: false`、`channel: null`、`groups: []`,端点认不出来返回 `null` —— 与 `getChannelAddOptions` 的读数同一份,界面做「这两个点之间已经有通道 / 有几组」的判断用它,不必算方案表 |
|
|
135
136
|
| `addChannel(spec, lineData?, group?)` | 程序化新增通道(新签名,只新建):第一段通道信息(`from` / `to` / `name` / `id` / `path` 等通道字段),第二段线路数组 line_data —— 一条或一批(字符串 / 数字按 id 认),**按每项 id 建 `lineIds`**,第三段可选分组信息(`{ id?, lineIds?, path? }`,单个 / 一组一个)—— **第二段 / 第三段显式给了**才走这条新路;两个节点之间已经有通道时整条失败(`reason` 指路下面两条)。旧写法 `addChannel(input, lineItems?)`(带 `circuits` / `resolution` / `channelId` / `groupId` / `groupIndex` / `kind`,或只写 `{ from, to }`)照样认:按方案表新建或并进已有通道,第二段 `lineItems` 给了几条就建几条 |
|
|
@@ -152,7 +153,7 @@
|
|
|
152
153
|
| `beginDecorationDraft(options?)` / `getDecorationDraft()` / `updateDecorationDraft(patch?)` / `commitDecorationDraft(overrides?)` / `cancelDecorationDraft(options?)` | 动态装饰器草稿:`target` 取 `'line'`(缺省)/ `'point'` / `'both'`,指针移到线路 / 回线或节点上就画临时装饰,移出立即收掉;`both` 按屏幕距离取更近者、等距优先节点,最近目标被白名单或上限拦住时尝试另一类。线路按 `scope`(`line` 单条 / `group` 同组 / `channel` 整条通道,非通道线退回单条)展开;节点侧 `placement` 只选位置来源(`offset` 相对偏移 / `fixed` 固定坐标 / `pointer` 鼠标位置),`anchor` 再选落地关系(`follow` 保存相对节点的屏幕偏移 / `fixed` 保存世界坐标),两者可自由组合,缺省按 `offset → follow`、`fixed / pointer → fixed` 推导。`allowedLines` / `allowedChannels` / `allowedGroups` / `allowedPoints` 与 `maxPerLine` / `maxPerPoint` 在悬浮与提交两处拦截,`allowDuplicate: false` 时按 `duplicateDistance` 检测同位置重复,`duplicateStrategy` 选 `offset` 自动避让或 `reject` 直接拦住。左键在目标上松开发 `ready`,空白处不发;`get` 取当前载荷,`update` 边交互边改图标 / 大小 / 方向 / 范围 / 位置来源 / 落地关系;`commit` 把线路与节点目标放在同一个 `batch` 里写入(一次 `dataChange`、一条历史),`cancel` 只清假装饰(Esc / 右键等价),数据与历史一个字节不动 |
|
|
153
154
|
| `setChannelLineWidth(id, width)` / `setChannelColors(id, colors)` / `setChannelPath(id, coordinates)` | 只改一条通道的回线线宽 / 逐回线颜色 / 骨架拐点:前两个把**成员回线连同通道声明**一起改(一次 `batch`,只发一条数据变更、只落一步历史),颜色不够时按顺序循环取、只给一个就整条通道一个色(改**单条回线**的颜色用 `updateLine(id, { color })`,不必走整条通道的批量写法);`colors` 传字符串或字符串数组,`setChannelPath` 只写中间拐点(两端由节点坐标补齐);分过组的通道写第一组的声明(`groups[].path` 优先于顶层 `path`;「第一组」跳过 `lineIds` 空的分组声明 —— 引擎会把这种组整组丢掉),要改别的组用 `updateChannel(id, { groups })` |
|
|
154
155
|
| `getParallelGroups()` | 新增拐点集合:被加过 / 拖过拐点的通道与线路,结构与 `test.json` 的 `parallel_groups` 一致 |
|
|
155
|
-
| `setFilter(filter \| null)` | 设置或清空筛选条件(传 `null` 清空):完整格式 `{ points, lines, cascade, worker }
|
|
156
|
+
| `setFilter(filter \| null)` | 设置或清空筛选条件(传 `null` 清空):完整格式 `{ points, lines, cascade, mode, worker }`,只筛节点时可以简写成节点条件本身。`mode: 'hide'`(缺省)只隐藏、不删数据、也不清空选中集;`mode: 'remove'` 把筛选结果从数据里删掉,只发一条 `filterRemove` 数据变更与最终一条 `onFilter`,见「筛选」 |
|
|
156
157
|
| `getFilter()` / `getFilterResult()` | 当前条件与最近一次结果:隐藏的点 / 线下标、可见数量、是否用了 Worker、耗时 |
|
|
157
158
|
| `getVisibleData()` | 过滤之后的数据副本(`points` / `lines`) |
|
|
158
159
|
| `getMovedPoints()` | 位置对账:相对上次对账(建视图 / 整份换数据 / 上一次 `clearMovedPoints`)位置变过的节点,按 id 去重、一趟扫出 `[{ index, id, x, y, item }]` —— 拖动 / `updatePoint` / `patchPoints` / 撤销都算,`removePoints` 删掉的记录顺手清掉,见「节点位置对账」 |
|
|
@@ -173,6 +174,9 @@
|
|
|
173
174
|
| `unregisterOperator(name)` | 注销一个自定义运算符(返回它之前是否注册着):还在用这个名字的条件按认不出来处理(不成立,一个要素都不命中) |
|
|
174
175
|
| `listOperators()` | 现在能用哪些运算符:内置 14 个在前,自定义按注册顺序跟在后面 |
|
|
175
176
|
| `use(plugin)` | 运行时挂一个插件(写法与 `options.plugins` 里的一项一致):调用即执行,返回幂等的卸载函数(跑插件自己的 `destroy`),见「插件」 |
|
|
177
|
+
| `registerCommand(name, handler)` | 注册一个实例命令:`handler(payload, context)` 同步执行,`context` 是冻结的 `{ view, name }`;同名覆盖,返回幂等的注销函数,旧卸载函数不会误删后来注册的同名命令,见「实例命令」 |
|
|
178
|
+
| `executeCommand(name, payload?)` | 执行实例命令:成功给 `{ ok: true, name, value }`;名字非法 / 未注册 / handler 抛错给 `{ ok: false, name, reason }`,见「实例命令」 |
|
|
179
|
+
| `listCommands()` | 当前注册着哪些实例命令(按注册顺序;同名覆盖不改变原来的位置) |
|
|
176
180
|
| `getFeatures()` / `setFeatures(next)` | 读当前生效的功能开关(跟随详细配置的也解析成 `true` / `false`)/ 换一份(预设名 / 开关表 / `true` / `false`),换完立刻生效并发一条 `onFeatureChange` |
|
|
177
181
|
| `undo()` / `redo()` | 撤销 / 重做一步:返回 `{ type, label, canUndo, canRedo }`,历史没开或没得撤销 / 重做时返回 `null` |
|
|
178
182
|
| `canUndo()` / `canRedo()` | 能不能撤销 / 重做(界面据此灰掉按钮) |
|
|
@@ -192,7 +196,7 @@
|
|
|
192
196
|
|
|
193
197
|
返回 `this` 的方法都可以链式调用;返回其它值的方法(`get*` / `list*` / `export*` / `search` / `pick*` / `add*` / `remove*` / `copy*` / `merge*` / `locate*` 这些)在下面的「参数速查」里都标了返回类型。
|
|
194
198
|
|
|
195
|
-
**怎么确认「组件到底有哪些属性和方法」**:上面那张表按功能分组介绍,下面的「参数速查」把实例的**每个成员逐个列全**(当前
|
|
199
|
+
**怎么确认「组件到底有哪些属性和方法」**:上面那张表按功能分组介绍,下面的「参数速查」把实例的**每个成员逐个列全**(当前 257 个:254 个方法 + `el` / `canvas` / `gl` 三个属性),`options` 表列全 96 个键,数据字段表列全 250 个字段。这三份清单不靠手抄 —— 它们直接对着源码与类型对账:
|
|
196
200
|
|
|
197
201
|
- `node docs/steps/gen-api-index.mjs`:从 `create.js` 的实例定义、本文档的两张表与 `types.d.ts` 生成 `docs/demos/api-index.js`(`API_SUMMARY` / `API_SECTIONS` / `API_OPTIONS`),demo 的「实例 API」面板读的就是它;带 `--check` 时只校验有没有过期。
|
|
198
202
|
- `node docs/steps/check-doc-coverage.mjs`:10 项双向对账 —— 实例成员 × 文档 / × 参数速查 / × 类型、参数速查与实例方法主表各自反查过期条目、类型反查过期声明、数据字段 × 文档、options 键 × 文档 / options 表反查过期字段、demo 清单是否最新。加一个实例成员、改一个 options 键而没同步文档时,这个脚本会直接报出来。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 17 参数速查(逐个方法)
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> 257 个成员逐个列全:参数、默认值与返回。
|
|
4
4
|
|
|
5
5
|
### 参数速查(逐个方法)
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
- **同步方法返回 `this` 时可链式调用**:所有 `update*` / `set*` / `add*` / `remove*`、选中与视角方法都先完成本地状态更新再返回实例;需要结果时用相邻的 `get*` / `list*` 读回。少数返回数组、对象或 `null` 的方法在「返回」列单独标出。
|
|
16
16
|
- **数据写入只发一次通知**:`updatePoint`、`updateLine`、`patch*`、`add*`、`remove*` 等每次成功改数据都会发一条对应的 `dataChange`(底层统一为 `updatePoints` / `updateLines` / `updateChannels` 等类型)并落一步历史;在 `batch()` 里连续调用会合并成一条。`emit: false` 只写数据、不发通知,适合宿主自己在保存成功后统一刷新。
|
|
17
17
|
- **选中方法会同步选中集**:`selectFeatures` / `selectWaypoint` / `selectInBox` 先更新引擎选中态,再同步 `getSelections()`、`getSelectionData()` 与 `isSelected()`;一次有效变更会发 `onSelect`(`cause` 标明是 `api`、`box` 或指针来源)和 `onSelectChange`。没有命中任何目标时不会凭空选中,`selectWaypoint(null)` 只清拐点、不动要素选中集。
|
|
18
|
-
- **视角方法会更新相机**:`focusOn` / `zoomTo` / `setCamera` / `fitView` 成功落到目标范围后更新 `getCamera()`,并触发 `onCameraChange`;目标认不出来、视口尚未量出或参数非法时保持当前相机。`focusOn`
|
|
18
|
+
- **视角方法会更新相机**:`focusOn` / `zoomTo` / `setCamera` / `fitView` 成功落到目标范围后更新 `getCamera()`,并触发 `onCameraChange`;目标认不出来、视口尚未量出或参数非法时保持当前相机。`focusOn` 缺省只居中、不改比例;`zoom` / `scale` / `center` / `padding` / `maxZoom` 只影响这一次调用,不会改写持久配置。
|
|
19
19
|
- **只读方法返回快照或副本**:`getSelectionData()`、`getFilter()`、`getStats()`、`snapshotScene()`、`listPoints()` / `listLines()` 返回的是调用当时的读数,不会随后续数据变更自动更新;需要最新值就再调一次。对象型字段的含义以 `types.d.ts` 同名接口为准。
|
|
20
20
|
- **失败是可控的**:找不到 id / 下标越界 / 不支持的写法会跳过这一条,能返回 `null` 或 `{ ok: false, reason }` 的就按对应签名返回;需要排查时订阅 `onWarning`。异步筛选 / 搜索通过完成事件、`getFilterResult()` / 搜索结果或返回的 Promise 取结果,不要在调用下一行假定 Worker 已经跑完。
|
|
21
21
|
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
| `zoomBy(factor, origin?)` | `factor: number` 缩放倍数(`> 1` 放大、`< 1` 缩小);`origin?: [number, number]` 缩放中心(画布 CSS 像素,缺省画布中心) | `this` |
|
|
59
59
|
| `zoomTo(scale, origin?)` | `scale: number` 目标缩放值(世界单位 → CSS 像素的比例);`origin?: [x, y]` 缩放中心 | `this` |
|
|
60
60
|
| `zoomToBounds(bounds, padding?)` | `bounds: GisViewBounds` 要装进画面的世界矩形 `[minX, minY, maxX, maxY]`(也认 `{ minX, minY, maxX, maxY }`);`padding?: number` 四周留白 | `this` |
|
|
61
|
-
| `focusOn(target, options?)` | `target: GisViewFocusTargets` 要对准的东西:id / `{ type: 'point' \| 'line' \| 'channel' \| 'group', id \| index }` / `{ channelId }`(整条通道)/ `{ type: 'group', channelId?, groupId }` / `[x, y]` 坐标 / 矩形 / `{ lngLat }` / `{ center }`,或者**一批**(数组取整体包围盒)。字符串按「先节点、再线路」,裸字符串不能表示通道;同 id 用显式 `type` 消歧,分组必须用 `type: 'group'`(`groupId` 全局唯一时可省略 `channelId
|
|
62
|
-
| `search(input)` | `input: string \| GisViewSearchOptions` 关键字,或 `{ keyword, scope, fields, limit }`
|
|
63
|
-
| `searchAsync(input)` |
|
|
61
|
+
| `focusOn(target, options?)` | `target: GisViewFocusTargets` 要对准的东西:id / `{ type: 'point' \| 'line' \| 'channel' \| 'group', id \| index }` / `{ channelId }`(整条通道)/ `{ type: 'group', channelId?, groupId }` / `[x, y]` 坐标 / 矩形 / `{ lngLat }` / `{ center }`,或者**一批**(数组取整体包围盒)。字符串按「先节点、再线路」,裸字符串不能表示通道;同 id 用显式 `type` 消歧,分组必须用 `type: 'group'`(`groupId` 全局唯一时可省略 `channelId`)。**缺省只居中、比例一点不动**;`options.zoom: true` 才按解析出的真实范围适配,四类目标共用这一条、没有额外放大倍率;`scale` 优先级高于 `zoom`,`maxZoom` 只给单点 / 单线这类零面积目标补最小范围。`options?: GisViewFocusOptions`:`zoom: true` 显式适配、`scale` 直接给比例、`center: true` 显式只居中(与缺省一致)、`padding` 要四周留白(CSS 像素,缺省 40)、`maxZoom` 限制这次适配的最大比例、`select` 顺带选中(`true` 选这次目标,也可另给一批写法)、`mode` 决定怎么并进当前选中集。目标认不出来或参数非法时什么都不做 | `this`(相机更新后发 `onCameraChange`;`select` 生效时另发 `onSelect` / `onSelectChange`) |
|
|
62
|
+
| `search(input)` | `input: string \| GisViewSearchOptions` 关键字,或 `{ keyword, scope, fields, limit }` 这类选项。`scope` 可选 `'points'` / `'lines'` / `'channels'` / `'groups'`,也认与 `focusOn` 一致的单数别名 `'point'` / `'line'` / `'channel'` / `'group'` 及数组;省略或写错时四类全搜。`limit` 对每一类分别计数。返回的 `groups` / `hits` 带分组命中(`channelIndex` / `groupId` / `groupIndex`,`item` 是轻量快照)—— **只返回结果、不动视角**,要定位就自己调 `focusOn(result.hits, …)` | `GisViewSearchResult`:`keyword` / `scope` / `points` / `lines` / `channels` / `groups` / `hits` / `total` / `truncated` / `durationMs` |
|
|
63
|
+
| `searchAsync(input)` | 同上;分组范围的当前轻量快照会随请求交给 Worker | `Promise<GisViewSearchResult>`:多一个 `worker`(是不是在 Worker 里算的)与 `stale`(回来时数据已经改过、或又搜过一次,这一份不作数了) |
|
|
64
64
|
| `setCamera(camera)` | `camera: Partial<GisViewCamera>` 要改的相机字段 `{ x, y, scale }`(只写一个也行) | `this` |
|
|
65
65
|
| `getCamera()` | 无 | `GisViewCamera` |
|
|
66
66
|
| `getZoomBaseScale()` | 无 | `number` 缩放联动的基准比例(`pointZoomScale` / `lineZoomScale` 共用那一份;缺省是首次适应视图时的 `camera.scale`) |
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
| `getViewport()` | 无 | `{ cssWidth, cssHeight, pixelRatio, displayScale }`:画布 CSS 尺寸、设备像素比与渲染分辨率比例 |
|
|
70
70
|
| `getViewRect()` | 无 | `GisViewBounds` |
|
|
71
71
|
| `isLayoutReady()` | 无 | `boolean` |
|
|
72
|
+
| `getMinimapElement()` | 无 | `HTMLElement \| null` 鹰眼图根节点(没配 `minimap` 时为 `null`);外部整图拖动 / 自定义手势用它,配合 `minimap.container` 可挂到外部宿主 |
|
|
72
73
|
| `getMinimapZoom()` | 无 | `number` |
|
|
73
74
|
| `setMinimapZoom(zoom)` | `zoom: number` 鹰眼图的目标倍数(被 `minimap.minZoom` / `maxZoom` 夹住) | `this` |
|
|
74
75
|
| `zoomMinimapBy(factor, origin?)` | `factor: number` 倍数;`origin?: [x, y]` 以小图里的哪个点为中心(缺省小图中心) | `this` |
|
|
@@ -201,13 +202,13 @@
|
|
|
201
202
|
| `addChannelGroupWaypoint(channelId, groupId, coordinate)` | `channelId` 通道 id;`groupId` 分组 id;`coordinate` 新拐点世界坐标 | `this` |
|
|
202
203
|
| `removeChannelGroupWaypoint(channelId, groupId, pathIndex)` | `channelId` / `groupId` / `pathIndex` 要删的骨架顶点下标 | `this` |
|
|
203
204
|
| `runChannelAction(actionId, options?)` | `actionId: GisViewChannelActionId` 动作名(`'select-group'` / `'deselect-group'` / `'add-waypoint'` / `'remove-waypoint'` / `'split'` / `'merge'`,见 `getChannelContext().actions`);`options?: GisViewChannelActionOptions` 动作自己的参数(`groupId` / `lineId` / `coordinate`…) | `GisViewChannelContext \| null` |
|
|
204
|
-
| `beginAddChannel(options = {})` | `options?: GisViewChannelDraftOptions` 草稿配置:`from`(预指定起点,下一步只选终点)/ `kind` / `circuits` / `autoCommit` / `continuous` / `chain` / `name` / `lineId` / `id` / `lineProps` / `linePropsByMember` / `lineItems`(第二段)/ `routing` / `path`(中间拐点)/ `channelProps` / `channelDraftStyle
|
|
205
|
+
| `beginAddChannel(options = {})` | `options?: GisViewChannelDraftOptions` 草稿配置:`from`(预指定起点,下一步只选终点)/ `kind` / `circuits` / `autoCommit` / `continuous` / `chain` / `name` / `lineId` / `id` / `lineProps` / `linePropsByMember` / `lineItems`(第二段)/ `routing` / `path`(中间拐点)/ `channelProps` / `channelDraftStyle`(本次草稿的预览样式,含 `dots` 与 `layer`)/ `handoff`(交接模式)/ `select`(点中的节点顺手选中,走 `onSelect` 那一套)/ `originalEvent` | `this`(只负责那条示例假通道,真正新增走 `commitAddChannel` / `addChannel`) |
|
|
205
206
|
| `getAddChannelDraft()` | 无 | `GisViewChannelDraftPayload \| null` |
|
|
206
|
-
| `updateAddChannelStyle(patch = {})` | `patch?: GisViewChannelDraftStyle \| null` 字段级合并的预览样式(箭头位置 / 多回线间距 / 自绘等);传 `null` 回到全局 `channelDraftStyle` | `this` |
|
|
207
|
+
| `updateAddChannelStyle(patch = {})` | `patch?: GisViewChannelDraftStyle \| null` 字段级合并的预览样式(箭头位置 / 多回线间距 / 两端 `dots` / 层级 `layer` / 自绘等);传 `null` 回到全局 `channelDraftStyle` | `this` |
|
|
207
208
|
| `continueAddChannel(options = {})` | `options?: GisViewChannelDraftOptions` 开下一段草稿(写法与 `beginAddChannel` 一致,不传就沿用这一段原来的) | `this` |
|
|
208
209
|
| `cancelAddChannel()` | 无 | `this`(收掉草稿并补一条 `phase: 'cancel'`) |
|
|
209
210
|
| `endAddChannel()` | 无 | `this`(静默收掉视图上的示例假通道 / 线路,数据不动、不补事件) |
|
|
210
|
-
| `commitAddChannel(
|
|
211
|
+
| `commitAddChannel(input?, options?)` | `input?: GisViewChannelAddResolution \| GisViewChannel \| GisViewLine \| GisViewChannelAddCommitInput`,五种写法:① 不传 / `null` = 用草稿 `preferred`;② 旧 resolution:字符串或只含非 `undefined` 的 `type` / `groupId` / `groupIndex` / `channelId` 的对象;③ 直接线路对象:没有 `lineIds` 数组,且写了 `kind: 'line'` / `path` / `from` / `to` / `start` / `end` 之一,业务字段与自己的 `lineProps` 透传到新线路;④ 直接通道对象:`Array.isArray(lineIds)` 且没有容器键,`lineIds` 逐条作新回线 id 种子、`groups` 作分组声明、自己的 `lineProps` 对所有新回线生效,其余字段进 `channelProps`,缺省 `resolution: 'newChannel'`;⑤ 容器:出现 `channel` / `line` / `lines` / `lineData` / `lineItems` / `channelGroups` / `group` / `channelProps` / `resolution` 任一键(只写 `lineProps` 也算)。容器里 `line` 缺省是独立线路,`lines` 是成员表(给了几条建几条,空数组沿用草稿);`channel.lineIds` 只在没有 `lines` 时当种子。字段优先级:`from` / `to` = 顶层 → `channel` → `line` → `lineItems` 第一个对象项(裸 id 跳过)→ 草稿;`path` = 顶层 → `line` → `channel` → 草稿;分组 = `channelGroups` → `group` → `channel.groups`;容器 `lineProps` = 草稿 → 顶层 → `line.lineProps` → 逐条,**不读 `channel.lineProps`**;`channelProps` = 草稿 → `channel` 业务字段 → 顶层 `channelProps`。直接线路 / 直接通道对象默认新建,要并进已有分组必须用容器并显式写 `resolution`。`options?: { auto?: boolean; continuous?: boolean; originalEvent?: Event \| null }`:`auto` 只标记自动提交,`continuous: false` 强制本次后结束,`originalEvent` 带回重开的草稿。`ready` 的方案对象不能整条回传,只取 `{ type, groupId, groupIndex, channelId }` 子集。调用前草稿必须 `ready`,否则不写数据;没有草稿的程序化新增用 `addChannel` / `addLine`。完整示例见「10 通道编辑与新增」与「18 逐方法示例」 | `GisViewChannelAddResult` |
|
|
211
212
|
| `getChannelAddOptions(from, to, count?, kind?)` | `from` / `to` 两端节点 id;`count?: number` 回数(缺省 1);`kind?: 'channel' \| 'line'`(缺省 `'channel'`) | `GisViewChannelAddPlan \| null` |
|
|
212
213
|
| `getChannelBetween(from, to)` | `from` / `to` 两端节点 id | `GisViewChannelBetween \| null` |
|
|
213
214
|
| `addChannel(channel, lineData?, group?)` | `channel: GisViewChannelAddSpec` 通道信息 `{ from, to, name?, id?, lineData?, group? }`(后两个是第二 / 第三段写在对象上的别名);`lineData?: GisViewChannelLineData` 线路数组(`Partial<GisViewLine>` / `string` / `number` 的一条或一批,按每项 id 建 `lineIds`);`group?: GisViewChannelAddGroup \| GisViewChannelAddGroup[]` 可选分组信息 `{ id?, lineIds?, path? }`。旧写法 `addChannel(input, lineItems?)`(`GisViewChannelAddInput`:`circuits` / `resolution` / `channelId` / `groupId` / `groupIndex` / `kind` / `routing` / `path` 那套)照样认;`path` 是中间拐点,独立线路落地成完整折线、通道只写骨架拐点 | `GisViewChannelAddResult`(`channelLineIds` 是落地后通道的完整成员表,独立线路为 `null`) |
|
|
@@ -306,7 +307,7 @@
|
|
|
306
307
|
|
|
307
308
|
| 方法 | 参数(名字: 类型 = 默认值) | 返回 |
|
|
308
309
|
| --- | --- | --- |
|
|
309
|
-
| `setFilter(filter)` | `filter: GisViewFilterInput \| null` 筛选条件:完整格式 `{ points, lines, cascade, worker }`;只筛节点时可以简写成节点条件本身;传 `null`
|
|
310
|
+
| `setFilter(filter)` | `filter: GisViewFilterInput \| null` 筛选条件:完整格式 `{ points, lines, cascade, mode, worker }`;只筛节点时可以简写成节点条件本身;传 `null` 等于清空。`mode: 'hide'`(缺省)只隐藏、不删数据、不清空选中集;`mode: 'remove'` 删除筛选结果,只发一条 `filterRemove` 与最终一条 `onFilter` | `this` |
|
|
310
311
|
| `getFilter()` | 无 | `GisViewFilter \| null` |
|
|
311
312
|
| `getFilterResult()` | 无 | `GisViewFilterResult \| null` |
|
|
312
313
|
|
|
@@ -318,6 +319,9 @@
|
|
|
318
319
|
| `once(name, handler)` | 与 `on` 同一套事件名与载荷;只触发一次,回调跑完自动摘掉。返回的取消函数可提前撤销;即使提前取消,重复调用也安全 | `() => void` 取消订阅 |
|
|
319
320
|
| `off(name, handler?)` | `name` 事件名(也认 `'*'`);`handler?` 只摘掉这一个回调,不传 = 摘掉这个事件的全部订阅 | `number` 摘掉几条(没摘到返回 `0`) |
|
|
320
321
|
| `use(plugin)` | `plugin: GisViewPlugin`(`(view, context) => hook`,与 `options.plugins` 的写法一致):立即执行一次,返回卸载函数 —— 调它跑插件自己的 `destroy`(重复调用只清一次,实例销毁之后也安全) | `() => void` 卸载 |
|
|
322
|
+
| `registerCommand(name, handler)` | `name: string` 命令名(会 `trim`,同名覆盖);`handler: GisViewCommandHandler<Payload, Value>` 同步处理函数 `(payload, context) => Value`,`context` 是冻结的 `{ view, name }`。名字为空 / handler 不是函数只报 warning、不注册;视图销毁后注册不生效 | `() => void` 幂等注销;同名已被后来者覆盖时不会误删新命令 |
|
|
323
|
+
| `executeCommand(name, payload?)` | `name: string` 命令名;`payload?: unknown` 原样交给 handler | `GisViewCommandResult<Value>`:`{ ok: true, name, value }` / `{ ok: false, name, reason }`(未注册 / 名字非法 / handler 抛错) |
|
|
324
|
+
| `listCommands()` | 无 | `string[]` 当前注册的命令名(按注册顺序;同名覆盖不改变位置) |
|
|
321
325
|
| `getFeatures()` | 无 | `GisViewFeatureState` |
|
|
322
326
|
| `setFeatures(next)` | `next: GisViewFeaturesInput` 预设名(`'edit'` / `'view'` / `'static'`)、开关表或布尔值 | `this` |
|
|
323
327
|
| `undo()` / `redo()` | 无:从撤销 / 重做栈回放一步;会同步数据、发 `history` 与对应的 `dataChange`,并更新相机以外的运行时读数 | `GisViewHistoryStepResult \| null`:`{ type, label, canUndo, canRedo }`;历史没开或栈空时为 `null` |
|
|
@@ -26,6 +26,7 @@ view.updateOptions({ points: nextPoints, lines: nextLines }, true)
|
|
|
26
26
|
// denseMode:大数据展示模式('auto' 缺省 / 'on' / 'off',或对象写法换三档阈值)
|
|
27
27
|
view.updateOptions({ denseMode: 'on' }) // 临时强制进入密集档(标签避让 / 截断,动效暂停)
|
|
28
28
|
view.updateOptions({ denseMode: { mode: 'auto', visibleThreshold: 3000, densityThreshold: 2500, pointThreshold: 60000 } })
|
|
29
|
+
view.updateOptions({ selectTrigger: 'dblClick' }) // 改成双击选中(缺省 'click');第二下同时派发 onClick 与 onDblClick
|
|
29
30
|
const dense = view.getStats().dense // { mode, active, reason, visiblePoints, visibleThreshold, densityThreshold, pointThreshold }
|
|
30
31
|
|
|
31
32
|
// updatePointStyle(patch):按字段合并全局点样式;写 null 清掉整份
|
|
@@ -169,20 +170,23 @@ view.zoomToBounds([0, 0, 400, 200], 40)
|
|
|
169
170
|
view.zoomToBounds({ minX: 116, minY: 39, maxX: 117, maxY: 40 })
|
|
170
171
|
|
|
171
172
|
// focusOn(target, options?):对准一个或多个目标(id / 显式类型 / 坐标 / 矩形 / 搜索命中 / 一批)
|
|
172
|
-
view.focusOn('a')
|
|
173
|
-
view.focusOn(
|
|
173
|
+
view.focusOn('a') // 缺省只居中,比例不动
|
|
174
|
+
view.focusOn('a', { zoom: true, maxZoom: 8 }) // 显式按范围适配
|
|
175
|
+
view.focusOn(['a', 'b'], { zoom: true, padding: 60, select: true })
|
|
174
176
|
view.focusOn({ type: 'point', id: 'a' }) // 节点与线路同 id 时显式消歧
|
|
175
177
|
view.focusOn({ type: 'line', id: 'a' })
|
|
176
178
|
view.focusOn({ type: 'channel', channelId: 'c1' }) // 通道也可以直接写 { channelId: 'c1' }
|
|
177
179
|
view.focusOn({ type: 'group', channelId: 'c1', groupId: 'c1::2' })
|
|
178
180
|
view.focusOn({ type: 'group', groupId: 'global-group' }) // groupId 全局唯一时可省略通道
|
|
179
|
-
view.focusOn([120, 80], { center: true }) //
|
|
181
|
+
view.focusOn([120, 80], { center: true }) // 显式只居中(与缺省一致)
|
|
180
182
|
view.focusOn({ lngLat: [116.4, 39.9] })
|
|
181
183
|
|
|
182
184
|
// search(input) / searchAsync(input):搜索(只返回结果、不动视角)
|
|
183
185
|
const hits = view.search('甲站')
|
|
184
|
-
const scoped = view.search({ keyword: '甲', scope: ['points', 'channels'], limit: 10 })
|
|
185
|
-
view.
|
|
186
|
+
const scoped = view.search({ keyword: '甲', scope: ['points', 'channels', 'groups'], limit: 10 })
|
|
187
|
+
const groupHits = view.search({ keyword: 'c1::2', scope: 'group' }) // 单数别名与 focusOn 一致
|
|
188
|
+
view.focusOn(groupHits.groups[0], { zoom: true, select: true }) // 按整组范围适配并选中成员回线
|
|
189
|
+
view.focusOn(hits.hits, { zoom: true, maxZoom: 8 }) // 命中集直接丢给 focusOn
|
|
186
190
|
const asyncHits = await view.searchAsync('甲站') // 大表走 Worker;stale 说明这一份不作数了
|
|
187
191
|
|
|
188
192
|
// setCamera(camera) / getCamera():读写相机(只写一个字段也行)
|
|
@@ -203,6 +207,9 @@ const { cssWidth, cssHeight, pixelRatio } = view.getViewport()
|
|
|
203
207
|
// isLayoutReady():容器量到尺寸、首批布局完成没有
|
|
204
208
|
const layoutReady = view.isLayoutReady()
|
|
205
209
|
|
|
210
|
+
// getMinimapElement():拿鹰眼图根节点做整图拖动 / 自定义手势(没配 minimap 时为 null)
|
|
211
|
+
const minimapElement = view.getMinimapElement()
|
|
212
|
+
|
|
206
213
|
// getMinimapZoom() / setMinimapZoom(zoom) / zoomMinimapBy(factor, origin?):鹰眼图缩放
|
|
207
214
|
view.setMinimapZoom(4)
|
|
208
215
|
view.zoomMinimapBy(1.25)
|
|
@@ -534,21 +541,130 @@ view.runChannelAction('split', { lineId: 'l2' })
|
|
|
534
541
|
view.addChannelGroupWaypoint('c1', 'c1::2', [200, 120])
|
|
535
542
|
view.removeChannelGroupWaypoint('c1', 'c1::2', 1)
|
|
536
543
|
|
|
537
|
-
// beginAddChannel(options?) / getAddChannelDraft() / updateAddChannelStyle(patch?) / continueAddChannel(options?)
|
|
544
|
+
// beginAddChannel(options?) / getAddChannelDraft() / updateAddChannelStyle(patch?) / continueAddChannel(options?)
|
|
545
|
+
// commitAddChannel(input?, options?) / cancelAddChannel() / endAddChannel()
|
|
538
546
|
view.beginAddChannel({
|
|
539
547
|
kind: 'channel',
|
|
540
548
|
circuits: 3,
|
|
541
549
|
channelDraftStyle: {
|
|
542
550
|
color: '#2f6fd0', width: 2.5, arrow: true, arrowSize: 14, arrowPositions: [0, 0.5, 1],
|
|
543
|
-
circuitSpacing: 12, opacity: 0.9
|
|
551
|
+
circuitSpacing: 12, opacity: 0.9,
|
|
552
|
+
// 两端示例点:false 全关;对象可统一 size / color / shape,from / to 再分别覆盖
|
|
553
|
+
dots: { size: 5, shape: 'square', from: { color: '#2f6fd0' }, to: { color: '#d9544d' } },
|
|
554
|
+
layer: 'below-points' // 示例线 / 箭头 / customDraw 画在真实节点之下;示例点仍在节点之后
|
|
544
555
|
}
|
|
545
556
|
}) // 点两个节点:第一个起点、第二个终点;通道 3 回时预览也画 3 条平行回线
|
|
546
|
-
view.beginAddChannel({ from: 'station-a' }) //
|
|
557
|
+
view.beginAddChannel({ from: 'station-a' }) // 只预指定起点:接下来只点终点(没有 from + to 的写法)
|
|
547
558
|
const draft = view.getAddChannelDraft() // 草稿读数(跟随光标的预览、两个节点、方案表与实际 style)
|
|
548
559
|
view.updateAddChannelStyle({ arrowPositions: [0.25, 0.75], arrowReverse: true }) // 字段级合并,只改箭头
|
|
549
560
|
view.updateAddChannelStyle(null) // 回到全局 channelDraftStyle
|
|
550
|
-
|
|
551
|
-
|
|
561
|
+
|
|
562
|
+
// commitAddChannel 只负责把已 ready 的草稿落地;没有草稿的程序化新增用 addChannel / addLine。
|
|
563
|
+
// 下面每个 commit 例子都假设当前草稿已经重新 ready;实际连续调用请逐段 begin / 点选。
|
|
564
|
+
// 五类入参:无参、旧 resolution、直接线路、直接通道(必须有 lineIds)、容器(channel / line / lines / ...)。
|
|
565
|
+
// 1. 无参:沿用草稿的 preferred(newChannel / newGroup / joinGroup / newLine)
|
|
566
|
+
view.commitAddChannel()
|
|
567
|
+
|
|
568
|
+
// 2. 旧 resolution:字符串或只含 type / groupId / groupIndex / channelId 的对象
|
|
569
|
+
view.commitAddChannel('newChannel')
|
|
570
|
+
view.commitAddChannel({ type: 'joinGroup', groupId: 'c1::2', groupIndex: 1, channelId: 'c1' })
|
|
571
|
+
|
|
572
|
+
// 3. 从 ready 的方案读数里选一条:只取四个定位字段,不能把整条 option 回传。
|
|
573
|
+
// 整条 option 还带 enabled / count / lineCount / lineIds,可能被误识别成直接通道或容器。
|
|
574
|
+
view.updateOptions({
|
|
575
|
+
onChannelDraft: payload => {
|
|
576
|
+
if (payload.phase !== 'ready' || payload.blocked) return
|
|
577
|
+
const chosen = payload.options.find(option => option.enabled && option.type === 'joinGroup')
|
|
578
|
+
if (!chosen) return
|
|
579
|
+
const result = view.commitAddChannel({
|
|
580
|
+
type: chosen.type,
|
|
581
|
+
groupId: chosen.groupId,
|
|
582
|
+
groupIndex: chosen.groupIndex,
|
|
583
|
+
channelId: chosen.channelId
|
|
584
|
+
})
|
|
585
|
+
console.log(result.ok, result.reason, result.lineIds)
|
|
586
|
+
}
|
|
587
|
+
})
|
|
588
|
+
|
|
589
|
+
// 4. 直接线路对象:没有 lineIds,但至少写 from / to / path / kind: 'line' 之一。
|
|
590
|
+
// 业务字段和 lineProps 都透传到新线路;path 是中间拐点(不含首尾)。
|
|
591
|
+
view.commitAddChannel({
|
|
592
|
+
id: 'new-line',
|
|
593
|
+
name: '对象线路',
|
|
594
|
+
from: 'station-a',
|
|
595
|
+
to: 'station-b',
|
|
596
|
+
path: [[116.72, 39.91], [116.86, 39.95]],
|
|
597
|
+
color: '#ff7a45', // 直接业务字段 → lineProps
|
|
598
|
+
width: 3,
|
|
599
|
+
lineType: 'dashed',
|
|
600
|
+
voltageLevel: '10kV',
|
|
601
|
+
lineProps: { opacity: 0.9 } // 合并顺序:业务字段 → 自己的 lineProps
|
|
602
|
+
})
|
|
603
|
+
|
|
604
|
+
// 5. 直接通道对象:必须写 lineIds;每个 id 生成一条回线,groups 是分组声明。
|
|
605
|
+
// id 只决定通道 id,不是回线 id 种子;并进已有通道要改用容器 + resolution。
|
|
606
|
+
view.commitAddChannel({
|
|
607
|
+
id: 'new-channel', name: '对象通道', from: 'station-a', to: 'station-b',
|
|
608
|
+
lineIds: ['new-channel-1', 'new-channel-2'],
|
|
609
|
+
groups: [
|
|
610
|
+
{ id: 'new-group-1', lineIds: ['new-channel-1'], path: [[116.75, 39.86]] },
|
|
611
|
+
{ id: 'new-group-2', lineIds: ['new-channel-2'], path: [[116.75, 39.98]] }
|
|
612
|
+
],
|
|
613
|
+
width: 28,
|
|
614
|
+
lineProps: { color: '#2f6fd0', lineType: 'dashed' },
|
|
615
|
+
owner: '运维一班' // 其余字段 → channelProps
|
|
616
|
+
})
|
|
617
|
+
|
|
618
|
+
// 6. 容器写法:一段一段覆盖草稿,没写的继续用草稿。
|
|
619
|
+
// lines / lineData / lineItems 同义,优先级 lines > lineData > lineItems,给了几条就建几条。
|
|
620
|
+
view.commitAddChannel({
|
|
621
|
+
resolution: 'newChannel',
|
|
622
|
+
from: 'station-a',
|
|
623
|
+
to: 'station-b',
|
|
624
|
+
channel: { id: 'container-channel', name: '容器通道', nodeWidth: 1 },
|
|
625
|
+
lines: [
|
|
626
|
+
{ id: 'n-1', color: '#dd4b2e', width: 2.2, name: '一回' },
|
|
627
|
+
'n-2',
|
|
628
|
+
{ id: 'n-3', color: '#2ea36b', voltageLevel: '10kV' }
|
|
629
|
+
],
|
|
630
|
+
channelGroups: [
|
|
631
|
+
{ id: 'container-channel::1', lineIds: ['n-1', 'n-2'] },
|
|
632
|
+
{ id: 'container-channel::2', lineIds: ['n-3'], path: [[116.78, 39.96]] }
|
|
633
|
+
],
|
|
634
|
+
routing: 'orthogonal', // 只有容器这一层的 routing 会改走线
|
|
635
|
+
path: [[116.78, 39.9]], // 中间拐点,不含两端
|
|
636
|
+
lineProps: { opacity: 0.9 }, // 容器合并:草稿 → 顶层 → line.lineProps → 逐条
|
|
637
|
+
channelProps: { width: 36 } // 最后覆盖新通道字段
|
|
638
|
+
})
|
|
639
|
+
|
|
640
|
+
// 7. 只给 channel.lineIds 当种子:没有 lines / line / lineData / lineItems 时,每个 id 建一条回线
|
|
641
|
+
view.commitAddChannel({
|
|
642
|
+
channel: { id: 'seed-channel', from: 'station-a', to: 'station-b', lineIds: ['seed-1', 'seed-2'] },
|
|
643
|
+
lineProps: { color: '#2f6fd0', width: 2 }
|
|
644
|
+
})
|
|
645
|
+
|
|
646
|
+
// 8. 空数组不覆盖草稿:lines / lineData / lineItems 给 [] 时,沿用草稿的 lineItems / circuits
|
|
647
|
+
view.commitAddChannel({ channel: { id: 'draft-lines' }, lines: [] })
|
|
648
|
+
|
|
649
|
+
// 9. 覆盖端点 / id / 名称 / 路由:顶层字段优先,lineId 是多回时自动展开的 id 种子
|
|
650
|
+
view.commitAddChannel({
|
|
651
|
+
from: 'station-c', to: 'station-d', name: '改道联络线',
|
|
652
|
+
lineId: 'rerouted', lines: [{ id: 'rerouted-1' }, { id: 'rerouted-2' }],
|
|
653
|
+
routing: 'orthogonal', path: [[116.9, 39.9]]
|
|
654
|
+
})
|
|
655
|
+
|
|
656
|
+
// 10. 并进已有通道 / 分组:直接通道默认新建,所以用容器并显式写 resolution
|
|
657
|
+
view.commitAddChannel({
|
|
658
|
+
resolution: { type: 'joinGroup', groupId: 'c1::2' },
|
|
659
|
+
lines: [{ id: 'join-1', color: '#dd4b2e' }, { id: 'join-2', color: '#2ea36b' }],
|
|
660
|
+
lineProps: { width: 2.4 }
|
|
661
|
+
})
|
|
662
|
+
|
|
663
|
+
// 11. 第二参数只管本次收尾:continuous: false 强制结束;originalEvent 原样带回重开的草稿
|
|
664
|
+
view.commitAddChannel(undefined, { continuous: false, originalEvent: null })
|
|
665
|
+
const commitResult = view.commitAddChannel()
|
|
666
|
+
console.log(commitResult.ok, commitResult.kind, commitResult.lineIds, commitResult.channelLineIds)
|
|
667
|
+
|
|
552
668
|
view.continueAddChannel({ kind: 'line' }) // 连续模式下开下一段(也能换这一段加什么)
|
|
553
669
|
view.cancelAddChannel() // 取消(Esc / 右键等价)
|
|
554
670
|
|
|
@@ -832,15 +948,29 @@ const selectionData = view.exportData({ scope: 'selection', parts: ['station', '
|
|
|
832
948
|
#### 筛选
|
|
833
949
|
|
|
834
950
|
```js
|
|
835
|
-
// setFilter(filter):设筛选条件(只筛节点可以写简写);传 null
|
|
951
|
+
// setFilter(filter):设筛选条件(只筛节点可以写简写);传 null 等于清空;默认只隐藏
|
|
836
952
|
view.setFilter({ vn_kv: { gte: 525 } })
|
|
837
953
|
view.setFilter({ points: { station_type: 'coal' }, lines: { vn_kv: { gte: 525 } }, cascade: 'binding' })
|
|
838
954
|
view.setFilter(null)
|
|
839
955
|
|
|
956
|
+
// 默认 hide:只隐藏显示,不删数据、也不清空选中集;被筛掉的选中项在条件放宽后原样恢复
|
|
957
|
+
view.selectFeatures(['a', 'a-b'])
|
|
958
|
+
view.setFilter({ points: { station_type: 'coal' }, cascade: false })
|
|
959
|
+
view.getSelections().map(item => item.item.id) // 仍然包含被隐藏的 'a' / 'a-b'
|
|
960
|
+
view.setFilter(null)
|
|
961
|
+
|
|
962
|
+
// remove:不命中的点 / 线直接从数据里删掉;先删线路再删节点,只发一条 filterRemove
|
|
963
|
+
view.on('dataChange', payload => {
|
|
964
|
+
if (payload.type === 'filterRemove') console.log(payload.pointIndexes, payload.removedPoints, payload.removedLineItems)
|
|
965
|
+
})
|
|
966
|
+
view.setFilter({ points: { station_type: 'coal' }, mode: 'remove' })
|
|
967
|
+
view.getFilterResult() // 删除完成后 hiddenPoints / hiddenLines 为空
|
|
968
|
+
view.undo() // 开了 history 时恢复数据;回放本身不会再触发一次删除
|
|
969
|
+
|
|
840
970
|
// getFilter() / getFilterResult():当前条件(副本)/ 最近一次结果
|
|
841
971
|
view.setFilter(null)
|
|
842
972
|
const filter = view.getFilter()
|
|
843
|
-
const filterResult = view.getFilterResult() //
|
|
973
|
+
const filterResult = view.getFilterResult() // hide 模式是隐藏下标;remove 完成后 hidden 为空
|
|
844
974
|
```
|
|
845
975
|
|
|
846
976
|
#### 事件、开关与历史
|
|
@@ -857,6 +987,20 @@ view.off('dataChange', sync) // 只摘掉这一个(返回摘掉几条
|
|
|
857
987
|
const dispose = view.use((view, context) => ({ destroy() { /* 插件自己的清理;context.apiVersion 当前为 1 */ } }))
|
|
858
988
|
dispose()
|
|
859
989
|
|
|
990
|
+
// registerCommand(name, handler) / executeCommand(name, payload?) / listCommands():实例级业务命令
|
|
991
|
+
const disposeCommand = view.registerCommand('focusHighestLoad', (payload = {}, context) => {
|
|
992
|
+
const threshold = Number(payload.threshold ?? 0.8)
|
|
993
|
+
const target = view.getData().points
|
|
994
|
+
.filter(point => Number(point.max_loading_rate ?? 0) >= threshold)
|
|
995
|
+
.sort((left, right) => Number(right.max_loading_rate ?? 0) - Number(left.max_loading_rate ?? 0))[0]
|
|
996
|
+
if (!target) return { focused: false, threshold }
|
|
997
|
+
context.view.focusOn(target.id, { select: true, zoom: true, maxZoom: 12 })
|
|
998
|
+
return { focused: true, id: target.id, command: context.name }
|
|
999
|
+
})
|
|
1000
|
+
const commandResult = view.executeCommand('focusHighestLoad', { threshold: 0.85 })
|
|
1001
|
+
const commandNames = view.listCommands() // ['focusHighestLoad']
|
|
1002
|
+
disposeCommand() // 幂等卸载;同名覆盖时不会误删新命令
|
|
1003
|
+
|
|
860
1004
|
// getFeatures() / setFeatures(next):功能开关的读 / 写(预设名 / 开关表 / 布尔值)
|
|
861
1005
|
const features = view.getFeatures()
|
|
862
1006
|
view.setFeatures('view') // 'edit' / 'view' / 'static'
|
|
@@ -20,8 +20,8 @@ view.listLines({ inView: true, limit: 200 }) // 视口里看得见的线
|
|
|
20
20
|
view.getElementBounds(view.getSelections()) // { minX, minY, maxX, maxY }
|
|
21
21
|
|
|
22
22
|
// 把视角挪过去 / 一次取全读数
|
|
23
|
-
view.focusOn(view.getSelections(), { maxZoom: 8 })
|
|
24
|
-
view.focusOn([{ type: 'point', index: 3 }, { type: 'line', index: 2 }], { padding: 60 })
|
|
23
|
+
view.focusOn(view.getSelections(), { zoom: true, maxZoom: 8 }) // 选中集按整体范围适配;单个节点最多放大到 8 倍
|
|
24
|
+
view.focusOn([{ type: 'point', index: 3 }, { type: 'line', index: 2 }], { zoom: true, padding: 60 })
|
|
25
25
|
const state = view.getViewState() // camera / viewport / layoutReady / stats …
|
|
26
26
|
|
|
27
27
|
// 自定义右键菜单:一个屏幕点上的东西都在这里
|
|
@@ -34,7 +34,7 @@ canvas.addEventListener('contextmenu', (event) => {
|
|
|
34
34
|
|
|
35
35
|
`GisViewListOptions` 的几个筛选条件是「与」的关系:`indexes`(只看这几个下标)、`inView`(`true` 按当前视口,或者直接给一份世界矩形 `{ minX, minY, maxX, maxY }`)、`limit`(最多几条)、`visibleOnly`(缺省 `true`:被筛选 / `visible: false` 隐藏掉的不算)、`withScreen`(补一份画布 CSS 像素坐标)。都不给就是「全部可见的」;十万级数据下这套方法适合面板读数、导出与校验,别逐帧调。
|
|
36
36
|
|
|
37
|
-
`listPoints()` 用的就是引擎画点那一份可见判定(旧版单独暴露的 `getVisiblePoints()` 并进了这一条):`radius` / 图层号 / 屏幕坐标这些几何读数都在它给的条目里。`focusOn()`
|
|
37
|
+
`listPoints()` 用的就是引擎画点那一份可见判定(旧版单独暴露的 `getVisiblePoints()` 并进了这一条):`radius` / 图层号 / 屏幕坐标这些几何读数都在它给的条目里。`focusOn()` 只移动相机、不改数据:缺省(以及显式 `{ center: true }`)只居中、比例不动,`{ zoom: true }` 才按目标范围适配,`{ select: true }` 顺带把这批选上,传一批目标(数组)就是整体居中。
|
|
38
38
|
|
|
39
39
|
只要「屏幕里这一片」的节点时用 `forEachPointInView()`:它按数据顺序逐个回调 `(index, item, x, y, radius)`,不建中间数组,回调返回 `false` 可以提前结束 —— 放大看一小片时不会去碰整份数据(十万级数据下,面板读数、导出与排序用上面那两条,按视口画自己的东西用这一条):
|
|
40
40
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- 网格与线宽都在屏幕空间计算,`devicePixelRatio` 变化后按设备像素重建场景。
|
|
10
10
|
- 拾取在 CPU 侧按屏幕距离完成:先识别拐点,再按 Ctrl + 点击补拐点(点到线比点到节点更近就加点,否则走节点多选),最后才轮到要素,容差分别由拐点尺寸、点直径与线宽推导。点的拾取与框选共用一张随数据范围重建的均匀网格索引,线也有随线段重建的网格索引,每次交互只遍历光标附近的候选再做精确比较,耗时与总量基本脱钩(`getStats().pickMs` 可以直接读出来)。
|
|
11
11
|
- 拐点用独立的圆点缓冲绘制,拖动只重算这一条线的线段与圆头,不触碰其它要素;框选矩形复用填充管线(一批顶点靠 `drawArrays` 偏移分段画填充与边框),悬停与选中强调仍走原来的高亮缓冲。
|
|
12
|
-
- 内置界面只有鹰眼图,而且要显式配 `minimap` 才有:小图自己画筛选后仍可见的节点与线路(含通道回线,`channelCircuits: false`
|
|
12
|
+
- 内置界面只有鹰眼图,而且要显式配 `minimap` 才有:小图自己画筛选后仍可见的节点与线路(含通道回线,`channelCircuits: false` 时每个分组只画一根逐顶点平均出的居中代表线),沿用主图规则时节点尺寸与圆 / 方 / 图片 / SVG / 自定义图元也和主图最终解析结果一致,但尺寸会再乘一次「小图视口 ÷ 主图视口」的比例,小图里的节点不会和主图一样大;视口框跟着相机走,节点 / 线路 / 框三份样式与位置、尺寸、交互都能单独配,`offset` 可动态移动整张图,`container` 可把根节点挂到外部 `div`(`getMinimapElement()` 用来接整图拖动),框上按下直接拖框。`zoomable` 三态互斥:`false` 关闭、`true` 手动缩放小图自身(主图留给 Ctrl / ⌘ + 滚轮)、`'follow'` 让整体范围跟随主图(`followZoomScale` 调指数);空白处拖动可以平移小图或框选让主图显示过去(`dragAction`,`box` 不依赖缩放,只有手动模式下 Ctrl / ⌘ 才切换动作),每格倍率是 `zoomStep`。`extentFollowCamera` 默认 `false`,外围要素消失时不会自行收窄包围盒;打开后才按相机取舍 `auto` 范围。不配就完全不产生 DOM,见「鹰眼图」。要更自由的预览仍然可以用 `getBounds()` 画全量缩略图、`getViewRect()` 画当前视口矩形,再把小图坐标按比例换算成 `setCamera()` 的目标。`docs/demos/GisViewDemo.vue` 右下角用的就是内置鹰眼图:尺寸、线路显隐、回线根数、拖动动作、缩放模式 / 跟随指数、范围开关与三份样式都在 demo 里换。
|
|
13
13
|
- 拖拽与框选期间只更新受影响要素的坐标与缓冲,不重新解析符号与贴图;通道拖拐点只重算这条通道的成员线。
|
|
14
14
|
- 配置写错不猜谜:键 / 预设 / 档位 / 事件名不认识时走 `onWarning`(与 `'warning'` 事件同一条消息)说一句,同一个错只提醒一次,不进 `onError`、也不打断流程;画质(`quality`)只改「画哪些批次 + 多大分辨率」,`view.getQuality()` 与 `onStats` 里的 `quality` 是同一份读数。
|
|
15
15
|
- 只需要渲染能力时,可以用 `createGisViewEngine(canvas, options)` 在任意 canvas 上复用同一套管线,此时渲染调度由调用方负责;引擎同样通过 `onClick` / `onDblClick` / `onPointDrag` / `onSelect` / `onWaypointChange` 暴露交互,框选与拐点的实例方法在引擎上分别叫 `selectInBox`、`insertWaypoint` / `removeWaypoint` / `selectWaypoint`。
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
**数据更新之后画面没变?**
|
|
40
40
|
`updateData`(只换一列时用 `updateData({ points })` / `updateData({ lines })`)会换数据副本;直接改数组里的对象不会触发重画,改单个要素请用 `updatePoint` / `updateLine` / `updateChannel`,或者重新 `updateData` 一次。
|
|
41
41
|
|
|
42
|
+
**筛选之后,选中的要素会从选中集里消失吗?**
|
|
43
|
+
默认不会。`setFilter` 的 `mode` 缺省是 `'hide'`:原始数据、选中集与 `getSelections()` 都保持原样,被隐藏的选中项在条件放宽 / 清空后恢复高亮,也不会额外发一次 `onSelectChange`。显式写 `mode: 'remove'` 时,不命中的要素会从数据里删掉(被删的选中项也会从选中集移除),只发一条 `filterRemove`,可用历史撤销。搜索同理:`search({ scope: 'group' })` 只返回分组命中,不隐藏其它要素;命中可交给 `focusOn` / `selectFeatures`。
|
|
44
|
+
|
|
42
45
|
**接口数据还没回来,先 createGisView 还是等回来再建?**
|
|
43
46
|
先建。空实例照样先铺底图 / 网格,第一次 `updateData` 拿到数据时会按 `initialView` 自动落一次位(容器当时是 0×0 也会记成待办、显示出来补上);相机、筛选、选中、标签与历史都挂在实例上,等接口回来再 `destroy()` 重建会全丢。收 loading 用 `whenDataRendered()`,完整写法与几条注意点在「动态换数据与加载完成」的「从接口拿数据」与「接口列名不一样」两段。
|
|
44
47
|
|
|
@@ -83,6 +86,9 @@
|
|
|
83
86
|
**怎么一次给通道加多回?**
|
|
84
87
|
`circuits` 就是「这一次加几条」:`beginAddChannel({ kind: 'channel', circuits: 3 })` / `addChannel({ from, to, circuits: 3 })`(旧写法),新建线路也一样(`addLine({ from, to, circuits: 2 })` 一次两条)。方案表的余量按它算 —— 加 3 回时只剩 2 回余量的分组会置灰,`reason` 写清「只剩 2 回余量,本次要加 3 回」;落地回执里 `lines` / `lineIds` 是这一批线,`onChannelDraft` 的 `commit` 载荷里也一样,`removeLine` 一条条摘掉就行(demo 的「移除上一条新增」就是整批摘)。
|
|
85
88
|
|
|
89
|
+
**鹰眼图的节点大小 / 范围 / 框选怎么调?**
|
|
90
|
+
节点大小:`inheritRules` 打开(默认)时,小图取主图最终解析出的尺寸,再乘「小图视口 ÷ 主图视口」的较小比例 —— 只看两边 CSS 视口宽高,不随主图相机倍数变化;仍嫌大就调小图自己的 `pointSizeScale`,或配自己的 `pointRules` / `pointStyle` 接管尺寸。范围:`extent: 'auto'` 默认取数据 ∪ 底图且**不随相机收窄**;想要外围内容消失后跟着收窄才打开 `extentFollowCamera`。框选:`dragAction: 'box'` 不需要打开 `zoomable`,关闭缩放也能在空白处直接框;`zoomable: 'follow'` 是整体范围跟随主图,跟手动缩放 `true` 互斥。
|
|
91
|
+
|
|
86
92
|
**虚线看不出来?**
|
|
87
93
|
图案是 CSS 像素量屏幕距离,线很粗时应把图案调长(`[10, 6]` 在 3px 线宽下很清楚,在 12px 线宽下就显得密);另外图案槽位上限 16 组,超过的线会退回实线。
|
|
88
94
|
|
|
@@ -174,17 +180,17 @@
|
|
|
174
180
|
| 规则与条件 | `GisViewPointRule`、`GisViewLineRule`、`GisViewConditionInput`、`GisViewCondition`、`GisViewConditionOperator`、`createConditionMatcher` |
|
|
175
181
|
| 热力图 | `GisViewHeatmap`、`GisViewHeatmapGlow`、`GisViewHeatmapDensity`、`GisViewHeatmapDensityCore`、`GisViewHeatmapTarget`、`GisViewHeatmapMissing`、`GisViewHeatmapOverride` |
|
|
176
182
|
| 覆盖层 | `GisViewLabelOptions`、`GisViewLineLabelOptions`、`GisViewItemLabel`、`GisViewLabelState`、`GisViewLabelPatch`、`GisViewSetLabelContentOptions`、`GisViewLabelListItem`、`GisViewItemLabelsInfo`、`GisViewRemoveLabelResult`、`GisViewSetLabelStatesResult`、`GisViewLabelChangePayload`、`GisViewLabelDragPayload`、`GisViewLabelClickPayload`、`GisViewLabelPointerPayload`、`GisViewLabelRef`、`GisViewLabelTarget`、`GisViewLabelBatchEntry`、`GisViewLabelRemoveEntry`、`GisViewLabelBatchSkip`、`GisViewAddLabelsResult`、`GisViewUpdateLabelsResult`、`GisViewRemoveLabelsResult`、`GisViewLineDecoration`、`GisViewTooltipOptions`、`GisViewLabelPayload`、`GisViewLineLabelPayload` |
|
|
177
|
-
| 筛选 | `GisViewFilter`、`GisViewFilterResult`、`GisViewFilterCascade`、`GisViewFilterWorkerOptions` |
|
|
183
|
+
| 筛选 | `GisViewFilter`、`GisViewFilterInput`、`GisViewFilterShorthand`、`GisViewFilterResult`、`GisViewFilterCascade`、`GisViewFilterMode`、`GisViewFilterWorkerOptions` |
|
|
178
184
|
| 大数据展示模式 | `GisViewDenseMode`、`GisViewDenseModeOptions`、`GisViewDenseModeInput`、`GisViewDenseState` |
|
|
179
|
-
| 通道 | `GisViewChannelInput`、`GisViewChannelBuildOptions`、`GisViewChannelBuild`、`GisViewChannelInfo`、`GisViewChannelGroupInfo`、`GisViewChannelGroupWaypoints`、`GisViewChannelGroupLineWaypoints`、`GisViewChannelMember`、`GisViewChannelContext`、`GisViewChannelAddPlan`、`GisViewChannelBetween`、`GisViewChannelAddOption`、`GisViewChannelAddInput`、`GisViewChannelAddResult`、`GisViewChannelDraftOptions`、`GisViewChannelDraftPayload`、`GisViewChannelLineMoveTarget`、`GisViewChannelLineMoveResult`、`GisViewRemoveLineResult`、`GisViewRemoveChannelResult`、`GisViewRemoveLinesResult`、`GisViewChannelInView`、`GisViewChannelAction`、`GisViewChannelActionId`、`GisViewChannelDraftStyle`、`GisViewChannelWaypointDragMode`、`createChannels`、`CHANNEL_DEFAULT_COLORS` |
|
|
185
|
+
| 通道 | `GisViewChannelInput`、`GisViewChannelBuildOptions`、`GisViewChannelBuild`、`GisViewChannelInfo`、`GisViewChannelGroupInfo`、`GisViewChannelGroupWaypoints`、`GisViewChannelGroupLineWaypoints`、`GisViewChannelMember`、`GisViewChannelContext`、`GisViewChannelAddPlan`、`GisViewChannelBetween`、`GisViewChannelAddOption`、`GisViewChannelAddInput`、`GisViewChannelAddCommitInput`、`GisViewChannelAddResult`、`GisViewChannelDraftOptions`、`GisViewChannelDraftPayload`、`GisViewChannelLineMoveTarget`、`GisViewChannelLineMoveResult`、`GisViewRemoveLineResult`、`GisViewRemoveChannelResult`、`GisViewRemoveLinesResult`、`GisViewChannelInView`、`GisViewChannelAction`、`GisViewChannelActionId`、`GisViewChannelDraftStyle`、`GisViewChannelDraftDots`、`GisViewChannelDraftDotStyle`、`GisViewChannelWaypointDragMode`、`createChannels`、`CHANNEL_DEFAULT_COLORS` |
|
|
180
186
|
| 事件载荷 | `GisViewPickResult`、`GisViewPickAtResult`、`GisViewRectQueryResult`、`GisViewSelectionInfo`、`GisViewSelectedItems`、`GisViewSelectPayload`、`GisViewClickPayload`、`GisViewPointerPayload、GisViewCascadeHighlightScope、GisViewCascadeHighlightOptions、GisViewCascadeHighlightInput、GisViewCascadeHighlightEntry、GisViewCascadeHighlightOrigin、GisViewCascadeHighlightInfo`、`GisViewPointerAction`、`GisViewPointerActionType`、`GisViewPointerTarget`、`GisViewPointerModifiers`、`GisViewWaypointActionData`、`GisViewLabelActionData`、`GisViewHoverPayload`、`GisViewCursorPayload`、`GisViewPointDragPayload`、`GisViewDragPointChange`、`GisViewDragLineChange`、`GisViewPointCopyPayload`、`GisViewPointCopyState`、`GisViewPointMergePayload`、`GisViewMergeImpact`、`GisViewMergeResult`、`GisViewMergeFailure`、`GisViewWaypointPayload`、`GisViewWaypointInfo`、`GisViewWaypointKey`、`GisViewParallelGroup`、`GisViewReadyPayload`、`GisViewEngineStats`、`GisViewEngineHeatDensity`、`GisViewDataChangeType`、`GisViewDataChangePayload`、`GisViewSelectChangePayload`、`GisViewShortcutPayload`、`GisViewRenderPayload`、`GisViewAddItemsResult`、`GisViewAddPointResult` |
|
|
181
187
|
| 快捷键与复制 / 合并 / 删除 | `GisViewShortcuts`、`GisViewShortcut`、`GisViewShortcutAction`、`GisViewCopyOptions`、`GisViewCopyContext`、`GisViewCopyStartOptions`、`GisViewPasteOptions`、`GisViewCopyItem`、`GisViewClipboardItem`、`GisViewMergeOptions`、`GisViewMergeContext`、`GisViewPointStyleSnapshot`、`GisViewPointRef`、`GisViewMergeResult`、`GisViewMergeFailure`、`GisViewMergeOutcome`、`GisViewRemovePointsOutcome`、`GisViewRemoveSelectedOutcome`、`GisViewRemoveOptions`、`GisViewRemoveScope`、`GisViewRemovePayload`、`GisViewRemoveResult`、`GisViewRemoveOutcome`、`GisViewRemoveFailure`、`GisViewRemoveAction`、`GisViewRemovePoint`、`GisViewRemoveLine`、`GisViewRemoveWaypoint`、`GisViewRemoveGroup`、`GisViewRemoveChannel`、`GisViewRemoveCounts`、`GisViewChannelSelectMode`、`GisViewUpdateItemsOutcome`、`GisViewUpdateItemEntry` |
|
|
182
188
|
| 相机与视图 | `GisViewCamera`、`GisViewViewport`、`GisViewFocusOptions`、`GisViewFocusTarget`、`GisViewExportImageOptions`、`GisViewExportSelectionOptions`、`GisViewExportSelectionResult` |
|
|
183
189
|
| 导出数据 | `GisViewExportScope`、`GisViewExportPart`、`GisViewExportDataOptions`、`GisViewExportDataResult`、`GisViewFeatureRef`、`GisViewExportFilterOptions`、`GisViewExportMeta`、`GisViewExportedLabel`、`GisViewStationRecord`、`GisViewPointRecord`、`GisViewLineRecord`、`GisViewChannelRecord`、`GisViewExportFormat`、`GisViewBuiltinExportFormat`、`GisViewExportFormatContext`、`GisViewExportFormatAdapter` |
|
|
184
|
-
| 开关 / 历史 / 事件 | `GisViewFeatureName`、`GisViewFeatures`、`GisViewFeatureState`、`GisViewFeaturePreset`、`GisViewFeaturesInput`、`FEATURE_NAMES`、`FEATURE_PRESETS`、`FEATURE_PRESET_NAMES`、`FEATURE_EDIT_NAMES`、`featureDefault`、`normalizeFeatures`、`featureOn`、`hasForcedFeatures`、`GisViewHistoryOptions`、`GisViewHistoryState`、`GisViewHistoryEntry`、`GisViewHistoryRecord`、`GisViewHistoryOp`、`GisViewHistoryOpEntry`、`GisViewHistoryRecorder`、`GisViewHistoryHost`、`GisViewHistoryPayload`、`GisViewHistoryStepResult`、`GisViewHistoryAction`、`GisViewHistoryCollection`、`createGisHistory`、`normalizeHistoryOptions`、`applyHistoryOps`、`DEFAULT_HISTORY_LIMIT`、`HISTORY_COLLECTIONS`、`GisViewEventMap`、`GisViewEventName`、`GisViewEventNameInput`、`GisViewEventWildcard`、`GisViewEventListener`、`GisViewAnyEventListener`、`GisViewEventBus`、`GisViewEventBusHost`、`createGisEventBus`、`EVENT_NAMES` |
|
|
190
|
+
| 开关 / 历史 / 事件 | `GisViewFeatureName`、`GisViewFeatures`、`GisViewFeatureState`、`GisViewFeaturePreset`、`GisViewFeaturesInput`、`GisViewSelectTrigger`、`FEATURE_NAMES`、`FEATURE_PRESETS`、`FEATURE_PRESET_NAMES`、`FEATURE_EDIT_NAMES`、`featureDefault`、`normalizeFeatures`、`featureOn`、`hasForcedFeatures`、`GisViewHistoryOptions`、`GisViewHistoryState`、`GisViewHistoryEntry`、`GisViewHistoryRecord`、`GisViewHistoryOp`、`GisViewHistoryOpEntry`、`GisViewHistoryRecorder`、`GisViewHistoryHost`、`GisViewHistoryPayload`、`GisViewHistoryStepResult`、`GisViewHistoryAction`、`GisViewHistoryCollection`、`createGisHistory`、`normalizeHistoryOptions`、`applyHistoryOps`、`DEFAULT_HISTORY_LIMIT`、`HISTORY_COLLECTIONS`、`GisViewEventMap`、`GisViewEventName`、`GisViewEventNameInput`、`GisViewEventWildcard`、`GisViewEventListener`、`GisViewAnyEventListener`、`GisViewEventBus`、`GisViewEventBusHost`、`createGisEventBus`、`EVENT_NAMES` |
|
|
185
191
|
| 动画效果与预热 | `GisViewLineEffect`、`GisViewLineEffectInput`、`GisViewPointEffect`、`GisViewPointEffectInput`、`GisViewEffectsOptions`、`GisViewEffectsInput`、`GisViewEffectsReadout`、`GisViewLineEffectReadout`、`GisViewPointEffectReadout`、`GisViewPrebakeOptions`、`GisViewPrebakeCombo`、`GisViewPrebakeReadout`、`GisViewSymbolCombos`、`PREBAKE_COMBO_KEYS`、`LINE_EFFECT_DEFAULTS`、`LINE_EFFECT_KEYS`、`POINT_EFFECT_DEFAULTS`、`POINT_EFFECT_KEYS`、`EFFECT_OPTION_KEYS`、`PREBAKE_OPTION_KEYS`、`normalizeLineEffect`、`normalizePointEffect`、`normalizeEffectsOptions`、`normalizePrebakeCombo`、`normalizePrebakeOptions`、`isEffectConfig`、`isEffectsExplicitlyOff`、`wrapPhase`、`phaseSeed`、`polylineLength`、`samplePolyline`、`lineEffectDistance`、`pointEffectPhase`、`sameLineEffect`、`samePointEffect` |
|
|
186
192
|
| 坐标与映射 | `GisViewGeoProjection`、`GisViewGeoMapper`、`GisViewGeoMapperOptions`、`GisViewPointerState`、`GisViewResolvedGeoJson`、`createGeoProjection`、`createGeoMapper` |
|
|
187
|
-
| 搜索 | `GisViewSearchOptions`、`GisViewSearchScope`、`GisViewSearchHit`、`GisViewSearchResult`、`GisViewVisiblePoint` |
|
|
193
|
+
| 搜索 | `GisViewSearchOptions`、`GisViewSearchScope`、`GisViewSearchScopeInput`、`GisViewSearchHit`、`GisViewSearchGroupItem`、`GisViewSearchResult`、`GisViewVisiblePoint` |
|
|
188
194
|
| 背景 | `GisViewBackground`、`GisViewBackgroundImage`、`GisViewGeoJsonStyle`、`GeoJsonInput`、`GeoJsonFeatureCollection`、`GeoJsonFeature`、`GeoJsonGeometry`、`GeoJsonPosition` |
|
|
189
195
|
| 鹰眼图 | `GisViewMinimapOptions`、`GisViewMinimapExtent`、`GisViewMinimapPointStyle`、`GisViewMinimapLineStyle`、`GisViewMinimapBoxStyle`、`GisViewMinimapPointRule`、`GisViewMinimapLineRule`、`GisViewMinimapDrawData`、`GisViewMinimapDrawInfo`、`GisViewMinimapLayer`、`GisViewMinimapLayerPlacement`、`GisViewMinimapLayerStage`、`GisViewMinimapInteractionType`、`GisViewMinimapInteractionInfo` |
|
|
190
196
|
|