UNPKG

bcgis-sdk

Version:

The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.

2,296 lines (2,234 loc) 241 kB
/// <reference path="Cesium.d.ts" /> /// <reference path="CustomCesium.d.ts" /> declare module 'bcgis-sdk/dist/bcgis.base.min'; declare module 'bcgis-sdk/dist/bcgis.core.min'; declare namespace BC { export declare let Namespace = { Cesium }; /// <reference types="node" /> /** * 场景动画基类 */ declare abstract class Animation_2 { protected _viewer: Viewer; protected _options: any; /* Excluded from this release type: __constructor */ /** * 绑定事件 */ protected abstract _bindEvent(): any; /** * 解绑事件 */ protected abstract _unbindEvent(): any; /** * 开始动画 * @returns */ start(): this; /** * 停止动画 * @returns */ stop(): this; } export { Animation_2 as Animation } export declare let AnimationType: any; /** * 点位环绕构造函数选项 */ export declare namespace AroundPoint { export type ConstructorOptions = { /** * 偏移角度 */ heading: number; /** * 翻转角度 */ pitch: number; /** * 距离 */ range: number; /** * 间隔,单位:秒,当此值大于0时,callback才会生效 */ duration: number; /** * 完成回调函数 */ callback: Function; /** * 回调函数执行上下文 */ context: any; }; } /** * 点位环绕 * ```ts * let aroundPoint = new BC.AroundPoint(viewer, '120.121, 31.12') * aroundPoint.start() * ``` */ export declare class AroundPoint extends Animation_2 { private _position; private _heading; private _aroundAmount; /** * * @param viewer 3D 场景 * @param position 点位 * @param options 选项 */ constructor(viewer: Viewer, position: Position | string | string[] | number[], options?: AroundPoint.ConstructorOptions); /* Excluded from this release type: type */ /** * 位置 */ set position(position: Position | string | string[] | number[]); /** * 环绕量,控制环绕速度 */ set aroundAmount(aroundAmount: number); /** * 绑定事件 */ protected _bindEvent(): void; /** * 解绑事件 */ protected _unbindEvent(): void; /** * * @param scene * @param time */ private _onAround; } /** * 相机环绕构造函数选项 */ export declare namespace AroundView { export type ConstructorOptions = { /** * 偏移角度 */ heading: number; /** * 翻转角度 */ pitch: number; /** * 距离 */ range: number; /** * 间隔,单位:秒,当此值大于0时,callback才会生效 */ duration: number; /** * 完成回调函数 */ callback: Function; /** * 回调函数执行上下文 */ context: any; }; } /** * 相机环绕 * @example * ```ts * let aroundPoint = new BC.AroundPoint(viewer, '120.121, 31.12') * aroundPoint.start() * ``` */ export declare class AroundView extends Animation_2 { private _heading; private _aroundAmount; /** * @param viewer 3D 场景 * @param options */ constructor(viewer: Viewer, options?: AroundView.ConstructorOptions); /* Excluded from this release type: type */ /** * 环绕量,控制环绕速度 */ set aroundAmount(aroundAmount: any); protected _bindEvent(): void; protected _unbindEvent(): void; /** * * @param scene * @param time * @private */ private _onAround; } /** * 攻击箭头 * @noInheritDoc * @example * ```ts * let attackArrow = new BC.AttackArrow('-90.0,32.0;-94.0,36.0;-94.0,38.0') * ``` */ export declare class AttackArrow extends Overlay { /** * @hidden */ private _positions; /** * @hidden */ private headHeightFactor; /** * @hidden */ private headWidthFactor; /** * @hidden */ private neckHeightFactor; /** * @hidden */ private neckWidthFactor; /** * @hidden */ private tailWidthFactor; /** * @hidden */ private headTailFactor; /** * @hidden */ private _primitive; /** * @param {T_Position} positions * @return {*} */ constructor(positions: T_Position[]); get type(): any; set positions(positions: T_Position[]); get positions(): T_Position[]; protected _updatePrimitive(): void; _getArrowPoints(positions: any): any[]; _getArrowHeadPoints(points: any, tailLeft: any, tailRight: any): any[]; protected _getArrowBodyPoints(points: any, neckLeft: any, neckRight: any, tailWidthFactor: any): any[]; protected _getHierarchy(): Cesium.PolygonHierarchy; _mountedHook(): void; setLabel(text: string, textStyle: any): this; /** * 设置箭头风格 * 详情参考:@see {@link Polygon} * @param style * @returns {AttackArrow} */ setStyle(style: any): this; } declare class BaiduImageryProvider { _url: any; _labelStyle: any; _tileWidth: number; _tileHeight: number; _maximumLevel: number; _crs: any; _tilingScheme: any; _rectangle: any; _credit: any; _token: any; _style: any; _errorEvent: Cesium.Event<(...args: any[]) => void>; constructor(options?: any); get url(): any; get token(): any; get tileWidth(): number; get tileHeight(): number; get maximumLevel(): number; get minimumLevel(): number; get tilingScheme(): any; get rectangle(): any; get ready(): boolean; get credit(): any; get hasAlphaChannel(): boolean; get errorEvent(): Cesium.Event<(...args: any[]) => void>; getTileCredits(x: any, y: any, level: any): void; /** * Request Image * @param x * @param y * @param level * @returns {Promise<HTMLImageElement | HTMLCanvasElement>} */ requestImage(x: any, y: any, level: any): Promise<Cesium.ImageryTypes | Cesium.CompressedTextureBuffer>; } declare type BcCesium = typeof Cesium; /** * 图标 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let billboard = new BC.Billboard(position, "*.png") * billboard.size = [20, 20] * ``` */ export declare class Billboard extends Overlay { /** * @hidden */ private _position; /** * @hidden */ private _icon; /** * @hidden */ private _size; /** * * @param position 位置 * @param icon 图标 */ constructor(position: T_Position, icon: Cesium.Property | string | HTMLCanvasElement); get type(): any; set position(position: T_Position); /** * 坐标位置 */ get position(): T_Position; set icon(icon: string | HTMLCanvasElement | Cesium.Property); /** * 图标 */ get icon(): string | HTMLCanvasElement | Cesium.Property; set size(size: number[]); /** * 尺寸 */ get size(): number[]; /** * @hidden */ _mountedHook(): void; /** * * @param style * @returns {Billboard} * @example * ```json * // 样式参数(可选) * { * "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 * "scale": 1, //比例 * "pixelOffset": { "x": 0, "y": 0 }, //偏移像素 * "rotation": 0, //旋转角度 * "translucencyByDistance": { * "near": 0, //最近距离 * "nearValue": 0, //最近距离值 * "far": 1, //最远距离值 * "farValue": 0 //最远距离值 * }, //根据距离设置透明度 * "scaleByDistance": { * "near": 0, //最近距离 * "nearValue": 0, //最近距离值 * "far": 1, //最远距离值 * "farValue": 0 //最远距离值 * }, //根据距离设置比例 * "distanceDisplayCondition": { * "near": 0, //最近距离 * "far": Number.MAX_VALUE //最远距离 * }, //根据距离设置可见 * "disableDepthTestDistance": 0 // 深度检测距离,用于防止剪切地形,设置为零时,将始终应用深度测试。设置为Number.POSITIVE_INFINITY时,永远不会应用深度测试。 * } * ``` */ setStyle(style: any): this; /** * Entity转换为Overlay * @param entity * @returns {Billboard} */ static fromEntity(entity: Cesium.Entity): Billboard | undefined; } /** * 图标图元 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let billboard = new BC.BillboardPrimitive(position, '*.png') * billboard.size = [20, 20] * ``` */ export declare class BillboardPrimitive extends Overlay { protected _position: Position; protected _icon: Cesium.Property | string | HTMLCanvasElement; protected _size: number[]; /** * * @param position 坐标 * @param icon 图标 */ constructor(position: T_Position, icon: Cesium.Property | string | HTMLCanvasElement); get type(): any; set position(position: T_Position); get position(): T_Position; set icon(icon: string | HTMLCanvasElement | Cesium.Property); get icon(): string | HTMLCanvasElement | Cesium.Property; set size(size: number[]); get size(): number[]; _mountedHook(): void; /** * * @param style */ setStyle(style: any): this; } /** * 黑白效果 * @example * ```ts * viewer.effect.blackAndWhite.enable = true * ``` */ export declare class BlackAndWhite { private _viewer; private _delegate; private _enable; private _gradations; private _selected; private _state; constructor(); /** * 类型 * @ignore */ get type(): string; /** * 是否启用 */ set enable(enable: boolean); get enable(): boolean; /** * 强度 */ set gradations(gradations: number); get gradations(): number; /** * 设置后期作用的覆盖物 */ set selected(selected: any[]); get selected(): any[]; /** * */ private _createPostProcessStage; /** * 添加特效 * @param viewer * @returns {BlackAndWhite} * @ignore */ addTo(viewer: Cesium.Viewer): BlackAndWhite; } /** * 泛光效果 * @example * ```ts * viewer.effect.bloom.enable = true * ``` */ export declare class Bloom { private _viewer; private _enable; private _contrast; private _brightness; private _glowOnly; private _delta; private _sigma; private _stepSize; private _selected; private _state; private _delegate; constructor(); /** * 类型 * @ignore */ get type(): string; /** * 是否启用 */ set enable(enable: boolean); get enable(): boolean; /** * 对比度 */ set contrast(contrast: number); get contrast(): number; /** * 亮度 */ set brightness(brightness: number); get brightness(): number; /** * 只发光 */ set glowOnly(glowOnly: boolean); get glowOnly(): boolean; /** * Delta */ set delta(delta: number); get delta(): number; /** * Sigma */ set sigma(sigma: number); get sigma(): number; /** * StepSize */ set stepSize(stepSize: number); get stepSize(): number; /** * 设置后期作用的覆盖物 */ set selected(selected: any[]); get selected(): any[]; /** * */ private _createPostProcessStage; /** * 添加效果 * @param viewer * @returns {Bloom} * @ignore */ addTo(viewer: Cesium.Viewer): Bloom; } /** * 跳动图标图元 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let billboard = new BC.BounceBillboardPrimitive(position, '*.png') * billboard.size = [20, 20] * ``` */ export declare class BounceBillboardPrimitive extends BillboardPrimitive { private _currentOffset; private _isUp; /** * * @param position 坐标 * @param icon 图标 */ constructor(position: T_Position, icon: Cesium.Property | string | HTMLCanvasElement); get type(): any; /** * * @param frameState */ update(frameState: any): void; destroy(): void; } /** * 跳动注记图元 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let label = new BC.BounceLabelPrimitive(position, 'test') * ``` */ export declare class BounceLabelPrimitive extends LabelPrimitive { protected _currentOffset: Cesium.Cartesian2; protected _isUp: boolean; protected _state: string; protected _show: boolean; protected _style: any; protected _delegate: any; /** * * @param position 坐标 * @param text 文本 */ constructor(position: T_Position, text: string); get type(): any; /** * * @param frameState */ update(frameState: any): void; destroy(): void; } /** * 盒子 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let box = new BC.Box(position, 20, 30, 40) * ``` */ export declare class Box extends Overlay { /** * @hidden */ private _position; /** * @hidden */ private _length; /** * @hidden */ private _width; /** * @hidden */ private _height; /** * * @param position 位置 * @param length 长度 * @param width 宽度 * @param height 高度 */ constructor(position: T_Position, length: number, width: number, height: number); get type(): any; set position(position: T_Position); /** * 位置 */ get position(): T_Position; set length(length: number); get length(): number; set width(width: number); get width(): number; set height(height: number); get height(): number; /** * @hidden */ _mountedHook(): void; /** * 设置风格 * @param style * @returns {Box} * @example * ```json * // 样式参数(可选) * { * "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 * "fill": true, //是否用提供的材料填充多边形。 * "material": BC.Color.WHITE, //材质 * "outline": false, //是否显示边框 * "outlineColor": BC.Color.BLACK, //边框颜色 * "outlineWidth": 0, //边框宽度 * "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受 * "distanceDisplayCondition": { * "near": 0, //最近距离 * "far": Number.MAX_VALUE //最远距离 * } //根据距离设置可见 * } * ``` */ setStyle(style: any): this; } /** * 明亮效果 * @example * ```ts * viewer.effect.brightness.enable = true * ``` */ export declare class Brightness { private _viewer; private _delegate; private _enable; private _intensity; private _selected; private _state; constructor(); /** * 类型 * @ignore */ get type(): string; /** * 设置类型 */ set enable(enable: boolean); /** * 强度 */ get enable(): boolean; /** * 设置强度 */ set intensity(intensity: number); /** * 强度 */ get intensity(): number; /** * 设置后期作用的覆盖物 */ set selected(selected: any[]); get selected(): any[]; /** * */ private _createPostProcessStage; /** * 添加效果 * @param viewer * @returns {Brightness} * @ignore */ addTo(viewer: Cesium.Viewer): Brightness; } export declare const CallbackProperty: typeof globalThis.Cesium.CallbackProperty; export declare const Cartesian2: typeof globalThis.Cesium.Cartesian2; export declare const Cartesian3: typeof globalThis.Cesium.Cartesian3; declare const Cesium_2: BcCesium; /** * 圆 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let circle = new BC.Circle(position, 200) * ``` */ export declare class Circle extends Overlay { private _center; private _radius; private _rotateAmount; private _stRotation; /** * * @param center 中心点位置 * @param radius 半径 */ constructor(center: T_Position, radius: number); get type(): any; set center(center: T_Position); get center(): T_Position; set radius(radius: number); get radius(): number; set rotateAmount(amount: number); get rotateAmount(): number; private _computeHierarchy; _mountedHook(): void; /** * Sets Text with Style * @param text * @param textStyle * @returns {Circle} */ setLabel(text: string, textStyle: any): this; /** * 设置风格 * @param style * @returns {Circle} * @example * ```json * // 样式参数(可选) * { * "height": 1, //高度 * "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 * "extrudedHeight": 0, //拉升高度 * "rotation": 0, //顺时针旋转角度 * "stRotation": 0, //逆时针旋转角度 * "fill": true, //是否用提供的材料填充多边形。 * "material": BC.Color.WHITE, //材质 * "outline": false, //是否显示边框 * "outlineColor": BC.Color.BLACK, //边框颜色 * "outlineWidth": 0, //边框宽度 * "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受 * "distanceDisplayCondition": { * "near": 0, //最近距离 * "far": Number.MAX_VALUE //最远距离 * }, //根据距离设置可见 * "classificationType": 2, //分类 是否影响地形,3D切片或同时影响这两者。0:地形、1:3D切片、2:两者 * "zIndex": 0 //层级 * } * ``` */ setStyle(style: any): this; } /** * 模糊圆材质 * @noInheritDoc * @example * ```ts * let material = new BC.CircleBlurMaterialProperty({ * color: BC.Color.WHITE, * }) * ``` */ export declare class CircleBlurMaterialProperty extends MaterialProperty { /** * 颜色 */ color: Cesium.Color; /** * 速度 */ speed: number; /** * @param options 属性 */ constructor(options?: { /** * 颜色 * @defaultValue BC.Color.fromBytes(0, 255, 255, 255) */ color: Cesium.Color; /** * 速度 * @defaultValue 1 */ speed: number; }); /* Excluded from this release type: getType */ /* Excluded from this release type: getValue */ /* Excluded from this release type: equals */ } /** * 扩散圆材质 * @noInheritDoc * @example * ```ts * let material = new BC.CircleDiffuseMaterialProperty({ * color: BC.Color.WHITE, * }) * ``` */ export declare class CircleDiffuseMaterialProperty extends MaterialProperty { /** * 颜色 */ color: Cesium.Color; /** * 速度 */ speed: number; /** * @param options 属性 */ constructor(options?: { /** * 颜色 * @defaultValue BC.Color.fromBytes(0, 255, 255, 255) */ color: Cesium.Color; /** * 速度 * @defaultValue 1 */ speed: number; }); /* Excluded from this release type: getType */ /* Excluded from this release type: getValue */ /* Excluded from this release type: equals */ } /** * 逐渐消逝圆材质 * @noInheritDoc * @example * ```ts * let material = new BC.CircleFadeMaterialProperty({ * color: BC.Color.WHITE, * }) * ``` */ export declare class CircleFadeMaterialProperty extends MaterialProperty { /** * 颜色 */ color: Cesium.Color; /** * 速度 */ speed: number; /** * @param options 属性 */ constructor(options?: { /** * 颜色 * @defaultValue BC.Color.fromBytes(0, 255, 255, 255) */ color: Cesium.Color; /** * 速度 * @defaultValue 1 */ speed: number; }); /* Excluded from this release type: getType */ /* Excluded from this release type: getValue */ /* Excluded from this release type: equals */ } /** * 脉冲圆材质 * @noInheritDoc * @example * ```ts * let material = new BC.CirclePulseMaterialProperty({ * color: BC.Color.WHITE, * }) * ``` */ export declare class CirclePulseMaterialProperty extends MaterialProperty { /** * 颜色 */ color: Cesium.Color; /** * 速度 */ speed: number; /** * @param options 属性 */ constructor(options?: { /** * 颜色 * @defaultValue BC.Color.fromBytes(0, 255, 255, 255) */ color: Cesium.Color; /** * 速度 * @defaultValue 1 */ speed: number; }); /* Excluded from this release type: getType */ /* Excluded from this release type: getValue */ /* Excluded from this release type: equals */ } /** * 扫描圈 * @example * ```ts * let circleScan = new BC.CircleScan(viewer, '120, 20', 200) * circleScan.start() * ``` */ export declare class CircleScan extends Animation_2 { private _delegate; private _position; private _radius; private _color; private _speed; /** * * @param viewer 3D场景 * @param position 位置 * @param radius 半径 * @param options 属性 */ constructor(viewer: Viewer, position: Position | string | string[] | number[], radius: number, options?: { /**颜色 */ color: Cesium.Color; /**速度 */ speed: number; }); /* Excluded from this release type: type */ private _mountContent; /** * 开始 * @returns */ start(): this; /** * 结束 */ stop(): this; protected _bindEvent(): void; protected _unbindEvent(): void; } /** * 扫描圆材质 * @noInheritDoc * @example * ```ts * let material = new BC.CircleScanMaterialProperty({ * color: BC.Color.WHITE, * }) * ``` */ export declare class CircleScanMaterialProperty extends MaterialProperty { /** * 颜色 */ color: Cesium.Color; /** * 速度 */ speed: number; /** * @param options 属性 */ constructor(options?: { /** * 颜色 * @defaultValue BC.Color.fromBytes(0, 255, 255, 255) */ color: Cesium.Color; /** * 速度 * @defaultValue 1 */ speed: number; }); /* Excluded from this release type: getType */ /* Excluded from this release type: getValue */ /* Excluded from this release type: equals */ } /** * 螺旋圆材质 * @noInheritDoc * @example * ```ts * let material = new BC.CircleSpiralMaterialProperty({ * color: BC.Color.WHITE, * }) * ``` */ export declare class CircleSpiralMaterialProperty extends MaterialProperty { /** * 颜色 */ color: Cesium.Color; /** * 速度 */ speed: number; /** * @param options 属性 */ constructor(options?: { /** * 颜色 * @defaultValue BC.Color.fromBytes(0, 255, 255, 255) */ color: Cesium.Color; /** * 速度 * @defaultValue 1 */ speed: number; }); /* Excluded from this release type: getType */ /* Excluded from this release type: getValue */ /* Excluded from this release type: equals */ } /** * 多彩圆材质 * @example * @noInheritDoc * ```ts * let material = new BC.CircleVaryMaterialProperty({ * color: BC.Color.WHITE, * }) * ``` */ export declare class CircleVaryMaterialProperty extends MaterialProperty { /** * 颜色 */ color: Cesium.Color; /** * 速度 */ speed: number; /** * @param options 属性 */ constructor(options?: { /** * 颜色 * @defaultValue BC.Color.fromBytes(0, 255, 255, 255) */ color: Cesium.Color; /** * 速度 * @defaultValue 1 */ speed: number; }); /* Excluded from this release type: getType */ /* Excluded from this release type: getValue */ /* Excluded from this release type: equals */ } /** * 波纹圆材质 * @noInheritDoc * @example * ```ts * let material = new BC.CircleWaveMaterialProperty({ * color: BC.Color.WHITE, * }) * ``` */ export declare class CircleWaveMaterialProperty extends MaterialProperty { /** * 颜色 */ color: Cesium.Color; /** * 速度 */ speed: number; /** * 数量 */ count: number; /** * 强度 */ gradient: number; /** * * @param options 属性 */ constructor(options?: { /**颜色 */ color: Cesium.Color; /** 速度*/ speed?: number; /**数量 */ count?: number; /**强度 */ gradient?: number; }); /* Excluded from this release type: isConstant */ /* Excluded from this release type: definitionChanged */ /* Excluded from this release type: getType */ /* Excluded from this release type: getValue */ /* Excluded from this release type: equals */ } export declare const ClassificationType: typeof globalThis.Cesium.ClassificationType; export declare class ClippingTerrain { _viewer: any; _clippingPlanes: Cesium.ClippingPlaneCollection; constructor(); get viewer(): any; get clippingPlanes(): Cesium.ClippingPlaneCollection; clipTerrain(positions: T_Position[], ishole?: boolean): void; createPlane(p1: Cesium.Cartesian3, p2: Cesium.Cartesian3): Cesium.ClippingPlane; isClockWise(latLngArr: any): boolean; /** * * @param viewer */ install(viewer: any): void; clear(): void; destroy(): void; uninstall(viewer: any): void; } export declare class ClippingTileset { _viewer: Viewer; _clippingPlanes: Cesium.ClippingPlaneCollection; constructor(); get viewer(): Viewer; get clippingPlanes(): Cesium.ClippingPlaneCollection; clipTileset(tileset: Cesium.Cesium3DTileset, positions: T_Position[], ishole?: boolean): void; createPlane(p1: Position, p2: Position, inverseTransform: Cesium.Matrix4, ishole: boolean): Cesium.ClippingPlane; isClockWise(latLngArr: any): boolean; /** * * @param viewer */ install(viewer: Viewer): void; clear(): void; destroy(): void; uninstall(viewer: any): void; } /** * 云效果 * @example * ```ts * viewer.weather.cloud.enable = true * viewer.weather.cloud.rotateAmount = 0.02 * ``` */ export declare class Cloud { private _id; private _viewer; private _delegate; private _rotateAmount; private _enable; private _heading; private _state; constructor(); /** * 类型 */ get type(): string; /** * 是否启用 */ set enable(enable: boolean); get enable(): boolean; /** * 移动增量,可为负数 */ set rotateAmount(rotateAmount: number); get rotateAmount(): number; /** * * @param scene * @param time */ private _onRotate; /** * * @private */ private _createPrimitive; /* Excluded from this release type: addTo */ } /** * 云图元 * @noInheritDoc */ export declare class CloudPrimitive extends Overlay { private _position; /** * * @param position 坐标 */ constructor(position: T_Position); get type(): any; set position(position: T_Position); get position(): T_Position; _mountedHook(): void; /** * * @param style */ setStyle(style: any): this; } /** * 聚合图层 * @noInheritDoc * @example * ```ts * let layer = new BC.ClusterLayer('id') * viewer.addLayer(layer) * ``` */ export declare class ClusterLayer extends Layer { _cache: any; private _options; protected _delegate: Cesium.CustomDataSource; /** * @param id ID * @param options 聚合图层选项 * @example * ```ts * // 属性参数(可选) { "size": 48, //聚合的尺寸 "pixelRange": 40, //像素范围 "gradient": { "0.0001": BC.Color.DEEPSKYBLUE, "0.001": BC.Color.GREEN, "0.01": BC.Color.ORANGE, "0.1": BC.Color.RED }, // 幅度颜色设置 "style": "circle", // circle 和 clustering "fontSize": 12, // 字体大小 "fontColor": BC.Color.BLACK // 字体颜色 } * ``` */ constructor(id: string, options?: ClusterLayerOptions); /** * 项目类型 */ get type(): string; /** * 是否聚合 */ set enableCluster(enableCluster: boolean); /** * 绘制圆 * @param color 颜色 * @param numLength * @returns {*} * @private */ private _drawCircle; /** * 绘制聚合 * @param color * @param numLength * @returns {*} */ private _drawClustering; /** * 聚合事件句柄 * @param {*} clusteredEntities * @param {*} cluster */ private _clusterEventHandler; /** * 清空聚合图层 */ clear(): this; setStyle(style: any): void; } declare interface ClusterLayerOptions { size: number; pixelRange: number; gradient: { 0.0001: any; 0.001: any; 0.01: any; 0.1: any; }; fontSize: number; fontColor: Cesium.Color; style: string; } export declare const Color: typeof globalThis.Cesium.Color; export declare const ColorMaterialProperty: typeof globalThis.Cesium.ColorMaterialProperty; /** * 指北针 * @noInheritDoc * @example * ```ts * viewer.compass.enable = true/false * ``` */ declare class Compass extends Widget { protected _wrapper: any; private _compassRectangle; private _outRing; private _gyro; private _rotation_marker; private _orbitCursorAngle; private _orbitCursorOpacity; private _orbitLastTimestamp; private _orbitFrame; private _orbitIsLook; private _rotateInitialCursorAngle; private _rotateFrame; private _mouseMoveHandle; private _mouseUpHandle; /** * 状态 */ _state: string; protected _ready: boolean; private _rotateInitialCameraAngle; /** * @hidden */ constructor(); /** * @hidden */ get type(): any; /** * @hidden */ protected _installHook(): void; /** * @hidden */ protected _bindEvent(): void; /** * @hidden */ protected _unbindEvent(): void; /** * @hidden */ private _postRenderHandler; /** * @hidden */ protected _mountContent(): void; /** * @hidden */ private _handleMouseDown; /** * @hidden */ private _handleDoubleClick; /** * @hidden */ private _getCameraFocus; /** * @hidden */ private _orbit; /** * @hidden */ private _orbitTickFunction; /** * @hidden */ private _updateAngleAndOpacity; /** * @hidden */ private _orbitMouseMoveFunction; /** * @hidden */ private _orbitMouseUpFunction; /** * @hidden */ private _rotate; /** * @hidden */ private _rotateMouseMoveFunction; /** * @hidden */ private _rotateMouseUpFunction; /** * @hidden */ private _getVector; } declare const ConstructorOptions: { /**最大可见距离 */ maxVisibleDistance: number; /**最小可见距离 */ minVisibleDistance: number; /**高度偏移 */ heightOffset: number; }; /** * 右击菜单 * @noInheritDoc * @example * ```ts * let contextMenu = viewer.contextMenu * contextMenu.enable = true * contextMenu.DEFAULT_MENU = [ * { * label: '测试', * callback: (e) => {}, // e是一个对象主要包括 windowPosition,position,surfacePosition,overlay * context: this, * }, * ] // 设置默认的右击菜单,会影响全局右击菜单(慎用)。 * ``` */ declare class ContextMenu extends Widget { private _ulEl; private _handler; private _overlay; private _position; private _wgs84Position; private _surfacePosition; private _wgs84SurfacePosition; private _windowPosition; private _instanceId; private _config; private _defaultMenu; private _overlayMenu; /** * @hidden */ constructor(); /** * @hidden */ get type(): any; /** * @hidden */ set DEFAULT_MENU(menus: any); set config(config: any); /** * * @private */ _installHook(): void; /** * * @private */ _bindEvent(): void; /** * * @private */ _unbindEvent(): void; /** * * @private */ _mountContent(): void; /** * * @private */ _mountMenu(): void; /** * * @param movement * @private */ _onRightClick(movement: Cesium.ScreenSpaceEventHandler.PositionedEvent): void; /** * * @param movement * @private */ _onClick(movement: Cesium.ScreenSpaceEventHandler.PositionedEvent): void; /** * * @param windowCoord * @private */ _updateWindowCoord(windowCoord: { x: number; y: number; }): void; /** * * @private */ _setCustomClass(): void; /** * * @param label * @param method * @param context * @returns {ContextMenu} * @private */ _addMenuItem(label: any, method: any, context: any): this; } export declare class ContourLine { _viewer: Viewer; options: any; constructor(); get viewer(): Viewer; addContourLine(options: any): void; removeContourLine(): void; destroy(): void; /** * * @param viewer */ install(viewer: Viewer): void; uninstall(viewer: any): void; } export declare class CoordTransform { /** * BD-09 To GCJ-02 * @param lng * @param lat * @returns {number[]} */ static BD09ToGCJ02(lng: any, lat: any): number[]; /** * GCJ-02 To BD-09 * @param lng * @param lat * @returns {number[]} * @constructor */ static GCJ02ToBD09(lng: any, lat: any): number[]; /** * WGS-84 To GCJ-02 * @param lng * @param lat * @returns {number[]} */ static WGS84ToGCJ02(lng: any, lat: any): any[]; /** * GCJ-02 To WGS-84 * @param lng * @param lat * @returns {number[]} * @constructor */ static GCJ02ToWGS84(lng: any, lat: any): any[]; /** * * @param lng * @param lat * @returns {number[]} */ static delta(lng: any, lat: any): any[]; /** * * @param lng * @param lat * @returns {number} */ static transformLng(lng: any, lat: any): any; /** * * @param lng * @param lat * @returns {number} */ static transformLat(lng: any, lat: any): number; /** * * @param lng * @param lat * @returns {boolean} */ static out_of_china(lng: any, lat: any): boolean; } /** * 走廊 * @noInheritDoc * @example * ```ts * let corridor = new BC.Corridor('120,20;120,30') * corridor.setStyle({ * width: 10, * }) * ``` */ export declare class Corridor extends Overlay { private _positions; /** * * @param positions 坐标串 */ constructor(positions: string | T_Position[]); get type(): any; set positions(positions: string | T_Position[]); get positions(): string | T_Position[]; _mountedHook(): void; /** * * @param text * @param textStyle */ setLabel(text: string, textStyle: any): this; /** * 设置风格 * @param style * @returns {Corridor} * @example * ```json * // 样式参数(可选) * { * "width": 1, //线宽 * "height": 0, //高度 * "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 * "cornerType": 0, //转角类别,0:圆角、1:直角、2:斜角 * "fill": true, //是否用提供的材料填充多边形。 * "material": BC.Color.WHITE, //材质 * "outline": false, //是否显示边框 * "outlineColor": BC.Color.BLACK, //边框颜色 * "outlineWidth": 0, //边框宽度 * "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受 * "distanceDisplayCondition": { * "near": 0, //最近距离 * "far": Number.MAX_VALUE //最远距离 * }, //根据距离设置可见 * "classificationType": 2, //分类 是否影响地形,3D切片或同时影响这两者。0:地形、1:3D切片、2:两者 * "zIndex": 0 //层级 * } * ``` */ setStyle(style: any): this; /** * Entity 转换为 Overlay * @param entity * @returns {Corridor} */ static fromEntity(entity: Cesium.Entity): Corridor | undefined; } /** * 自定义图标 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let billboard = new BC.CustomBillboard(position, '*.png') * billboard.size = [20, 20] * ``` */ export declare class CustomBillboard extends Overlay { _position: Position; _icon: any; _size: number[]; constructor(position: T_Position, icon: any); get type(): any; set position(position: Position); get position(): Position; set icon(icon: any); get icon(): any; set size(size: number[]); get size(): number[]; _mountedHook(): void; /** * Sets label * @param text * @param textStyle */ setLabel(text: string, textStyle: any): this; /** * 设置风格 * @param style */ setStyle(style: any): this; /** * Sets VLine style * @param style */ setVLine(style?: any): this; /** * @param {*} radius * @param {*} style * @param {*} rotateAmount */ setBottomCircle(radius: number, style?: {}, rotateAmount?: number): this; } /** * 自定义注记 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let label = new BC.CustomLabel(position, 'test') * ``` */ export declare class CustomLabel extends Overlay { _position: Position; _text: string; constructor(position: T_Position, text: any); get type(): any; set position(position: T_Position); get position(): T_Position; set text(text: string); get text(): string; _mountedHook(): void; /** * * @param style * @example * ```json * * ``` */ setStyle(style: any): this; /** * Sets VLine style * @param style */ setVLine(style?: any): this; /** * Sets bottom circle * @param radius * @param style * @param rotateAmount */ setBottomCircle(radius: number, style?: {}, rotateAmount?: number): this; } export declare class CustomPrimitive extends Overlay { /** * * @param positions 坐标串 * @param holes 空心坐标串 */ constructor(options: any); get type(): any; _mountedHook(): void; setStyle(style: any): this; } export declare const CustomShader: typeof globalThis.Cesium.CustomShader; export declare const CustomShaderMode: typeof globalThis.Cesium.CustomShaderMode; export declare const CustomShaderTranslucencyMode: typeof globalThis.Cesium.CustomShaderTranslucencyMode; export declare class CutFill { _viewer: Viewer; _db: Cesium.CustomDataSource; totalFillVolume: number; totalCutVolume: number; constructor(); get viewer(): Viewer; get db(): Cesium.CustomDataSource; /** * 计算多边形的重心点, 用于展示label标签 * @param {*} positions */ computeCentroidOfPolygon(positions: any): Cesium.Cartographic; /** * 计算方量 * @param {*} positions 点串 * @param {*} cutAndFillBaseHeight 填挖高度 * @param {*} precision 精度,默认64 */ computeCutVolume(positions: Position[], cutAndFillHeight?: number, precision?: number): number | false; /** * 计算三角形的面积 * @param {*} pos1 * @param {*} pos2 * @param {*} pos3 */ computeAreaOfTriangle(pos1: any, pos2: any, pos3: any): number; clear(): void; destroy(): void; /** * * @param viewer */ install(viewer: Viewer): void; uninstall(viewer: any): void; } /** * 圆柱 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let cylinder = new BC.Cylinder(position, 20, 30, 40) * ``` */ export declare class Cylinder extends Overlay { private _position; private _length; private _topRadius; private _bottomRadius; /** * * @param position 位置 * @param length 长度 * @param topRadius 上半径 * @param bottomRadius 下半径 */ constructor(position: T_Position, length: number, topRadius: number, bottomRadius: number); get type(): any; set position(position: T_Position); get position(): T_Position; set length(length: number); get length(): number; set topRadius(topRadius: number); get topRadius(): number; set bottomRadius(bottomRadius: number); get bottomRadius(): number; _mountedHook(): void; /** * * @param text * @param textStyle */ setLabel(text: string, textStyle: any): this; /** * 设置风格 * @param style * @returns {Cylinder} * @example * ```json * // 样式参数(可选) * { * "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 * "fill": true, //是否用提供的材料填充多边形。 * "material": BC.Color.WHITE, //材质 * "outline": false, //是否显示边框 * "outlineColor": BC.Color.BLACK, //边框颜色 * "outlineWidth": 0, //边框宽度 * "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受 * "distanceDisplayCondition": { * "near": 0, //最近距离 * "far": Number.MAX_VALUE //最远距离 * } //根据距离设置可见 * } * ``` */ setStyle(style: any): this; } /** * Czml 图层,用于加载 Czml 数据 * @noInheritDoc * @example * ```js * let layer = new BC.CzmlLayer('id', '**\/**.czml') * layer.eachOverlay((item) => { * if (item.polyline) { * //todo * } * if (item.polygon) { * //todo * } * if (item.billboard) { * //todo * } * }) * ``` */ export declare class CzmlLayer extends Layer { protected _delegate: Promise<Cesium.CzmlDataSource>; /** * @param id 图层唯一标识 * @param url 数据地址 * @param options 属性配置 */ constructor(id: string, url?: string, options?: {}); /** * 类型 */ get type(): string; /** * 是否显示 */ set show(show: boolean); get show(): boolean; /** * 遍历覆盖物 * @param method 回调方法 * @param context * @returns {CzmlLayer} */ eachOverlay(method: { (item: { attr: { [x: string]: any; }; }): void; call?: any; }, context: this): this; setStyle(style: any): void; clear(): void; } declare const DEF_OPTS: { clampToGround: boolean; clampToTileset: boolean; interpolationType: string; interpolationDegree: number; endDelayTime: number; headingOffset: number; }; /** * 景深效果 * @example * ```ts * viewer.effect.depthOfField.enable = true * ``` */ export declare class DepthOfField { private _viewer; private _delegate; private _enable; private _focalDistance; private _delta; private _sigma; private _stepSize; private _selected; private _state; constructor(); /** * 类型 * @ignore */ get type(): string; /** * 是否启用 */ set enable(enable: boolean); get enable(): boolean; /** * 焦距 */ set focalDistance(focalDistance: number); get focalDistance(): number; /** * Delta */ set delta(delta: number); get delta(): number; /** * Sigma */ set sigma(sigma: number); get sigma(): number; /** * StepSize */ set stepSize(stepSize: number); get stepSize(): number; /** * 设置后期作用的覆盖物 */ set selected(selected: any[]); get selected(): any[]; /** * * @private */ private _createPostProcessStage; /** * 添加效果 * @param viewer * @returns {DepthOfField} * @ignore */ addTo(viewer: Cesium.Viewer): DepthOfField; } /** * 扩散墙图元 * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let wall = new BC.DiffuseWallPrimitive(position, 2000, 1000) * ``` */ export declare class DiffuseWallPrimitive extends Overlay { private _center; private _height; private _radius; private _currentHeight; private _currentRadius; /** * * @param center 坐标 * @param radius 半径 * @param height 高度 */ constructor(center: T_Position, radius: number, height: number); get type(): any; set center(position: T_Position); get center(): T_Position; set radius(radius: number); get radius(): number; set height(height: number); get height(): number; /** * * @private */ private _getPositions; /** * * @param length * @param hegiht * @private */ private _getHeights; /** * * @param frameState */ update(frameState: any): boolean; /** * 设置风格 * @param style * @example * ```json * // 样式参数(可选) * { * "minRadius": 10, // 动画最小半径 * "minHeight": 30, // 动画最小高度 * "color": BC.Color.RED, // 墙体颜色 * "slices": 128, //边数 * "speed": 10 //速度 * } * ``` */ setStyle(style: any): this; destroy(): void; } /** * 比例尺 * @noInheritDoc * @example * ```ts * viewer.distanceLegend.enable = true * ``` */ declare class DistanceLegend extends Widget { private _labelEl; private _scaleBarEl; private _lastUpdate; /** * @hidden */ constructor(); /** * @hidden */ get type(): any; /** * * @private */ _installHook(): void; /** * * @private */ _bindEvent(): void; /** * * @private */ _unbindEvent(): void; /** * * @param scene * @param time * @returns * @private */ _updateContent(scene: any, time: any): void; /** * * @private */ _mountContent(): void; } /** * DivIcon * @noInheritDoc * @example * ```ts * let position = new BC.Position(120, 20) * let divIcon = new BC.DivIcon(position, '<div></div>') * ``` */ export declare class DivIcon extends Overlay { private _position; /** * * @param position 坐标 * @param content 内容 */ constructor(position: T_Position, content: any); get type(): any; set show(show: boolean); get show(): boolean; set position(position: T_Position); get position(): T_Position; set content(content: any); get content(): any; /** * Updates style * @param windowCoord * @param distance * @param isFront * @private */ _updateStyle(windowCoord: any, distance: any, isFront: any): void; /** * * @param layer * @private */ _onAdd(layer: Layer): void; /** * * @private */ _onRemove(): void; /** * Sets text * @param text * @param textStyle */ setLabel(text: string, textStyle: any): this; /** * 设置风格 * @param style * @example * ```json * // 样式参数(可选) * { * "className": "test", //样式名 * "scaleByDistance": { * "near": 0, //最近距离 * "nearValue": 0, //最近距离值 * "far": 1, //最远距离值 * "farValue": 0 //最远距离值 * }, //根据距离设置比例 * "distanceDisplayCondition": { * "near": 0, //最近距离 * "far": Number.MAX_VALUE //最远距离 * } //根据距离设置可见 * } * ``` */ setStyle(style: any): this; /** * entity转换为overlay * @param entity * @param content */ static fromEntity(entity: Cesium.Entity, content: any): any; } /** * DOM工具类 */ export declare class DomUtil { /** * 根据id获取dom * @param id 要素 ID * @returns */ static get(id: string): HTMLElement | any; /** * 返回元素上指定样式属性的值,包括计算值或通过CSS设置的值 * @param el DOM元素 * @param style 样式名称 * @returns {null|*} */ static getStyle(el: HTMLElement, style: string): null | any; /** * 创建 dom * @param tagName 标签名 * @param className 样式名,多个用空格隔开 * @param container 父容器 * @returns {HTMLElement} */ static create(tagName: string, className: string, container?: HTMLElement | string): HTMLElement; /** * 移除元素 * @param el 被移除的要素 */ static remove(el: Element): void; /** * 移除元素的所有子元素 * @param el 元素 */ static empty(el: Element): void; /** * 判断元素是否具有指定的类 * @param el DOM元素 * @param name 类名 */ static hasClass(el: Element, name: string): boolean; /** * 添加类 * @param el DOM元素 * @param name 类名 */ static addClass(el: Element, na