@teeechina/teee-map 0.0.16 → 0.0.17

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 } from 'maplibre-gl';
1
+ import type { Map as MaplibreMap, LngLat, GeoJSONFeature, LngLatLike, FilterSpecification } from 'maplibre-gl';
2
2
  import type { LayerSpecification, SourceSpecification } from 'maplibre-gl';
3
3
  import type { FeatureCollection } from 'geojson';
4
4
 
@@ -367,6 +367,10 @@ export declare class TeeeMap {
367
367
  public map: MaplibreMap;
368
368
  public mapConfigs: MapForgeConfig;
369
369
  public stashFeatures: Map<any, any>;
370
+ /** 地图方向 */
371
+ public mapDir: 'left' | 'right';
372
+ /** GeoJSON 图层要素缓存:key 为图层名,value 为该图层所有要素 */
373
+ public layerFeaturesCache: Map<string, GeoJSONFeature[]>;
370
374
  /** 绘图工具(地图 load 事件后可用) */
371
375
  public drawTool: DrawTool;
372
376
 
@@ -417,7 +421,28 @@ export declare class TeeeMap {
417
421
  getMapConfigs(): MapForgeConfig;
418
422
  getFeatureState(code: string | number): Record<string, unknown> | undefined;
419
423
  locateGeojsonFeature(data: GeoJSON.FeatureCollection, transform?: boolean): void;
424
+ /** 根据要素编码与图层类型将地图缩放至该要素位置 */
425
+ locateFeatureByCode(code: string, layerType: LayerType): void;
426
+ /** 平滑闪烁高亮指定要素,返回清理函数用于提前终止动画 */
427
+ smoothBlinkFeature(
428
+ sourceId: string,
429
+ featureFilter: FilterSpecification,
430
+ featureType?: 'line' | 'point',
431
+ options?: {
432
+ duration?: number;
433
+ blinkSpeed?: number;
434
+ baseColor?: [number, number, number];
435
+ minAlpha?: number;
436
+ maxAlpha?: number;
437
+ strokeWidthBase?: number;
438
+ strokeWidthRange?: number;
439
+ },
440
+ ): () => void;
420
441
  getTrackCircuitFeaturesByCodes(circuitCodes: string[]): GeoJSONFeature[];
442
+ /** 查询指定 GeoJSON 图层的所有要素 */
443
+ queryGeojsonFeatures(key: string): GeoJSONFeature[];
444
+ /** 根据要素编码与图层类型获取单个 GeoJSON 要素 */
445
+ getGeojsonLayerFeaturesByCode(code: string, layerType: LayerType): GeoJSONFeature | undefined;
421
446
 
422
447
  // 信号解析与模拟
423
448
  interLockVisualization?: InterLockVisualization;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teeechina/teee-map",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "",
5
5
  "main": "dist/teee-map.umd.js",
6
6
  "module": "dist/teee-map.mjs",