@teeechina/teee-map 0.0.23 → 0.0.25

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
@@ -1,4 +1,4 @@
1
- import type { Map as MaplibreMap, LngLat, GeoJSONFeature, LngLatLike, FilterSpecification } from 'maplibre-gl';
1
+ import type { Map as MaplibreMap, LngLat, GeoJSONFeature } from 'maplibre-gl';
2
2
  import type { LayerSpecification, SourceSpecification } from 'maplibre-gl';
3
3
  import type { FeatureCollection } from 'geojson';
4
4
 
@@ -8,7 +8,10 @@ import type { FeatureCollection } from 'geojson';
8
8
 
9
9
  export type MapType = 'graph' | 'geom' | 'ctc' | 'raster';
10
10
 
11
- export type LayerType = 'background' | 'signal' | 'track' | 'track_circuit' | 'bumper' | 'switch' | 'switch_loc' | 'insulation' | 'label' | 'prevention';
11
+ export type LayerType = 'background' | 'signal' | 'track' | 'track_circuit' | 'bumper' | 'switch' | 'switch_loc' | 'insulation' | 'label' | 'prevention' | 'sgfhqy' | 'region';
12
+
13
+ // 股道 | 桥梁 | 隧道 | 信号机 | 曲线 | 防洪 | 坡道 | 接触网分相 | 通话柱
14
+ export type RegionLayerType = 'background' | 'track' | 'bridge' | 'tunnel' | 'region_signal' | 'curve' | 'floodcontrol' | 'ramp' | 'contactseparation' | 'callpost';
12
15
 
13
16
  // ─────────────────────────────────────────────
14
17
  // 联锁枚举
@@ -119,17 +122,17 @@ export enum PreventionTypes {
119
122
 
120
123
  /** MapForge 生成的地图初始化配置 */
121
124
  export interface MapForgeConfig {
122
- id: string;
123
- sourceUrl?: string;
125
+ id: string; // 地图主源名
126
+ sourceUrl?: string; // 用于 Vector/Raster 的 URL
127
+
124
128
  subSourceId?: string;
125
129
  subSourceUrl?: string;
126
- layers?: LayerType[];
127
- sourceLayers?: string[];
128
- subLayers?: LayerType[];
129
- subSourceLayers?: string[];
130
- geojsonData?: object | string;
131
- center?: LngLatLike;
132
- zoom?: number;
130
+
131
+ layers?: (LayerType | RegionLayerType)[]; // 加载的图层类型
132
+ sourceLayers?: string[]; // 矢量瓦片内部的图层名
133
+ type?: 'region' | 'station';
134
+
135
+ zoom?: number; // 初始缩放级别
133
136
  }
134
137
 
135
138
  /** 传递给 initMap 的参数结构 */
@@ -401,6 +404,7 @@ export declare class TeeeMap {
401
404
  initGraphFeatureState(f: GeoJSONFeature): void;
402
405
  initGeoJsonFeatureState(f: GeoJSONFeature, layerType: string): void;
403
406
  initGeoJsonState(): void;
407
+ initMixGeoJsonMapState(): void;
404
408
  stashAllFeature(): void;
405
409
  updateFeatureState(code: string | number, state: any): void;
406
410
 
@@ -415,6 +419,27 @@ export declare class TeeeMap {
415
419
  createGeomEncryptedMap(stcode: string, url: string, layers: LayerType[]): void;
416
420
  createCTCEncryptedMap(stcode: string, url: string, layers: LayerType[]): void;
417
421
  createGeoJsonStationMap(stationDatas: GeojsonStationDatas[]): Promise<void>;
422
+ createMixGeoJsonMap(
423
+ stationDatas: {
424
+ code: string;
425
+ type: 'region' | 'station';
426
+ geojsonData: {
427
+ name: string;
428
+ data: GeoJSON.FeatureCollection | string;
429
+ }[];
430
+ deltaInfo?: {
431
+ deltax: number;
432
+ deltay: number;
433
+ };
434
+ }[],
435
+ ): Promise<void>;
436
+ createGeoJsonRegionMap(
437
+ regionCode: string,
438
+ regionDatas: {
439
+ name: string;
440
+ data: GeoJSON.FeatureCollection | string;
441
+ }[],
442
+ ): Promise<void>;
418
443
 
419
444
  // ── 其他工具方法 ──
420
445
  getMap(): MaplibreMap;
@@ -425,9 +450,8 @@ export declare class TeeeMap {
425
450
  locateFeatureByCode(code: string, layerType: LayerType): void;
426
451
  /** 平滑闪烁高亮指定要素,返回清理函数用于提前终止动画 */
427
452
  smoothBlinkFeature(
428
- sourceId: string,
429
- featureFilter: FilterSpecification,
430
- featureType?: 'line' | 'point',
453
+ code: string,
454
+ layerType: LayerType,
431
455
  options?: {
432
456
  duration?: number;
433
457
  blinkSpeed?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teeechina/teee-map",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "",
5
5
  "main": "dist/teee-map.umd.js",
6
6
  "module": "dist/teee-map.mjs",