m-gis核心库 / Wall
类: Wall
定义于: overlay/entity/Wall.ts:52
用于三维中绘制墙体要素
// 添加图层 const layer = new EntityLayer().addToViewer(this.$viewer); const wall = new Wall([ new Position(118.78653636, 31.91315607, 40), new Position(118.78717476, 31.91365014, 40), new Position(118.78773082, 31.91401772, 40), new Position(118.78792258, 31.91435828, 40) ]).addToLayer(layer); wall.setStyle({ material: Color.fromCssColorString("rgba(241,12,12,0.5)"), outline: true }); // 注册 wall 鼠标移入事件 wall.on(MouseEventType.CLICK, evt => { console.log(evt); });
继承
构造函数
构造函数
new Wall(
positions,options?):Wall
定义于: overlay/entity/Wall.ts:66
参数
positions
Position[]
坐标串
options?
OPT = DEF_OPT
返回
Wall
重写了
属性
_attr
_attr:
any
继承自
_bid
_bid:
any
继承自
_color
_color:
Color
定义于: overlay/entity/Wall.ts:54
_customData
_customData:
any
继承自
_delegate
_delegate:
any
继承自
_height
_height:
number
定义于: overlay/entity/Wall.ts:56
_id
_id:
string|number
继承自
_layer
_layer:
any
继承自
_material
_material:
any
定义于: overlay/entity/Wall.ts:55
_options
_options:
any
定义于: overlay/entity/Wall.ts:57
重写了
_overlayEvent
_overlayEvent:
OverlayEvent
继承自
_position
_position:
any
继承自
_positions
_positions:
Position[]
定义于: overlay/entity/Wall.ts:53
重写了
_relaters
_relaters:
any
继承自
_show
_show:
boolean
继承自
_state
_state:
any
继承自
_style
_style:
any
继承自
interactionEvents
interactionEvents:
any[]
继承自
type
type:
any
继承自
访问器
attr
Getter 签名
get attr():
any
返回
any
Setter 签名
set attr(
attr):void
覆盖物的额外属性设置
参数
attr
any
返回
void
继承自
center
Getter 签名
get center():
Position
返回
继承自
color
Getter 签名
get color():
Color
定义于: overlay/entity/Wall.ts:119
返回
Color
Setter 签名
set color(
value):void
定义于: overlay/entity/Wall.ts:114
参数
value
Color
返回
void
customData
Getter 签名
get customData():
any
返回
any
继承自
delegate
Getter 签名
get delegate():
any
覆盖物的代理对象
返回
any
继承自
height
Getter 签名
get height():
number
定义于: overlay/entity/Wall.ts:110
返回
number
Setter 签名
set height(
height):void
定义于: overlay/entity/Wall.ts:105
参数
height
number
返回
void
id
Getter 签名
get id():
any
返回
any
Setter 签名
set id(
id):void
设置覆盖物的业务 id
参数
id
any
返回
void
继承自
overlayEvent
Getter 签名
get overlayEvent():
OverlayEvent
覆盖物的事件对象
返回
OverlayEvent
继承自
overlayId
Getter 签名
get overlayId():
string|number
覆盖物唯一标识
返回
string | number
继承自
positions
Getter 签名
get positions():
Position[]
定义于: overlay/entity/Wall.ts:101
返回
Position[]
Setter 签名
set positions(
positions):void
定义于: overlay/entity/Wall.ts:87
参数
positions
Position[]
返回
void
relaters
Getter 签名
get relaters():
any[]
返回
any[]
继承自
show
Getter 签名
get show():
boolean
返回
boolean
Setter 签名
set show(
show):void
覆盖物的可见性
参数
show
boolean
返回
void
继承自
state
Getter 签名
get state():
any
覆盖物的状态
返回
any
继承自
viewer
Getter 签名
get viewer():
any
返回
any
继承自
方法
addCustomData()
addCustomData(
key,value):void
参数
key
any
value
any
返回
void
继承自
addToLayer()
addToLayer(
layer):Wall
添加到指定图层
参数
layer
any
指定图层
返回
Wall
继承自
clearCustomData()
clearCustomData():
void
返回
void
继承自
clearRelate()
clearRelate():
void
返回
void
继承自
eachRelaters()
eachRelaters(
callback):void
参数
callback
any
返回
void
继承自
fire()
fire(
type,params):Wall
触发事件
参数
type
string | number
params
any
返回
Wall
继承自
getCustomData()
getCustomData(
key):any
参数
key
any
返回
any
继承自
off()
off(
type,callback,context?):Wall
注销事件
参数
type
string | number
事件类型
callback
any
监听回调
context?
any
返回
Wall
继承自
on()
on(
type,callback,context?):Wall
注册事件
参数
type
string | number
事件类型
callback
any
监听回调
context?
any
返回
Wall
继承自
relate()
relate(
overlay):void
参数
overlay
返回
void
继承自
remove()
remove():
Wall
从图层上移出
返回
Wall
继承自
setLabel()
setLabel():
Wall
定义于: overlay/entity/Wall.ts:136
返回
Wall
重写了
setMode()
setMode(
mode?):void
定义于: overlay/entity/Wall.ts:177
加载预设模式
参数
mode?
number
模式
返回
void
setStyle()
setStyle(
style?):Wall
定义于: overlay/entity/Wall.ts:162
设置墙体要素的样式
参数
style?
any = {}
样式可选属性
// 样式参数(可选) { "fill": true, //是否用提供的材料填充多边形。 "minimumHeights":[], // 指定 wall 底部的高度数组。 "maximumHeights":[], // 指定 wall 顶部的高度数组。 "material": Color.WHITE, //材质 "outline": false, //是否显示边框 "outlineColor": Color.BLACK, //边框颜色 "outlineWidth": 0, //边框宽度 "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受 "distanceDisplayCondition": { "near": 0, //最近距离 "far": Number.MAX_VALUE //最远距离 }, //根据距离设置可见 }
返回
Wall
unRelate()
unRelate(
overlay):void
参数
overlay
返回
void
继承自
fromEntity()
staticfromEntity(entity):Wall|undefined
定义于: overlay/entity/Wall.ts:217
从 entity 中解析出 Wall
参数
entity
any
返回
Wall | undefined
getOverlayType()
staticgetOverlayType(type):string|number|undefined
获取 Overlay 类型
参数
type
string
返回
string | number | undefined
继承自
registerType()
staticregisterType(type):void
Overlay 类型注册
参数
type
string
返回
void