THING.EARTH.GeoBaseStyle(param)

地理对象样式的基类

new GeoBaseStyle(param)

构造函数

Parameters:
Name Type Description
param Object 参数列表 这里所有的参数,包括子对象里所有参数,均可以通过数组的形式实现按照不同条件设置样式,例如:
color:[{ condition:'[type=red]', value:[1,0,0]},{ condition:'[type=green]', value:[0,1,0]},{ condition:'', value:[0,0,1]}] //condition给空字符串代表其他
Properties
Name Type Attributes Default Description
opacity Number <optional>
1 不透明度
color Array.<Number> <optional>
[1,1,1] 叠加的颜色
depthWrite Boolean <optional>
true 是否写入深度
depthTest Boolean <optional>
true 是否进行深度测试
blending Boolean <optional>
false 是否混色
lights Boolean <optional>
false 是否接受光照
tailing Boolean <optional>
false 物体的拖尾效果(垂直发光)
radial Boolean <optional>
false 物体的屏幕径向拖尾效果(扩散发光)
effect Boolean <optional>
false 发光效果
glowStrength Number <optional>
0.5 发光强度
outlineColor Array.<Number> <optional>
勾边颜色
emissive Array.<Number> <optional>
自发光颜色

Members

blending :Boolean

开启/关闭混色

Default Value:
  • false
Example
geoObject.style.blending = true;

color :Array.<Number>

叠加的颜色

Default Value:
  • [1,1,1]
Example
geoPoint.style.color = [1,0,0];//设置geoPoint填充色为红色

depthTest :Boolean

获取/设置是否进行深度测试

Default Value:
  • true

depthWrite :Boolean

获取/设置是否写入深度

Default Value:
  • true

effect :Boolean

获取/设置 发光效果

Default Value:
  • false
Example
geoObject.style.effect = true; //开启发光效果

emissive :Array.<Number>

自发光颜色

Example
geoPoint.style.emissive = [1,0,0];//设置geoPoint红色自发光
geoPoint.style.emissive = null;//取消自发光

glowStrength :Number

获取/设置发光强度

Default Value:
  • 0.5

lights :Boolean

获取/设置是否接受光照

Default Value:
  • false

opacity :Number

获取/设置透明度

Default Value:
  • 1.0
Example
geoItem.style.opacity = 1; //将不透明度设置为1

outlineColor :Array.<Number>

勾边颜色

Example
geoPoint.style.outlineColor = [1,0,0];//设置geoPoint红色勾边
geoPoint.style.outlineColor = null;//取消勾边

radial :Boolean

开启/关闭物体的屏幕径向拖尾效果(扩散发光)

Default Value:
  • false

sideType :THING.SideType

设置对象正面/背面/双面渲染

Default Value:
  • THING.SideType.Back
Example
geoObject.style.sideType = THING.SideType.Back;

tailing :Boolean

开启/关闭物体的拖尾效果(垂直发光)

Default Value:
  • false