@teeechina/teee-map 0.0.7 → 0.0.9

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/index.d.ts CHANGED
@@ -7,17 +7,7 @@ import type { LayerSpecification, SourceSpecification } from 'maplibre-gl';
7
7
 
8
8
  export type MapType = 'graph' | 'geom' | 'ctc' | 'raster';
9
9
 
10
- export type LayerType =
11
- | 'background'
12
- | 'signal'
13
- | 'track'
14
- | 'track_circuit'
15
- | 'bumper'
16
- | 'switch'
17
- | 'switch_loc'
18
- | 'insulation'
19
- | 'label'
20
- | 'prevention';
10
+ export type LayerType = 'background' | 'signal' | 'track' | 'track_circuit' | 'bumper' | 'switch' | 'switch_loc' | 'insulation' | 'label' | 'prevention';
21
11
 
22
12
  // ─────────────────────────────────────────────
23
13
  // 联锁枚举
@@ -25,101 +15,101 @@ export type LayerType =
25
15
 
26
16
  /** 联锁信号机状态 */
27
17
  export enum InterLockSignal {
28
- RedLight = 1,
18
+ RedLight = 1,
29
19
  GreenLight = 2,
30
20
  WhiteLight = 3,
31
- BlueLight = 4,
32
- Unknown = 5,
21
+ BlueLight = 4,
22
+ Unknown = 5,
33
23
  }
34
24
 
35
25
  /** 联锁电路区段状态 */
36
26
  export enum InterLockCircuit {
37
- RedCircuit = 1,
38
- WhiteCircuit = 2,
27
+ RedCircuit = 1,
28
+ WhiteCircuit = 2,
39
29
  EqualRedCircuit = 3,
40
- GreyCircuit = 4,
41
- GreenCircuit = 5,
30
+ GreyCircuit = 4,
31
+ GreenCircuit = 5,
42
32
  }
43
33
 
44
34
  /** 联锁道岔状态 */
45
35
  export enum InterLockSwitchloc {
46
- NormalPosition = 2,
36
+ NormalPosition = 2,
47
37
  ReversePosition = 3,
48
38
  NeutralPosition = 4,
49
39
  }
50
40
 
51
41
  /** 闭塞信号 */
52
42
  export enum BsSignal {
53
- COME_GREEN = 0,
43
+ COME_GREEN = 0,
54
44
  COME_YELLOW = 1,
55
- COME_RED = 2,
56
- GO_GREEN = 3,
57
- GO_YELLOW = 4,
58
- GO_RED = 5,
59
- LOCK = 6,
60
- EMERGENCY = 7,
61
- RESET = 8,
45
+ COME_RED = 2,
46
+ GO_GREEN = 3,
47
+ GO_YELLOW = 4,
48
+ GO_RED = 5,
49
+ LOCK = 6,
50
+ EMERGENCY = 7,
51
+ RESET = 8,
62
52
  }
63
53
 
64
54
  /** 防控点类型枚举 */
65
55
  export enum PreventionTypes {
66
- NULL = 0,
67
- BUMPER = 1,
68
- CONTACTLINEEND = 2,
69
- FIXEDDERAILER = 3,
70
- CONTACTLINENOSTOP = 4,
71
- CONTACTLINENOSTOPIN = 5,
72
- OTHERPROMPT = 6,
73
- OTHERBRAKE = 7,
74
- ONESTOP = 8,
75
- SPEEDLIMITED = 9,
76
- SPEEDNOTICE = 10,
77
- CROSSSPEEDLIMITED = 11,
78
- CONTACTLINEPSS = 12,
79
- SSG = 13,
80
- CONTACTLINEPSSIN = 14,
81
- CONTACTLINENOAREA = 15,
82
- HIGHPOSTSIGNAL = 16,
83
- RESCUEVEHICLE = 17,
84
- RAILWAYCROSS = 18,
85
- TRAIN = 19,
86
- STATIONBOUND = 20,
87
- SHORTPOSTSIGNAL = 21,
88
- BRIDGE = 22,
89
- WHITE = 23,
90
- WHITEBLUE = 24,
91
- BLUE = 25,
92
- BLUEWHITE = 26,
93
- SLOPE = 27,
94
- PEOPLE = 28,
95
- TUNNEL = 29,
96
- DANGER = 30,
97
- SIGNAL = 31,
98
- SWERVE = 32,
99
- SWITCH = 33,
100
- ISOLATE = 35,
101
- TGQ = 47,
102
- BLOCKLINE = 50,
103
- WORKAREA = 51,
104
- ROUTELINE = 52,
105
- PARK = 53,
106
- WORKBUOND = 54,
107
- WORKBUONDCROSS = 55,
108
- LEFTHIGHPLATFORM = 61,
109
- RIGHTHIGHPLATFORM = 62,
110
- BOTHSIDEHIGHPLATFORM = 63,
111
- DOOR = 87,
112
- ISOLATESWITCH = 100,
113
- OTHER = 95,
114
- SIDE = 253,
115
- NONE = 254,
116
- MAX = 255,
117
- FOULINGPOST = 38,
118
- CUNCHE = 39,
119
- STATIONBOUNDEXTEND = 40,
120
- RED = 41,
121
- GREEN = 42,
122
- YELLOW = 43,
56
+ NULL = 0,
57
+ BUMPER = 1,
58
+ CONTACTLINEEND = 2,
59
+ FIXEDDERAILER = 3,
60
+ CONTACTLINENOSTOP = 4,
61
+ CONTACTLINENOSTOPIN = 5,
62
+ OTHERPROMPT = 6,
63
+ OTHERBRAKE = 7,
64
+ ONESTOP = 8,
65
+ SPEEDLIMITED = 9,
66
+ SPEEDNOTICE = 10,
67
+ CROSSSPEEDLIMITED = 11,
68
+ CONTACTLINEPSS = 12,
69
+ SSG = 13,
70
+ CONTACTLINEPSSIN = 14,
71
+ CONTACTLINENOAREA = 15,
72
+ HIGHPOSTSIGNAL = 16,
73
+ RESCUEVEHICLE = 17,
74
+ RAILWAYCROSS = 18,
75
+ TRAIN = 19,
76
+ STATIONBOUND = 20,
77
+ SHORTPOSTSIGNAL = 21,
78
+ BRIDGE = 22,
79
+ WHITE = 23,
80
+ WHITEBLUE = 24,
81
+ BLUE = 25,
82
+ BLUEWHITE = 26,
83
+ SLOPE = 27,
84
+ PEOPLE = 28,
85
+ TUNNEL = 29,
86
+ DANGER = 30,
87
+ SIGNAL = 31,
88
+ SWERVE = 32,
89
+ SWITCH = 33,
90
+ ISOLATE = 35,
91
+ TGQ = 47,
92
+ BLOCKLINE = 50,
93
+ WORKAREA = 51,
94
+ ROUTELINE = 52,
95
+ PARK = 53,
96
+ WORKBUOND = 54,
97
+ WORKBUONDCROSS = 55,
98
+ LEFTHIGHPLATFORM = 61,
99
+ RIGHTHIGHPLATFORM = 62,
100
+ BOTHSIDEHIGHPLATFORM = 63,
101
+ DOOR = 87,
102
+ ISOLATESWITCH = 100,
103
+ OTHER = 95,
104
+ SIDE = 253,
105
+ NONE = 254,
106
+ MAX = 255,
107
+ FOULINGPOST = 38,
108
+ CUNCHE = 39,
109
+ STATIONBOUNDEXTEND = 40,
110
+ RED = 41,
111
+ GREEN = 42,
112
+ YELLOW = 43,
123
113
  }
