earthsdk3-cesium 3.7.0-beta.15 → 3.7.0-beta.17
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/earthsdk3-cesium.iife.js +171 -1995
- package/dist/earthsdk3-cesium.js +21268 -19160
- package/dist/earthsdk3-cesium.umd.cjs +126 -120
- package/dist/types/CzmObjects/base/InnerClass/CzmImagery/extends/MVTImageryProviderVector.d.ts +72 -0
- package/dist/types/CzmObjects/base/InnerClass/XbsjGroundPolylinePrimitive/GroundPolylinePrimitive.d.ts +148 -0
- package/dist/types/CzmObjects/general/CzmESMVTLayer/index.d.ts +2 -0
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/XbsjPolylineGeometry.d.ts +3 -0
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/xbsjCreateODLinesPrimitive.d.ts +29 -0
- package/dist/types/CzmObjects/general/CzmESVideoFusion/XbsjCameraVideo/XbsjCameraVideo.d.ts +18 -0
- package/dist/types/CzmObjects/general/CzmESViewShed/XbsjViewshed/XbsjViewshed.d.ts +16 -0
- package/dist/types/ESCesiumViewer/BackGroundImage/BackGroundImage.d.ts +5 -0
- package/dist/types/ESCesiumViewer/LocalSkyBox/SkyAtmosphere.d.ts +14 -0
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/AvoidanceManager.d.ts +12 -3
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.d.ts +5 -4
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenObject.d.ts +12 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/index.d.ts +2 -0
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/StyleManager.d.ts +2 -0
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/TileLoader.d.ts +5 -6
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/TileNode.d.ts +20 -5
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/{TilesCache..d.ts → TilesCache.d.ts} +9 -4
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/index.d.ts +12 -6
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/utils.d.ts +3 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixGoogleEarth/cesiumFixGoogleEarth.d.ts +1 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixLabel.d.ts +5 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixLabelCollection.d.ts +8 -0
- package/dist/types/ESJTypesCzm/czmObject/CzmBillboard.d.ts +4 -0
- package/dist/types/ESJTypesCzm/czmObject/CzmLabel.d.ts +7 -0
- package/dist/types/__declares/cesium.d.ts +434 -0
- package/dist/types/utils/czmUtils/todo/generateCartesianArc/czm/generateCartesianArc.d.ts +8 -0
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/index.d.ts +37 -0
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/lib/spline.d.ts +62 -0
- package/package.json +2 -2
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatFS.d.ts +0 -2
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatSorter.d.ts +0 -10
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatTextureGenerator.d.ts +0 -10
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatVS.d.ts +0 -2
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GeometryStageFS.d.ts +0 -2
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GeometryStageVS.d.ts +0 -2
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/ModelFS.d.ts +0 -2
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/ModelVS.d.ts +0 -2
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixCesium3DTileStyle.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixCesium3DTileset.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixFrustuCommands.d.ts +0 -4
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixGeometryPipelineStage.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixGltfLoader.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixModel.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixModel3DTileContent.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixModelDrawCommands.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixModelRuntimePrimitive.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixModelUtility.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixPassGaussianSplatting.d.ts +0 -3
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixPixelFormat.d.ts +0 -3
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixPrimitiveLoadPlan.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixScene.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixShaderProgram.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixTexture.d.ts +0 -8
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixVertexArray.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixVertexAttributeSemantic.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixView.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/fixcreateUniform.d.ts +0 -23
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/index.d.ts +0 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/passGaussianSplats.d.ts +0 -2
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixCesium1_83.d.ts +0 -1
package/dist/types/CzmObjects/base/InnerClass/CzmImagery/extends/MVTImageryProviderVector.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Credit, Event, WebMercatorTilingScheme, DefaultProxy, GeographicTilingScheme, Resource } from "cesium";
|
|
2
|
+
import { MVTImageryProviderOptions, StyleSpecification } from "./type";
|
|
3
|
+
import { Viewer } from "cesium";
|
|
4
|
+
import { SceneObjectKey } from "earthsdk3";
|
|
5
|
+
import { VectorTilesManager } from "../../../../../ESCesiumViewer/ViewerExtensions/VectorTilesManager";
|
|
6
|
+
declare class MVTImageryProviderVector {
|
|
7
|
+
viewer?: Viewer;
|
|
8
|
+
esSceneObjectId?: SceneObjectKey;
|
|
9
|
+
vectorTileManager?: VectorTilesManager;
|
|
10
|
+
ready: boolean;
|
|
11
|
+
readyPromise?: Promise<boolean>;
|
|
12
|
+
rectangle: any;
|
|
13
|
+
tileSize: number;
|
|
14
|
+
tileWidth: number;
|
|
15
|
+
tileHeight: number;
|
|
16
|
+
maximumLevel: number;
|
|
17
|
+
minimumLevel: number;
|
|
18
|
+
tileDiscardPolicy: undefined;
|
|
19
|
+
credit: Credit;
|
|
20
|
+
proxy: DefaultProxy;
|
|
21
|
+
layerStyle: {
|
|
22
|
+
[xx: string]: any;
|
|
23
|
+
}[];
|
|
24
|
+
hasAlphaChannel: boolean;
|
|
25
|
+
sourceFilter: any;
|
|
26
|
+
tilingScheme: WebMercatorTilingScheme | GeographicTilingScheme;
|
|
27
|
+
private _destroyed;
|
|
28
|
+
private _error;
|
|
29
|
+
private _accessToken;
|
|
30
|
+
private _enablePickFeatures;
|
|
31
|
+
/**
|
|
32
|
+
* create a MVTImageryProviderVector Object
|
|
33
|
+
* @param {MVTImageryProviderOptions} options MVTImageryProviderVector options as follow:
|
|
34
|
+
* @param {Resource | string | StyleSpecification} options.style - mapbox style object or url Resource.
|
|
35
|
+
* @param {string} options.accessToken - mapbox style accessToken.
|
|
36
|
+
* @param {RequestTransformFunction} options.transformRequest - use transformRequest to modify tile requests.
|
|
37
|
+
* @param {Number} [options.tileSize = 256] - can be 256 or 512. defaults to 256.
|
|
38
|
+
* @param {Number} [options.maximumLevel = 18] - if cesium zoom level exceeds maximumLevel, layer will be invisible, defaults to 18.
|
|
39
|
+
* @param {Number} [options.minimumLevel = 0] - if cesium zoom level belows minimumLevel, layer will be invisible, defaults to 0.
|
|
40
|
+
* @param {Boolean} [options.showCanvas = false] - if show canvas for debug.
|
|
41
|
+
* @param {Boolean} [options.enablePickFeatures = true] - enable pickFeatures or not, defaults to true.
|
|
42
|
+
* @param {Function} options.sourceFilter - sourceFilter is used to filter which source participate in pickFeature process.
|
|
43
|
+
* @param {WebMercatorTilingScheme | GeographicTilingScheme} [options.tilingScheme = WebMercatorTilingScheme] - Cesium tilingScheme, defaults to WebMercatorTilingScheme(EPSG: 3857).
|
|
44
|
+
* @param {Credit} options.credit - A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
|
|
45
|
+
* @example
|
|
46
|
+
* const imageryProvider = new MVTImageryProviderVector({
|
|
47
|
+
style: 'https://demotiles.maplibre.org/style.json'
|
|
48
|
+
});
|
|
49
|
+
*/
|
|
50
|
+
constructor(options: MVTImageryProviderOptions & {
|
|
51
|
+
/**
|
|
52
|
+
* Deprecated
|
|
53
|
+
*
|
|
54
|
+
* You can use fromUrl instead
|
|
55
|
+
* @example
|
|
56
|
+
* const provider = await MVTImageryProviderVector.fromUrl(url)
|
|
57
|
+
*/
|
|
58
|
+
style: string | Resource | StyleSpecification;
|
|
59
|
+
});
|
|
60
|
+
get isDestroyed(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Gets an event that will be raised if an error is encountered during processing.
|
|
63
|
+
* @memberof GeoJsonDataSource.prototype
|
|
64
|
+
* @type {Event}
|
|
65
|
+
*/
|
|
66
|
+
get errorEvent(): Event<(...args: any[]) => void>;
|
|
67
|
+
static fromUrl(url: Resource | string | StyleSpecification, options?: MVTImageryProviderOptions): Promise<MVTImageryProviderVector>;
|
|
68
|
+
requestImage(x: number, y: number, level: number, releaseTile?: boolean): Promise<HTMLImageElement | HTMLCanvasElement | any> | undefined;
|
|
69
|
+
pickFeatures(x: number, y: number, zoom: number, longitude: number, latitude: number): undefined;
|
|
70
|
+
destroy(): void;
|
|
71
|
+
}
|
|
72
|
+
export default MVTImageryProviderVector;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
|
|
3
|
+
// declare class GroundPolylinePrimitive extends Destroyable {
|
|
4
|
+
// constructor()
|
|
5
|
+
// }
|
|
6
|
+
|
|
7
|
+
type GeometryInstance = Cesium.GeometryInstance;
|
|
8
|
+
type Appearance = Cesium.Appearance;
|
|
9
|
+
type ClassificationType = Cesium.ClassificationType;
|
|
10
|
+
type Scene = Cesium.Scene;
|
|
11
|
+
|
|
12
|
+
declare class GroundPolylinePrimitive {
|
|
13
|
+
constructor(options?: {
|
|
14
|
+
geometryInstances?: any[] | GeometryInstance;
|
|
15
|
+
appearance?: Appearance;
|
|
16
|
+
show?: boolean;
|
|
17
|
+
interleave?: boolean;
|
|
18
|
+
releaseGeometryInstances?: boolean;
|
|
19
|
+
allowPicking?: boolean;
|
|
20
|
+
asynchronous?: boolean;
|
|
21
|
+
classificationType?: ClassificationType;
|
|
22
|
+
debugShowBoundingVolume?: boolean;
|
|
23
|
+
debugShowShadowVolume?: boolean;
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* The geometry instances rendered with this primitive. This may
|
|
27
|
+
* be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
|
|
28
|
+
* is <code>true</code> when the primitive is constructed.
|
|
29
|
+
* <p>
|
|
30
|
+
* Changing this property after the primitive is rendered has no effect.
|
|
31
|
+
* </p>
|
|
32
|
+
*/
|
|
33
|
+
readonly geometryInstances: any[] | GeometryInstance;
|
|
34
|
+
/**
|
|
35
|
+
* The {@link Appearance} used to shade this primitive. Each geometry
|
|
36
|
+
* instance is shaded with the same appearance. Some appearances, like
|
|
37
|
+
* {@link PolylineColorAppearance} allow giving each instance unique
|
|
38
|
+
* properties.
|
|
39
|
+
*/
|
|
40
|
+
appearance: Appearance;
|
|
41
|
+
/**
|
|
42
|
+
* Determines if the primitive will be shown. This affects all geometry
|
|
43
|
+
* instances in the primitive.
|
|
44
|
+
*/
|
|
45
|
+
show: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Determines whether terrain, 3D Tiles or both will be classified.
|
|
48
|
+
*/
|
|
49
|
+
classificationType: ClassificationType;
|
|
50
|
+
/**
|
|
51
|
+
* This property is for debugging only; it is not for production use nor is it optimized.
|
|
52
|
+
* <p>
|
|
53
|
+
* Draws the bounding sphere for each draw command in the primitive.
|
|
54
|
+
* </p>
|
|
55
|
+
*/
|
|
56
|
+
debugShowBoundingVolume: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
|
|
59
|
+
*/
|
|
60
|
+
readonly interleave: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
|
|
63
|
+
*/
|
|
64
|
+
readonly releaseGeometryInstances: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
|
|
67
|
+
*/
|
|
68
|
+
readonly allowPicking: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Determines if the geometry instances will be created and batched on a web worker.
|
|
71
|
+
*/
|
|
72
|
+
readonly asynchronous: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Determines if the primitive is complete and ready to render. If this property is
|
|
75
|
+
* true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}
|
|
76
|
+
* is called.
|
|
77
|
+
*/
|
|
78
|
+
readonly ready: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Gets a promise that resolves when the primitive is ready to render.
|
|
81
|
+
*/
|
|
82
|
+
readonly readyPromise: Promise<GroundPolylinePrimitive>;
|
|
83
|
+
/**
|
|
84
|
+
* This property is for debugging only; it is not for production use nor is it optimized.
|
|
85
|
+
* <p>
|
|
86
|
+
* If true, draws the shadow volume for each geometry in the primitive.
|
|
87
|
+
* </p>
|
|
88
|
+
*/
|
|
89
|
+
readonly debugShowShadowVolume: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
|
|
92
|
+
* GroundPolylinePrimitive synchronously.
|
|
93
|
+
* @returns A promise that will resolve once the terrain heights have been loaded.
|
|
94
|
+
*/
|
|
95
|
+
static initializeTerrainHeights(): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Called when {@link Viewer} or {@link CesiumWidget} render the scene to
|
|
98
|
+
* get the draw commands needed to render this primitive.
|
|
99
|
+
* <p>
|
|
100
|
+
* Do not call this function directly. This is documented just to
|
|
101
|
+
* list the exceptions that may be propagated when the scene is rendered:
|
|
102
|
+
* </p>
|
|
103
|
+
*/
|
|
104
|
+
update(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
|
|
107
|
+
* @example
|
|
108
|
+
* const attributes = primitive.getGeometryInstanceAttributes('an id');
|
|
109
|
+
* attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
|
|
110
|
+
* attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
|
|
111
|
+
* @param id - The id of the {@link GeometryInstance}.
|
|
112
|
+
* @returns The typed array in the attribute's format or undefined if the is no instance with id.
|
|
113
|
+
*/
|
|
114
|
+
getGeometryInstanceAttributes(id: any): any;
|
|
115
|
+
/**
|
|
116
|
+
* Checks if the given Scene supports GroundPolylinePrimitives.
|
|
117
|
+
* GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.
|
|
118
|
+
* @param scene - The current scene.
|
|
119
|
+
* @returns Whether or not the current scene supports GroundPolylinePrimitives.
|
|
120
|
+
*/
|
|
121
|
+
static isSupported(scene: Scene): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Returns true if this object was destroyed; otherwise, false.
|
|
124
|
+
* <p>
|
|
125
|
+
* If this object was destroyed, it should not be used; calling any function other than
|
|
126
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
|
|
127
|
+
* </p>
|
|
128
|
+
* @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
|
|
129
|
+
*/
|
|
130
|
+
isDestroyed(): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
|
|
133
|
+
* release of WebGL resources, instead of relying on the garbage collector to destroy this object.
|
|
134
|
+
* <p>
|
|
135
|
+
* Once an object is destroyed, it should not be used; calling any function other than
|
|
136
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
|
|
137
|
+
* assign the return value (<code>undefined</code>) to the object as done in the example.
|
|
138
|
+
* </p>
|
|
139
|
+
* @example
|
|
140
|
+
* e = e && e.destroy();
|
|
141
|
+
*/
|
|
142
|
+
destroy(): void;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export default GroundPolylinePrimitive;
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CzmESVisualObject } from "../../base";
|
|
2
2
|
import { ESCesiumViewer } from "../../../ESCesiumViewer";
|
|
3
3
|
import { ESMVTLayer } from "../../../ESObjects";
|
|
4
|
+
import { Event } from "earthsdk3";
|
|
4
5
|
export declare class CzmESMVTLayer extends CzmESVisualObject<ESMVTLayer> {
|
|
5
6
|
static readonly type: string;
|
|
6
7
|
private _czmImagery;
|
|
@@ -13,6 +14,7 @@ export declare class CzmESMVTLayer extends CzmESVisualObject<ESMVTLayer> {
|
|
|
13
14
|
pointJson: any[];
|
|
14
15
|
otherJson: any[];
|
|
15
16
|
};
|
|
17
|
+
mvtLayerJsonChanged: Event<[]>;
|
|
16
18
|
constructor(sceneObject: ESMVTLayer, czmViewer: ESCesiumViewer);
|
|
17
19
|
flyTo(duration: number | undefined, id: number): boolean;
|
|
18
20
|
flyIn(duration: number | undefined, id: number): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
import { XbsjRoutePath } from './XbsjRoutePath';
|
|
3
|
+
import { SceneObjectKey } from "earthsdk3";
|
|
4
|
+
|
|
5
|
+
export type XbsjPositionCallbackResultType = {
|
|
6
|
+
timeRatio: number;
|
|
7
|
+
repeat: number;
|
|
8
|
+
color: [number, number, number, number];
|
|
9
|
+
bgColor: [number, number, number, number];
|
|
10
|
+
bidirectional: 0 | 1 | 2 | 3; // 0/1表示单向,2表示双向, 3表示无信号
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type XbsjODLinesPostionCallback = (
|
|
14
|
+
instanceIndex: number,
|
|
15
|
+
frameState: Cesium.FrameState,
|
|
16
|
+
result: XbsjPositionCallbackResultType,
|
|
17
|
+
) => XbsjPositionCallbackResultType;
|
|
18
|
+
|
|
19
|
+
export default function xbsjCreateODLinesPrimitive(
|
|
20
|
+
routePaths: XbsjRoutePath[],
|
|
21
|
+
color: [number, number, number, number],
|
|
22
|
+
arcType: Cesium.ArcType,
|
|
23
|
+
postionCallback: (instanceIndex: number, frameState: Cesium.FrameState | undefined, result: XbsjPositionCallbackResultType) => XbsjPositionCallbackResultType,
|
|
24
|
+
brightening?: boolean,
|
|
25
|
+
depthTest?: boolean,
|
|
26
|
+
getTextureFunc?: () => Cesium.Texture,
|
|
27
|
+
id?: SceneObjectKey
|
|
28
|
+
): Cesium.Primitive;
|
|
29
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
|
|
3
|
+
export declare class XbsjCameraVideo {
|
|
4
|
+
constructor(options: {
|
|
5
|
+
inverseViewMatrix: Cesium.Matrix4,
|
|
6
|
+
frustum: Cesium.PerspectiveFrustum,
|
|
7
|
+
// videoElement: HTMLVideoElement | string | undefined,
|
|
8
|
+
videoTextureFunc?: (() => Cesium.Texture | undefined) | undefined,
|
|
9
|
+
alphaTextureFunc?: (() => Cesium.Texture | undefined) | undefined,
|
|
10
|
+
showHelperPrimitive: true,
|
|
11
|
+
});
|
|
12
|
+
// videoElement: HTMLVideoElement | string | undefined;
|
|
13
|
+
// alphaImage: string;
|
|
14
|
+
videoTextureFunc: (() => Cesium.Texture | undefined) | undefined;
|
|
15
|
+
alphaTextureFunc: (() => Cesium.Texture | undefined) | undefined;
|
|
16
|
+
showHelperPrimitive: boolean;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
|
|
3
|
+
export declare class XbsjViewshed {
|
|
4
|
+
constructor(scene: Cesium.Scene, id?: string);
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
showHelper: boolean;
|
|
7
|
+
fovH: number;
|
|
8
|
+
fovV: number;
|
|
9
|
+
near: number;
|
|
10
|
+
far: number;
|
|
11
|
+
position: Cesium.Cartesian3;
|
|
12
|
+
heading: number;
|
|
13
|
+
pitch: number;
|
|
14
|
+
roll: number;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
|
|
3
|
+
declare class SkyAtmosphere {
|
|
4
|
+
constructor(ellipsoid: Cesium.Ellipsoid | undefined, sources: {
|
|
5
|
+
positiveX: string;
|
|
6
|
+
negativeX: string;
|
|
7
|
+
positiveY: string;
|
|
8
|
+
negativeY: string;
|
|
9
|
+
positiveZ: string;
|
|
10
|
+
negativeZ: string;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export = SkyAtmosphere;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Destroyable, ESJScreenLayerInfo
|
|
1
|
+
import { Destroyable, ESJScreenLayerInfo } from "earthsdk3";
|
|
2
2
|
import * as Cesium from "cesium";
|
|
3
3
|
import { ScreenManager } from ".";
|
|
4
4
|
/**
|
|
@@ -10,19 +10,28 @@ import { ScreenManager } from ".";
|
|
|
10
10
|
export declare class AvoidanceManager extends Destroyable {
|
|
11
11
|
rectangleCollisionCheck: Cesium.RectangleCollisionChecker;
|
|
12
12
|
screenManager: ScreenManager;
|
|
13
|
-
enable: boolean;
|
|
14
13
|
forceRebuildNext: boolean;
|
|
15
14
|
avoidanceLayers: string[];
|
|
15
|
+
customLayers: string[];
|
|
16
16
|
private _processingQueue;
|
|
17
17
|
private _isProcessing;
|
|
18
|
+
/** 单帧最多处理多少个对象,适当调大可以加快收敛,调小可以减轻单帧压力 */
|
|
18
19
|
private BATCH_SIZE;
|
|
20
|
+
/** 总共参与避让计算的对象上限,超过后只保留优先级最高的一部分(zOrder 最大) */
|
|
21
|
+
private MAX_OBJECTS;
|
|
22
|
+
/** 屏幕网格大小(像素),用于做候选抽样,保证一块区域内只保留少量候选点 */
|
|
23
|
+
private GRID_SIZE;
|
|
24
|
+
/** 每个网格 cell 内最多参与避让的对象数量 */
|
|
25
|
+
private MAX_PER_CELL;
|
|
19
26
|
private _cache;
|
|
20
27
|
private _lastCameraState;
|
|
28
|
+
/** 摄像机移动触发全量重建的阈值,适当调大避免频繁 clear 树 */
|
|
21
29
|
private CAMERA_MOVE_THRESHOLD;
|
|
22
30
|
constructor(screenManager: ScreenManager);
|
|
23
31
|
update(): void;
|
|
24
32
|
setAvoidanceLayer(): void;
|
|
25
|
-
|
|
33
|
+
add(layer?: ESJScreenLayerInfo['layer']): void;
|
|
34
|
+
remove(layer?: ESJScreenLayerInfo['layer']): void;
|
|
26
35
|
private _shouldForceRebuild;
|
|
27
36
|
private _updateLastCameraState;
|
|
28
37
|
private _buildProcessingQueue;
|
|
@@ -2,18 +2,19 @@ import { Destroyable, SceneObjectKey } from "earthsdk3";
|
|
|
2
2
|
import * as Cesium from "cesium";
|
|
3
3
|
import { ESJScreenObjectInfo } from "earthsdk3";
|
|
4
4
|
import { CzmBillboard, CzmLabel, ESCesiumViewer, ScreenManager } from "../../../index";
|
|
5
|
-
import { ScreenObject, ScreenObjectType } from "./ScreenObject";
|
|
5
|
+
import { ScreenObject, ScreenObjectKey, ScreenObjectType } from "./ScreenObject";
|
|
6
6
|
/**
|
|
7
7
|
* 管理一类对象(同图层)
|
|
8
8
|
* 负责增删改 ScreenObject
|
|
9
9
|
* 提供快速访问索引 objects: Map<SceneObjectKey, ScreenObject>
|
|
10
10
|
*/
|
|
11
11
|
export declare class ScreenLayer extends Destroyable {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
protected screenManager: ScreenManager;
|
|
13
|
+
protected screenManagerLayerName: string;
|
|
14
|
+
objects: Map<ScreenObjectKey, ScreenObject>;
|
|
14
15
|
czmViewer: ESCesiumViewer;
|
|
15
16
|
viewer: Cesium.Viewer;
|
|
16
|
-
constructor(screenManager: ScreenManager);
|
|
17
|
+
constructor(screenManager: ScreenManager, screenManagerLayerName: string);
|
|
17
18
|
/**
|
|
18
19
|
* 检查图层是否包含有效对象
|
|
19
20
|
* @returns 如果图层中存在有效对象则返回 true,否则返回 false
|
|
@@ -2,6 +2,7 @@ import { Destroyable, Event, SceneObjectKey } from "earthsdk3";
|
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
3
|
export declare const ScreenObjectTypes: readonly ["label", "billboard", "rectangle"];
|
|
4
4
|
export type ScreenObjectType = typeof ScreenObjectTypes[number];
|
|
5
|
+
export type ScreenObjectKey = string;
|
|
5
6
|
/**
|
|
6
7
|
* 储存相同位置下的对象的信息
|
|
7
8
|
* 代表一个场景对象
|
|
@@ -12,7 +13,10 @@ export type ScreenObjectType = typeof ScreenObjectTypes[number];
|
|
|
12
13
|
*/
|
|
13
14
|
export declare class ScreenObject extends Destroyable {
|
|
14
15
|
id: string;
|
|
15
|
-
|
|
16
|
+
private _position;
|
|
17
|
+
get position(): Cesium.Cartesian3;
|
|
18
|
+
set position(value: Cesium.Cartesian3);
|
|
19
|
+
get positionChanged(): import("earthsdk3").Listener<[Cesium.Cartesian3, Cesium.Cartesian3]>;
|
|
16
20
|
label: Cesium.Label | undefined;
|
|
17
21
|
billboard: Cesium.Billboard | undefined;
|
|
18
22
|
rectangle: Record<string, any> | undefined;
|
|
@@ -20,9 +24,16 @@ export declare class ScreenObject extends Destroyable {
|
|
|
20
24
|
labelRefCount: number;
|
|
21
25
|
billboardRefCount: number;
|
|
22
26
|
rectangleRefCount: number;
|
|
27
|
+
labelIgnorePlacement: boolean;
|
|
28
|
+
billboardIgnorePlacement: boolean;
|
|
29
|
+
rectangleIgnorePlacement: boolean;
|
|
30
|
+
labelAllowOverlap: boolean;
|
|
31
|
+
billboardAllowOverlap: boolean;
|
|
32
|
+
rectangleAllowOverlap: boolean;
|
|
23
33
|
private _showEvent;
|
|
24
34
|
get showEvent(): Event<[boolean]>;
|
|
25
35
|
show(show: boolean): void;
|
|
26
36
|
constructor(id: SceneObjectKey, position: Cesium.Cartesian3);
|
|
27
37
|
updateShow(show: boolean): void;
|
|
38
|
+
updatePosition(position: Cesium.Cartesian3): void;
|
|
28
39
|
}
|
|
@@ -20,6 +20,8 @@ export declare class ScreenManager extends Destroyable {
|
|
|
20
20
|
collectionMap: Record<ScreenObjectType, any>;
|
|
21
21
|
private _refreshEvent;
|
|
22
22
|
get refreshEvent(): Event<[]>;
|
|
23
|
+
/** 是否已经在本帧调度了 refresh,防止一帧内被调用成千上万次 */
|
|
24
|
+
private _refreshScheduled;
|
|
23
25
|
refresh(): void;
|
|
24
26
|
constructor(_czmViewer: ESCesiumViewer);
|
|
25
27
|
getLayer(layerName: string): ScreenLayer;
|
|
@@ -2,6 +2,7 @@ import { Destroyable, SceneObjectKey } from "earthsdk3";
|
|
|
2
2
|
import { CzmESMVTLayer, CzmLabel } from '../../../index';
|
|
3
3
|
import { BackgroundLayerSpecification, LayerSpecification } from "../../../CzmObjects/base/InnerClass/CzmImagery/extends/type";
|
|
4
4
|
export type LayerStyle = Exclude<LayerSpecification, BackgroundLayerSpecification> & {
|
|
5
|
+
symbolStyle?: any;
|
|
5
6
|
labelStyle?: any;
|
|
6
7
|
billboardStyle?: any;
|
|
7
8
|
polygonStyle?: any;
|
|
@@ -9,6 +10,7 @@ export type LayerStyle = Exclude<LayerSpecification, BackgroundLayerSpecificatio
|
|
|
9
10
|
};
|
|
10
11
|
export type mapboxLabel = CzmLabel & {
|
|
11
12
|
'text-transform'?: string;
|
|
13
|
+
"maxWidth"?: number;
|
|
12
14
|
};
|
|
13
15
|
export declare const textTransform: {
|
|
14
16
|
none: (s: string) => string;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { sourceName } from "./index";
|
|
1
|
+
import { sourceName, VectorTilesManager } from "./index";
|
|
2
2
|
import { Destroyable, SceneObjectKey } from "earthsdk3";
|
|
3
3
|
import { CzmESMVTLayer } from "../../../CzmObjects";
|
|
4
4
|
import { TileNode } from './TileNode';
|
|
5
|
-
import { TilesCache } from "./TilesCache
|
|
6
|
-
import { WorkerPool } from "./WorkerPool";
|
|
5
|
+
import { TilesCache } from "./TilesCache";
|
|
7
6
|
/**
|
|
8
7
|
* 瓦片加载器
|
|
9
8
|
* 只负责加载瓦片数据并解析为GeoJson格式
|
|
10
9
|
*/
|
|
11
10
|
export declare class TileLoader extends Destroyable {
|
|
12
|
-
|
|
11
|
+
vectorTilesManager: VectorTilesManager;
|
|
13
12
|
/**
|
|
14
13
|
* 等待请求的瓦片服务
|
|
15
14
|
*/
|
|
@@ -23,14 +22,14 @@ export declare class TileLoader extends Destroyable {
|
|
|
23
22
|
minzoom?: number;
|
|
24
23
|
maxzoom?: number;
|
|
25
24
|
}>>;
|
|
26
|
-
|
|
25
|
+
tilesCache: TilesCache;
|
|
27
26
|
/**
|
|
28
27
|
* 切片方案
|
|
29
28
|
* xyz: 谷歌瓦片方案
|
|
30
29
|
* tms: 瓦片服务方案
|
|
31
30
|
*/
|
|
32
31
|
tileSchemes: Map<SceneObjectKey, "xyz" | "tms">;
|
|
33
|
-
constructor(
|
|
32
|
+
constructor(vectorTilesManager: VectorTilesManager);
|
|
34
33
|
add(czmESMVTLayer: CzmESMVTLayer): void;
|
|
35
34
|
remove(czmESMVTLayer: CzmESMVTLayer): void;
|
|
36
35
|
fetchTile(sceneObjectId: SceneObjectKey, tileKey: string): Promise<TileNode | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Destroyable } from "earthsdk3";
|
|
2
|
-
import {
|
|
2
|
+
import { layerName, sourceName, TileKey, TileNodeState } from ".";
|
|
3
3
|
export declare class TileNode extends Destroyable {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
@@ -7,8 +7,23 @@ export declare class TileNode extends Destroyable {
|
|
|
7
7
|
tileKey: TileKey;
|
|
8
8
|
parent: TileNode | null;
|
|
9
9
|
children: Set<TileNode>;
|
|
10
|
-
data: Map<sourceName, Map<layerName, Set<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
data: Map<sourceName, Map<layerName, Set<GeoJSON.Feature<Exclude<GeoJSON.Geometry, GeoJSON.GeometryCollection>>>>>;
|
|
11
|
+
private _state;
|
|
12
|
+
get state(): TileNodeState;
|
|
13
|
+
set state(value: TileNodeState);
|
|
14
|
+
get stateChanged(): import("earthsdk3").Listener<[TileNodeState, TileNodeState]>;
|
|
15
|
+
refCount: number;
|
|
16
|
+
lastUsedFrame: number;
|
|
17
|
+
screenIds: Set<string> | null;
|
|
18
|
+
/** 瓦片渲染结果,可以是 Canvas 或 ImageBitmap(优先 ImageBitmap,减少主线程绘制开销) */
|
|
19
|
+
image: HTMLCanvasElement | ImageBitmap | null;
|
|
20
|
+
/** 该瓦片对应的影像渲染 Promise,用于避免重复开启 worker 计算 */
|
|
21
|
+
imagePromise?: Promise<HTMLCanvasElement | ImageBitmap>;
|
|
22
|
+
constructor(tileCache: Map<string, TileNode | undefined>, tileKey: TileKey);
|
|
23
|
+
attachToParent(tileCache: Map<string, TileNode | undefined>): void;
|
|
24
|
+
getParentTileKey(): string | undefined;
|
|
25
|
+
getChildrenTileKeys(): string[];
|
|
26
|
+
idReady(): boolean;
|
|
27
|
+
hasReadyChildren(): boolean;
|
|
28
|
+
allChildrenReady(): boolean;
|
|
14
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Destroyable, Event, SceneObjectKey } from "earthsdk3";
|
|
2
|
-
import { TileKey } from "./index";
|
|
2
|
+
import { TileKey, VectorTilesManager } from "./index";
|
|
3
3
|
import { CzmESMVTLayer } from "../../../CzmObjects";
|
|
4
4
|
import { TileNode } from "./TileNode";
|
|
5
5
|
/**
|
|
@@ -7,18 +7,23 @@ import { TileNode } from "./TileNode";
|
|
|
7
7
|
* 缓存请求的xyz瓦片数据,超过缓存数量后,将最旧的瓦片删除
|
|
8
8
|
*/
|
|
9
9
|
export declare class TilesCache extends Destroyable {
|
|
10
|
+
vectorTilesManager: VectorTilesManager;
|
|
10
11
|
cache: Map<SceneObjectKey, Map<TileKey, TileNode | undefined>>;
|
|
12
|
+
private _cacheEvent;
|
|
13
|
+
get cacheEvent(): Event<[string, string, TileNode]>;
|
|
11
14
|
maxSize: number;
|
|
12
15
|
private _deleteTileEvent;
|
|
13
16
|
get deleteTileEvent(): Event<[string, string | undefined]>;
|
|
14
17
|
deleteTile(sceneObjectId: SceneObjectKey, tileKey?: TileKey): void;
|
|
15
|
-
constructor();
|
|
18
|
+
constructor(vectorTilesManager: VectorTilesManager);
|
|
16
19
|
has(sceneObjectId: SceneObjectKey, tileKey?: TileKey): boolean;
|
|
17
|
-
get(sceneObjectId: SceneObjectKey): Map<TileKey, TileNode | undefined
|
|
20
|
+
get(sceneObjectId: SceneObjectKey): Map<TileKey, TileNode | undefined>;
|
|
18
21
|
get(sceneObjectId: SceneObjectKey, tileKey: TileKey): TileNode | undefined;
|
|
19
|
-
set(sceneObjectId: SceneObjectKey, tileKey: TileKey, tileNode: TileNode
|
|
22
|
+
set(sceneObjectId: SceneObjectKey, tileKey: TileKey, tileNode: TileNode): void;
|
|
20
23
|
remove(sceneObject: SceneObjectKey): void;
|
|
21
24
|
remove(sceneObject: CzmESMVTLayer): void;
|
|
22
25
|
remove(sceneObject: SceneObjectKey, tileKey: TileKey): void;
|
|
23
26
|
remove(sceneObject: CzmESMVTLayer, tileKey: TileKey): void;
|
|
27
|
+
requestImage(sceneObjectId: SceneObjectKey, x: number, y: number, z: number): Promise<HTMLCanvasElement | ImageBitmap>;
|
|
28
|
+
private _requestImageWorker;
|
|
24
29
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Destroyable, SceneObjectKey } from "earthsdk3";
|
|
2
|
-
import { TilesCache } from "./TilesCache
|
|
2
|
+
import { TilesCache } from "./TilesCache";
|
|
3
3
|
import { TileLoader } from "./TileLoader";
|
|
4
4
|
import { TileRenderer } from "./TileRenderer";
|
|
5
5
|
import { StyleManager } from "./StyleManager";
|
|
6
6
|
import { EventManager } from "./EventManager";
|
|
7
7
|
import { CzmESMVTLayer } from "../../../index";
|
|
8
8
|
import * as Cesium from 'cesium';
|
|
9
|
+
import { WorkerPool } from "./WorkerPool";
|
|
9
10
|
/**
|
|
10
11
|
* Viewer Camera/LOD
|
|
11
12
|
* ↓
|
|
@@ -19,11 +20,6 @@ import * as Cesium from 'cesium';
|
|
|
19
20
|
* ↓
|
|
20
21
|
* EventManager 绑定事件
|
|
21
22
|
*/
|
|
22
|
-
export interface FeatureDate {
|
|
23
|
-
id: string | number;
|
|
24
|
-
geometry: any;
|
|
25
|
-
properties: Record<string, any>;
|
|
26
|
-
}
|
|
27
23
|
export type TileKey = string;
|
|
28
24
|
export type sourceName = string;
|
|
29
25
|
export type layerName = string;
|
|
@@ -44,9 +40,19 @@ export declare class VectorTilesManager extends Destroyable {
|
|
|
44
40
|
styleManager: StyleManager;
|
|
45
41
|
eventManager: EventManager;
|
|
46
42
|
lastImageryTileMap: Map<SceneObjectKey, Set<TileKey>>;
|
|
43
|
+
workerPool: WorkerPool;
|
|
44
|
+
/**
|
|
45
|
+
* 最近一次瓦片集合发生变化的时间,用于避免相机缩放/平移过程中频繁隐藏导致的闪烁
|
|
46
|
+
*/
|
|
47
|
+
private lastTilesChangedTime;
|
|
48
|
+
/**
|
|
49
|
+
* 视图稳定多久后才开始真正隐藏旧瓦片(毫秒)
|
|
50
|
+
*/
|
|
51
|
+
private readonly hideDelayWhenCameraMoving;
|
|
47
52
|
constructor(viewer: Cesium.Viewer);
|
|
48
53
|
add(czmESMVTLayer: CzmESMVTLayer): Promise<void>;
|
|
49
54
|
remove(czmESMVTLayer: CzmESMVTLayer): void;
|
|
50
55
|
refreshVisibleTiles(forceUpdate?: boolean): void;
|
|
51
56
|
updateTiles(tileMap: Map<SceneObjectKey, Set<TileKey>>, forceUpdate?: boolean): void;
|
|
57
|
+
requestImage(sceneObjectId: SceneObjectKey, x: number, y: number, z: number): Promise<HTMLCanvasElement | ImageBitmap>;
|
|
52
58
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import * as Cesium from "cesium";
|
|
1
2
|
export declare function getMapboxTextField(textField: any, zoom: number): string | string[] | null;
|
|
2
3
|
export declare function tileDataToGeoJSON(tileData: Record<string, any>): Map<string, Set<any>>;
|
|
4
|
+
export declare function interpolateTextAlongPath(viewer: Cesium.Viewer, positions: Cesium.Cartesian3[], text: string, font: string): Map<Cesium.Cartesian3, Cesium.Cartesian3[]>;
|
|
5
|
+
export declare function wrapByPixel(text: any, maxWidth: any, font: any): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cesiumFixGoogleEarth(Cesium: any): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
export declare function fixLabelCollection(): void;
|
|
3
|
+
/**
|
|
4
|
+
* 根据传入点数量,对 Cartesian3 数组做均匀插值
|
|
5
|
+
* @param points 原始点数组(至少两个)
|
|
6
|
+
* @param targetCount 目标插值数量(包含起终点)
|
|
7
|
+
*/
|
|
8
|
+
export declare function interpolateCartesian3(points: Cesium.Cartesian3[], targetCount: number): Cesium.Cartesian3[];
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as Cesium from 'cesium';
|
|
2
|
+
import { ESJVector4D } from 'earthsdk3';
|
|
2
3
|
export type CzmBillboard = Partial<{
|
|
3
4
|
position: Cesium.Cartesian3;
|
|
4
5
|
id: any;
|
|
5
6
|
show: boolean;
|
|
6
7
|
image: string | HTMLCanvasElement;
|
|
8
|
+
avoidancePadding: ESJVector4D;
|
|
9
|
+
ignorePlacement: boolean;
|
|
10
|
+
allowOverlap: boolean;
|
|
7
11
|
scale: number;
|
|
8
12
|
pixelOffset: Cesium.Cartesian2;
|
|
9
13
|
eyeOffset: Cesium.Cartesian3;
|