new BaseLayer(opts)
基础图层构造函数
Parameters:
| Name |
Type |
Description |
opts |
Object
|
图层配置参数
Properties
| Name |
Type |
Argument |
Default |
Description |
id |
String
|
<optional>
|
|
图层id |
name |
String
|
<optional>
|
|
图层名称 |
type |
String
|
|
|
图层类型, 参见Glodon.CIMCube.Global.Defines.LayerType |
url |
String
|
|
|
图层url |
show |
Boolean
|
<optional>
|
true
|
是否显示,默认为true |
alpha |
Number
|
<optional>
|
1.0
|
透明度,0.0~1.0,默认为1.0 |
enableMouseMove |
Boolean
|
<optional>
|
false
|
是否可以触发鼠标移动,默认为false |
canSelected |
Boolean
|
<optional>
|
false
|
是否可选,默认为false |
canHighlight |
Boolean
|
<optional>
|
false
|
选中是否高亮,默认为false |
selectedColor |
String
|
<optional>
|
"#32D3A6"
|
点选颜色,默认为"#32D3A6" |
glowColor |
String
|
<optional>
|
"#FF0000"
|
发光颜色,默认为"#FF0000" |
glowTimeInterval |
number
|
<optional>
|
3000
|
闪烁的时间间隔,单位毫秒,默认3000 |
pickable |
boolean
|
<optional>
|
true
|
是否能被拾取,默认true |
hiddenInLayerTree |
boolean
|
<optional>
|
false
|
为 true 时不加入图层树,getAllLayers/getLayersByType 等枚举接口不可见,仍可通过 getLayer 访问 |
|
Example
事件监听:
layer.on(Glodon.CIMCube.Global.Defines.ScreenSpaceEventType.LEFT_CLICK, function(e){
console.log(e);
});
layer.off(Glodon.CIMCube.Global.Defines.ScreenSpaceEventType.LEFT_CLICK);