earthsdk3-cesium 3.7.0-beta.14 → 3.7.0-beta.15
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 +127 -127
- package/dist/earthsdk3-cesium.js +4307 -4273
- package/dist/earthsdk3-cesium.umd.cjs +113 -113
- package/package.json +1 -1
- package/dist/types/CzmObjects/base/InnerClass/XbsjGroundPolylinePrimitive/GroundPolylinePrimitive.d.ts +0 -148
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/XbsjPolylineGeometry.d.ts +0 -3
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/xbsjCreateODLinesPrimitive.d.ts +0 -29
- package/dist/types/CzmObjects/general/CzmESVideoFusion/XbsjCameraVideo/XbsjCameraVideo.d.ts +0 -18
- package/dist/types/CzmObjects/general/CzmESViewShed/XbsjViewshed/XbsjViewshed.d.ts +0 -16
- package/dist/types/ESCesiumViewer/BackGroundImage/BackGroundImage.d.ts +0 -5
- package/dist/types/ESCesiumViewer/LocalSkyBox/SkyAtmosphere.d.ts +0 -14
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatPipelineStage.d.ts +0 -12
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatTexturePipelineStage.d.ts +0 -11
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixGoogleEarth/cesiumFixGoogleEarth.d.ts +0 -1
- package/dist/types/__declares/cesium.d.ts +0 -434
- package/dist/types/utils/czmUtils/todo/generateCartesianArc/czm/generateCartesianArc.d.ts +0 -8
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/index.d.ts +0 -37
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/lib/spline.d.ts +0 -62
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
// cesium声明文件补充
|
|
2
|
-
// 注意此声明文件不全,用到哪儿写到哪儿
|
|
3
|
-
// vtxf 20211215
|
|
4
|
-
import * as Cesium from "cesium";
|
|
5
|
-
declare module 'cesium' {
|
|
6
|
-
interface Destroyable {
|
|
7
|
-
isDestroyed(): boolean;
|
|
8
|
-
destroy(): undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface Context {
|
|
12
|
-
defaultTexture: Texture;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
type TextureOptions = {
|
|
17
|
-
context: Context;
|
|
18
|
-
pixelFormat?: number;
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
flipY?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const enum MipmapHint {
|
|
25
|
-
DONT_CARE = WebGLConstants.DONT_CARE,
|
|
26
|
-
FASTEST = WebGLConstants.FASTEST,
|
|
27
|
-
NICEST = WebGLConstants.NICEST,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface Texture extends Destroyable {
|
|
31
|
-
copyFrom(options: {
|
|
32
|
-
// arrayBufferView: ArrayBufferView,
|
|
33
|
-
// width: number;
|
|
34
|
-
// height: number;
|
|
35
|
-
source: {
|
|
36
|
-
width: number;
|
|
37
|
-
height: number;
|
|
38
|
-
arrayBufferView: ArrayBufferView;
|
|
39
|
-
} | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
|
|
40
|
-
xOffset?: number;
|
|
41
|
-
yOffset?: number;
|
|
42
|
-
skipColorSpaceConversion?: boolean; // false
|
|
43
|
-
}): void;
|
|
44
|
-
|
|
45
|
-
generateMipmap(hint: MipmapHint): void;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var Texture: {
|
|
49
|
-
prototype: Texture;
|
|
50
|
-
new(options: TextureOptions): Texture;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
interface Scene {
|
|
54
|
-
context: Context;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
interface AttributeLocations {
|
|
58
|
-
[k: string]: number;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const enum BufferUsage {
|
|
62
|
-
STREAM_DRAW = WebGLConstants.STREAM_DRAW,
|
|
63
|
-
STATIC_DRAW = WebGLConstants.STATIC_DRAW,
|
|
64
|
-
DYNAMIC_DRAW = WebGLConstants.DYNAMIC_DRAW,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface VertexArrayOptions {
|
|
68
|
-
context: Context;
|
|
69
|
-
attributes: {
|
|
70
|
-
index: number,
|
|
71
|
-
vertexBuffer: Buffer,
|
|
72
|
-
componentsPerAttribute: number,
|
|
73
|
-
componentDatatype: ComponentDatatype,
|
|
74
|
-
normalize?: boolean, // false
|
|
75
|
-
}[];
|
|
76
|
-
attributeLocations: AttributeLocations;
|
|
77
|
-
bufferUsage: BufferUsage;
|
|
78
|
-
indexBuffer?: Buffer;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
namespace ComponentDatatype {
|
|
82
|
-
function createTypedArray(componentDatatype: ComponentDatatype, valuesOrLength: number | number[]): Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
interface VertexArray extends Destroyable {
|
|
86
|
-
isDestroyed(): boolean;
|
|
87
|
-
destroy(): undefined;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
var VertexArray: {
|
|
91
|
-
prototype: VertexArray;
|
|
92
|
-
new(options: VertexArrayOptions): VertexArray;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// interface ShaderProgramOptions {
|
|
96
|
-
// gl: WebGLRenderingContext | WebGL2RenderingContext;
|
|
97
|
-
// // debugShaders: boolean;
|
|
98
|
-
// vertexShaderText: string;
|
|
99
|
-
// fragmentShaderText: string;
|
|
100
|
-
// attributeLocations: AttributeLocations;
|
|
101
|
-
// }
|
|
102
|
-
|
|
103
|
-
interface ShaderProgram extends Destroyable {
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// var ShaderProgram: {
|
|
108
|
-
// prototype: ShaderProgram;
|
|
109
|
-
// new(options: ShaderProgramOptions): ShaderProgram;
|
|
110
|
-
// }
|
|
111
|
-
|
|
112
|
-
interface ShaderSource {
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
var ShaderSource: {
|
|
117
|
-
prototype: ShaderSource;
|
|
118
|
-
new(options: {
|
|
119
|
-
defines?: string[];
|
|
120
|
-
sources: string[];
|
|
121
|
-
includeBuiltIns?: boolean;
|
|
122
|
-
}): ShaderSource;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
namespace ShaderProgram {
|
|
126
|
-
function fromCache(options: {
|
|
127
|
-
context: Context,
|
|
128
|
-
vertexShaderSource: ShaderSource,
|
|
129
|
-
fragmentShaderSource: ShaderSource,
|
|
130
|
-
attributeLocations: AttributeLocations,
|
|
131
|
-
}): ShaderProgram;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
interface UniformMap {
|
|
135
|
-
[k: string]: () => Texture | number | Cartesian2 | Cartesian3 | Cartesian4;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
interface RenderState {
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
interface RenderStateOptions {
|
|
143
|
-
frontFace?: WindingOrder, // WindingOrder.COUNTER_CLOCKWISE,
|
|
144
|
-
cull?: {
|
|
145
|
-
enabled?: boolean, // false
|
|
146
|
-
face?: CullFace, // CullFace.BACK
|
|
147
|
-
},
|
|
148
|
-
lineWidth?: number, // 1
|
|
149
|
-
polygonOffset?: {
|
|
150
|
-
enabled?: boolean, // false
|
|
151
|
-
factor?: number, // 0,
|
|
152
|
-
units?: number, // 0
|
|
153
|
-
},
|
|
154
|
-
scissorTest?: {
|
|
155
|
-
enabled?: boolean, // false,
|
|
156
|
-
rectangle?: {
|
|
157
|
-
x?: number, // 0,
|
|
158
|
-
y?: number, // 0,
|
|
159
|
-
width?: number, // 0,
|
|
160
|
-
height?: number, // 0
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
depthRange?: {
|
|
164
|
-
near?: number, // 0,
|
|
165
|
-
far?: number, // 1
|
|
166
|
-
},
|
|
167
|
-
depthTest?: {
|
|
168
|
-
enabled?: boolean; // false,
|
|
169
|
-
func?: DepthFunction; //DepthFunction.LESS
|
|
170
|
-
},
|
|
171
|
-
colorMask?: {
|
|
172
|
-
red?: boolean, // true,
|
|
173
|
-
green?: boolean, // true,
|
|
174
|
-
blue?: boolean, // true,
|
|
175
|
-
alpha?: boolean, // true
|
|
176
|
-
},
|
|
177
|
-
depthMask?: boolean, // true,
|
|
178
|
-
stencilMask?: number, // ~0
|
|
179
|
-
blending?: {
|
|
180
|
-
enabled?: boolean, // false,
|
|
181
|
-
color?: {
|
|
182
|
-
red?: number, // 0.0,
|
|
183
|
-
green?: number, // 0.0,
|
|
184
|
-
blue?: number, // 0.0,
|
|
185
|
-
alpha?: number, // 0.0
|
|
186
|
-
},
|
|
187
|
-
equationRgb?: BlendEquation, // BlendEquation.ADD,
|
|
188
|
-
equationAlpha?: BlendEquation, // BlendEquation.ADD,
|
|
189
|
-
functionSourceRgb?: BlendFunction, // BlendFunction.ONE,
|
|
190
|
-
functionSourceAlpha?: BlendFunction, // BlendFunction.ONE,
|
|
191
|
-
functionDestinationRgb?: BlendFunction, // BlendFunction.ZERO,
|
|
192
|
-
functionDestinationAlpha?: BlendFunction, // BlendFunction.ZERO
|
|
193
|
-
},
|
|
194
|
-
stencilTest?: {
|
|
195
|
-
enabled?: boolean, // false,
|
|
196
|
-
frontFunction?: StencilFunction, // StencilFunction.ALWAYS,
|
|
197
|
-
backFunction?: StencilFunction, // StencilFunction.ALWAYS,
|
|
198
|
-
reference?: number; // 0,
|
|
199
|
-
mask?: number; // ~0,
|
|
200
|
-
frontOperation?: {
|
|
201
|
-
fail?: StencilOperation, // StencilOperation.KEEP,
|
|
202
|
-
zFail?: StencilOperation, // StencilOperation.KEEP,
|
|
203
|
-
zPass?: StencilOperation, // StencilOperation.KEEP
|
|
204
|
-
},
|
|
205
|
-
backOperation?: {
|
|
206
|
-
fail?: StencilOperation, // StencilOperation.KEEP,
|
|
207
|
-
zFail?: StencilOperation, // StencilOperation.KEEP,
|
|
208
|
-
zPass?: StencilOperation, // StencilOperation.KEEP
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
sampleCoverage?: {
|
|
212
|
-
enabled?: boolean, // false,
|
|
213
|
-
value?: number, // 1.0,
|
|
214
|
-
invert?: boolean, // false
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
namespace RenderState {
|
|
219
|
-
function fromCache(options: RenderStateOptions): RenderState;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
namespace Appearance {
|
|
223
|
-
/**
|
|
224
|
-
*
|
|
225
|
-
* @param translucent 是否是透明的?透明对象的depthMask设为false,blending设为ALPHA_BLEND
|
|
226
|
-
* @param closed 是否为封闭体,如果是封闭体,会开启背面裁剪 cull { enabled: true, face: CullFace.BACK }
|
|
227
|
-
* @param existing 是否和一个已存在的RenderState进行合并,已存在的RenderState不做修改
|
|
228
|
-
*/
|
|
229
|
-
function getDefaultRenderState(translucent: boolean, closed: boolean, existing?: RenderStateOptions): RenderStateOptions;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const enum Pass {
|
|
234
|
-
ENVIRONMENT = 0,
|
|
235
|
-
COMPUTE = 1,
|
|
236
|
-
GLOBE = 2,
|
|
237
|
-
TERRAIN_CLASSIFICATION = 3,
|
|
238
|
-
CESIUM_3D_TILE = 4,
|
|
239
|
-
CESIUM_3D_TILE_CLASSIFICATION = 5,
|
|
240
|
-
CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW = 6,
|
|
241
|
-
OPAQUE = 7,
|
|
242
|
-
TRANSLUCENT = 8,
|
|
243
|
-
OVERLAY = 9,
|
|
244
|
-
NUMBER_OF_PASSES = 10,
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// interface DrawCommandOptions
|
|
248
|
-
|
|
249
|
-
interface PickId {
|
|
250
|
-
key: number;
|
|
251
|
-
color: Cesium.Color;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
interface DrawCommand {
|
|
255
|
-
boundingVolume: BoundingRectangle | BoundingSphere | OrientedBoundingBox | undefined;
|
|
256
|
-
orientedBoundingBox: OrientedBoundingBox | undefined;
|
|
257
|
-
cull: boolean; // deafult true
|
|
258
|
-
occlude: boolean; // default true
|
|
259
|
-
modelMatrix: Cesium.Matrix4 | undefined; // default undefined
|
|
260
|
-
primitiveType: PrimitiveType; // default TRIANGLES
|
|
261
|
-
vertexArray: VertexArray | undefined; // default undefined
|
|
262
|
-
count: number | undefined;
|
|
263
|
-
offset: number; // default 0
|
|
264
|
-
instanceCount: number; // default 0
|
|
265
|
-
shaderProgram: ShaderProgram | undefined; // default undefined
|
|
266
|
-
castShadows: boolean; // default false
|
|
267
|
-
receiveShadows: boolean; // default false
|
|
268
|
-
uniformMap: UniformMap | undefined; // default undefine
|
|
269
|
-
renderState: RenderState | undefined; // default undefined
|
|
270
|
-
// framebuffer: FrameB
|
|
271
|
-
pass: Pass | undefined; // default undefined
|
|
272
|
-
executeInClosestFrustum: boolean;
|
|
273
|
-
owner: Object | undefined;
|
|
274
|
-
debugShowBoundingVolume: boolean;
|
|
275
|
-
debugOverlappingFrustums: number;
|
|
276
|
-
pickId: string | undefined;
|
|
277
|
-
pickOnly: boolean;
|
|
278
|
-
depthForTranslucentClassification: boolean;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
var DrawCommand: {
|
|
282
|
-
prototype: DrawCommand;
|
|
283
|
-
new(options: {
|
|
284
|
-
// boundingVolume: BoundingVoluem;
|
|
285
|
-
cull?: boolean;
|
|
286
|
-
occlude?: boolean;
|
|
287
|
-
modelMatrix: Matrix4;
|
|
288
|
-
primitiveType?: PrimitiveType; // TRIANGLES
|
|
289
|
-
vertexArray: VertexArray;
|
|
290
|
-
count?: number;
|
|
291
|
-
offset?: number;
|
|
292
|
-
instanceCount?: number; // 0
|
|
293
|
-
shaderProgram: ShaderProgram;
|
|
294
|
-
uniformMap?: UniformMap;
|
|
295
|
-
renderState: RenderState;
|
|
296
|
-
// framebuffer: ;
|
|
297
|
-
pass: Pass;
|
|
298
|
-
executeInClosestFrustum: boolean;
|
|
299
|
-
owner?: any;
|
|
300
|
-
debugShowBoundingVolume?: boolean;
|
|
301
|
-
castShadows?: boolean; // false;
|
|
302
|
-
receiveShadows?: boolean; // false
|
|
303
|
-
pickId?: string;
|
|
304
|
-
pickOnly?: boolean; // false
|
|
305
|
-
depthForTranslucentClassification?: boolean; // false
|
|
306
|
-
boundingVolume?: BoundingRectangle | BoundingSphere | OrientedBoundingBox;
|
|
307
|
-
orientedBoundingBox?: OrientedBoundingBox;
|
|
308
|
-
}): DrawCommand;
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
interface ShadowMap {
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
interface FrameState {
|
|
316
|
-
context: Context;
|
|
317
|
-
commandList: DrawCommand[];
|
|
318
|
-
shadowMaps: ShadowMap[];
|
|
319
|
-
// brdfLutGenerator
|
|
320
|
-
// environmentMap
|
|
321
|
-
// sphericalHarmonicCoefficients
|
|
322
|
-
// specularEnvironmentMaps
|
|
323
|
-
mode: SceneMode;
|
|
324
|
-
morphTime: number;
|
|
325
|
-
frameNumber: number; // 0
|
|
326
|
-
newFrame: boolean;
|
|
327
|
-
time: JulianDate;
|
|
328
|
-
// jobScheduler
|
|
329
|
-
// mapProjection
|
|
330
|
-
camera: Camera;
|
|
331
|
-
cameraUnderground: boolean;
|
|
332
|
-
// globeTranslucencyState
|
|
333
|
-
// cullingVolume
|
|
334
|
-
// occluder
|
|
335
|
-
maximumScreenSpaceError: number; // 2
|
|
336
|
-
pixelRatio: number; // 1.0
|
|
337
|
-
passes: {
|
|
338
|
-
render: boolean;
|
|
339
|
-
pick: boolean;
|
|
340
|
-
depth: boolean;
|
|
341
|
-
postProcess: boolean;
|
|
342
|
-
offscreen: boolean;
|
|
343
|
-
};
|
|
344
|
-
// creditDisplay
|
|
345
|
-
afterRender: (() => void)[];
|
|
346
|
-
scene3DOnly: boolean;
|
|
347
|
-
// fog: FrameState.Fog
|
|
348
|
-
terrainExaggeration: number; // 1.0
|
|
349
|
-
imagerySplitPosition: number;
|
|
350
|
-
// frustumSplits
|
|
351
|
-
// light
|
|
352
|
-
// minimumDisableDepthTestDistance
|
|
353
|
-
// invertClassification
|
|
354
|
-
useLogDepth: boolean;
|
|
355
|
-
// tilesetPassState
|
|
356
|
-
minimumTerrainHeight: number; // 0.0
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
interface Buffer {
|
|
360
|
-
copyFromArrayView(arrayView: ArrayBufferView, offsetInBytes?: number): void;
|
|
361
|
-
readonly sizeInBytes: number;
|
|
362
|
-
readonly usage: BufferUsage;
|
|
363
|
-
isDestroyed(): boolean;
|
|
364
|
-
destroy(): undefined;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
// const enum IndexDatatype {
|
|
368
|
-
// /**
|
|
369
|
-
// * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
|
|
370
|
-
// * of an element in <code>Uint8Array</code>.
|
|
371
|
-
// */
|
|
372
|
-
// UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
|
|
373
|
-
// /**
|
|
374
|
-
// * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
|
|
375
|
-
// * of an element in <code>Uint16Array</code>.
|
|
376
|
-
// */
|
|
377
|
-
// UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
|
|
378
|
-
// /**
|
|
379
|
-
// * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
|
|
380
|
-
// * of an element in <code>Uint32Array</code>.
|
|
381
|
-
// */
|
|
382
|
-
// UNSIGNED_INT = WebGLConstants.UNSIGNED_INT
|
|
383
|
-
// }
|
|
384
|
-
|
|
385
|
-
interface IndexBuffer extends Buffer {
|
|
386
|
-
indexDatatype: IndexDatatype;
|
|
387
|
-
bytesPerIndex: number;
|
|
388
|
-
numberOfIndices: number;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
namespace Buffer {
|
|
392
|
-
function createVertexBuffer(options: {
|
|
393
|
-
context: Context;
|
|
394
|
-
typedArray: ArrayBufferView;
|
|
395
|
-
usage: BufferUsage;
|
|
396
|
-
}): Buffer;
|
|
397
|
-
|
|
398
|
-
function createIndexBuffer(options: {
|
|
399
|
-
context: Context;
|
|
400
|
-
typedArray: Uint8Array | Uint16Array | Uint32Array;
|
|
401
|
-
usage: BufferUsage;
|
|
402
|
-
indexDatatype: IndexDatatype;
|
|
403
|
-
}): IndexBuffer;
|
|
404
|
-
}
|
|
405
|
-
interface RectangleCollisionChecker {
|
|
406
|
-
_tree: any;
|
|
407
|
-
insert(id: string, rectangle: Cesium.Rectangle): void;
|
|
408
|
-
remove(id: string, rectangle: Cesium.Rectangle): void;
|
|
409
|
-
collides(rectangle: Cesium.Rectangle): boolean;
|
|
410
|
-
}
|
|
411
|
-
var RectangleCollisionChecker: {
|
|
412
|
-
prototype: RectangleCollisionChecker;
|
|
413
|
-
new(): RectangleCollisionChecker;
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
interface MaterialCache {
|
|
417
|
-
_materials: Record<string, any>;
|
|
418
|
-
addMaterial(type: string, materialTemplate: any): void;
|
|
419
|
-
getMaterial(type: string): any | undefined;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// 或者扩展 Material 类型
|
|
423
|
-
namespace Material {
|
|
424
|
-
let XbsjPolylineArrow: string;
|
|
425
|
-
const _materialCache: MaterialCache
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
interface QuadtreeTile {
|
|
429
|
-
x: number,
|
|
430
|
-
y: number,
|
|
431
|
-
level: number,
|
|
432
|
-
rectangle: Cesium.Rectangle;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Feature, LineString, Properties } from "@turf/helpers";
|
|
2
|
-
/**
|
|
3
|
-
* Takes a {@link LineString|line} and returns a curved version
|
|
4
|
-
* by applying a [Bezier spline](http://en.wikipedia.org/wiki/B%C3%A9zier_spline)
|
|
5
|
-
* algorithm.
|
|
6
|
-
*
|
|
7
|
-
* The bezier spline implementation is by [Leszek Rybicki](http://leszek.rybicki.cc/).
|
|
8
|
-
*
|
|
9
|
-
* @name bezierSpline
|
|
10
|
-
* @param {Feature<LineString>} line input LineString
|
|
11
|
-
* @param {Object} [options={}] Optional parameters
|
|
12
|
-
* @param {Object} [options.properties={}] Translate properties to output
|
|
13
|
-
* @param {number} [options.resolution=10000] time in milliseconds between points
|
|
14
|
-
* @param {number} [options.sharpness=0.85] a measure of how curvy the path should be between splines
|
|
15
|
-
* @returns {Feature<LineString>} curved line
|
|
16
|
-
* @example
|
|
17
|
-
* var line = turf.lineString([
|
|
18
|
-
* [-76.091308, 18.427501],
|
|
19
|
-
* [-76.695556, 18.729501],
|
|
20
|
-
* [-76.552734, 19.40443],
|
|
21
|
-
* [-74.61914, 19.134789],
|
|
22
|
-
* [-73.652343, 20.07657],
|
|
23
|
-
* [-73.157958, 20.210656]
|
|
24
|
-
* ]);
|
|
25
|
-
*
|
|
26
|
-
* var curved = turf.bezierSpline(line);
|
|
27
|
-
*
|
|
28
|
-
* //addToMap
|
|
29
|
-
* var addToMap = [line, curved]
|
|
30
|
-
* curved.properties = { stroke: '#0F0' };
|
|
31
|
-
*/
|
|
32
|
-
declare function bezier<P = Properties>(line: Feature<LineString> | LineString, options?: {
|
|
33
|
-
properties?: P;
|
|
34
|
-
resolution?: number;
|
|
35
|
-
sharpness?: number;
|
|
36
|
-
}): Feature<LineString, P>;
|
|
37
|
-
export default bezier;
|
package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/lib/spline.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export interface Point {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
z: number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* BezierSpline
|
|
8
|
-
* https://github.com/leszekr/bezier-spline-js
|
|
9
|
-
*
|
|
10
|
-
* @private
|
|
11
|
-
* @copyright
|
|
12
|
-
* Copyright (c) 2013 Leszek Rybicki
|
|
13
|
-
*
|
|
14
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
16
|
-
* in the Software without restriction, including without limitation the rights
|
|
17
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
19
|
-
* furnished to do so, subject to the following conditions:
|
|
20
|
-
*
|
|
21
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
22
|
-
* copies or substantial portions of the Software.
|
|
23
|
-
*
|
|
24
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
-
* SOFTWARE.
|
|
31
|
-
*/
|
|
32
|
-
export default class Spline {
|
|
33
|
-
duration: number;
|
|
34
|
-
points: Point[];
|
|
35
|
-
sharpness: number;
|
|
36
|
-
centers: Point[];
|
|
37
|
-
controls: Array<[Point, Point]>;
|
|
38
|
-
stepLength: number;
|
|
39
|
-
length: number;
|
|
40
|
-
delay: number;
|
|
41
|
-
steps: number[];
|
|
42
|
-
constructor(options?: any);
|
|
43
|
-
/**
|
|
44
|
-
* Caches an array of equidistant (more or less) points on the curve.
|
|
45
|
-
*/
|
|
46
|
-
cacheSteps(mindist: number): number[];
|
|
47
|
-
/**
|
|
48
|
-
* returns angle and speed in the given point in the curve
|
|
49
|
-
*/
|
|
50
|
-
vector(t: number): {
|
|
51
|
-
angle: number;
|
|
52
|
-
speed: number;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Gets the position of the point, given time.
|
|
56
|
-
*
|
|
57
|
-
* WARNING: The speed is not constant. The time it takes between control points is constant.
|
|
58
|
-
*
|
|
59
|
-
* For constant speed, use Spline.steps[i];
|
|
60
|
-
*/
|
|
61
|
-
pos(time: number): Point;
|
|
62
|
-
}
|