@terra.gl/core 0.0.1-alpha.67 → 0.0.1-alpha.68
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 +377 -0
- package/dist/index.js +7655 -6981
- package/dist/index.umd.cjs +41 -33
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -677,6 +677,22 @@ export declare interface BasicPointStyle extends BaseStyle {
|
|
|
677
677
|
sizeAttenuation?: boolean;
|
|
678
678
|
}
|
|
679
679
|
|
|
680
|
+
/**
|
|
681
|
+
* Camera follow configuration.
|
|
682
|
+
* 相机跟随配置
|
|
683
|
+
* @category Layer
|
|
684
|
+
*/
|
|
685
|
+
declare interface CameraFollowConfig {
|
|
686
|
+
/** Camera mode. 相机模式 */
|
|
687
|
+
mode: 'none' | 'first-person' | 'third-person';
|
|
688
|
+
/** Camera distance from target. 相机距离 */
|
|
689
|
+
distance?: number;
|
|
690
|
+
/** Camera polar angle (degrees, 0=top-down, 90=horizontal). 相机极角(度,0=俯视,90=水平) */
|
|
691
|
+
polarAngle?: number;
|
|
692
|
+
/** Camera smoothing factor (0-1). 相机平滑系数 */
|
|
693
|
+
smoothing?: number;
|
|
694
|
+
}
|
|
695
|
+
|
|
680
696
|
/** 类选项类型 * @category Core
|
|
681
697
|
/** 类选项类型 */
|
|
682
698
|
declare type ClassOptions_2 = Record<string, any>;
|
|
@@ -1091,6 +1107,24 @@ declare enum CollisionType {
|
|
|
1091
1107
|
*/
|
|
1092
1108
|
export declare function concatenateTypedArrays<T extends TypedArray>(...typedArrays: T[]): T;
|
|
1093
1109
|
|
|
1110
|
+
/**
|
|
1111
|
+
* Control point style configuration.
|
|
1112
|
+
* 控制点样式配置
|
|
1113
|
+
* @category Layer
|
|
1114
|
+
*/
|
|
1115
|
+
declare interface ControlPointStyle {
|
|
1116
|
+
/** Control point type. 控制点类型 */
|
|
1117
|
+
type?: 'point' | 'icon' | 'gif';
|
|
1118
|
+
/** Color for point type. 点模式颜色 */
|
|
1119
|
+
color?: string;
|
|
1120
|
+
/** Size. 尺寸 */
|
|
1121
|
+
size?: number;
|
|
1122
|
+
/** Icon or GIF URL. 图标/GIF 地址 */
|
|
1123
|
+
url?: string;
|
|
1124
|
+
/** Sprite anchor [x, y], 0-1 range. Default [0.5, 0.5] = center. */
|
|
1125
|
+
anchor?: [number, number];
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1094
1128
|
/**
|
|
1095
1129
|
* 转换整个geometry数据结构
|
|
1096
1130
|
* @param geometryData - MVT解析出的 geometry 数据结构(包含 Vector2 对象)
|
|
@@ -6975,6 +7009,349 @@ export declare type TPointsOptions = PointOptions & {
|
|
|
6975
7009
|
geometries?: any;
|
|
6976
7010
|
};
|
|
6977
7011
|
|
|
7012
|
+
/**
|
|
7013
|
+
* Trail line style configuration.
|
|
7014
|
+
* 轨迹线样式配置
|
|
7015
|
+
* @category Layer
|
|
7016
|
+
*/
|
|
7017
|
+
declare interface TrailLineStyle {
|
|
7018
|
+
color?: string;
|
|
7019
|
+
width?: number;
|
|
7020
|
+
opacity?: number;
|
|
7021
|
+
}
|
|
7022
|
+
|
|
7023
|
+
/**
|
|
7024
|
+
* Trajectory input data.
|
|
7025
|
+
* 轨迹输入数据
|
|
7026
|
+
* @category Layer
|
|
7027
|
+
*/
|
|
7028
|
+
export declare interface TrajectoryData {
|
|
7029
|
+
/** Array of trajectory points. 轨迹点数组 */
|
|
7030
|
+
points: TrajectoryPoint[];
|
|
7031
|
+
/** Optional total duration override (ms). 可选总时长覆盖 */
|
|
7032
|
+
duration?: number;
|
|
7033
|
+
}
|
|
7034
|
+
|
|
7035
|
+
/**
|
|
7036
|
+
* TrajectoryLayer - Trajectory playback layer.
|
|
7037
|
+
* 轨迹图层 - 轨迹回放图层
|
|
7038
|
+
*
|
|
7039
|
+
* @description
|
|
7040
|
+
* Provides trajectory visualization with playback control, speed adjustment,
|
|
7041
|
+
* time display, control points, and first/third-person camera follow.
|
|
7042
|
+
*
|
|
7043
|
+
* 提供轨迹可视化,支持回放控制、速度调节、时间显示、控制点、
|
|
7044
|
+
* 第一/第三人称相机跟随。
|
|
7045
|
+
*
|
|
7046
|
+
* @extends Layer
|
|
7047
|
+
* @category Layer
|
|
7048
|
+
*/
|
|
7049
|
+
export declare class TrajectoryLayer extends Layer {
|
|
7050
|
+
private _trailLine;
|
|
7051
|
+
private _activeLine;
|
|
7052
|
+
private _marker;
|
|
7053
|
+
private _controlPointGroup;
|
|
7054
|
+
private _timeLabels;
|
|
7055
|
+
private _points;
|
|
7056
|
+
private _worldPoints;
|
|
7057
|
+
private _timestamps;
|
|
7058
|
+
private _totalDuration;
|
|
7059
|
+
private _state;
|
|
7060
|
+
private _currentTime;
|
|
7061
|
+
private _playbackSpeed;
|
|
7062
|
+
private _loop;
|
|
7063
|
+
private _cameraMode;
|
|
7064
|
+
private _cameraConfig;
|
|
7065
|
+
private _prevControlsEnabled;
|
|
7066
|
+
private _options;
|
|
7067
|
+
private _gifStates;
|
|
7068
|
+
/**
|
|
7069
|
+
* Create a TrajectoryLayer instance.
|
|
7070
|
+
* 创建轨迹图层实例
|
|
7071
|
+
*
|
|
7072
|
+
* @param id Layer unique ID. 图层唯一标识
|
|
7073
|
+
* @param data Trajectory data. 轨迹数据
|
|
7074
|
+
* @param options Layer options. 图层配置
|
|
7075
|
+
*/
|
|
7076
|
+
constructor(id: string, data?: TrajectoryData, options?: TrajectoryLayerOptions);
|
|
7077
|
+
/**
|
|
7078
|
+
* Override _bindMap to build geometry when map is available.
|
|
7079
|
+
* 重写 _bindMap,在地图可用时构建几何体
|
|
7080
|
+
*/
|
|
7081
|
+
_bindMap(map: Map_2): void;
|
|
7082
|
+
/**
|
|
7083
|
+
* Set or replace trajectory data.
|
|
7084
|
+
* 设置或替换轨迹数据
|
|
7085
|
+
*
|
|
7086
|
+
* @param data Trajectory data. 轨迹数据
|
|
7087
|
+
*/
|
|
7088
|
+
setData(data: TrajectoryData): void;
|
|
7089
|
+
/**
|
|
7090
|
+
* Internal data setup (no geometry build).
|
|
7091
|
+
*/
|
|
7092
|
+
private _setDataInternal;
|
|
7093
|
+
/**
|
|
7094
|
+
* Start or resume playback.
|
|
7095
|
+
* 开始或恢复播放
|
|
7096
|
+
*/
|
|
7097
|
+
play(): void;
|
|
7098
|
+
/**
|
|
7099
|
+
* Pause playback.
|
|
7100
|
+
* 暂停播放
|
|
7101
|
+
*/
|
|
7102
|
+
pause(): void;
|
|
7103
|
+
/**
|
|
7104
|
+
* Stop playback and reset to start.
|
|
7105
|
+
* 停止播放并重置到起点
|
|
7106
|
+
*/
|
|
7107
|
+
stop(): void;
|
|
7108
|
+
/**
|
|
7109
|
+
* Seek to a specific time.
|
|
7110
|
+
* 跳转到指定时间
|
|
7111
|
+
*
|
|
7112
|
+
* @param timeMs Time in milliseconds from start. 从起点开始的毫秒数
|
|
7113
|
+
*/
|
|
7114
|
+
seekTo(timeMs: number): void;
|
|
7115
|
+
/**
|
|
7116
|
+
* Set playback speed multiplier.
|
|
7117
|
+
* 设置播放速度倍率
|
|
7118
|
+
*
|
|
7119
|
+
* @param multiplier Speed multiplier (1 = normal). 速度倍率
|
|
7120
|
+
*/
|
|
7121
|
+
setSpeed(multiplier: number): void;
|
|
7122
|
+
/**
|
|
7123
|
+
* Set loop mode.
|
|
7124
|
+
* 设置循环模式
|
|
7125
|
+
*
|
|
7126
|
+
* @param enabled Whether to loop. 是否循环
|
|
7127
|
+
*/
|
|
7128
|
+
setLoop(enabled: boolean): void;
|
|
7129
|
+
/**
|
|
7130
|
+
* Show or hide control points.
|
|
7131
|
+
* 显示或隐藏控制点
|
|
7132
|
+
*
|
|
7133
|
+
* @param visible Whether to show control points. 是否显示控制点
|
|
7134
|
+
*/
|
|
7135
|
+
setShowControlPoints(visible: boolean): void;
|
|
7136
|
+
/**
|
|
7137
|
+
* Show or hide time labels.
|
|
7138
|
+
* 显示或隐藏时间标签
|
|
7139
|
+
*
|
|
7140
|
+
* @param visible Whether to show time labels. 是否显示时间标签
|
|
7141
|
+
*/
|
|
7142
|
+
setShowTimeLabels(visible: boolean): void;
|
|
7143
|
+
/**
|
|
7144
|
+
* Set camera follow mode.
|
|
7145
|
+
* 设置相机跟随模式
|
|
7146
|
+
*
|
|
7147
|
+
* @param mode Camera mode. 相机模式
|
|
7148
|
+
* @param config Optional camera config override. 可选相机配置覆盖
|
|
7149
|
+
*/
|
|
7150
|
+
setCameraMode(mode: 'none' | 'first-person' | 'third-person', config?: Partial<CameraFollowConfig>): void;
|
|
7151
|
+
/**
|
|
7152
|
+
* Get current playback time (ms from start).
|
|
7153
|
+
* 获取当前播放时间
|
|
7154
|
+
*/
|
|
7155
|
+
getCurrentTime(): number;
|
|
7156
|
+
/**
|
|
7157
|
+
* Get total duration (ms).
|
|
7158
|
+
* 获取总时长
|
|
7159
|
+
*/
|
|
7160
|
+
getDuration(): number;
|
|
7161
|
+
/**
|
|
7162
|
+
* Get current playback state.
|
|
7163
|
+
* 获取当前播放状态
|
|
7164
|
+
*/
|
|
7165
|
+
getPlaybackState(): 'idle' | 'playing' | 'paused';
|
|
7166
|
+
/**
|
|
7167
|
+
* Get current speed multiplier.
|
|
7168
|
+
* 获取当前速度倍率
|
|
7169
|
+
*/
|
|
7170
|
+
getSpeed(): number;
|
|
7171
|
+
/**
|
|
7172
|
+
* Per-frame animation update.
|
|
7173
|
+
* 每帧动画更新
|
|
7174
|
+
*
|
|
7175
|
+
* @param delta Frame delta time (seconds). 帧间隔时间(秒)
|
|
7176
|
+
* @param elapsedtime Total elapsed time (seconds). 累计时间(秒)
|
|
7177
|
+
* @param context Viewer instance. Viewer 实例
|
|
7178
|
+
*/
|
|
7179
|
+
protected animate(delta: number, _elapsedtime: number, context: Viewer): void;
|
|
7180
|
+
/**
|
|
7181
|
+
* Build all visual elements.
|
|
7182
|
+
* 构建所有视觉元素
|
|
7183
|
+
*/
|
|
7184
|
+
private _buildAll;
|
|
7185
|
+
/**
|
|
7186
|
+
* Transform geographic coordinates to world coordinates relative to prjcenter.
|
|
7187
|
+
* 将地理坐标转换为相对于 prjcenter 的世界坐标
|
|
7188
|
+
*/
|
|
7189
|
+
private _transformCoordinates;
|
|
7190
|
+
/**
|
|
7191
|
+
* Build the full trail line (static).
|
|
7192
|
+
* 构建完整轨迹线(静态)
|
|
7193
|
+
*/
|
|
7194
|
+
private _buildTrailLine;
|
|
7195
|
+
/**
|
|
7196
|
+
* Build the active (traveled) trail line (dynamic).
|
|
7197
|
+
* 构建已走轨迹线(动态)
|
|
7198
|
+
*/
|
|
7199
|
+
private _buildActiveLine;
|
|
7200
|
+
/**
|
|
7201
|
+
* Build the moving marker.
|
|
7202
|
+
* 构建移动标记
|
|
7203
|
+
*/
|
|
7204
|
+
private _buildMarker;
|
|
7205
|
+
/**
|
|
7206
|
+
* Build control points.
|
|
7207
|
+
* 构建控制点
|
|
7208
|
+
*/
|
|
7209
|
+
private _buildControlPoints;
|
|
7210
|
+
/**
|
|
7211
|
+
* Create a GIF animated control point.
|
|
7212
|
+
* 创建 GIF 动图控制点
|
|
7213
|
+
*/
|
|
7214
|
+
private _createGifControlPoint;
|
|
7215
|
+
/**
|
|
7216
|
+
* Update GIF textures each frame.
|
|
7217
|
+
* 每帧更新 GIF 纹理
|
|
7218
|
+
*
|
|
7219
|
+
* Note: Browsers animate GIFs automatically in <img> elements.
|
|
7220
|
+
* drawImage() draws the current frame of the animated GIF.
|
|
7221
|
+
* We just need to periodically redraw and flag texture update.
|
|
7222
|
+
*/
|
|
7223
|
+
private _updateGifTextures;
|
|
7224
|
+
/**
|
|
7225
|
+
* Build time labels using UIMarker.
|
|
7226
|
+
* 使用 UIMarker 构建时间标签
|
|
7227
|
+
*/
|
|
7228
|
+
private _buildTimeLabels;
|
|
7229
|
+
/**
|
|
7230
|
+
* Update all visuals to match current time.
|
|
7231
|
+
* 更新所有视觉元素以匹配当前时间
|
|
7232
|
+
*/
|
|
7233
|
+
private _updateVisuals;
|
|
7234
|
+
/**
|
|
7235
|
+
* Update marker position via interpolation.
|
|
7236
|
+
* 通过插值更新标记位置
|
|
7237
|
+
*/
|
|
7238
|
+
private _updateMarkerPosition;
|
|
7239
|
+
/**
|
|
7240
|
+
* Update the active trail line.
|
|
7241
|
+
* 更新已走轨迹线
|
|
7242
|
+
*/
|
|
7243
|
+
private _updateActiveLine;
|
|
7244
|
+
/**
|
|
7245
|
+
* Interpolate position at a given time offset.
|
|
7246
|
+
* 在给定时间偏移处插值位置
|
|
7247
|
+
*
|
|
7248
|
+
* @param timeMs Time offset from start (ms). 从起点开始的时间偏移
|
|
7249
|
+
* @returns Interpolated world position (relative to prjcenter). 插值世界坐标
|
|
7250
|
+
*/
|
|
7251
|
+
private _interpolatePosition;
|
|
7252
|
+
/**
|
|
7253
|
+
* Compute heading angle from trajectory direction.
|
|
7254
|
+
* 从轨迹方向计算航向角
|
|
7255
|
+
*/
|
|
7256
|
+
private _computeCurrentHeading;
|
|
7257
|
+
/**
|
|
7258
|
+
* Update camera for follow mode.
|
|
7259
|
+
* 更新相机跟随
|
|
7260
|
+
*
|
|
7261
|
+
* First-person: Camera behind the marker, nearly horizontal,
|
|
7262
|
+
* looking at the marker as it moves forward.
|
|
7263
|
+
* 第一视角:相机在控制点后方,接近水平,看着控制点前进。
|
|
7264
|
+
*
|
|
7265
|
+
* Third-person: Camera high above and behind, looking down at marker.
|
|
7266
|
+
* 第三视角:相机在控制点上方偏后,俯视控制点。
|
|
7267
|
+
*/
|
|
7268
|
+
private _updateCamera;
|
|
7269
|
+
/**
|
|
7270
|
+
* Dispose all visual elements.
|
|
7271
|
+
* 销毁所有视觉元素
|
|
7272
|
+
*/
|
|
7273
|
+
private _disposeAll;
|
|
7274
|
+
private _disposeTrailLine;
|
|
7275
|
+
private _disposeActiveLine;
|
|
7276
|
+
private _disposeMarker;
|
|
7277
|
+
private _disposeControlPoints;
|
|
7278
|
+
private _disposeTimeLabels;
|
|
7279
|
+
private _disposeGifStates;
|
|
7280
|
+
private _removeResizeHandler;
|
|
7281
|
+
/**
|
|
7282
|
+
* Emit a custom event.
|
|
7283
|
+
* 触发自定义事件
|
|
7284
|
+
*/
|
|
7285
|
+
private _emitEvent;
|
|
7286
|
+
/**
|
|
7287
|
+
* Destroy the layer and clean up all resources.
|
|
7288
|
+
* 销毁图层并清理所有资源
|
|
7289
|
+
*/
|
|
7290
|
+
destroy(): void;
|
|
7291
|
+
}
|
|
7292
|
+
|
|
7293
|
+
/**
|
|
7294
|
+
* TrajectoryLayer options.
|
|
7295
|
+
* 轨迹图层配置项
|
|
7296
|
+
* @category Layer
|
|
7297
|
+
*/
|
|
7298
|
+
export declare interface TrajectoryLayerOptions extends LayerOptions {
|
|
7299
|
+
/** Full trail line style. 完整轨迹线样式 */
|
|
7300
|
+
trailStyle?: TrailLineStyle;
|
|
7301
|
+
/** Active (traveled) trail line style. 已走轨迹线样式 */
|
|
7302
|
+
activeTrailStyle?: TrailLineStyle;
|
|
7303
|
+
/** Moving marker style. 移动标记样式 */
|
|
7304
|
+
markerStyle?: TrajectoryMarkerStyle;
|
|
7305
|
+
/** Whether to show control points. 是否显示控制点 */
|
|
7306
|
+
showControlPoints?: boolean;
|
|
7307
|
+
/** Control point style. 控制点样式 */
|
|
7308
|
+
controlPointStyle?: ControlPointStyle;
|
|
7309
|
+
/** Whether to show time labels. 是否显示时间标签 */
|
|
7310
|
+
showTimeLabels?: boolean;
|
|
7311
|
+
/** Custom time format function. 自定义时间格式化函数 */
|
|
7312
|
+
timeFormat?: (timestamp: number) => string;
|
|
7313
|
+
/** Custom time label HTML renderer. Returns full HTML string. 自定义时间标签渲染函数,返回完整 HTML */
|
|
7314
|
+
timeLabelContent?: (timestamp: number) => string;
|
|
7315
|
+
/** Initial playback speed multiplier. 初始播放速度 */
|
|
7316
|
+
speed?: number;
|
|
7317
|
+
/** Whether to loop playback. 是否循环播放 */
|
|
7318
|
+
loop?: boolean;
|
|
7319
|
+
/** Camera follow configuration. 相机跟随配置 */
|
|
7320
|
+
cameraFollow?: CameraFollowConfig;
|
|
7321
|
+
}
|
|
7322
|
+
|
|
7323
|
+
/**
|
|
7324
|
+
* Moving marker style configuration.
|
|
7325
|
+
* 移动标记样式配置
|
|
7326
|
+
* @category Layer
|
|
7327
|
+
*/
|
|
7328
|
+
declare interface TrajectoryMarkerStyle {
|
|
7329
|
+
/** Marker type: 'point' for sphere, 'icon' for sprite. */
|
|
7330
|
+
type?: 'point' | 'icon';
|
|
7331
|
+
/** Icon URL (for icon type). 图标地址 */
|
|
7332
|
+
url?: string;
|
|
7333
|
+
/** Marker size. 标记尺寸 */
|
|
7334
|
+
size?: number;
|
|
7335
|
+
/** Marker color (for point type). 标记颜色 */
|
|
7336
|
+
color?: string;
|
|
7337
|
+
/** Sprite anchor [x, y], 0-1 range. Default [0.5, 0.5] = center. [0.5, 0] = bottom-center. */
|
|
7338
|
+
anchor?: [number, number];
|
|
7339
|
+
}
|
|
7340
|
+
|
|
7341
|
+
/**
|
|
7342
|
+
* Trajectory point data.
|
|
7343
|
+
* 轨迹点数据
|
|
7344
|
+
* @category Layer
|
|
7345
|
+
*/
|
|
7346
|
+
export declare interface TrajectoryPoint {
|
|
7347
|
+
/** Geographic coordinate [lng, lat, alt?]. 地理坐标 */
|
|
7348
|
+
coordinate: [number, number, number?];
|
|
7349
|
+
/** Timestamp in milliseconds. 时间戳(毫秒) */
|
|
7350
|
+
timestamp: number;
|
|
7351
|
+
/** Extra metadata. 附加属性 */
|
|
7352
|
+
properties?: Record<string, any>;
|
|
7353
|
+
}
|
|
7354
|
+
|
|
6978
7355
|
/**
|
|
6979
7356
|
* Tile event map
|
|
6980
7357
|
* 瓦片事件映射
|