修改点线面默认样式
This commit is contained in:
@ -24,7 +24,7 @@ class StraightArrowObject extends Base {
|
||||
* @param options {object} 属性
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color="#36c4ff" {string} 颜色
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
@ -34,13 +34,13 @@ class StraightArrowObject extends Base {
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
this.options.name = options.name || '未命名对象'
|
||||
this.options.color = options.color || "#36c4ff"
|
||||
this.options.color = options.color || "#ff000080"
|
||||
this.options.show = (options.show || options.show === false) ? options.show : true
|
||||
this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2
|
||||
this.options.positions = options.positions || []
|
||||
this.options.line = options.line || {}
|
||||
this.options.line.width = this.options.line.width || 2
|
||||
this.options.line.color = this.options.line.color || 'rgba(155, 155, 124, 0.89)'
|
||||
this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3)
|
||||
this.options.line.color = this.options.line.color || '#ff000080'
|
||||
this.options['area-unit'] = options['area-unit'] || '平方米'
|
||||
this.entity
|
||||
this.event = new MouseEvent(this.sdk)
|
||||
@ -60,8 +60,8 @@ class StraightArrowObject extends Base {
|
||||
color: options.label.color || '#ffffff',
|
||||
lineWidth: (options.label.lineWidth || options.label.lineWidth === 0) ? options.label.lineWidth : 4,
|
||||
pixelOffset: (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) ? options.label.near : 2000,
|
||||
far: (options.label.far || options.label.far === 0) ? options.label.far : 100000,
|
||||
@ -109,14 +109,14 @@ class StraightArrowObject extends Base {
|
||||
return this.options.color
|
||||
}
|
||||
set color(v) {
|
||||
this.options.color = v
|
||||
this.options.color = v || '#ff000080'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polygon) {
|
||||
return
|
||||
}
|
||||
let material = Cesium.Color.fromCssColorString(v)
|
||||
let material = Cesium.Color.fromCssColorString(this.options.color)
|
||||
if (this.sdk.viewer.scene.mode === 2) {
|
||||
material = new Cesium.CustomColorMaterialSource({
|
||||
color: v
|
||||
color: this.options.color
|
||||
})
|
||||
}
|
||||
this.entity.polygon.material = material
|
||||
@ -126,7 +126,7 @@ class StraightArrowObject extends Base {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
@ -466,7 +466,7 @@ class StraightArrowObject 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