@teeechina/teee-map 0.0.3 → 0.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/dist/.vite/license.md +24 -0
- package/dist/teee-map.mjs +4624 -3123
- package/dist/teee-map.umd.js +34 -30
- package/index.d.ts +56 -64
- package/package.json +2 -1
package/index.d.ts
CHANGED
|
@@ -6,94 +6,86 @@ export type MapType = 'graph' | 'geom' | 'ctc' | 'raster';
|
|
|
6
6
|
export type LayerType = 'background' | 'signal' | 'track' | 'track_circuit' | 'bumper' | 'switch' | 'switch_loc' | 'insulation' | 'label' | 'prevention';
|
|
7
7
|
|
|
8
8
|
export interface MapForgeConfig {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
id: string;
|
|
10
|
+
subSourceId?: string;
|
|
11
|
+
sourceUrl?: string;
|
|
12
|
+
geojsonData?: object | string;
|
|
13
|
+
layers?: LayerType[];
|
|
14
|
+
sourceLayers?: string[];
|
|
15
|
+
center?: LngLatLike;
|
|
16
|
+
zoom?: number;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface MapParams {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
id: string;
|
|
21
|
+
source: SourceSpecification;
|
|
22
|
+
subSourceId?: string;
|
|
23
|
+
subSource?: SourceSpecification;
|
|
24
|
+
layers?: LayerSpecification[];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface IconType {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
id: string;
|
|
29
|
+
image: HTMLImageElement;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export interface stateType {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
state?: string;
|
|
34
|
+
select?: boolean;
|
|
35
|
+
visiable?: boolean;
|
|
36
|
+
subState1?: any;
|
|
37
|
+
subState2?: any;
|
|
38
|
+
subState3?: any;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export interface layerSettingItem {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
key: string;
|
|
43
|
+
label: string;
|
|
44
|
+
checked: boolean;
|
|
45
|
+
disabled: boolean;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export interface FeatureInteractionPayload {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
type: LayerType;
|
|
50
|
+
code: string;
|
|
51
|
+
state: stateType;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export interface AppEvents {
|
|
55
|
-
|
|
55
|
+
'map:feature-click': FeatureInteractionPayload;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export declare class TeeeMap {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
public map: MaplibreMap;
|
|
60
|
+
public mapConfigs: MapForgeConfig;
|
|
61
|
+
public stashFeatures: Map<any, any>;
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
constructor(container: string | HTMLElement);
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
paint?: any,
|
|
75
|
-
layout?: any
|
|
76
|
-
): void;
|
|
77
|
-
updateLayerStyle(id: string, paint: any): void;
|
|
78
|
-
removeLayer(id: string): void;
|
|
79
|
-
onFeatureClick(
|
|
80
|
-
layerIds: string | string[],
|
|
81
|
-
callback: (feature: MapGeoJSONFeature, lngLat: LngLat) => void
|
|
82
|
-
): void;
|
|
65
|
+
addGeoJsonSource(id: string, data?: any): void;
|
|
66
|
+
removeSource(id: string): void;
|
|
67
|
+
updateGeoJsonSource(id: string, data: any): void;
|
|
68
|
+
addVectorTileSource(id: string, url: string): void;
|
|
69
|
+
addRasterTileSource(id: string, url: string): void;
|
|
70
|
+
addGeoJsonLayer(layerId: string, sourceId: string, type?: 'fill' | 'line' | 'circle' | 'symbol', paint?: any, layout?: any): void;
|
|
71
|
+
updateLayerStyle(id: string, paint: any): void;
|
|
72
|
+
removeLayer(id: string): void;
|
|
73
|
+
onFeatureClick(layerIds: string | string[], callback: (feature: MapGeoJSONFeature, lngLat: LngLat) => void): void;
|
|
83
74
|
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
destroy(): void;
|
|
76
|
+
initState(): void;
|
|
86
77
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
78
|
+
initMap(mapParams: MapParams): void;
|
|
79
|
+
createCTCMap(stcode: string, url: string, layers: LayerType[]): void;
|
|
80
|
+
createRSWPMap(url: string): void;
|
|
81
|
+
createGraphMap(stcode: string, url: string, layers: LayerType[]): void;
|
|
82
|
+
createGeomMap(stcode: string, url: string, layers: LayerType[]): void;
|
|
83
|
+
createMbtilesMap(mbtileDBClient: any, url: string, layers: LayerType[]): void;
|
|
84
|
+
createRasterMap(url: string): void;
|
|
85
|
+
getMap(): MaplibreMap;
|
|
86
|
+
getMapConfigs(): MapForgeConfig;
|
|
87
|
+
stashAllFeature(): void;
|
|
88
|
+
updateFeatureState(code: string | number, state: any): void;
|
|
97
89
|
}
|
|
98
90
|
|
|
99
|
-
export default TeeeMap;
|
|
91
|
+
export default TeeeMap;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teeechina/teee-map",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/teee-map.umd.js",
|
|
6
6
|
"module": "dist/teee-map.mjs",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"packageManager": "pnpm@10.33.0",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"maplibre-gl": "5.21.1",
|
|
23
|
+
"pako": "^2.1.0",
|
|
23
24
|
"vite": "^8.0.9"
|
|
24
25
|
},
|
|
25
26
|
"publishConfig": {
|