124
114
 
125
115
  // ─────────────────────────────────────────────
@@ -219,7 +209,7 @@ export interface ModeStyles {
219
209
  markerOutlineColor?: string;
220
210
  }
221
211
 
222
- export type DrawEventCallback = (features: GeoJSON.FeatureCollection) => void;
212
+ export type DrawEventCallback = (features: GeoJSON.FeatureCollection) => void;
223
213
  export type SelectEventCallback = (id: string | null) => void;
224
214
 
225
215
  export declare class DrawTool {
@@ -323,10 +313,7 @@ export interface InterlockVisualizationLegacyOptions {
323
313
  updateFeatureState?: (code: string | number, state: any) => void;
324
314
  }
325
315
 
326
- export type InterlockVisualizationOptions =
327
- | InterlockVisualizationGraphOptions
328
- | InterlockVisualizationGeoJsonOptions
329
- | InterlockVisualizationLegacyOptions;
316
+ export type InterlockVisualizationOptions = InterlockVisualizationGraphOptions | InterlockVisualizationGeoJsonOptions | InterlockVisualizationLegacyOptions;
330
317
 
331
318
  export declare class InterLockVisualization {
332
319
  constructor(options: InterlockVisualizationOptions);
@@ -355,21 +342,12 @@ export declare class TeeeMap {
355
342
  addRasterTileSource(id: string, url: string): void;
356
343
 
357
344
  // ── 图层管理 ──
358
- addGeoJsonLayer(
359
- layerId: string,
360
- sourceId: string,
361
- type?: 'fill' | 'line' | 'circle' | 'symbol',
362
- paint?: any,
363
- layout?: any,
364
- ): void;
345
+ addGeoJsonLayer(layerId: string, sourceId: string, type?: 'fill' | 'line' | 'circle' | 'symbol', paint?: any, layout?: any): void;
365
346
  updateLayerStyle(id: string, paint: any): void;
366
347
  removeLayer(id: string): void;
367
348
 
368
349
  // ── 交互事件 ──
369
- onFeatureClick(
370
- layerIds: string | string[],
371
- callback: (feature: GeoJSONFeature, lngLat: LngLat) => void,
372
- ): void;
350
+ onFeatureClick(layerIds: string | string[], callback: (feature: GeoJSONFeature, lngLat: LngLat) => void): void;
373
351
 
374
352
  // ── 生命周期 ──
375
353
  destroy(): void;
@@ -394,6 +372,12 @@ export declare class TeeeMap {
394
372
  createGraphEncryptedMap(stcode: string, url: string, layers: LayerType[]): void;
395
373
  createGeomEncryptedMap(stcode: string, url: string, layers: LayerType[]): void;
396
374
  createCTCEncryptedMap(stcode: string, url: string, layers: LayerType[]): void;
375
+ createGeoJsonStationMap(
376
+ stationDatas: {
377
+ name: string;
378
+ data: GeoJSON.FeatureCollection | string;
379
+ }[],
380
+ ): Promise<void>;
397
381
 
398
382
  // ── 其他工具方法 ──
399
383
  getMap(): MaplibreMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teeechina/teee-map",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "",
5
5
  "main": "dist/teee-map.umd.js",
6
6
  "module": "dist/teee-map.mjs",
@@ -19,9 +19,9 @@
19
19
  "license": "ISC",
20
20
  "packageManager": "pnpm@10.33.0",
21
21
  "dependencies": {
22
+ "@turf/turf": "^7.3.5",
22
23
  "@watergis/maplibre-gl-terradraw": "^1.13.1",
23
24
  "maplibre-gl": "5.21.1",
24
- "pako": "^2.1.0",
25
25
  "vite": "^8.0.9"
26
26
  },
27
27
  "publishConfig": {