bcgis-type
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.
63 lines (62 loc) • 2.03 kB
TypeScript
import Overlay from "../Overlay";
import Position from "../../position/Position";
import { T_Position } from "../../common/type";
/**
* 模型
* @noInheritDoc
* @example
* ```ts
* let position = new BC.Position(120, 20)
* let model = new BC.Model(position, '*.glb')
* ```
*/
declare class Model extends Overlay {
private _position;
private _modelUrl;
private _rotateAmount;
/**
*
* @param position 坐标
* @param modelUrl 模型地址
*/
constructor(position: T_Position, modelUrl: string);
get type(): any;
set position(position: Position);
get position(): Position;
set modelUrl(modelUrl: string);
get modelUrl(): string;
set rotateAmount(amount: number);
get rotateAmount(): number;
_mountedHook(): void;
/**
* 设置风格
* @param style
* @return {Model}
* @example
* ```json
* // 样式参数(可选)
* {
* "scale": 1, //比例
* "minimumPixelSize": 0, //指定模型的最小像素大小,而不考虑缩放
* "maximumScale": 0, //指定模型的最大比例
* "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。
* "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受
* "silhouetteColor": BC.Color.RED, //轮廓颜色
* "silhouetteSize": 0, //轮廓宽度
* "lightColor": BC.Color.RED, //模型着色时指定灯光颜色
* "distanceDisplayCondition": {
* "near": 0, //最近距离
* "far": Number.MAX_VALUE //最远距离
* } //根据距离设置可见
* }
* ```
*/
setStyle(style: any): this;
/**
* Entity 转换为 Overlay
* @param entity 实体
* @param modelUrl 模型地址
*/
static fromEntity(entity: Cesium.Entity, modelUrl: string): Model;
}
export default Model;