webgl-network-view 0.1.0 → 0.1.2

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 CHANGED
@@ -1,64 +1 @@
1
- # gis-view
2
1
 
3
- 面向节点、线路与多回线通道的 WebGL2 矢量视图。通过 `createGisView(dom, options)` 把画布挂到任意 DOM 容器,不依赖 Vue 或其他图形库,也没有内置业务界面。
4
-
5
- - npm 包:`gis-view-webgl2`
6
- - 渲染:原生 WebGL2(GLSL ES 3.00 + 实例化绘制)
7
- - 交互:平移、缩放、点击、框选、拖拽与要素编辑均按需开启
8
-
9
- ## 特性
10
-
11
- - **点、线、通道**:节点、折线、多回线通道、通道分组与骨架拐点。
12
- - **交互与编辑**:点击 / 双击 / 悬停、平移缩放、框选多选、节点拖拽、复制合并、线路与通道拐点编辑。
13
- - **样式与标注**:按属性筛选和批量配色、节点 / 线路标签、悬浮提示、装饰、动效、热力图与自定义图元。
14
- - **视图与导出**:适应视图、初始视图、鹰眼图、背景图片 / GeoJSON,导出图片、选中数据和标准文档。
15
- - **大数据**:批量渲染、视口裁剪、增量更新、Web Worker 筛选与搜索。
16
-
17
- ## 安装
18
-
19
- ```bash
20
- npm install gis-view-webgl2
21
- ```
22
-
23
- ```js
24
- import { createGisView } from 'gis-view-webgl2'
25
- import 'gis-view-webgl2/style.css'
26
- ```
27
-
28
- 需要支持 WebGL2 的浏览器。容器必须有明确高度。
29
-
30
- ## 快速开始
31
-
32
- ```html
33
- <div id="map" style="height: 520px"></div>
34
- ```
35
-
36
- ```js
37
- import { createGisView } from 'gis-view-webgl2'
38
- import 'gis-view-webgl2/style.css'
39
-
40
- const points = [
41
- { id: 'station-a', x: 116.397, y: 39.908, name: '望京换流站' },
42
- { id: 'station-b', x: 117.201, y: 39.084, name: '海河变电站' }
43
- ]
44
-
45
- const lines = [
46
- { id: 'line-a-b', from: 'station-a', to: 'station-b', name: '京海线路' }
47
- ]
48
-
49
- const channels = [
50
- { id: 'channel-a-b', from: 'station-a', to: 'station-b', lineIds: ['line-a-b'] }
51
- ]
52
-
53
- const view = createGisView('#map', {
54
- features: 'view',
55
- points,
56
- lines,
57
- channels,
58
- onClick: payload => console.log('单击', payload?.type, payload?.item)
59
- })
60
-
61
- view.fitView()
62
- ```
63
-
64
- 不需要时调用 `view.destroy()` 销毁实例。更新数据、样式和交互的完整写法见手册。