浏览代码

优化属性覆盖方法

tags/1.0.0
Caven 5 年前
父节点
当前提交
7dc676fd28

+ 3
- 2
src/core/overlay/base/DC.Billboard.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-19 10:18:23
* @Last Modified by: Caven
* @Last Modified time: 2020-02-13 17:19:33
* @Last Modified time: 2020-02-20 19:29:15
*/

import Cesium from '@/namespace'
@@ -110,7 +110,8 @@ DC.Billboard = class extends Overlay {
return
}
this._style = style
this._delegate.billboard && this._delegate.billboard.merge(this._style)
this._delegate.billboard &&
DC.Util.merge(this._delegate.billboard, this._style)
return this
}


+ 2
- 2
src/core/overlay/base/DC.Cricle.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-31 18:57:02
* @Last Modified by: Caven
* @Last Modified time: 2020-02-18 16:15:17
* @Last Modified time: 2020-02-20 19:29:46
*/
import Cesium from '@/namespace'
import Overlay from '../Overlay'
@@ -97,7 +97,7 @@ DC.Circle = class extends Overlay {
return
}
this._style = style
this._delegate.ellipse && this._delegate.ellipse.merge(this._style)
this._delegate.ellipse && DC.Util.merge(this._delegate.ellipse, this._style)
return this
}
}

+ 2
- 2
src/core/overlay/base/DC.Label.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-02-01 11:59:28
* @Last Modified by: Caven
* @Last Modified time: 2020-02-20 13:59:58
* @Last Modified time: 2020-02-20 19:30:04
*/
import Cesium from '@/namespace'
import Overlay from '../Overlay'
@@ -81,7 +81,7 @@ DC.Label = class extends Overlay {
return
}
this._style = style
this._delegate.label && this._delegate.label.merge(this._style)
this._delegate.label && DC.Util.merge(this._delegate.label, this._style)
return this
}
}

+ 2
- 2
src/core/overlay/base/DC.Plane.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-02-18 16:08:26
* @Last Modified by: Caven
* @Last Modified time: 2020-02-18 16:42:15
* @Last Modified time: 2020-02-20 19:30:20
*/

import Cesium from '@/namespace'
@@ -102,7 +102,7 @@ DC.Plane = class extends Overlay {
return
}
this._style = style
this._delegate.plane && this._delegate.plane.merge(this._style)
this._delegate.plane && DC.Util.merge(this._delegate.plane, this._style)
return this
}
}

+ 1
- 1
src/core/overlay/base/DC.Point.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-06 15:03:25
* @Last Modified by: Caven
* @Last Modified time: 2020-02-18 16:16:15
* @Last Modified time: 2020-02-20 19:30:27
*/

import Cesium from '@/namespace'

+ 2
- 2
src/core/overlay/base/DC.Polygon.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-09 09:10:37
* @Last Modified by: Caven
* @Last Modified time: 2020-02-18 11:03:30
* @Last Modified time: 2020-02-20 19:30:28
*/
import Overlay from '../Overlay'
import Cesium from '@/namespace'
@@ -129,7 +129,7 @@ DC.Polygon = class extends Overlay {
return
}
this._style = style
this._delegate.polygon && this._delegate.polygon.merge(style)
this._delegate.polygon && DC.Util.merge(this._delegate.polygon, this._style)
return this
}


+ 3
- 2
src/core/overlay/base/DC.Polyline.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-06 15:03:25
* @Last Modified by: Caven
* @Last Modified time: 2020-02-14 19:26:22
* @Last Modified time: 2020-02-20 19:30:54
*/

import Overlay from '../Overlay'
@@ -104,7 +104,8 @@ DC.Polyline = class extends Overlay {
return
}
this._style = style
this._delegate.polyline && this._delegate.polyline.merge(this._style)
this._delegate.polyline &&
DC.Util.merge(this._delegate.polyline, this._style)
return this
}


+ 2
- 2
src/core/overlay/model/DC.Model.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-06 15:03:25
* @Last Modified by: Caven
* @Last Modified time: 2020-02-13 17:23:40
* @Last Modified time: 2020-02-20 19:31:48
*/

import Overlay from '../Overlay'
@@ -89,6 +89,6 @@ DC.Model = class extends Overlay {
return
}
this._style = style
this._delegate.model && this._delegate.model.merge(this._style)
this._delegate.model && DC.Util.merge(this._delegate.model, this._style)
}
}

+ 1
- 1
src/core/overlay/model/DC.Tileset.js 查看文件

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-07 08:51:56
* @Last Modified by: Caven
* @Last Modified time: 2020-02-11 17:56:19
* @Last Modified time: 2020-02-20 19:31:47
*/
import Cesium from '@/namespace'
import Overlay from '../Overlay'

+ 15
- 7
src/plugins/overlay/DC.CustomPolygon.js 查看文件

@@ -2,10 +2,10 @@
* @Author: Caven
* @Date: 2020-02-06 13:11:58
* @Last Modified by: Caven
* @Last Modified time: 2020-02-14 19:39:10
* @Last Modified time: 2020-02-21 10:28:04
*/
import Cesium from '@/namespace'
import '../../core/overlay/base/DC.Polygon'
import '@/core/overlay/base/DC.Polygon'

DC.CustomPolygon = class extends DC.Polygon {
constructor(positions) {
@@ -30,7 +30,7 @@ DC.CustomPolygon = class extends DC.Polygon {
this._show = show
this._delegate && (this._delegate.show = show)
this._topOutline && (this._topOutline.show = show)
this._bottomOutline && (this._bottomOutline = show)
this._bottomOutline && (this._bottomOutline.show = show)
}

get show() {
@@ -106,8 +106,12 @@ DC.CustomPolygon = class extends DC.Polygon {
*/
setTopOutline(lineStyle) {
if (this._topOutline) {
this._topOutline.show = true
this._topOutline.polyline.merge(lineStyle)
this._topOutline.show = Cesium.defaultValue(lineStyle.show, true)
delete lineStyle.show
if (!lineStyle || Object.keys(lineStyle).length === 0) {
return
}
DC.Util.merge(this._topOutline.polyline, lineStyle)
}
return this
}
@@ -118,8 +122,12 @@ DC.CustomPolygon = class extends DC.Polygon {
*/
setBottomOutline(lineStyle) {
if (this._bottomOutline) {
this._bottomOutline.show = true
this._bottomOutline.polyline.merge(lineStyle)
this._bottomOutline.show = Cesium.defaultValue(lineStyle.show, true)
delete lineStyle.show
if (!lineStyle || Object.keys(lineStyle).length === 0) {
return
}
DC.Util.merge(this._bottomOutline.polyline, lineStyle)
}
return this
}

正在加载...
取消
保存