bbl-mapbox-react 0.0.6 → 0.0.7

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.
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { BaseEntity, EntityId } from '../types';
2
+ import { BaseEntity, EntityId, NameConfig } from '../types';
3
3
  import { EntityBounds } from './BaseRenderer';
4
4
  /** Canvas 尺寸 */
5
5
  export declare const CANVAS_SIZE = 512;
@@ -31,8 +31,10 @@ export declare abstract class BaseCanvasRenderer<T extends BaseEntity> {
31
31
  protected labelLayerId: string;
32
32
  protected isDestroyed: boolean;
33
33
  protected isSelected: boolean;
34
+ protected globalNameConfig?: NameConfig;
35
+ protected globalSelectNameConfig?: NameConfig;
34
36
  protected entity: T;
35
- constructor(map: MapboxMap, entity: T, idPrefix: string);
37
+ constructor(map: MapboxMap, entity: T, idPrefix: string, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
36
38
  /**
37
39
  * 初始化 - 子类需要调用此方法
38
40
  */
@@ -40,6 +42,8 @@ export declare abstract class BaseCanvasRenderer<T extends BaseEntity> {
40
42
  /**
41
43
  * 初始化 name 标签 layer
42
44
  */
45
+ protected get nameStyle(): Required<NameConfig>;
46
+ protected get selectNameStyle(): Required<NameConfig>;
43
47
  protected initLabelLayer(): void;
44
48
  /**
45
49
  * 更新标签
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { CircleEntity, CircleGradientAnimation } from '../types';
2
+ import { CircleEntity, CircleGradientAnimation, NameConfig } from '../types';
3
3
  import { BaseCanvasRenderer } from './BaseCanvasRenderer';
4
4
  import { EntityBounds } from './BaseRenderer';
5
5
  /**
@@ -24,7 +24,7 @@ export declare class CanvasCircleRenderer extends BaseCanvasRenderer<CircleEntit
24
24
  private animationFrameId;
25
25
  private animationTime;
26
26
  private pulsePhase;
27
- constructor(map: MapboxMap, entity: CircleEntity);
27
+ constructor(map: MapboxMap, entity: CircleEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
28
28
  /**
29
29
  * 获取实体中心点坐标
30
30
  */
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { ImageEntity } from '../types';
2
+ import { ImageEntity, NameConfig } from '../types';
3
3
  import { BaseCanvasRenderer } from './BaseCanvasRenderer';
4
4
  import { EntityBounds } from './BaseRenderer';
5
5
  /**
@@ -11,7 +11,7 @@ export declare class CanvasImageRenderer extends BaseCanvasRenderer<ImageEntity>
11
11
  private imageLoaded;
12
12
  private currentSrc;
13
13
  private imageAspectRatio;
14
- constructor(map: MapboxMap, entity: ImageEntity);
14
+ constructor(map: MapboxMap, entity: ImageEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
15
15
  /**
16
16
  * 获取实体尺寸 [宽, 高],高度根据图片原始宽高比计算
17
17
  */
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { RadarEntity } from '../types';
2
+ import { RadarEntity, NameConfig } from '../types';
3
3
  import { BaseCanvasRenderer } from './BaseCanvasRenderer';
4
4
  import { EntityBounds } from './BaseRenderer';
5
5
  /**
@@ -9,7 +9,7 @@ import { EntityBounds } from './BaseRenderer';
9
9
  export declare class CanvasRadarRenderer extends BaseCanvasRenderer<RadarEntity> {
10
10
  private currentRotation;
11
11
  private animationFrameId;
12
- constructor(map: MapboxMap, entity: RadarEntity);
12
+ constructor(map: MapboxMap, entity: RadarEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
13
13
  /**
14
14
  * 获取实体中心点坐标
15
15
  */
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { CircleEntity, EntityId } from '../types';
2
+ import { CircleEntity, EntityId, NameConfig } from '../types';
3
3
  import { BaseRenderer, EntityBounds } from './BaseRenderer';
4
4
  /**
5
5
  * Circle 渲染器
@@ -20,8 +20,12 @@ export declare class CircleRenderer implements BaseRenderer<CircleEntity> {
20
20
  private gradientLayerIds;
21
21
  private gradientSourceIds;
22
22
  private static readonly GRADIENT_STEPS;
23
+ private globalNameConfig?;
24
+ private globalSelectNameConfig?;
23
25
  private static readonly DEFAULTS;
24
- constructor(map: MapboxMap, entity: CircleEntity);
26
+ constructor(map: MapboxMap, entity: CircleEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
27
+ private get nameStyle();
28
+ private get selectNameStyle();
25
29
  /**
26
30
  * 初始化图层
27
31
  */
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { MarkerEntity, BaseMarkerEntity, EntityId } from '../types';
2
+ import { MarkerEntity, BaseMarkerEntity, EntityId, NameConfig } from '../types';
3
3
  import { BaseRenderer, EntityBounds } from './BaseRenderer';
4
4
  /**
5
5
  * Marker 渲染器
@@ -16,7 +16,9 @@ export declare class MarkerRenderer<T extends BaseMarkerEntity = MarkerEntity> i
16
16
  protected isSelected: boolean;
17
17
  protected imageAspectRatio: number;
18
18
  protected imageLoaded: boolean;
19
- constructor(map: MapboxMap, entity: T);
19
+ private globalNameConfig?;
20
+ private globalSelectNameConfig?;
21
+ constructor(map: MapboxMap, entity: T, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
20
22
  /**
21
23
  * 加载图片并创建 marker
22
24
  */
@@ -35,6 +37,8 @@ export declare class MarkerRenderer<T extends BaseMarkerEntity = MarkerEntity> i
35
37
  * 子类可重写此方法进行额外初始化
36
38
  */
37
39
  protected onMarkerCreated(): void;
40
+ private get nameStyle();
41
+ private get selectNameStyle();
38
42
  /**
39
43
  * 更新标签样式
40
44
  */
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { PolygonEntity, EntityId } from '../types';
2
+ import { PolygonEntity, EntityId, NameConfig } from '../types';
3
3
  import { BaseRenderer, EntityBounds } from './BaseRenderer';
4
4
  /**
5
5
  * Polygon 渲染器
@@ -15,8 +15,12 @@ export declare class PolygonRenderer implements BaseRenderer<PolygonEntity> {
15
15
  private strokeLayerId;
16
16
  private labelLayerId;
17
17
  private initialized;
18
+ private globalNameConfig?;
19
+ private globalSelectNameConfig?;
18
20
  private static readonly DEFAULTS;
19
- constructor(map: MapboxMap, entity: PolygonEntity);
21
+ constructor(map: MapboxMap, entity: PolygonEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
22
+ private get nameStyle();
23
+ private get selectNameStyle();
20
24
  /**
21
25
  * 初始化图层
22
26
  */
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { PolylineEntity, EntityId } from '../types';
2
+ import { PolylineEntity, EntityId, NameConfig } from '../types';
3
3
  import { BaseRenderer, EntityBounds } from './BaseRenderer';
4
4
  /**
5
5
  * Polyline 渲染器
@@ -14,8 +14,12 @@ export declare class PolylineRenderer implements BaseRenderer<PolylineEntity> {
14
14
  private lineLayerId;
15
15
  private labelLayerId;
16
16
  private initialized;
17
+ private globalNameConfig?;
18
+ private globalSelectNameConfig?;
17
19
  private static readonly DEFAULTS;
18
- constructor(map: MapboxMap, entity: PolylineEntity);
20
+ constructor(map: MapboxMap, entity: PolylineEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
21
+ private get nameStyle();
22
+ private get selectNameStyle();
19
23
  /**
20
24
  * 初始化图层
21
25
  */
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { RectangleEntity, EntityId } from '../types';
2
+ import { RectangleEntity, EntityId, NameConfig } from '../types';
3
3
  import { BaseRenderer, EntityBounds } from './BaseRenderer';
4
4
  /**
5
5
  * Rectangle 渲染器
@@ -15,8 +15,12 @@ export declare class RectangleRenderer implements BaseRenderer<RectangleEntity>
15
15
  private strokeLayerId;
16
16
  private labelLayerId;
17
17
  private initialized;
18
+ private globalNameConfig?;
19
+ private globalSelectNameConfig?;
18
20
  private static readonly DEFAULTS;
19
- constructor(map: MapboxMap, entity: RectangleEntity);
21
+ constructor(map: MapboxMap, entity: RectangleEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
22
+ private get nameStyle();
23
+ private get selectNameStyle();
20
24
  /**
21
25
  * 初始化图层
22
26
  */
@@ -1,5 +1,5 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
- import { SquareEntity, EntityId } from '../types';
2
+ import { SquareEntity, EntityId, NameConfig } from '../types';
3
3
  import { BaseRenderer, EntityBounds } from './BaseRenderer';
4
4
  /**
5
5
  * Square 渲染器
@@ -15,8 +15,12 @@ export declare class SquareRenderer implements BaseRenderer<SquareEntity> {
15
15
  private strokeLayerId;
16
16
  private labelLayerId;
17
17
  private initialized;
18
+ private globalNameConfig?;
19
+ private globalSelectNameConfig?;
18
20
  private static readonly DEFAULTS;
19
- constructor(map: MapboxMap, entity: SquareEntity);
21
+ constructor(map: MapboxMap, entity: SquareEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
22
+ private get nameStyle();
23
+ private get selectNameStyle();
20
24
  /**
21
25
  * 初始化图层
22
26
  */
@@ -1,6 +1,6 @@
1
1
  import { Map as MapboxMap } from 'mapbox-gl';
2
2
  import { ReactNode } from 'react';
3
- import { UnitEntity } from '../types';
3
+ import { UnitEntity, NameConfig } from '../types';
4
4
  import { MarkerRenderer } from './MarkerRenderer';
5
5
  /**
6
6
  * Unit 渲染器
@@ -15,7 +15,7 @@ export declare class UnitRenderer extends MarkerRenderer<UnitEntity> {
15
15
  private trajInitialized;
16
16
  private statusElement;
17
17
  private statusRoot;
18
- constructor(map: MapboxMap, entity: UnitEntity);
18
+ constructor(map: MapboxMap, entity: UnitEntity, globalNameConfig?: NameConfig, globalSelectNameConfig?: NameConfig);
19
19
  /**
20
20
  * 渲染状态内容
21
21
  * 子类可重写此方法,或者实例化后直接覆盖此方法