@taichina/map-sdk 1.0.2 → 1.0.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 +11 -19
- package/package.json +2 -1
- package/teee-sdk/teee-map-sdk.es.js +3339 -1887
- package/teee-sdk/teee-map-sdk.umd.js +4 -4
package/README.md
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
9
|
-
git submodule update --init --recursive
|
|
8
|
+
npm install @taichina/map-sdk
|
|
10
9
|
```
|
|
11
10
|
|
|
12
11
|
## 快速开始
|
|
13
12
|
|
|
14
13
|
```typescript
|
|
15
|
-
import { TeeeMap } from "
|
|
14
|
+
import { TeeeMap } from "@taichina/map-sdk";
|
|
15
|
+
import maplibregl from "maplibre-gl";
|
|
16
16
|
|
|
17
17
|
const teeeMap = new TeeeMap("map-container");
|
|
18
18
|
|
|
@@ -39,7 +39,7 @@ const map = teeeMap.getMap();
|
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
41
|
// ES Module
|
|
42
|
-
import { TeeeMap } from "
|
|
42
|
+
import { TeeeMap } from "@taichina/map-sdk";
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
## API
|
|
@@ -47,13 +47,12 @@ import { TeeeMap } from "teee-map-sdk";
|
|
|
47
47
|
### 构造函数
|
|
48
48
|
|
|
49
49
|
```typescript
|
|
50
|
-
new TeeeMap(container: string | HTMLElement
|
|
50
|
+
new TeeeMap(container: string | HTMLElement)
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
| 参数 | 说明 |
|
|
54
54
|
|------|------|
|
|
55
55
|
| `container` | DOM 元素 ID 或 HTMLElement |
|
|
56
|
-
| `mbtileDbClient` | 可选。SQLite 客户端(需具备 `prepare` / `get` / `free` 方法),传入后启用 `mbtiles://` 协议 |
|
|
57
56
|
|
|
58
57
|
### 地图创建方法
|
|
59
58
|
|
|
@@ -131,15 +130,6 @@ draw.clear(); // 清空画布
|
|
|
131
130
|
| `getMapConfigs()` | 获取当前 `MapForgeConfig` |
|
|
132
131
|
| `destroy()` | 销毁地图实例 |
|
|
133
132
|
|
|
134
|
-
### LayerType
|
|
135
|
-
|
|
136
|
-
```typescript
|
|
137
|
-
type LayerType =
|
|
138
|
-
| "background" | "track" | "track_circuit"
|
|
139
|
-
| "signal" | "switch" | "switch_loc"
|
|
140
|
-
| "bumper" | "insulation" | "label" | "prevention";
|
|
141
|
-
```
|
|
142
|
-
|
|
143
133
|
## 构建
|
|
144
134
|
|
|
145
135
|
```bash
|
|
@@ -163,7 +153,9 @@ npm run build # 输出到 teee-sdk/
|
|
|
163
153
|
|
|
164
154
|
## 依赖
|
|
165
155
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
156
|
+
| 包 | 版本 | 说明 |
|
|
157
|
+
|------|------|------|
|
|
158
|
+
| `maplibre-gl` | ^5.24.0 | peer,需自行安装 |
|
|
159
|
+
| `@turf/bbox` | ^7.0.0 | GeoJSON 包围盒计算 |
|
|
160
|
+
| `@watergis/maplibre-gl-terradraw` | ^1.13.1 | 绘制工具 |
|
|
161
|
+
| `pako` | ^2.1.0 | MBTiles Gzip 解压 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taichina/map-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "基于 GIS 的铁路业务地图 SDK。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./teee-sdk/teee-map-sdk.umd.js",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@turf/bbox": "^7.0.0",
|
|
46
|
+
"@turf/nearest-point-on-line": "^7.3.5",
|
|
46
47
|
"@watergis/maplibre-gl-terradraw": "^1.13.1",
|
|
47
48
|
"pako": "^2.1.0"
|
|
48
49
|
}
|