EarthSDK GlobeTranslucency

地表透明

new TerrainEffect.GlobeTranslucency()

Extends

Members

backFaceAlpha : number

背面透明度 A constant translucency to apply to back faces of the globe.
Default Value: 1.0
Example:
earth.terrainEffect.backFaceAlpha = 0.5;

backFaceAlphaByDistance : Array.<number>|undefined

Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera. The translucency will interpolate between the NearFarScalar#nearValue and NearFarScalar#farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar#near and NearFarScalar#far. Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, backFaceAlphaByDistance will be disabled. 值的形式如下:[near, nearValue, far, farValue] 参见Cesium的NearFarScalar
Default Value: false
Example:
earth.terrainEffect.backFaceAlphaByDistance = [1000, 1.0, 10000, 0.0];

disposers

用来收集资源销毁函数,并在析构时自动调用!
Inherited From:
Example:
// 示例1:
myObject.disposers.push(() => {
    // 此处执行需要销毁的资源
});

// 示例2:
// XE.MVVM.bind的返回值是一个函数,作用是用来解除双向绑定,
// 把它的返回值放到disposer中,那么对象销毁时就会执行解绑操作。
myObject.disposers.push(XE.MVVM.bind(xxx));

// 示例3:
// XE.MVVM.watch的返回值是一个函数,作用是用来取消监视,
// 把它的返回值放到disposer中,那么对象销毁时就会执行取消监视的操作。
myObject.disposers.push(XE.MVVM.watch(xxx));

enabled : boolean

是否启用
Default Value: false

frontFaceAlpha : number

正面透明度 A constant translucency to apply to front faces of the globe.
Default Value: 1.0
Example:
earth.terrainEffect.frontFaceAlpha = 0.5;

frontFaceAlphaByDistance : Array.<number>|undefined

Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera. The translucency will interpolate between the NearFarScalar#nearValue and NearFarScalar#farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar#near and NearFarScalar#far. Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, frontFaceAlphaByDistance will be disabled. 值的形式如下:[near, nearValue, far, farValue] 参见Cesium的NearFarScalar
Default Value: undefined
Example:
earth.terrainEffect.frontFaceAlphaByDistance = [1000, 1.0, 10000, 0.0];

rectangle : Array.<number>

区域限制 值的形式如 [west, south, east, north],注意单位是弧度,参见Cesium的Rectangle
Default Value: undefined
Example:
earth.terrainEffect.frontFaceAlphaByDistance = [116.39*Math.PI/180, 39.9*Math.PI/180, 118.39*Math.PI/180, 41.9*Math.PI/180];

Methods

destroy()undefined

销毁对象
警告:对象一旦销毁不可再次使用!
警告:挂在场景树上的对象禁止调用destroy方法,只要通过数组函数将其从场景树中移除,就会自动销毁!
Returns:
返回undefined
Inherited From:
Example:
// 使用范例
// 这样写的好处是,一旦对象销毁,会同时将引用该对象的变量同时置为undefined,防止再次使用。
this._myObject = this._myObject && this._myObject.destroy();

isDestroyed()boolean

检查对象是否已被销毁
警告:对象一旦销毁不可再次使用!仅此函数可以调用!
Returns:
对象是否已销毁
Inherited From:

toAllJSON()object

数据整个JSOn对象,包括默认值
Returns:
创建的JSON数据对象
Inherited From:

toAllJSONStr()string

转化成JSON字符串,输出全部元素
Returns:
JSON格式化好的字符串
Inherited From:

toJSON()object

转化成一个JSON数据对象
注意:每次都会创建一个新对象!
Returns:
创建的JSON数据对象
Inherited From:

toJSONStr()string

转化成JSON字符串,默认元素不输出
Returns:
JSON格式化好的字符串
Inherited From:

xbsjFromJSON(jsonObject)

通过JSON数据对象来设置属性
Name Type Description
jsonObject *
Inherited From:
Example:
// 创建一个pin对象
const objConfig = {
    "name": 'Pin1',
    "xbsjType": "Pin",
    "position": [1.9017005694855162, 0.5972477268978722, 488.7695178987821],
    "near": 300,
    "show": false,
    evalString,
};
const pin = new XE.Obj.Pin(earth);  
pin.xbsjFromJSON(objConfig);