@terra.gl/core 0.0.1-alpha.8 → 0.0.1-alpha.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/dist/index.d.ts CHANGED
@@ -233,7 +233,7 @@ export declare interface BaseEventMap<Target = any> {
233
233
  /**
234
234
  * 基础线样式配置
235
235
  */
236
- declare interface BaseLineStyle extends BaseStyle {
236
+ export declare interface BaseLineStyle extends BaseStyle {
237
237
  type: 'basic-line';
238
238
  /** 线颜色 */
239
239
  color?: string | number | Color;
@@ -252,7 +252,7 @@ declare interface BaseLineStyle extends BaseStyle {
252
252
  /**
253
253
  * 基础多边形样式配置
254
254
  */
255
- declare interface BasePolygonStyle extends BaseStyle {
255
+ export declare interface BasePolygonStyle extends BaseStyle {
256
256
  type: 'basic-polygon';
257
257
  /** 填充颜色 */
258
258
  color?: string | number | Color;
@@ -273,7 +273,7 @@ declare interface BasePolygonStyle extends BaseStyle {
273
273
  /**
274
274
  * 基础样式接口
275
275
  */
276
- declare interface BaseStyle {
276
+ export declare interface BaseStyle {
277
277
  /** 是否可见 */
278
278
  visible?: boolean;
279
279
  /** 透明度 (0-1) */
@@ -365,7 +365,7 @@ declare interface BaseTileLayerOptions extends LayerOptions {
365
365
  /**
366
366
  * 基础水面样式配置
367
367
  */
368
- declare interface BaseWaterStyle extends BaseStyle {
368
+ export declare interface BaseWaterStyle extends BaseStyle {
369
369
  type: 'base-water';
370
370
  /** 水面颜色 */
371
371
  color?: number | string;
@@ -388,7 +388,7 @@ declare interface BaseWaterStyle extends BaseStyle {
388
388
  /**
389
389
  * 基础点样式配置
390
390
  */
391
- declare interface BasicPointStyle extends BaseStyle {
391
+ export declare interface BasicPointStyle extends BaseStyle {
392
392
  type: 'basic-point';
393
393
  /** 点颜色 */
394
394
  color?: string | number | Color;
@@ -401,10 +401,17 @@ declare interface BasicPointStyle extends BaseStyle {
401
401
  /** 类选项类型 */
402
402
  declare type ClassOptions = Record<string, any>;
403
403
 
404
+ /**
405
+ * 云朵要素配置选项
406
+ *
407
+ * @extends PointOptions
408
+ */
409
+ export declare type CloudOptions = PointOptions & {};
410
+
404
411
  /**
405
412
  * 云朵属性配置
406
413
  */
407
- declare type CloudProps = {
414
+ export declare type CloudProps = {
408
415
  /** 随机种子 */
409
416
  seed?: number;
410
417
  /** 分段/粒子数量 */
@@ -498,7 +505,7 @@ export declare class CloudsLayer extends OverlayLayer<ICloud> {
498
505
  /**
499
506
  * 云朵状态类型
500
507
  */
501
- declare type CloudState = {
508
+ export declare type CloudState = {
502
509
  /** 引用组 */
503
510
  ref: Group;
504
511
  /** 唯一标识 */
@@ -540,7 +547,7 @@ declare type CloudState = {
540
547
  /**
541
548
  * 云朵样式配置
542
549
  */
543
- declare type CloudStyle = BaseStyle & CloudProps & {
550
+ export declare type CloudStyle = BaseStyle & CloudProps & {
544
551
  type: 'cloud';
545
552
  };
546
553
 
@@ -768,7 +775,7 @@ export declare function createBillboards(txt: string, size?: number): Sprite<Obj
768
775
  /**
769
776
  * 自定义样式配置
770
777
  */
771
- declare interface CustomStyle extends BaseStyle {
778
+ export declare interface CustomStyle extends BaseStyle {
772
779
  type: 'custom';
773
780
  /** 构建函数 */
774
781
  build: () => Object3D | Promise<Object3D>;
@@ -869,7 +876,7 @@ export declare class EventClass {
869
876
  /**
870
877
  * 拉伸多边形样式配置
871
878
  */
872
- declare interface ExtrudeStyle extends BaseStyle {
879
+ export declare interface ExtrudeStyle extends BaseStyle {
873
880
  type: 'extrude-polygon';
874
881
  /** 填充颜色 */
875
882
  color?: number | string;
@@ -913,7 +920,7 @@ declare abstract class Feature extends Feature_base implements ICollidable {
913
920
  /** 所属图层 */
914
921
  _layer?: Layer;
915
922
  /** 当前样式 */
916
- _style?: Style_2;
923
+ _style?: Style;
917
924
  /** 要素ID */
918
925
  _id: string;
919
926
  /** 样式队列(用于处理异步样式应用) */
@@ -965,7 +972,7 @@ declare abstract class Feature extends Feature_base implements ICollidable {
965
972
  *
966
973
  * @returns 当前样式或undefined
967
974
  */
968
- getStyle(): Style_2 | undefined;
975
+ getStyle(): Style | undefined;
969
976
  /**
970
977
  * 应用样式(带重试机制)
971
978
  *
@@ -1495,7 +1502,7 @@ export declare class ICloud extends Point_3 {
1495
1502
  *
1496
1503
  * @private
1497
1504
  */
1498
- _createObject(style: Style_2): Promise<any>;
1505
+ _createObject(style: Style): Promise<any>;
1499
1506
  }
1500
1507
 
1501
1508
  /**
@@ -1506,7 +1513,7 @@ export declare class ICloud extends Point_3 {
1506
1513
  *
1507
1514
  * @extends OverlayLayerOptions<ICloud>
1508
1515
  */
1509
- declare type ICloudLayerOptions = OverlayLayerOptions<ICloud> & {
1516
+ export declare type ICloudLayerOptions = OverlayLayerOptions<ICloud> & {
1510
1517
  /**
1511
1518
  * 云层纹理
1512
1519
  * @description 支持直接传入Texture对象或纹理URL字符串
@@ -1627,7 +1634,7 @@ declare interface ICollisionState {
1627
1634
  /**
1628
1635
  * 图标标签样式配置
1629
1636
  */
1630
- declare interface IconLabelStyle extends BaseStyle {
1637
+ export declare interface IconLabelStyle extends BaseStyle {
1631
1638
  type: 'icon-label-point';
1632
1639
  /** 文本内容 */
1633
1640
  text: string;
@@ -1670,7 +1677,7 @@ declare interface IconLabelStyle extends BaseStyle {
1670
1677
  /**
1671
1678
  * 图标点样式配置
1672
1679
  */
1673
- declare interface IconPointStyle extends BaseStyle {
1680
+ export declare interface IconPointStyle extends BaseStyle {
1674
1681
  type: 'icon-point';
1675
1682
  /** 点颜色 */
1676
1683
  color?: string | number | Color;
@@ -1925,13 +1932,13 @@ export declare class Label extends Point_3 {
1925
1932
  * - 'canvas-label-fixed': 固定大小标签
1926
1933
  * - 'canvas-label': 动态大小标签
1927
1934
  */
1928
- _createObject(style: Style_2): Promise<Object3D>;
1935
+ _createObject(style: Style): Promise<Object3D>;
1929
1936
  }
1930
1937
 
1931
1938
  /**
1932
1939
  * 标签样式配置
1933
1940
  */
1934
- declare interface LabelStyle extends BaseStyle {
1941
+ export declare interface LabelStyle extends BaseStyle {
1935
1942
  type: 'canvas-label' | 'canvas-label-fixed';
1936
1943
  /** 文本内容 */
1937
1944
  text: string;
@@ -2162,7 +2169,7 @@ declare type LayerOptions = {
2162
2169
  altitude?: number;
2163
2170
  };
2164
2171
 
2165
- declare interface LightStyle extends BaseStyle {
2172
+ export declare interface LightStyle extends BaseStyle {
2166
2173
  type: 'light';
2167
2174
  /** 点颜色 */
2168
2175
  color?: string | number | Color;
@@ -2175,7 +2182,7 @@ declare interface LightStyle extends BaseStyle {
2175
2182
  /**
2176
2183
  * 水面样式配置
2177
2184
  */
2178
- declare interface LightWaterStyle extends BaseStyle {
2185
+ export declare interface LightWaterStyle extends BaseStyle {
2179
2186
  type: 'water';
2180
2187
  /** 水面颜色 */
2181
2188
  color?: number | string;
@@ -2280,7 +2287,7 @@ export declare class LineLayer extends OverlayLayer<Line> {
2280
2287
  * 线图层的配置选项,继承自基础覆盖图层选项
2281
2288
  * 可添加线图层特有的配置项
2282
2289
  */
2283
- declare type LineLayerOptions = OverlayLayerOptions<Line> & {};
2290
+ export declare type LineLayerOptions = OverlayLayerOptions<Line> & {};
2284
2291
 
2285
2292
  /**
2286
2293
  * 线要素配置选项
@@ -2327,7 +2334,7 @@ export declare class LineString extends Line {
2327
2334
  * 当前支持样式类型:
2328
2335
  * - 'basic-line': 基础线样式
2329
2336
  */
2330
- _createObject(style: Style_2): Promise<Object3D>;
2337
+ _createObject(style: Style): Promise<Object3D>;
2331
2338
  /**
2332
2339
  * 更新几何体
2333
2340
  *
@@ -2343,7 +2350,7 @@ export declare class LineString extends Line {
2343
2350
  *
2344
2351
  * @extends LineOptions
2345
2352
  */
2346
- declare type LineStringOptions = LineOptions & {};
2353
+ export declare type LineStringOptions = LineOptions & {};
2347
2354
 
2348
2355
  /**
2349
2356
  * Factory for loader
@@ -2447,7 +2454,7 @@ export declare class Maker extends Point_3 {
2447
2454
  * @returns 创建的标记点对象
2448
2455
  * @throws 如果样式类型不支持会抛出错误
2449
2456
  */
2450
- _createObject(style: Style_2): Promise<Object3D>;
2457
+ _createObject(style: Style): Promise<Object3D>;
2451
2458
  /**
2452
2459
  * 计算碰撞检测用的屏幕空间包围盒(根据不同类型使用不同的计算策略)
2453
2460
  *
@@ -2498,7 +2505,7 @@ export declare class Maker extends Point_3 {
2498
2505
  *
2499
2506
  * @extends PointOptions
2500
2507
  */
2501
- declare type MakerOptions = PointOptions & {};
2508
+ export declare type MakerOptions = PointOptions & {};
2502
2509
 
2503
2510
  /**
2504
2511
  * 标签要素配置选项
@@ -2756,7 +2763,7 @@ export declare type MapBoxSourceOptions = SourceOptions & {
2756
2763
  /**
2757
2764
  * 地图总配置类型(用嵌套对象区分模块)
2758
2765
  */
2759
- declare type MapOptions = {
2766
+ export declare type MapOptions = {
2760
2767
  /** 查看器配置选项 */
2761
2768
  viewer?: ViewerOptions;
2762
2769
  /** 瓦片地图参数配置 */
@@ -2916,7 +2923,7 @@ export declare class Model extends Point_3 {
2916
2923
  * @returns 创建的模型对象
2917
2924
  * @throws 如果样式类型不支持会抛出错误
2918
2925
  */
2919
- _createObject(style: Style_2): Promise<any>;
2926
+ _createObject(style: Style): Promise<any>;
2920
2927
  /**
2921
2928
  * 应用自发光属性
2922
2929
  * @private
@@ -3019,7 +3026,7 @@ export declare class Model extends Point_3 {
3019
3026
  *
3020
3027
  * @extends PointOptions
3021
3028
  */
3022
- declare type ModelOptions = PointOptions & {
3029
+ export declare type ModelOptions = PointOptions & {
3023
3030
  /** 是否启用自发光效果 */
3024
3031
  emissive?: boolean;
3025
3032
  /** 自发光强度 */
@@ -3037,7 +3044,7 @@ declare type ModelOptions = PointOptions & {
3037
3044
  /**
3038
3045
  * 模型样式配置
3039
3046
  */
3040
- declare interface ModelStyle extends BaseStyle {
3047
+ export declare interface ModelStyle extends BaseStyle {
3041
3048
  /** 模型URL */
3042
3049
  url: string;
3043
3050
  /** 模型类型 */
@@ -3158,7 +3165,7 @@ export declare class MultiLineString extends Line {
3158
3165
  *
3159
3166
  * @extends LineOptions
3160
3167
  */
3161
- declare type MultiLineStringOptions = LineOptions & {};
3168
+ export declare type MultiLineStringOptions = LineOptions & {};
3162
3169
 
3163
3170
  /**
3164
3171
  * MVTGeo数据源类
@@ -3281,7 +3288,7 @@ declare type OverlayLayerOptions<T extends Feature> = LayerOptions & {
3281
3288
  /**
3282
3289
  * 管道线样式配置
3283
3290
  */
3284
- declare interface PipelineStyle extends BaseStyle {
3291
+ export declare interface PipelineStyle extends BaseStyle {
3285
3292
  type: 'tube-line';
3286
3293
  /** 管道颜色 */
3287
3294
  color?: string | number | Color;
@@ -3376,7 +3383,7 @@ export declare class PointLayer extends OverlayLayer<Point_3> {
3376
3383
  * 点图层配置选项
3377
3384
  * @extends OverlayLayerOptions<Point>
3378
3385
  */
3379
- declare type PointLayerOptions = OverlayLayerOptions<Point_3> & {};
3386
+ export declare type PointLayerOptions = OverlayLayerOptions<Point_3> & {};
3380
3387
 
3381
3388
  /**
3382
3389
  * 点要素配置选项
@@ -3391,7 +3398,7 @@ declare type PointOptions = FeatureOptions & {
3391
3398
  /**
3392
3399
  * 点样式联合类型
3393
3400
  */
3394
- declare type PointStyle = BasicPointStyle | IconPointStyle | IconLabelStyle | LightStyle;
3401
+ export declare type PointStyle = BasicPointStyle | IconPointStyle | IconLabelStyle | LightStyle;
3395
3402
 
3396
3403
  /**
3397
3404
  * 多边形要素类
@@ -3435,7 +3442,7 @@ export declare class Polygon extends Surface {
3435
3442
  * - 'water': 水面效果
3436
3443
  * - 'base-water': 基础水面效果
3437
3444
  */
3438
- _createObject(style: Style_2): Promise<Object3D>;
3445
+ _createObject(style: Style): Promise<Object3D>;
3439
3446
  /**
3440
3447
  * 计算碰撞检测包围盒
3441
3448
  * @returns 碰撞检测包围盒
@@ -3470,14 +3477,14 @@ export declare class PolygonLayer extends OverlayLayer<Polygon> {
3470
3477
  * @extends OverlayLayerOptions<Polygon>
3471
3478
  * @description 扩展基础图层选项,可添加多边形特有的配置项
3472
3479
  */
3473
- declare type PolygonLayerOptions = OverlayLayerOptions<Polygon> & {};
3480
+ export declare type PolygonLayerOptions = OverlayLayerOptions<Polygon> & {};
3474
3481
 
3475
3482
  /**
3476
3483
  * 多边形要素配置选项
3477
3484
  *
3478
3485
  * @extends SurfaceOptions
3479
3486
  */
3480
- declare type PolygonOptions = SurfaceOptions & {
3487
+ export declare type PolygonOptions = SurfaceOptions & {
3481
3488
  /** GeoJSON多边形几何数据 */
3482
3489
  geometry?: Polygon_2 | MultiPolygon;
3483
3490
  };
@@ -3585,17 +3592,11 @@ export declare interface SourceOptions {
3585
3592
  [key: string]: unknown;
3586
3593
  }
3587
3594
 
3588
- /**
3589
- * 天地图地图样式类型
3590
- * @description 定义天地图支持的各种地图样式
3591
- */
3592
- declare type Style = "img_w" | "cia_w" | "cva_w" | "ibo_w" | "ter_w" | "vec_w" | "cta_w" | "img_c" | "cia_c";
3593
-
3594
3595
  /**
3595
3596
  * 样式主类
3596
3597
  * @description 负责管理和应用各种3D对象的样式
3597
3598
  */
3598
- declare class Style_2 {
3599
+ export declare class Style {
3599
3600
  config: StyleConfig;
3600
3601
  /** 纹理缓存 */
3601
3602
  private static _textureCache;
@@ -3701,18 +3702,24 @@ declare class Style_2 {
3701
3702
  * @param input 样式输入
3702
3703
  * @returns 样式实例
3703
3704
  */
3704
- static create(input: StyleInput): Style_2;
3705
+ static create(input: StyleInput): Style;
3705
3706
  }
3706
3707
 
3708
+ /**
3709
+ * 天地图地图样式类型
3710
+ * @description 定义天地图支持的各种地图样式
3711
+ */
3712
+ declare type Style_2 = "img_w" | "cia_w" | "cva_w" | "ibo_w" | "ter_w" | "vec_w" | "cta_w" | "img_c" | "cia_c";
3713
+
3707
3714
  /**
3708
3715
  * 样式配置联合类型
3709
3716
  */
3710
- declare type StyleConfig = PointStyle | BaseLineStyle | PipelineStyle | ModelStyle | CustomStyle | BasePolygonStyle | ExtrudeStyle | WaterStyle | CloudStyle | BaseWaterStyle | LabelStyle | IconLabelStyle;
3717
+ export declare type StyleConfig = PointStyle | BaseLineStyle | PipelineStyle | ModelStyle | CustomStyle | BasePolygonStyle | ExtrudeStyle | WaterStyle | CloudStyle | BaseWaterStyle | LabelStyle | IconLabelStyle;
3711
3718
 
3712
3719
  /**
3713
3720
  * 样式输入类型
3714
3721
  */
3715
- declare type StyleInput = StyleConfig | Style_2;
3722
+ export declare type StyleInput = StyleConfig | Style;
3716
3723
 
3717
3724
  /**
3718
3725
  * 样式规则接口 (简化版)
@@ -3871,7 +3878,7 @@ export declare class TDTSource extends TileSource {
3871
3878
  * 地图样式类型
3872
3879
  * @default "img_w" (全球影像地图)
3873
3880
  */
3874
- style: Style;
3881
+ style: Style_2;
3875
3882
  /**
3876
3883
  * 服务器子域列表
3877
3884
  * @default "01234"
@@ -3907,7 +3914,7 @@ export declare type TDTSourceOptins = SourceOptions & {
3907
3914
  * 地图样式类型
3908
3915
  * @default "img_w" (全球影像地图)
3909
3916
  */
3910
- style?: Style;
3917
+ style?: Style_2;
3911
3918
  /**
3912
3919
  * 天地图访问令牌
3913
3920
  * @description 必须提供有效的天地图API访问令牌
@@ -4552,6 +4559,12 @@ export declare type TileSourceLoadParamsType<TSource extends ISource = ISource>
4552
4559
  source: TSource;
4553
4560
  };
4554
4561
 
4562
+ /**
4563
+ * 矢量瓦片样式输入类型
4564
+ * @description 支持单个样式配置或数组
4565
+ */
4566
+ export declare type TileStyleInput = StyleConfig | StyleConfig[];
4567
+
4555
4568
  /**
4556
4569
  * Tile update parameters
4557
4570
  */
@@ -4605,7 +4618,7 @@ export declare class TPoints extends Point_3 {
4605
4618
  *
4606
4619
  * @private
4607
4620
  */
4608
- _createObject(style: Style_2): Promise<any>;
4621
+ _createObject(style: Style): Promise<any>;
4609
4622
  }
4610
4623
 
4611
4624
  /**
@@ -4613,7 +4626,7 @@ export declare class TPoints extends Point_3 {
4613
4626
  *
4614
4627
  * @extends PointOptions
4615
4628
  */
4616
- declare type TPointsOptions = PointOptions & {
4629
+ export declare type TPointsOptions = PointOptions & {
4617
4630
  geometries?: any;
4618
4631
  };
4619
4632
 
@@ -4825,7 +4838,7 @@ export declare class VectorTileLayer extends BaseTileLayer {
4825
4838
  /**
4826
4839
  * 矢量瓦片图层配置接口
4827
4840
  */
4828
- declare interface VectorTileLayerOptions extends BaseTileLayerOptions {
4841
+ export declare interface VectorTileLayerOptions extends BaseTileLayerOptions {
4829
4842
  style: any;
4830
4843
  featureFilter?: (feature: any) => boolean;
4831
4844
  collision?: boolean;
@@ -5158,7 +5171,7 @@ export declare function waitFor(condition: boolean, delay?: number): Promise<voi
5158
5171
  /**
5159
5172
  * 水面样式联合类型
5160
5173
  */
5161
- declare type WaterStyle = BaseWaterStyle | LightWaterStyle;
5174
+ export declare type WaterStyle = BaseWaterStyle | LightWaterStyle;
5162
5175
 
5163
5176
  /**
5164
5177
  * WMTS标准瓦片数据源
@@ -5261,7 +5274,7 @@ export declare class WMTSTileLayer extends RasterTileLayer {
5261
5274
  /**
5262
5275
  * WMTS瓦片图层配置接口
5263
5276
  */
5264
- declare interface WMTSTileLayerOptions extends RasterTileLayerOptions {
5277
+ export declare interface WMTSTileLayerOptions extends RasterTileLayerOptions {
5265
5278
  layerName: string;
5266
5279
  style?: string;
5267
5280
  matrixSet?: string;