修改点线面默认样式
This commit is contained in:
@ -24,8 +24,8 @@ class CurvelineObject extends Base {
|
||||
* @description 折线
|
||||
* @param options {object} 线属性
|
||||
* @param options.name{string} 名称
|
||||
* @param options.width=5{number} 线宽
|
||||
* @param options.color=#0df89e {string} 颜色
|
||||
* @param options.width=3{number} 线宽
|
||||
* @param options.color=#ff0000 {string} 颜色
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光
|
||||
* @param options.heightMode{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
@ -51,8 +51,8 @@ class CurvelineObject extends Base {
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options)
|
||||
this.options.name = options.name || '未命名对象'
|
||||
this.options.width = options.width || 10
|
||||
this.options.color = options.color || '#0df89e'
|
||||
this.options.width = ((options.width || options.width === 0) ? options.width : 3)
|
||||
this.options.color = options.color || '#ff0000'
|
||||
this.options.type = options.type ? Number(options.type) : 0
|
||||
this.options['nose-to-tail'] = options['nose-to-tail'] || false
|
||||
this.options.extend = options.extend || false
|
||||
@ -86,8 +86,8 @@ class CurvelineObject extends Base {
|
||||
options.label.pixelOffset || options.label.pixelOffset === 0
|
||||
? options.label.pixelOffset
|
||||
: 20,
|
||||
backgroundColor: options.label.backgroundColor || ['#42c6ef', '#42c6ef'],
|
||||
lineColor: options.label.lineColor || '#fff000',
|
||||
backgroundColor: options.label.backgroundColor || ['#00ffff80', '#00ffff80'],
|
||||
lineColor: options.label.lineColor || '#00ffff80',
|
||||
scaleByDistance: options.label.scaleByDistance || false,
|
||||
near:
|
||||
options.label.near || options.label.near === 0
|
||||
@ -143,7 +143,7 @@ class CurvelineObject extends Base {
|
||||
return this.options.color
|
||||
}
|
||||
set color(v) {
|
||||
this.options.color = v
|
||||
this.options.color = v || '#ff0000'
|
||||
this.entity.polyline.material = this.getMaterial(v, this.options.type)
|
||||
if (this._elms.color) {
|
||||
this._elms.color.forEach((item, i) => {
|
||||
@ -151,14 +151,14 @@ class CurvelineObject extends Base {
|
||||
el: item.el,
|
||||
size: 'mini', //颜色box类型
|
||||
alpha: true, //是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.color,
|
||||
disabled: false, //是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity', //打开颜色选择器动画
|
||||
sure: c => {
|
||||
this.color = c
|
||||
}, //点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.color = 'rgba(255,255,255,1)'
|
||||
this.color = 'rgba(255,0,0,1)'
|
||||
} //点击清空按钮事件回调
|
||||
})
|
||||
this._elms.color[i] = colorPicker
|
||||
@ -243,10 +243,10 @@ class CurvelineObject extends Base {
|
||||
}
|
||||
|
||||
set lineWidth(v) {
|
||||
this.options.width = v
|
||||
this.options.width = (v || v == 0) ? v : 3
|
||||
this._elms.lineWidth &&
|
||||
this._elms.lineWidth.forEach(item => {
|
||||
item.value = v
|
||||
item.value = this.options.width
|
||||
})
|
||||
this.entity &&
|
||||
this.entity.polyline &&
|
||||
@ -623,7 +623,7 @@ class CurvelineObject extends Base {
|
||||
this.labelLineColor = color
|
||||
}, //点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.labelLineColor = 'rgba(255,255,255,1)'
|
||||
this.labelLineColor = 'rgba(0,255,255,0.5)'
|
||||
} //点击清空按钮事件回调
|
||||
})
|
||||
this._elms.labelLineColor[i] = lineColorPicker
|
||||
|
Reference in New Issue
Block a user