TextMaterial

TextMaterial

文字贴图 材质

Constructor

new TextMaterial(optionsopt)

创建文字贴图

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

带有以下属性的对象:

Properties
Name Type Attributes Default Description
text String <optional>

文字

color Color <optional>

文字颜色

repeat Cartesian2 <optional>
Cartesian2(1.0, 1.0)

X/Y方向上的重复次数

textStyles Object <optional>
{}

文本样式

Properties
Name Type Attributes Default Description
font String <optional>
'50px 楷体'

字体字号

fill Boolean <optional>
true

是否填充颜色

fillColor Color <optional>
Color(1.0, 1.0, 0.0, 1.0)

填充色

stroke Boolean <optional>
true

是否有边框

strokeWidth Number <optional>
2

边框宽度

strokeColor Color <optional>
Color(1.0, 1.0, 1.0, 0.8)

边框色

backgroundColor Color <optional>
Color(1.0, 1.0, 1.0, 0.1)

背景色

Classes

TextMaterial

Methods

equals(otheropt) → {Boolean}

将此属性与提供的属性进行比较并返回, 如果两者相等返回true,否则为false

Parameters:
Name Type Attributes Description
other Cesium.Property <optional>

The other property.

Returns:

两者是否是同一个对象

Type
Boolean

getType(time) → {String}

获取材质名称

Parameters:
Name Type Description
time JulianDate

检索值的时间

Returns:

材质名称

Type
String

getValue(time, resultopt) → {Object}

获取所提供时间的属性值

Parameters:
Name Type Attributes Description
time JulianDate

检索值的时间

result Object <optional>

用于存储值的对象,如果省略,则创建并返回一个新的实例

Returns:

修改的result参数或一个新的实例(如果没有提供result参数)

Type
Object