@teeechina/teee-map 0.0.1
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/.vite/license.md +122 -0
- package/dist/teee-map.css +2 -0
- package/dist/teee-map.mjs +35515 -0
- package/dist/teee-map.umd.js +756 -0
- package/index.d.ts +73 -0
- package/package.json +26 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { LngLatLike, LayerSpecification, SourceSpecification } from 'maplibre-gl';
|
|
2
|
+
|
|
3
|
+
import type { TMap } from './src'
|
|
4
|
+
|
|
5
|
+
export default TMap
|
|
6
|
+
|
|
7
|
+
// 地图类型枚举( 基础平面图 |基础地理图 | 施工(平面)地图 )
|
|
8
|
+
type MapType = 'graph' | 'geom' | 'ctc' | 'raster';
|
|
9
|
+
|
|
10
|
+
// 图层类型枚举 (对应 layer 文件夹的文件)
|
|
11
|
+
type LayerType =
|
|
12
|
+
| 'background'
|
|
13
|
+
| 'signal'
|
|
14
|
+
| 'track'
|
|
15
|
+
| 'track_circuit'
|
|
16
|
+
| 'bumper'
|
|
17
|
+
| 'switch'
|
|
18
|
+
| 'switch_loc'
|
|
19
|
+
| 'insulation'
|
|
20
|
+
| 'label'
|
|
21
|
+
| 'prevention';
|
|
22
|
+
|
|
23
|
+
// 地图初始化配置 (由 MapForge 生成)
|
|
24
|
+
interface MapForgeConfig {
|
|
25
|
+
id: string;
|
|
26
|
+
sourceUrl: string;
|
|
27
|
+
layers?: LayerType[];
|
|
28
|
+
sourceLayers?: string[];
|
|
29
|
+
center?: LngLatLike;
|
|
30
|
+
zoom?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 传递给 initMap 的参数结构
|
|
34
|
+
interface MapParams {
|
|
35
|
+
id: string;
|
|
36
|
+
source: SourceSpecification;
|
|
37
|
+
layers?: LayerSpecification[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 图标配置
|
|
41
|
+
interface IconType {
|
|
42
|
+
id: string;
|
|
43
|
+
image: HTMLImageElement;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 要素状态配置
|
|
47
|
+
interface StateType {
|
|
48
|
+
state?: string; // 股道(封锁1 / 停电2 / 股道无接触网3)
|
|
49
|
+
select?: boolean; // 选中状态
|
|
50
|
+
visible?: boolean; // 是否可见
|
|
51
|
+
subState1?: any; // 信号机(钮封)道岔(占用3 / 锁闭2)
|
|
52
|
+
subState2?: any; // 信号机(灭灯)道岔(单锁1 / 解锁 )
|
|
53
|
+
subState3?: any; // 信号机(暂无)道岔(单封1 / 解封 )
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface LayerSettingItem {
|
|
57
|
+
key: string;
|
|
58
|
+
label: string;
|
|
59
|
+
checked: boolean;
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface FeatureInteractionPayload {
|
|
64
|
+
type: LayerType;
|
|
65
|
+
code: string;
|
|
66
|
+
state: StateType;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 全局事件类型定义
|
|
70
|
+
interface AppEvents {
|
|
71
|
+
// 场景:点击地图上的设备(信号机、道岔等)
|
|
72
|
+
'map:feature-click': FeatureInteractionPayload;
|
|
73
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teeechina/teee-map",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/teee-map.umd.js",
|
|
6
|
+
"module": "dist/teee-map.mjs",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"build": "vite build"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"author": "Teee",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"index.d.ts"
|
|
16
|
+
],
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"packageManager": "pnpm@10.33.0",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"maplibre-gl": "5.21.1",
|
|
21
|
+
"vite": "^8.0.9"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
}
|
|
26
|
+
}
|