@yituengine/keymap 1.0.0
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/LICENSE +201 -0
- package/README.md +148 -0
- package/dist/engine.js +1 -0
- package/dist/types/core/Assets.d.ts +11 -0
- package/dist/types/core/Classification.d.ts +17 -0
- package/dist/types/core/Flatten.d.ts +74 -0
- package/dist/types/core/Status.d.ts +3 -0
- package/dist/types/core/pathAnim.d.ts +27 -0
- package/dist/types/core/transformFun.d.ts +16 -0
- package/dist/types/draw/baseDraw.d.ts +74 -0
- package/dist/types/draw/drawCircle.d.ts +44 -0
- package/dist/types/draw/drawPoint.d.ts +30 -0
- package/dist/types/draw/drawPolygon.d.ts +35 -0
- package/dist/types/draw/drawPolyline.d.ts +35 -0
- package/dist/types/draw/index.d.ts +17 -0
- package/dist/types/effect/cloud.d.ts +34 -0
- package/dist/types/effect/fog.d.ts +44 -0
- package/dist/types/effect/fogPro.d.ts +46 -0
- package/dist/types/effect/index.d.ts +32 -0
- package/dist/types/effect/lensflare.d.ts +38 -0
- package/dist/types/effect/rainy.d.ts +47 -0
- package/dist/types/effect/snowCover.d.ts +50 -0
- package/dist/types/effect/snowFall.d.ts +38 -0
- package/dist/types/event/index.d.ts +12 -0
- package/dist/types/event/menu.d.ts +110 -0
- package/dist/types/event/mousePick.d.ts +57 -0
- package/dist/types/graphic/baseGraphic.d.ts +131 -0
- package/dist/types/graphic/billboardGraphic.d.ts +75 -0
- package/dist/types/graphic/circleGraphic.d.ts +103 -0
- package/dist/types/graphic/customPopupGraphic.d.ts +75 -0
- package/dist/types/graphic/index.d.ts +32 -0
- package/dist/types/graphic/modelGraphic.d.ts +90 -0
- package/dist/types/graphic/polygonGraphic.d.ts +124 -0
- package/dist/types/graphic/polylineGraphic.d.ts +100 -0
- package/dist/types/graphic/popupGraphic.d.ts +85 -0
- package/dist/types/layer/graphicLayer.d.ts +96 -0
- package/dist/types/layer/heatmapLayer/heatmapRenderer.d.ts +39 -0
- package/dist/types/layer/heatmapLayer.d.ts +113 -0
- package/dist/types/layer/index.d.ts +14 -0
- package/dist/types/layer/tilesetLayer.d.ts +107 -0
- package/dist/types/main.d.ts +68 -0
- package/dist/types/map/defaultInteractions.d.ts +26 -0
- package/dist/types/map/index.d.ts +254 -0
- package/dist/types/material/LightingFlow.d.ts +63 -0
- package/dist/types/material/PolylineDashed.d.ts +68 -0
- package/dist/types/material/TextureFlow.d.ts +94 -0
- package/dist/types/material/Wave.d.ts +75 -0
- package/dist/types/material/index.d.ts +20 -0
- package/dist/types/measure/baseMeasure.d.ts +93 -0
- package/dist/types/measure/index.d.ts +18 -0
- package/dist/types/measure/measureArea.d.ts +46 -0
- package/dist/types/measure/measureCutFill.d.ts +69 -0
- package/dist/types/measure/measureDistance.d.ts +50 -0
- package/dist/types/measure/measureHeight.d.ts +47 -0
- package/dist/types/primitive/ClassificationPrimitive.d.ts +72 -0
- package/dist/types/primitive/Tube.d.ts +38 -0
- package/dist/types/primitive/Wall.d.ts +47 -0
- package/dist/types/primitive/basePrimitive.d.ts +42 -0
- package/dist/types/primitive/index.d.ts +16 -0
- package/dist/types/types/general.d.ts +94 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/public.d.ts +11 -0
- package/dist/types/utils/CoordTransform.d.ts +26 -0
- package/dist/types/utils/controlPoint.d.ts +10 -0
- package/dist/types/utils/cutFillAnalysis.d.ts +38 -0
- package/dist/types/utils/graphic.d.ts +45 -0
- package/dist/types/utils/midPoint.d.ts +11 -0
- package/dist/types/utils/rightMenu.d.ts +1 -0
- package/dist/types/utils/tools.d.ts +38 -0
- package/docs/guide/draw-measure.md +97 -0
- package/docs/guide/graphic.md +136 -0
- package/docs/guide/index.md +29 -0
- package/docs/guide/menu.md +101 -0
- package/docs/guide/quick-start.md +74 -0
- package/package.json +58 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Asset } from '../types';
|
|
2
|
+
export default class Assets {
|
|
3
|
+
private collection;
|
|
4
|
+
constructor();
|
|
5
|
+
add(asset: Asset): void;
|
|
6
|
+
getById(id?: string): Asset | undefined;
|
|
7
|
+
removeAll(): boolean;
|
|
8
|
+
removeById(id: string): boolean;
|
|
9
|
+
detach(id: string): boolean;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TilesetLayer } from '../layer';
|
|
2
|
+
interface IClpInfo {
|
|
3
|
+
id: string;
|
|
4
|
+
coordinates: number[];
|
|
5
|
+
maxHeight: number;
|
|
6
|
+
minHeight: number;
|
|
7
|
+
}
|
|
8
|
+
export default class Classification {
|
|
9
|
+
layer: TilesetLayer;
|
|
10
|
+
areasId: string[];
|
|
11
|
+
focus: string | null;
|
|
12
|
+
constructor(layer: TilesetLayer);
|
|
13
|
+
add(clpInfo: IClpInfo | IClpInfo[]): void;
|
|
14
|
+
removeById(id: string): void;
|
|
15
|
+
removeAll(): void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { GeojsonCoordinate } from '../types';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
interface ShaderBlock {
|
|
4
|
+
id: string;
|
|
5
|
+
text: string;
|
|
6
|
+
display: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 3dtiles模型压平
|
|
10
|
+
*/
|
|
11
|
+
declare class Flatten {
|
|
12
|
+
tileset: Cesium.Cesium3DTileset;
|
|
13
|
+
center: Cesium.Cartesian3;
|
|
14
|
+
matrix: Cesium.Matrix4;
|
|
15
|
+
localMatrix: Cesium.Matrix4;
|
|
16
|
+
localPositionsArr: GeojsonCoordinate[][];
|
|
17
|
+
shaderArr: ShaderBlock[];
|
|
18
|
+
constructor(tileset: Cesium.Cesium3DTileset);
|
|
19
|
+
/**
|
|
20
|
+
* 添加压平面
|
|
21
|
+
* @param {Object} [opt] 参数
|
|
22
|
+
* @param {Cesium.Cartesian3[]} [opt.positions] 压平面坐标
|
|
23
|
+
* @param {Number} [opt.height] 压平深度
|
|
24
|
+
*/
|
|
25
|
+
add(opt: {
|
|
26
|
+
id?: string;
|
|
27
|
+
positions: Cesium.Cartesian3[];
|
|
28
|
+
height?: number;
|
|
29
|
+
}): void;
|
|
30
|
+
/**
|
|
31
|
+
* 根据id或下标 删除压平的区域,优先以id
|
|
32
|
+
* @param {Object} [opt]
|
|
33
|
+
* @param {string} [opt.id] 唯一标识
|
|
34
|
+
* @param {number} [opt.index] 指定下标
|
|
35
|
+
*/
|
|
36
|
+
remove(opt: {
|
|
37
|
+
id: string;
|
|
38
|
+
index?: never;
|
|
39
|
+
} | {
|
|
40
|
+
id: never;
|
|
41
|
+
index: number;
|
|
42
|
+
}): void;
|
|
43
|
+
/**
|
|
44
|
+
* 隐藏全部选区
|
|
45
|
+
*/
|
|
46
|
+
hide(): void;
|
|
47
|
+
/**
|
|
48
|
+
* 显示全部选区
|
|
49
|
+
*/
|
|
50
|
+
show(): void;
|
|
51
|
+
/**
|
|
52
|
+
* 清空全部 选区 与 着色器块组
|
|
53
|
+
*/
|
|
54
|
+
destroy(): void;
|
|
55
|
+
findShader(opt: {
|
|
56
|
+
id: string;
|
|
57
|
+
index?: never;
|
|
58
|
+
} | {
|
|
59
|
+
id?: never;
|
|
60
|
+
index: number;
|
|
61
|
+
}): {
|
|
62
|
+
shaderObj: ShaderBlock;
|
|
63
|
+
index: number;
|
|
64
|
+
} | null;
|
|
65
|
+
createShaderText(): {
|
|
66
|
+
vtx1: string;
|
|
67
|
+
vtx2: string;
|
|
68
|
+
};
|
|
69
|
+
getIsinPolygonFun(polygons: GeojsonCoordinate[][]): string;
|
|
70
|
+
updateShader(vtx1: string, vtx2: string): void;
|
|
71
|
+
getUniqueArray: (arr: number[]) => number[];
|
|
72
|
+
cartesiansToLocal(positions: Cesium.Cartesian3[]): GeojsonCoordinate[];
|
|
73
|
+
}
|
|
74
|
+
export default Flatten;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
type PathRotation = number | {
|
|
3
|
+
heading: number;
|
|
4
|
+
pitch: number;
|
|
5
|
+
roll: number;
|
|
6
|
+
};
|
|
7
|
+
export type PathAnimOptions = {
|
|
8
|
+
positions?: Cesium.Cartesian3[];
|
|
9
|
+
rotation?: PathRotation;
|
|
10
|
+
speed?: number;
|
|
11
|
+
isLerpRotation?: boolean;
|
|
12
|
+
model?: Cesium.Entity | null;
|
|
13
|
+
};
|
|
14
|
+
export default class pathAnim {
|
|
15
|
+
pos: Cesium.Cartesian3[];
|
|
16
|
+
rotate: PathRotation;
|
|
17
|
+
speed: number;
|
|
18
|
+
isLerpRotation: boolean;
|
|
19
|
+
model: Cesium.Entity | null;
|
|
20
|
+
constructor(opt: PathAnimOptions);
|
|
21
|
+
start(): void;
|
|
22
|
+
getHeading(pointA: Cesium.Cartesian3, pointB: Cesium.Cartesian3): number;
|
|
23
|
+
getDistance(p1: Cesium.Cartesian3, p2: Cesium.Cartesian3): number;
|
|
24
|
+
private getRotationOffset;
|
|
25
|
+
FloatLerp(start: number, end: number, percent: number): number;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WGS84Pos } from '../types';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
type RotationXYZ = {
|
|
4
|
+
x?: number;
|
|
5
|
+
y?: number;
|
|
6
|
+
z?: number;
|
|
7
|
+
};
|
|
8
|
+
type TransformableTileset = Cesium.Cesium3DTileset & {
|
|
9
|
+
_root?: {
|
|
10
|
+
transform: Cesium.Matrix4;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type TransformPosition = WGS84Pos | Cesium.Cartesian3;
|
|
14
|
+
export declare function setTilesetTransform(_tileset: TransformableTileset | null, position: TransformPosition, rotation?: RotationXYZ | null): void;
|
|
15
|
+
export declare function setEntityTransform(_entity: Cesium.Entity | null, position: WGS84Pos, rotation?: RotationXYZ | null): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import KeyMap from '../map';
|
|
2
|
+
import { Asset } from '../types';
|
|
3
|
+
import * as Cesium from 'cesium';
|
|
4
|
+
/**
|
|
5
|
+
* 交互式绘制工具基类。
|
|
6
|
+
*
|
|
7
|
+
* 负责创建 Cesium 事件处理器和绘制数据源,并统一维护绘制工具的激活、隐藏、清理和销毁生命周期。具体绘制工具通过实现事件注册逻辑完成交互。
|
|
8
|
+
*/
|
|
9
|
+
export default abstract class BaseDraw implements Asset {
|
|
10
|
+
/** 绘制实例的唯一标识。 */
|
|
11
|
+
id: string;
|
|
12
|
+
/** 绘制实例名称,默认由类名和唯一标识组成。 */
|
|
13
|
+
name: string;
|
|
14
|
+
/** 资源类型标识,当前沿用测量资源类型。 */
|
|
15
|
+
type: string;
|
|
16
|
+
/** 当前绘制工具是否处于交互状态。 */
|
|
17
|
+
isMeasure: boolean;
|
|
18
|
+
/** 当前绘制工具所属地图实例。 */
|
|
19
|
+
map: KeyMap;
|
|
20
|
+
/** 当前地图的 Cesium Viewer。 */
|
|
21
|
+
viewer: Cesium.Viewer;
|
|
22
|
+
/** 当前绘制工具独占的屏幕事件处理器。 */
|
|
23
|
+
handler: Cesium.ScreenSpaceEventHandler;
|
|
24
|
+
/** 存放绘制过程实体和结果实体的数据源。 */
|
|
25
|
+
dataSource: Cesium.CustomDataSource;
|
|
26
|
+
/** 绘制完成回调;未设置时为 `null`。 */
|
|
27
|
+
finishCallback: (() => void) | null;
|
|
28
|
+
/**
|
|
29
|
+
* 创建绘制工具实例。
|
|
30
|
+
*
|
|
31
|
+
* @param map - 地图实例,绘制数据源会添加到该地图的 Viewer 中。
|
|
32
|
+
*/
|
|
33
|
+
constructor(map: KeyMap);
|
|
34
|
+
/**
|
|
35
|
+
* 激活当前绘制工具。
|
|
36
|
+
*
|
|
37
|
+
* 激活后会注册交互事件、将鼠标样式切换为十字光标、更新地图绘制状态,并将实例加入地图资源管理器。
|
|
38
|
+
*/
|
|
39
|
+
activate(): void;
|
|
40
|
+
/**
|
|
41
|
+
* 停止当前绘制交互。
|
|
42
|
+
*
|
|
43
|
+
* 该方法只解除交互和状态,不会清除已经绘制到数据源中的结果。
|
|
44
|
+
*/
|
|
45
|
+
deactivate(): void;
|
|
46
|
+
/**
|
|
47
|
+
* 设置绘制完成回调。
|
|
48
|
+
*
|
|
49
|
+
* @param callback - 绘制完成后调用的回调函数。
|
|
50
|
+
*/
|
|
51
|
+
setFinishCallback(callback: () => void): void;
|
|
52
|
+
/** 显示绘制数据源。 */
|
|
53
|
+
show(): void;
|
|
54
|
+
/** 隐藏绘制数据源。 */
|
|
55
|
+
hide(): void;
|
|
56
|
+
/** 销毁绘制工具,停止交互、清理实体并注销事件。 */
|
|
57
|
+
destroy(): void;
|
|
58
|
+
/**
|
|
59
|
+
* 清空当前绘制结果并移除绘制数据源。
|
|
60
|
+
*
|
|
61
|
+
* 清理后实例会从地图资源管理器中解绑。
|
|
62
|
+
*/
|
|
63
|
+
clear(): void;
|
|
64
|
+
/** 调用完成回调并停止绘制交互。 */
|
|
65
|
+
protected completeDrawing(): void;
|
|
66
|
+
/** 注销绘制工具注册的鼠标事件。 */
|
|
67
|
+
protected unRegisterEvents(): void;
|
|
68
|
+
/** 停止交互后的子类扩展钩子。 */
|
|
69
|
+
protected onDeactivate(): void;
|
|
70
|
+
/** 清空绘制结果后的子类扩展钩子。 */
|
|
71
|
+
protected onClear(): void;
|
|
72
|
+
/** 注册当前绘制工具需要的鼠标事件。 */
|
|
73
|
+
protected abstract registerEvents(): void;
|
|
74
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import KeyMap from '../map';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
import BaseDraw from './baseDraw';
|
|
4
|
+
/**
|
|
5
|
+
* 圆形绘制工具。
|
|
6
|
+
*
|
|
7
|
+
* 首次左键设置圆心,鼠标移动动态调整半径并显示半径标签,再次左键或中键完成绘制;右键会重置当前绘制状态。
|
|
8
|
+
*/
|
|
9
|
+
export default class DrawCircle extends BaseDraw {
|
|
10
|
+
/** 圆心坐标;未设置或重置后为 `null`。 */
|
|
11
|
+
center: Cesium.Cartesian3 | null;
|
|
12
|
+
/** 当前圆半径,按圆心到预览点的 Cartesian 距离计算。 */
|
|
13
|
+
radius: number | null;
|
|
14
|
+
/** 鼠标移动时用于预览半径的临时终点。 */
|
|
15
|
+
previewPosition: Cesium.Cartesian3 | null;
|
|
16
|
+
/** 圆心点实体。 */
|
|
17
|
+
centerEntity: Cesium.Entity | null;
|
|
18
|
+
/** 半径虚线实体。 */
|
|
19
|
+
radiusEntity: Cesium.Entity | null;
|
|
20
|
+
/** 动态圆形轮廓实体。 */
|
|
21
|
+
circleEntity: Cesium.Entity | null;
|
|
22
|
+
/** 半径文本标签实体。 */
|
|
23
|
+
labelEntity: Cesium.Entity | null;
|
|
24
|
+
/** 完成绘制提示图标实体。 */
|
|
25
|
+
finishIconEntity: Cesium.Entity | null;
|
|
26
|
+
/**
|
|
27
|
+
* 创建圆形绘制工具。
|
|
28
|
+
*
|
|
29
|
+
* @param map - 地图实例。
|
|
30
|
+
*/
|
|
31
|
+
constructor(map: KeyMap);
|
|
32
|
+
protected registerEvents(): void;
|
|
33
|
+
private leftClickEvent;
|
|
34
|
+
private mouseMoveEvent;
|
|
35
|
+
private middleClickEvent;
|
|
36
|
+
private rightClickEvent;
|
|
37
|
+
private createPointEntity;
|
|
38
|
+
private createRadiusEntity;
|
|
39
|
+
private createCircleEntity;
|
|
40
|
+
private updateLabelEntity;
|
|
41
|
+
private updateFinishIconEntity;
|
|
42
|
+
private resetDrawingState;
|
|
43
|
+
private finishDrawing;
|
|
44
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type KeyMap from '../map';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
import BaseDraw from './baseDraw';
|
|
4
|
+
/**
|
|
5
|
+
* 点绘制工具。
|
|
6
|
+
*
|
|
7
|
+
* 左键拾取一个有效场景坐标后创建点实体,并立即完成绘制。
|
|
8
|
+
*/
|
|
9
|
+
export default class DrawPoint extends BaseDraw {
|
|
10
|
+
/** 当前绘制点的世界坐标;未绘制或清空后为 `null`。 */
|
|
11
|
+
position: Cesium.Cartesian3 | null;
|
|
12
|
+
/** 当前点绘制关联实体引用;清空后为 `null`。 */
|
|
13
|
+
polygonEntity: Cesium.Entity | null;
|
|
14
|
+
/**
|
|
15
|
+
* 创建点绘制工具。
|
|
16
|
+
*
|
|
17
|
+
* @param map - 地图实例。
|
|
18
|
+
*/
|
|
19
|
+
constructor(map: KeyMap);
|
|
20
|
+
protected registerEvents(): void;
|
|
21
|
+
/** 注册左键拾取点位并完成绘制的事件。 */
|
|
22
|
+
leftClickEvent(): void;
|
|
23
|
+
/**
|
|
24
|
+
* 创建点实体并添加到绘制数据源中。
|
|
25
|
+
*
|
|
26
|
+
* @param position - 点实体所在的世界坐标。
|
|
27
|
+
*/
|
|
28
|
+
createPointEntity(position: Cesium.Cartesian3): void;
|
|
29
|
+
protected onClear(): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import KeyMap from '../map';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
import BaseDraw from './baseDraw';
|
|
4
|
+
/**
|
|
5
|
+
* 多边形绘制工具。
|
|
6
|
+
*
|
|
7
|
+
* 左键添加多边形顶点,鼠标移动预览闭合边界,右键撤销上一个顶点,中键或点击最新结束节点完成绘制。
|
|
8
|
+
*/
|
|
9
|
+
export default class DrawPolygon extends BaseDraw {
|
|
10
|
+
/** 用户左键确认的多边形顶点。 */
|
|
11
|
+
positions: Cesium.Cartesian3[];
|
|
12
|
+
/** 鼠标移动时用于预览多边形边界的临时顶点。 */
|
|
13
|
+
previewPosition: Cesium.Cartesian3 | null;
|
|
14
|
+
/** 动态多边形边界线实体。 */
|
|
15
|
+
lineEntity: Cesium.Entity | null;
|
|
16
|
+
/** 多边形顶点标记实体集合。 */
|
|
17
|
+
vertexEntities: Cesium.Entity[];
|
|
18
|
+
/**
|
|
19
|
+
* 创建多边形绘制工具。
|
|
20
|
+
*
|
|
21
|
+
* @param map - 地图实例。
|
|
22
|
+
*/
|
|
23
|
+
constructor(map: KeyMap);
|
|
24
|
+
private createLineEntity;
|
|
25
|
+
private createVertexEntity;
|
|
26
|
+
protected registerEvents(): void;
|
|
27
|
+
private leftClickEvent;
|
|
28
|
+
private mouseMoveEvent;
|
|
29
|
+
private middleClickEvent;
|
|
30
|
+
private rightClickEvent;
|
|
31
|
+
private isLatestVertexPicked;
|
|
32
|
+
private finishDrawing;
|
|
33
|
+
protected onDeactivate(): void;
|
|
34
|
+
protected onClear(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import KeyMap from '../map';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
import BaseDraw from './baseDraw';
|
|
4
|
+
/**
|
|
5
|
+
* 折线绘制工具。
|
|
6
|
+
*
|
|
7
|
+
* 左键添加折线节点,鼠标移动预览下一段,右键撤销上一个节点,中键或点击最新结束节点完成绘制。
|
|
8
|
+
*/
|
|
9
|
+
export default class DrawPolyline extends BaseDraw {
|
|
10
|
+
/** 用户左键确认的折线节点。 */
|
|
11
|
+
positions: Cesium.Cartesian3[];
|
|
12
|
+
/** 鼠标移动时用于预览下一段折线的临时节点。 */
|
|
13
|
+
previewPosition: Cesium.Cartesian3 | null;
|
|
14
|
+
/** 动态折线实体。 */
|
|
15
|
+
lineEntity: Cesium.Entity | null;
|
|
16
|
+
/** 折线节点标记实体集合。 */
|
|
17
|
+
vertexEntities: Cesium.Entity[];
|
|
18
|
+
/**
|
|
19
|
+
* 创建折线绘制工具。
|
|
20
|
+
*
|
|
21
|
+
* @param map - 地图实例。
|
|
22
|
+
*/
|
|
23
|
+
constructor(map: KeyMap);
|
|
24
|
+
private createLineEntity;
|
|
25
|
+
private createVertexEntity;
|
|
26
|
+
protected registerEvents(): void;
|
|
27
|
+
private leftClickEvent;
|
|
28
|
+
private mouseMoveEvent;
|
|
29
|
+
private middleClickEvent;
|
|
30
|
+
private rightClickEvent;
|
|
31
|
+
private isLatestVertexPicked;
|
|
32
|
+
private finishDrawing;
|
|
33
|
+
protected onDeactivate(): void;
|
|
34
|
+
protected onClear(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DrawPoint from './drawPoint';
|
|
2
|
+
import DrawPolyline from './drawPolyline';
|
|
3
|
+
import DrawCircle from './drawCircle';
|
|
4
|
+
import DrawPolygon from './drawPolygon';
|
|
5
|
+
export { default as DrawPoint } from './drawPoint';
|
|
6
|
+
export { default as DrawPolyline } from './drawPolyline';
|
|
7
|
+
export { default as DrawCircle } from './drawCircle';
|
|
8
|
+
export { default as DrawPolygon } from './drawPolygon';
|
|
9
|
+
/** SDK 内置交互式绘制工具实例类型。 */
|
|
10
|
+
export type DrawType = DrawPoint | DrawPolyline | DrawCircle | DrawPolygon;
|
|
11
|
+
declare const _default: {
|
|
12
|
+
DrawPoint: typeof DrawPoint;
|
|
13
|
+
DrawPolyline: typeof DrawPolyline;
|
|
14
|
+
DrawCircle: typeof DrawCircle;
|
|
15
|
+
DrawPolygon: typeof DrawPolygon;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type KeyMap from '../map';
|
|
2
|
+
/**
|
|
3
|
+
* 云层屏幕后处理效果。
|
|
4
|
+
*
|
|
5
|
+
* 通过 Cesium `PostProcessStage` 执行体积云 ray marching,并定时更新云层高度、厚度和风向等 uniform。构造函数当前保留 `_options` 参数但不读取配置。
|
|
6
|
+
*/
|
|
7
|
+
export default class CloudEffect {
|
|
8
|
+
private _map;
|
|
9
|
+
private t;
|
|
10
|
+
private addTimeout;
|
|
11
|
+
private cloudStage;
|
|
12
|
+
/**
|
|
13
|
+
* 创建云层效果。
|
|
14
|
+
*
|
|
15
|
+
* @param _options - 预留配置参数,当前实现不会读取该参数。
|
|
16
|
+
*/
|
|
17
|
+
constructor(_options?: unknown);
|
|
18
|
+
/**
|
|
19
|
+
* 将云层后处理阶段添加到地图场景中,并启动定时更新。
|
|
20
|
+
*
|
|
21
|
+
* @param map - 地图实例。
|
|
22
|
+
*/
|
|
23
|
+
add(map: KeyMap): void;
|
|
24
|
+
/** 从地图场景中移除并销毁云层后处理阶段,同时清理定时器。 */
|
|
25
|
+
destroy(): void;
|
|
26
|
+
/**
|
|
27
|
+
* 返回云层效果使用的 GLSL 片元着色器源码。
|
|
28
|
+
*
|
|
29
|
+
* @returns Cesium 后处理阶段使用的 shader 字符串。
|
|
30
|
+
*/
|
|
31
|
+
cloud(): string;
|
|
32
|
+
/** 根据当前相机位置更新云层后处理阶段的地球半径、高度和厚度 uniform。 */
|
|
33
|
+
update(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type KeyMap from '../map';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
/** 基础雾效配置项。 */
|
|
4
|
+
export interface FogEffectOptions {
|
|
5
|
+
/** 雾效可见距离,默认 `500.0`。 */
|
|
6
|
+
visibility?: number;
|
|
7
|
+
/** 雾效颜色,支持 CSS 颜色字符串。 */
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 基础屏幕后处理雾效。
|
|
12
|
+
*
|
|
13
|
+
* 通过 Cesium `PostProcessStage` 按相机距离混合雾色,用于给场景添加均匀距离雾效果。
|
|
14
|
+
*/
|
|
15
|
+
export default class FogEffect {
|
|
16
|
+
/** 雾效可见距离。 */
|
|
17
|
+
visibility: number;
|
|
18
|
+
/** 雾效颜色。 */
|
|
19
|
+
color: Cesium.Color;
|
|
20
|
+
/** Cesium 距离插值参数,用于控制雾效随距离增强。 */
|
|
21
|
+
fogByDistance: Cesium.Cartesian4;
|
|
22
|
+
private map;
|
|
23
|
+
private fogStage;
|
|
24
|
+
/**
|
|
25
|
+
* 创建基础雾效。
|
|
26
|
+
*
|
|
27
|
+
* @param options - 雾效配置项。
|
|
28
|
+
*/
|
|
29
|
+
constructor(options?: FogEffectOptions);
|
|
30
|
+
/**
|
|
31
|
+
* 将雾效后处理阶段添加到地图场景中。
|
|
32
|
+
*
|
|
33
|
+
* @param map - 地图实例。
|
|
34
|
+
*/
|
|
35
|
+
add(map: KeyMap): void;
|
|
36
|
+
/** 从地图场景中移除并销毁雾效后处理阶段。 */
|
|
37
|
+
destroy(): void;
|
|
38
|
+
/**
|
|
39
|
+
* 返回基础雾效使用的 GLSL 片元着色器源码。
|
|
40
|
+
*
|
|
41
|
+
* @returns Cesium 后处理阶段使用的 shader 字符串。
|
|
42
|
+
*/
|
|
43
|
+
fog(): string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type KeyMap from '../map';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
/** 高度雾效配置项。 */
|
|
4
|
+
export interface FogProEffectOptions {
|
|
5
|
+
/** 全局雾浓度,默认 `0.6`。 */
|
|
6
|
+
density?: number;
|
|
7
|
+
/** 雾效颜色,支持 CSS 颜色字符串。 */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** 雾层最大影响高度,默认 `100`。 */
|
|
10
|
+
height?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 高度雾屏幕后处理效果。
|
|
14
|
+
*
|
|
15
|
+
* 根据相机高度、像素粗略高程和全局浓度计算高度雾,并在保留透明度的前提下混合雾色。
|
|
16
|
+
*/
|
|
17
|
+
export default class FogProEffect {
|
|
18
|
+
/** 全局雾浓度。 */
|
|
19
|
+
density: number;
|
|
20
|
+
/** 雾效颜色。 */
|
|
21
|
+
color: Cesium.Color;
|
|
22
|
+
/** 雾层最大影响高度。 */
|
|
23
|
+
height: number;
|
|
24
|
+
private map;
|
|
25
|
+
private fogProStage;
|
|
26
|
+
/**
|
|
27
|
+
* 创建高度雾效果。
|
|
28
|
+
*
|
|
29
|
+
* @param options - 高度雾配置项。
|
|
30
|
+
*/
|
|
31
|
+
constructor(options?: FogProEffectOptions);
|
|
32
|
+
/**
|
|
33
|
+
* 将高度雾后处理阶段添加到地图场景中。
|
|
34
|
+
*
|
|
35
|
+
* @param map - 地图实例。
|
|
36
|
+
*/
|
|
37
|
+
add(map: KeyMap): void;
|
|
38
|
+
/** 从地图场景中移除并销毁高度雾后处理阶段。 */
|
|
39
|
+
destroy(): void;
|
|
40
|
+
/**
|
|
41
|
+
* 返回高度雾使用的 GLSL 片元着色器源码。
|
|
42
|
+
*
|
|
43
|
+
* @returns Cesium 后处理阶段使用的 shader 字符串。
|
|
44
|
+
*/
|
|
45
|
+
fogPro(): string;
|
|
46
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import FogEffect from './fog';
|
|
2
|
+
import FogProEffect from './fogPro';
|
|
3
|
+
import RainyEffect from './rainy';
|
|
4
|
+
import SnowCoverEffect from './snowCover';
|
|
5
|
+
import SnowFallEffect from './snowFall';
|
|
6
|
+
import LensFlareEffect from './lensflare';
|
|
7
|
+
import CloudEffect from './cloud';
|
|
8
|
+
export { default as FogEffect } from './fog';
|
|
9
|
+
export { default as FogProEffect } from './fogPro';
|
|
10
|
+
export { default as RainyEffect } from './rainy';
|
|
11
|
+
export { default as SnowCoverEffect } from './snowCover';
|
|
12
|
+
export { default as SnowFallEffect } from './snowFall';
|
|
13
|
+
export { default as LensFlareEffect } from './lensflare';
|
|
14
|
+
export { default as CloudEffect } from './cloud';
|
|
15
|
+
export type { FogEffectOptions } from './fog';
|
|
16
|
+
export type { FogProEffectOptions } from './fogPro';
|
|
17
|
+
export type { LensEffectOptions } from './lensflare';
|
|
18
|
+
export type { RainyEffectOptions } from './rainy';
|
|
19
|
+
export type { SnowCoverEffectOptions } from './snowCover';
|
|
20
|
+
export type { SnowFallEffectOptions } from './snowFall';
|
|
21
|
+
/** SDK 内置场景特效实例类型。 */
|
|
22
|
+
export type EffectType = FogEffect | FogProEffect | RainyEffect | SnowCoverEffect | SnowFallEffect | LensFlareEffect | CloudEffect;
|
|
23
|
+
declare const _default: {
|
|
24
|
+
FogEffect: typeof FogEffect;
|
|
25
|
+
FogProEffect: typeof FogProEffect;
|
|
26
|
+
RainyEffect: typeof RainyEffect;
|
|
27
|
+
SnowCoverEffect: typeof SnowCoverEffect;
|
|
28
|
+
SnowFallEffect: typeof SnowFallEffect;
|
|
29
|
+
LensFlareEffect: typeof LensFlareEffect;
|
|
30
|
+
CloudEffect: typeof CloudEffect;
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type KeyMap from '../map';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
/** 镜头光晕效果配置项。 */
|
|
4
|
+
export interface LensEffectOptions {
|
|
5
|
+
/** 光晕颜色,支持 CSS 颜色字符串。 */
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 镜头光晕屏幕后处理效果。
|
|
10
|
+
*
|
|
11
|
+
* 根据太阳在屏幕中的位置和相机朝向叠加镜头光晕。该类在模块出口中以 `LensFlareEffect` 名称导出。
|
|
12
|
+
*/
|
|
13
|
+
export default class lensEffect {
|
|
14
|
+
/** 镜头光晕颜色。 */
|
|
15
|
+
color: Cesium.Color;
|
|
16
|
+
private map;
|
|
17
|
+
private lensStage;
|
|
18
|
+
/**
|
|
19
|
+
* 创建镜头光晕效果。
|
|
20
|
+
*
|
|
21
|
+
* @param options - 镜头光晕效果配置项。
|
|
22
|
+
*/
|
|
23
|
+
constructor(options?: LensEffectOptions);
|
|
24
|
+
/**
|
|
25
|
+
* 将镜头光晕后处理阶段添加到地图场景中。
|
|
26
|
+
*
|
|
27
|
+
* @param map - 地图实例。
|
|
28
|
+
*/
|
|
29
|
+
add(map: KeyMap): void;
|
|
30
|
+
/** 从地图场景中移除并销毁镜头光晕后处理阶段。 */
|
|
31
|
+
destroy(): void;
|
|
32
|
+
/**
|
|
33
|
+
* 返回镜头光晕使用的 GLSL 片元着色器源码。
|
|
34
|
+
*
|
|
35
|
+
* @returns Cesium 后处理阶段使用的 shader 字符串。
|
|
36
|
+
*/
|
|
37
|
+
lens(): string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type KeyMap from '../map';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
/** 雨天效果配置项。 */
|
|
4
|
+
export interface RainyEffectOptions {
|
|
5
|
+
/** 雨丝倾斜角度,默认 `0.1`。 */
|
|
6
|
+
angle?: number;
|
|
7
|
+
/** 雨滴动画速度,默认 `0.5`。 */
|
|
8
|
+
speed?: number;
|
|
9
|
+
/** 雨效颜色,支持 CSS 颜色字符串。 */
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 雨天屏幕后处理效果。
|
|
14
|
+
*
|
|
15
|
+
* 通过 Cesium `PostProcessStage` 在画面上叠加带方向和速度的雨丝效果。
|
|
16
|
+
*/
|
|
17
|
+
declare class RainyEffect {
|
|
18
|
+
/** 雨丝倾斜角度。 */
|
|
19
|
+
angle: number;
|
|
20
|
+
/** 雨滴动画速度。 */
|
|
21
|
+
speed: number;
|
|
22
|
+
/** 雨效颜色。 */
|
|
23
|
+
color: Cesium.Color;
|
|
24
|
+
private map;
|
|
25
|
+
private rainyStage;
|
|
26
|
+
/**
|
|
27
|
+
* 创建雨天效果。
|
|
28
|
+
*
|
|
29
|
+
* @param options - 雨天效果配置项。
|
|
30
|
+
*/
|
|
31
|
+
constructor(options?: RainyEffectOptions);
|
|
32
|
+
/**
|
|
33
|
+
* 将雨天后处理阶段添加到地图场景中。
|
|
34
|
+
*
|
|
35
|
+
* @param map - 地图实例。
|
|
36
|
+
*/
|
|
37
|
+
add(map: KeyMap): void;
|
|
38
|
+
/** 从地图场景中移除并销毁雨天后处理阶段。 */
|
|
39
|
+
destroy(): void;
|
|
40
|
+
/**
|
|
41
|
+
* 返回雨天效果使用的 GLSL 片元着色器源码。
|
|
42
|
+
*
|
|
43
|
+
* @returns Cesium 后处理阶段使用的 shader 字符串。
|
|
44
|
+
*/
|
|
45
|
+
rainy(): string;
|
|
46
|
+
}
|
|
47
|
+
export default RainyEffect;
|