瀏覽代碼

add CloudPrimitive

tags/2.7.0
Caven Chen 4 年之前
父節點
當前提交
dc3deea417
共有 1 個檔案被更改,包括 19 行新增18 行删除
  1. 19
    18
      modules/overlay/Overlay.js

+ 19
- 18
modules/overlay/Overlay.js 查看文件

@@ -130,21 +130,22 @@ class Overlay {
}
this._layer = layer
this._mountedHook && this._mountedHook()
let collection = {
point_primitive: this._layer.points,
billboard_primitive: this._layer.billboards,
bounce_billboard_primitive: this._layer.billboards,
label_primitive: this._layer.labels,
bounce_label_primitive: this._layer.labels,
polyline_primitive: this._layer.polylines,
cloud_primitive: this._layer.clouds
}

// for Entity
if (this._layer?.delegate?.entities && this._delegate) {
this._layer.delegate.entities.add(this._delegate)
}
// for Primitive
else if (this._layer?.delegate?.add && this._delegate) {
let collection = {
point_primitive: this._layer.points,
billboard_primitive: this._layer.billboards,
bounce_billboard_primitive: this._layer.billboards,
label_primitive: this._layer.labels,
bounce_label_primitive: this._layer.labels,
polyline_primitive: this._layer.polylines,
cloud_primitive: this._layer.clouds
}
if (this.type && collection[this.type]) {
this._delegate = collection[this.type].add(this._delegate)
} else {
@@ -163,21 +164,21 @@ class Overlay {
if (!this._layer || !this._delegate) {
return
}
let collection = {
point_primitive: this._layer.points,
billboard_primitive: this._layer.billboards,
bounce_billboard_primitive: this._layer.billboards,
label_primitive: this._layer.labels,
bounce_label_primitive: this._layer.labels,
polyline_primitive: this._layer.polylines,
cloud_primitive: this._layer.clouds
}
// for Entity
if (this._layer?.delegate?.entities) {
this._layer.delegate.entities.remove(this._delegate)
}
// for Primitive
else if (this._layer?.delegate?.remove) {
let collection = {
point_primitive: this._layer.points,
billboard_primitive: this._layer.billboards,
bounce_billboard_primitive: this._layer.billboards,
label_primitive: this._layer.labels,
bounce_label_primitive: this._layer.labels,
polyline_primitive: this._layer.polylines,
cloud_primitive: this._layer.clouds
}
if (this.type && collection[this.type]) {
collection[this.type].remove(this._delegate)
} else {

Loading…
取消
儲存