@terra.gl/core 0.0.1-alpha.44 → 0.0.1-alpha.46
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 +219 -2
- package/dist/index.js +39 -35
- package/dist/index.umd.cjs +18 -18
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { default as default_2 } from '../handler/Handler';
|
|
|
9
9
|
import { DirectionalLight } from 'three';
|
|
10
10
|
import { EventClass as EventClass_2 } from '..';
|
|
11
11
|
import { EventClass as EventClass_3 } from '../..';
|
|
12
|
+
import { EventClass as EventClass_4 } from '../core';
|
|
12
13
|
import { EventDispatcher } from 'three';
|
|
13
14
|
import { Group } from 'three';
|
|
14
15
|
import { Intersection } from 'three';
|
|
@@ -989,6 +990,10 @@ declare class EmptyBase {
|
|
|
989
990
|
constructor(..._args: any[]);
|
|
990
991
|
}
|
|
991
992
|
|
|
993
|
+
declare class EmptyBase_2 {
|
|
994
|
+
constructor(..._args: any[]);
|
|
995
|
+
}
|
|
996
|
+
|
|
992
997
|
/**
|
|
993
998
|
* 创建一个空基类(仅用于混入起点)
|
|
994
999
|
*/
|
|
@@ -1924,6 +1929,63 @@ export declare interface IconPointStyle extends BaseStyle {
|
|
|
1924
1929
|
sizeUnit?: 'pixels' | 'meters';
|
|
1925
1930
|
}
|
|
1926
1931
|
|
|
1932
|
+
/**
|
|
1933
|
+
* InfoWindow
|
|
1934
|
+
* @extends UIComponent
|
|
1935
|
+
*/
|
|
1936
|
+
export declare class InfoWindow extends UIComponent {
|
|
1937
|
+
options: InfoWindowOptions;
|
|
1938
|
+
private _titleEl?;
|
|
1939
|
+
private _contentEl?;
|
|
1940
|
+
constructor(options: InfoWindowOptions);
|
|
1941
|
+
protected _getClassName(): string;
|
|
1942
|
+
/**
|
|
1943
|
+
* 构建 InfoWindow 的 DOM 结构
|
|
1944
|
+
*/
|
|
1945
|
+
protected buildOn(): HTMLElement;
|
|
1946
|
+
protected getOffset(): {
|
|
1947
|
+
x: number;
|
|
1948
|
+
y: number;
|
|
1949
|
+
};
|
|
1950
|
+
/**
|
|
1951
|
+
* 计算 Sprite 在屏幕上的实际像素高度
|
|
1952
|
+
*/
|
|
1953
|
+
private _getSpriteScreenHeight;
|
|
1954
|
+
/**
|
|
1955
|
+
* 设置标题
|
|
1956
|
+
*/
|
|
1957
|
+
setTitle(title?: string): this;
|
|
1958
|
+
/**
|
|
1959
|
+
* 设置内容
|
|
1960
|
+
*/
|
|
1961
|
+
setContent(content: string | HTMLElement): this;
|
|
1962
|
+
/**
|
|
1963
|
+
* 打开 InfoWindow(语义上等价于 show)
|
|
1964
|
+
* @param coordinate 可选地理坐标,不传则使用 owner 的中心 / 地图中心
|
|
1965
|
+
*/
|
|
1966
|
+
open(coordinate?: Coordinate): this;
|
|
1967
|
+
/**
|
|
1968
|
+
* 关闭 InfoWindow(语义上等价于 hide)
|
|
1969
|
+
*/
|
|
1970
|
+
close(): this;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
/**
|
|
1974
|
+
* InfoWindow 配置项
|
|
1975
|
+
*/
|
|
1976
|
+
declare type InfoWindowOptions = UIComponentOptions & {
|
|
1977
|
+
/** 标题文本 */
|
|
1978
|
+
title?: string;
|
|
1979
|
+
/** 内容,可以是 HTML 字符串或 HTMLElement */
|
|
1980
|
+
content?: string | HTMLElement;
|
|
1981
|
+
/** 最小宽度 */
|
|
1982
|
+
minWidth?: number;
|
|
1983
|
+
/** 最小高度 */
|
|
1984
|
+
minHeight?: number;
|
|
1985
|
+
/** 自定义模式:true 时不渲染默认标题栏/内容框,直接使用用户提供的 DOM/HTML */
|
|
1986
|
+
custom?: boolean;
|
|
1987
|
+
};
|
|
1988
|
+
|
|
1927
1989
|
/**
|
|
1928
1990
|
* 投影接口
|
|
1929
1991
|
* @description 定义地图投影系统的基本功能和方法
|
|
@@ -2629,9 +2691,9 @@ export declare class LineString extends Line {
|
|
|
2629
2691
|
export declare type LineStringOptions = LineOptions & {};
|
|
2630
2692
|
|
|
2631
2693
|
/**
|
|
2632
|
-
*
|
|
2694
|
+
* 线样式联合类型
|
|
2633
2695
|
*/
|
|
2634
|
-
export declare type LineStyle = BaseLineStyle | PipelineStyle | FlowLineStyle | FlowTextureLineStyle;
|
|
2696
|
+
export declare type LineStyle = BaseLineStyle | PipelineStyle | FlowLineStyle | FlowTextureLineStyle | ArrowLineStyle;
|
|
2635
2697
|
|
|
2636
2698
|
/**
|
|
2637
2699
|
* Factory for loader
|
|
@@ -5251,6 +5313,155 @@ declare class Map extends Map_base {
|
|
|
5251
5313
|
*/
|
|
5252
5314
|
declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
5253
5315
|
|
|
5316
|
+
/**
|
|
5317
|
+
* 抽象目标:
|
|
5318
|
+
* - 挂到 Map 或 Feature 上(addTo)
|
|
5319
|
+
* - 内部管理 DOM 生命周期(buildOn / remove)
|
|
5320
|
+
* - 根据世界坐标 + 相机,将 DOM 定位到屏幕坐标
|
|
5321
|
+
* - 监听地图视图变化(control-change)时更新位置
|
|
5322
|
+
*/
|
|
5323
|
+
export declare abstract class UIComponent extends UIComponent_base {
|
|
5324
|
+
/** 组件配置 */
|
|
5325
|
+
options: UIComponentOptions;
|
|
5326
|
+
/** 所属对象:Map 或 Feature */
|
|
5327
|
+
protected _owner?: any;
|
|
5328
|
+
/** 所属地图实例 */
|
|
5329
|
+
protected _map?: Map_2;
|
|
5330
|
+
/** 当前使用的世界坐标 */
|
|
5331
|
+
protected _worldPosition?: Vector3;
|
|
5332
|
+
/** 如果通过 show(coordinate) 传入了坐标,这里记录下来 */
|
|
5333
|
+
private _coordinate?;
|
|
5334
|
+
/** 对应的 DOM 元素 */
|
|
5335
|
+
protected _dom?: HTMLElement;
|
|
5336
|
+
/** 当前是否可见 */
|
|
5337
|
+
protected _visible: boolean;
|
|
5338
|
+
/** 绑定到 Map 的事件处理缓存,便于 off 时移除 */
|
|
5339
|
+
private _boundMapHandlers;
|
|
5340
|
+
/** 绑定到 Viewer 的 update 事件处理函数 */
|
|
5341
|
+
private _viewerUpdateHandler?;
|
|
5342
|
+
/** 是否已经完成过一次位置计算(用于避免第一次错误位置闪一下) */
|
|
5343
|
+
private _positionedOnce;
|
|
5344
|
+
/** 同一张地图上的“single”组件集合,用于互斥显示 */
|
|
5345
|
+
private static _singletons;
|
|
5346
|
+
constructor(options?: UIComponentOptions);
|
|
5347
|
+
/**
|
|
5348
|
+
* 子类必须实现:构建自身 DOM
|
|
5349
|
+
*/
|
|
5350
|
+
protected abstract buildOn(): HTMLElement;
|
|
5351
|
+
/**
|
|
5352
|
+
* 子类可选:用于调试和样式区分
|
|
5353
|
+
*/
|
|
5354
|
+
protected _getClassName(): string;
|
|
5355
|
+
/**
|
|
5356
|
+
* 子类可选:额外偏移
|
|
5357
|
+
*/
|
|
5358
|
+
protected getOffset(): {
|
|
5359
|
+
x: number;
|
|
5360
|
+
y: number;
|
|
5361
|
+
};
|
|
5362
|
+
/**
|
|
5363
|
+
* 生命周期钩子:addTo 时调用
|
|
5364
|
+
*/
|
|
5365
|
+
protected onAdd?(): void;
|
|
5366
|
+
/**
|
|
5367
|
+
* 生命周期钩子:remove 时调用
|
|
5368
|
+
*/
|
|
5369
|
+
protected onRemove?(): void;
|
|
5370
|
+
/**
|
|
5371
|
+
* 生命周期钩子:DOM 从容器移除时调用
|
|
5372
|
+
*/
|
|
5373
|
+
protected onDomRemove?(): void;
|
|
5374
|
+
/**
|
|
5375
|
+
* 将 UIComponent 添加到 Map 或 Feature 上
|
|
5376
|
+
* @param owner Map 或 Feature
|
|
5377
|
+
*/
|
|
5378
|
+
addTo(owner: any): this;
|
|
5379
|
+
/**
|
|
5380
|
+
* 从所属 Map / Feature 移除 UIComponent
|
|
5381
|
+
*/
|
|
5382
|
+
remove(): this;
|
|
5383
|
+
/**
|
|
5384
|
+
* 显示 UIComponent
|
|
5385
|
+
* @param coordinate 地理坐标([lng, lat, alt]),可选
|
|
5386
|
+
*/
|
|
5387
|
+
show(coordinate?: Coordinate): this;
|
|
5388
|
+
/**
|
|
5389
|
+
* 隐藏 UIComponent(保留 DOM,不解绑)
|
|
5390
|
+
*/
|
|
5391
|
+
hide(): this;
|
|
5392
|
+
/**
|
|
5393
|
+
* 移除 DOM(remove 时调用)
|
|
5394
|
+
*/
|
|
5395
|
+
hideDom(): this;
|
|
5396
|
+
/**
|
|
5397
|
+
* 获取所属 Map
|
|
5398
|
+
*/
|
|
5399
|
+
getMap(): Map_2 | undefined;
|
|
5400
|
+
/**
|
|
5401
|
+
* 当前是否可见(show 状态)
|
|
5402
|
+
*/
|
|
5403
|
+
isVisible(): boolean;
|
|
5404
|
+
/**
|
|
5405
|
+
* 内部:绑定 / 解绑地图事件
|
|
5406
|
+
*/
|
|
5407
|
+
private _bindMapEvents;
|
|
5408
|
+
/**
|
|
5409
|
+
* 内部:根据地理坐标 / owner 推导世界坐标
|
|
5410
|
+
* 保证统一走 map.geo2world,从而保持 altitude / center 单位统一
|
|
5411
|
+
*/
|
|
5412
|
+
private _resolveWorldPosition;
|
|
5413
|
+
/**
|
|
5414
|
+
* 内部:根据世界坐标更新 DOM 位置
|
|
5415
|
+
*/
|
|
5416
|
+
protected _updatePosition(): void;
|
|
5417
|
+
}
|
|
5418
|
+
|
|
5419
|
+
declare const UIComponent_base: {
|
|
5420
|
+
new (...args: any[]): {
|
|
5421
|
+
eventClass: EventClass_4;
|
|
5422
|
+
on: (type: string, listener: (data?: any) => void) => EventClass_4;
|
|
5423
|
+
trigger: (type: string, data?: any) => EventClass_4;
|
|
5424
|
+
off: (type: string, listener: (...args: any[]) => void) => EventClass_4;
|
|
5425
|
+
};
|
|
5426
|
+
} & {
|
|
5427
|
+
new (...args: any[]): {
|
|
5428
|
+
[x: string]: any;
|
|
5429
|
+
options: any;
|
|
5430
|
+
_isUpdatingOptions?: boolean;
|
|
5431
|
+
_initHooksCalled?: boolean;
|
|
5432
|
+
_initHooks?: Function[];
|
|
5433
|
+
proxyOptions(): /*elided*/ any;
|
|
5434
|
+
callInitHooks(): /*elided*/ any;
|
|
5435
|
+
setOptions(options: ClassOptions_2): /*elided*/ any;
|
|
5436
|
+
config(conf?: string | ClassOptions_2, value?: any): ClassOptions_2 | /*elided*/ any;
|
|
5437
|
+
onConfig(_conf: ClassOptions_2): void;
|
|
5438
|
+
_visitInitHooks(proto: {
|
|
5439
|
+
_initHooks: any;
|
|
5440
|
+
}): void;
|
|
5441
|
+
};
|
|
5442
|
+
mergeOptions(options: ClassOptions_2): /*elided*/ any & typeof EmptyBase_2;
|
|
5443
|
+
addInitHook(fn: Function | string, ...args: any[]): /*elided*/ any & typeof EmptyBase_2;
|
|
5444
|
+
include(...sources: any[]): /*elided*/ any & typeof EmptyBase_2;
|
|
5445
|
+
} & typeof EmptyBase_2;
|
|
5446
|
+
|
|
5447
|
+
/**
|
|
5448
|
+
* UI 组件配置项
|
|
5449
|
+
*/
|
|
5450
|
+
declare type UIComponentOptions = ClassOptions_2 & {
|
|
5451
|
+
/** DOM 容器 class,可为 string 或 string[] */
|
|
5452
|
+
containerClass?: string | string[];
|
|
5453
|
+
/** X 方向像素偏移(右为正) */
|
|
5454
|
+
dx?: number;
|
|
5455
|
+
/** Y 方向像素偏移(下为正) */
|
|
5456
|
+
dy?: number;
|
|
5457
|
+
/** 是否默认可见 */
|
|
5458
|
+
visible?: boolean;
|
|
5459
|
+
/** 是否为同一张地图上的全局唯一组件(同类只显示一个) */
|
|
5460
|
+
single?: boolean;
|
|
5461
|
+
/** DOM zIndex */
|
|
5462
|
+
zIndex?: number;
|
|
5463
|
+
};
|
|
5464
|
+
|
|
5254
5465
|
/**
|
|
5255
5466
|
* 将_Vector2格式的瓦片坐标转换为WGS84经纬度
|
|
5256
5467
|
* @param vector2 - 包含x, y属性的坐标对象 {x: 1536, y: 4176}
|
|
@@ -5614,6 +5825,8 @@ declare class Map extends Map_base {
|
|
|
5614
5825
|
private _createCamera;
|
|
5615
5826
|
/**
|
|
5616
5827
|
* 创建地图控制器
|
|
5828
|
+
* @param minDistance 最小缩放距离
|
|
5829
|
+
* @param maxDistance 最大缩放距离
|
|
5617
5830
|
* @returns 控制器对象
|
|
5618
5831
|
*/
|
|
5619
5832
|
private _createControls;
|
|
@@ -5827,6 +6040,10 @@ declare class Map extends Map_base {
|
|
|
5827
6040
|
/** 触发辉光的亮度阈值,对应 UnrealBloomPass 的 threshold */
|
|
5828
6041
|
threshold?: number;
|
|
5829
6042
|
};
|
|
6043
|
+
/** 控制器最小缩放距离(相机能靠多近),默认为 100 */
|
|
6044
|
+
minDistance?: number;
|
|
6045
|
+
/** 控制器最大缩放距离(相机能拉多远),默认为 60000 */
|
|
6046
|
+
maxDistance?: number;
|
|
5830
6047
|
};
|
|
5831
6048
|
|
|
5832
6049
|
export declare function waitFor(condition: boolean, delay?: number): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as pt from "three";
|
|
2
2
|
import { REVISION as qd, TrianglesDrawMode as k_, TriangleFanDrawMode as Kl, TriangleStripDrawMode as ef, Mesh as Ie, Vector3 as O, Color as ce, FrontSide as jo, Plane as tf, Matrix4 as Me, Vector4 as yn, PerspectiveCamera as jr, WebGLRenderTarget as xi, UniformsUtils as $r, UniformsLib as No, ShaderMaterial as Zn, MOUSE as cr, TOUCH as ur, Spherical as Bh, Quaternion as fn, OrthographicCamera as Ti, Vector2 as de, Ray as U_, PlaneGeometry as Jr, HalfFloatType as Ur, AdditiveBlending as oc, MeshBasicMaterial as pn, RGBAFormat as nf, LinearFilter as vr, NoBlending as N_, Clock as Jo, Loader as ac, LoaderUtils as Si, FileLoader as wr, MeshPhysicalMaterial as Gn, SpotLight as rf, PointLight as kl, DirectionalLight as Yo, InstancedMesh as lc, InstancedBufferAttribute as Ul, Object3D as mn, TextureLoader as Qo, ImageBitmapLoader as Y_, BufferAttribute as xt, InterleavedBuffer as H_, InterleavedBufferAttribute as Nr, LinearMipmapLinearFilter as bs, NearestMipmapLinearFilter as B_, LinearMipmapNearestFilter as j_, NearestMipmapNearestFilter as J_, NearestFilter as sf, RepeatWrapping as vn, MirroredRepeatWrapping as Q_, ClampToEdgeWrapping as Nl, PointsMaterial as $o, Material as yl, LineBasicMaterial as of, MeshStandardMaterial as xs, DoubleSide as Wi, PropertyBinding as ws, BufferGeometry as en, SkinnedMesh as af, LineSegments as $_, Line as lf, LineLoop as q_, Points as Gi, Group as gn, MathUtils as yt, Skeleton as cf, AnimationClip as uf, Bone as Yl, InterpolateDiscrete as eb, InterpolateLinear as hf, Texture as Zi, VectorKeyframeTrack as Hl, NumberKeyframeTrack as Bl, QuaternionKeyframeTrack as jl, Interpolant as tb, Box3 as qr, Sphere as cc, Curve as nb, MeshPhongMaterial as gs, MeshLambertMaterial as df, EquirectangularReflectionMapping as rb, AmbientLight as ff, Float32BufferAttribute as hr, Uint16BufferAttribute as ib, Matrix3 as sb, Euler as us, DataTextureLoader as ob, FloatType as Ko, DataUtils as _o, InstancedBufferGeometry as pf, InstancedInterleavedBuffer as Jl, WireframeGeometry as ab, Line3 as lb, EventDispatcher as mf, Scene as cb, FogExp2 as jh, CubeTextureLoader as ub, WebGLRenderer as hb, PCFSoftShadowMap as db, ACESFilmicToneMapping as fb, SRGBColorSpace as qo, CameraHelper as pb, CubicBezierCurve3 as mb, Frustum as gb, Raycaster as uc, CanvasTexture as Ts, SpriteMaterial as Ss, Sprite as ei, DynamicDrawUsage as Jh, NormalBlending as gf, CurvePath as yf, LineCurve3 as Li, QuadraticBezierCurve3 as vf, TubeGeometry as yb, BackSide as vb, Shape as wb, ShapeGeometry as _b, CylinderGeometry as bb, AnimationMixer as xb, LoopRepeat as Tb, LoopOnce as Sb, LoadingManager as Lb, Box2 as Mb, ImageLoader as wf } from "three";
|
|
3
|
-
const Pb = "0.0.1-alpha.
|
|
3
|
+
const Pb = "0.0.1-alpha.46", vl = {
|
|
4
4
|
name: "Criska"
|
|
5
5
|
};
|
|
6
6
|
var ys = function() {
|
|
@@ -6199,33 +6199,33 @@ class P1 extends mf {
|
|
|
6199
6199
|
* @param options 配置选项
|
|
6200
6200
|
*/
|
|
6201
6201
|
constructor(e, t = {}) {
|
|
6202
|
-
super(), Fe(this, "scene"), Fe(this, "renderer"), Fe(this, "camera"), Fe(this, "controls"), Fe(this, "ambLight"), Fe(this, "dirLight"), Fe(this, "auxDirLight"), Fe(this, "clouds", null), Fe(this, "container"), Fe(this, "_clock", new Jo()), Fe(this, "stats"), Fe(this, "_animationCallbacks", /* @__PURE__ */ new Set()), Fe(this, "_fogFactor", 1), Fe(this, "_sceneSize", 5e4 * 2), Fe(this, "gorund"), Fe(this, "map"), Fe(this, "centerPostion"), Fe(this, "_isInteracting", !1), Fe(this, "debug", !1), Fe(this, "flyTween", null), Fe(this, "composer"), Fe(this, "renderPass"), Fe(this, "bloomPass"), Fe(this, "calculateCameraPosition", (
|
|
6203
|
-
const
|
|
6202
|
+
super(), Fe(this, "scene"), Fe(this, "renderer"), Fe(this, "camera"), Fe(this, "controls"), Fe(this, "ambLight"), Fe(this, "dirLight"), Fe(this, "auxDirLight"), Fe(this, "clouds", null), Fe(this, "container"), Fe(this, "_clock", new Jo()), Fe(this, "stats"), Fe(this, "_animationCallbacks", /* @__PURE__ */ new Set()), Fe(this, "_fogFactor", 1), Fe(this, "_sceneSize", 5e4 * 2), Fe(this, "gorund"), Fe(this, "map"), Fe(this, "centerPostion"), Fe(this, "_isInteracting", !1), Fe(this, "debug", !1), Fe(this, "flyTween", null), Fe(this, "composer"), Fe(this, "renderPass"), Fe(this, "bloomPass"), Fe(this, "calculateCameraPosition", (f, g, y, w) => {
|
|
6203
|
+
const _ = new O(
|
|
6204
6204
|
0,
|
|
6205
6205
|
// X分量
|
|
6206
|
-
|
|
6206
|
+
g * Math.cos(y),
|
|
6207
6207
|
// Y分量
|
|
6208
|
-
|
|
6208
|
+
g * Math.sin(y)
|
|
6209
6209
|
// Z分量 <-- 这里改成正号
|
|
6210
6210
|
);
|
|
6211
|
-
return
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6211
|
+
return _.applyAxisAngle(new O(0, 1, 0), w), new O(
|
|
6212
|
+
f.x + _.x,
|
|
6213
|
+
f.y + _.y,
|
|
6214
|
+
f.z + _.z
|
|
6215
6215
|
);
|
|
6216
6216
|
});
|
|
6217
|
-
const { antialias: n = !1, stencil: r = !0, logarithmicDepthBuffer: o = !0, skybox: l, map: c, bloom: u } = t;
|
|
6218
|
-
if (this.map = c, this.centerPostion = this.map.geo2world(new O(this.map.center[0], this.map.center[1], 0)), this.renderer = this._createRenderer(n, r, o), this.scene = this._createScene(l), this.camera = this._createCamera(), e && this.addTo(e), this.controls = this._createControls(), this.ambLight = this._createAmbLight(), this.scene.add(this.ambLight), this.dirLight = this._createDirLight(), this.scene.add(this.dirLight), this.scene.add(this.dirLight.target), this.auxDirLight = this._createAuxDirLight(), this.gorund = this._createGorund(), this.scene.add(this.gorund), u && u.enabled) {
|
|
6219
|
-
const
|
|
6217
|
+
const { antialias: n = !1, stencil: r = !0, logarithmicDepthBuffer: o = !0, skybox: l, map: c, bloom: u, minDistance: d, maxDistance: p } = t;
|
|
6218
|
+
if (this.map = c, this.centerPostion = this.map.geo2world(new O(this.map.center[0], this.map.center[1], 0)), this.renderer = this._createRenderer(n, r, o), this.scene = this._createScene(l), this.camera = this._createCamera(), e && this.addTo(e), this.controls = this._createControls(d, p), this.ambLight = this._createAmbLight(), this.scene.add(this.ambLight), this.dirLight = this._createDirLight(), this.scene.add(this.dirLight), this.scene.add(this.dirLight.target), this.auxDirLight = this._createAuxDirLight(), this.gorund = this._createGorund(), this.scene.add(this.gorund), u && u.enabled) {
|
|
6219
|
+
const f = this.renderer.getPixelRatio(), g = this.container ? this.width : window.innerWidth, y = this.container ? this.height : window.innerHeight, w = g * f, _ = y * f, b = new xi(w, _, {
|
|
6220
6220
|
format: nf
|
|
6221
6221
|
});
|
|
6222
|
-
|
|
6223
|
-
const
|
|
6222
|
+
b.samples = 4, this.composer = new hx(this.renderer, b), this.renderPass = new px(this.scene, this.camera), this.composer.addPass(this.renderPass);
|
|
6223
|
+
const S = u?.strength ?? 1.5, x = u?.radius ?? 1, M = u?.threshold ?? 0.7;
|
|
6224
6224
|
this.bloomPass = new sx(
|
|
6225
|
-
new de(
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6225
|
+
new de(w, _),
|
|
6226
|
+
S,
|
|
6227
|
+
x,
|
|
6228
|
+
M
|
|
6229
6229
|
), this.composer.addPass(this.bloomPass);
|
|
6230
6230
|
}
|
|
6231
6231
|
this.renderer.setAnimationLoop(this.animate.bind(this)), this.debug = t.debug || !1, this.flyTween = null, this.debug && (this.stats = new ys(), document.body.appendChild(this.stats.dom));
|
|
@@ -6379,37 +6379,39 @@ class P1 extends mf {
|
|
|
6379
6379
|
}
|
|
6380
6380
|
/**
|
|
6381
6381
|
* 创建地图控制器
|
|
6382
|
+
* @param minDistance 最小缩放距离
|
|
6383
|
+
* @param maxDistance 最大缩放距离
|
|
6382
6384
|
* @returns 控制器对象
|
|
6383
6385
|
*/
|
|
6384
|
-
_createControls() {
|
|
6385
|
-
const
|
|
6386
|
-
return
|
|
6387
|
-
const
|
|
6388
|
-
|
|
6389
|
-
const
|
|
6390
|
-
|
|
6391
|
-
const
|
|
6392
|
-
|
|
6386
|
+
_createControls(e, t) {
|
|
6387
|
+
const n = new Qb(this.camera, this.renderer.domElement), r = Math.PI / 2.1;
|
|
6388
|
+
return n.screenSpacePanning = !1, n.minDistance = e ?? 0.1, n.maxDistance = t ?? 6e4, n.maxPolarAngle = r, n.enableDamping = !0, n.dampingFactor = 0.08, n.keyPanSpeed = 1, n.listenToKeyEvents(this.renderer.domElement), n.addEventListener("change", () => {
|
|
6389
|
+
const o = Math.max(n.getPolarAngle(), 0.1), l = Math.max(n.getDistance(), 100);
|
|
6390
|
+
n.zoomSpeed = Math.max(Math.log(l / 1e3), 1) + 3;
|
|
6391
|
+
const c = 3e5 * 2;
|
|
6392
|
+
n.maxDistance > c * 0.95 && (n.maxDistance = c * 0.95), this.camera.far = yt.clamp(l / o * 8, 100, c), this.camera.near = yt.clamp(this.camera.far / 1e3, 1e-3, 1), this.camera.updateProjectionMatrix(), this.scene.fog instanceof jh && (this.scene.fog.density = o / (l + 5) * this.fogFactor * 0.1);
|
|
6393
|
+
const d = l > 6e4;
|
|
6394
|
+
n.minAzimuthAngle = d ? 0 : -1 / 0, n.maxAzimuthAngle = d ? 0 : 1 / 0, n.maxPolarAngle = S1(n.getDistance(), 0, 7e4, r, 0), this.map?.trigger("control-change", {
|
|
6393
6395
|
type: "control-change",
|
|
6394
|
-
control:
|
|
6396
|
+
control: n,
|
|
6395
6397
|
camera: this.camera,
|
|
6396
6398
|
target: this.map
|
|
6397
6399
|
});
|
|
6398
|
-
}),
|
|
6400
|
+
}), n.addEventListener("start", () => {
|
|
6399
6401
|
this._isInteracting = !0, this.map?.trigger("control-start", {
|
|
6400
6402
|
type: "control-start",
|
|
6401
|
-
control:
|
|
6403
|
+
control: n,
|
|
6402
6404
|
camera: this.camera,
|
|
6403
6405
|
target: this.map
|
|
6404
6406
|
});
|
|
6405
|
-
}),
|
|
6407
|
+
}), n.addEventListener("end", () => {
|
|
6406
6408
|
this._isInteracting = !1, this.map?.trigger("control-end", {
|
|
6407
6409
|
type: "control-end",
|
|
6408
|
-
control:
|
|
6410
|
+
control: n,
|
|
6409
6411
|
camera: this.camera,
|
|
6410
6412
|
target: this.map
|
|
6411
6413
|
});
|
|
6412
|
-
}),
|
|
6414
|
+
}), n;
|
|
6413
6415
|
}
|
|
6414
6416
|
/**
|
|
6415
6417
|
* 创建环境光
|
|
@@ -17219,7 +17221,7 @@ function lM(i, e) {
|
|
|
17219
17221
|
}
|
|
17220
17222
|
const cM = `{
|
|
17221
17223
|
"name": "@terra.gl/core",
|
|
17222
|
-
"version": "0.0.1-alpha.
|
|
17224
|
+
"version": "0.0.1-alpha.46",
|
|
17223
17225
|
"type": "module",
|
|
17224
17226
|
"files": [
|
|
17225
17227
|
"dist"
|
|
@@ -20376,7 +20378,7 @@ let Ei = class yp extends pc(
|
|
|
20376
20378
|
let y = g.object, w = null;
|
|
20377
20379
|
for (; y; ) {
|
|
20378
20380
|
if (y instanceof Nn) {
|
|
20379
|
-
w = y;
|
|
20381
|
+
w = y, console.log(w, "feature ------------------- ");
|
|
20380
20382
|
break;
|
|
20381
20383
|
}
|
|
20382
20384
|
y = y.parent;
|
|
@@ -21831,6 +21833,7 @@ export {
|
|
|
21831
21833
|
Cs as DrawTool,
|
|
21832
21834
|
_d as EventClass,
|
|
21833
21835
|
pL as ICloud,
|
|
21836
|
+
jd as InfoWindow,
|
|
21834
21837
|
wL as Label,
|
|
21835
21838
|
RP as LineLayer,
|
|
21836
21839
|
Pi as LineString,
|
|
@@ -21863,6 +21866,7 @@ export {
|
|
|
21863
21866
|
cp as TileMaterial,
|
|
21864
21867
|
up as TileMaterialLoader,
|
|
21865
21868
|
Rn as TileSource,
|
|
21869
|
+
G2 as UIComponent,
|
|
21866
21870
|
gt as VectorFeatureTypes,
|
|
21867
21871
|
Yd as VectorTileLayer,
|
|
21868
21872
|
eM as VectorTileRender,
|