Constructor
new Label(geoObj, options)
构造函数
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
geoObj |
Object | |||||||||||||||||||||||||
options |
Object | 参数列表
Properties
|
Members
azimuth :Array
方位角(正北为0,单位度)
Type:
- Array
Example
geoPoint.azimuth = 20;//设置GeoPoint的方位角为20度 即北偏东20度
fontColor :Array
文字颜色
Type:
- Array
Example
label.fontColor = 'rgb(255,0,0)'; //设置标注颜色为红色
fontFamily :String
字体名称
Type:
- String
Example
label.fontFamily = '黑体'; //设置标注字体为黑体
fontSize :Number
Label的字体大小 默认18
Type:
- Number
Example
label.fontSize = 12; //设置字体大小为12
offset :Array
Label的偏移 [xOffset,yOffset] 单位:像素 xOffset左负右正 yOffset上正下负
Type:
- Array
Example
label.offset = [0,20]; //点的标注向上偏移20像素
text :String
Label的文字内容
Type:
- String
Example
//设置文字内容 注{{}}包住的是需要标注对象的userData中的属性名称
//比如被标注物体的userData.name='花家地南街' 该例子中的标注会显示 '名称:花家地南街'
label.text = '名称:{{name}}';
(readonly) useSpriteMaterial :Boolean
是否使用精灵材质 默认true 只有初始化时可以设置,设置之后Label不会随摄影机转动
Type:
- Boolean
visible :Boolean
Label是否可见
Type:
- Boolean
Example
label.visible = false; //设置label不可见