修改自定义颜色插件
This commit is contained in:
@ -40,7 +40,7 @@ class AttackArrowObject extends Base {
|
||||
this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2
|
||||
this.options.line = options.line || {}
|
||||
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.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)'
|
||||
this.options['area-unit'] = options['area-unit'] || '平方米'
|
||||
this.entity
|
||||
this.event = new MouseEvent(this.sdk)
|
||||
@ -110,7 +110,7 @@ class AttackArrowObject extends Base {
|
||||
return this.options.color
|
||||
}
|
||||
set color(v) {
|
||||
this.options.color = v || '#ff000080'
|
||||
this.options.color = v || 'rgba(255, 0, 0, 0.5)'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polygon) {
|
||||
return
|
||||
}
|
||||
@ -123,7 +123,7 @@ class AttackArrowObject extends Base {
|
||||
this.entity.polygon.material = material
|
||||
if (this._elms.color) {
|
||||
this._elms.color.forEach((item, i) => {
|
||||
let colorPicker = new ewPlugins('colorpicker', {
|
||||
let colorPicker = new YJColorPicker({
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -243,14 +243,14 @@ class AttackArrowObject extends Base {
|
||||
return this.options.line.color
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.line.color = v || '#ff000080'
|
||||
this.options.line.color = v || 'rgba(255, 0, 0, 0.5)'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polyline) {
|
||||
return
|
||||
}
|
||||
this.entity.polyline.material = Cesium.Color.fromCssColorString(this.options.line.color)
|
||||
if (this._elms.lineColor) {
|
||||
this._elms.lineColor.forEach((item, i) => {
|
||||
let lineColorPicker = new ewPlugins('colorpicker', {
|
||||
let lineColorPicker = new YJColorPicker({
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -358,7 +358,7 @@ class AttackArrowObject extends Base {
|
||||
this.label.color = v
|
||||
if (this._elms.labelColor) {
|
||||
this._elms.labelColor.forEach((item, i) => {
|
||||
let labelColorPicker = new ewPlugins('colorpicker', {
|
||||
let labelColorPicker = new YJColorPicker({
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -458,7 +458,7 @@ class AttackArrowObject extends Base {
|
||||
this.label.lineColor = v
|
||||
if (this._elms.labelLineColor) {
|
||||
this._elms.labelLineColor.forEach((item, i) => {
|
||||
let lineColorPicker = new ewPlugins('colorpicker', {
|
||||
let lineColorPicker = new YJColorPicker({
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -485,7 +485,7 @@ class AttackArrowObject extends Base {
|
||||
this.label.backgroundColor = [v, this.label.backgroundColor[1]]
|
||||
if (this._elms.labelBackgroundColorStart) {
|
||||
this._elms.labelBackgroundColorStart.forEach((item, i) => {
|
||||
let labelBackgroundColorStartPicker = new ewPlugins('colorpicker', {
|
||||
let labelBackgroundColorStartPicker = new YJColorPicker({
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -511,7 +511,7 @@ class AttackArrowObject extends Base {
|
||||
this.label.backgroundColor = [this.label.backgroundColor[0], v]
|
||||
if (this._elms.labelBackgroundColorEnd) {
|
||||
this._elms.labelBackgroundColorEnd.forEach((item, i) => {
|
||||
let labelBackgroundColorEndPicker = new ewPlugins('colorpicker', {
|
||||
let labelBackgroundColorEndPicker = new YJColorPicker({
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -1182,7 +1182,7 @@ class AttackArrowObject extends Base {
|
||||
// 创建标签页
|
||||
let tabsElm = new cy_tabs('attack-arrow-object-edit-tabs', undefined, this.sdk)
|
||||
// 颜色组件
|
||||
let colorPicker = new ewPlugins('colorpicker', {
|
||||
let colorPicker = new YJColorPicker({
|
||||
el: contentElm.getElementsByClassName("color")[0],
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -1196,7 +1196,7 @@ class AttackArrowObject extends Base {
|
||||
this.color = 'rgba(255,255,255,1)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
let linecolorPicker = new ewPlugins('colorpicker', {
|
||||
let linecolorPicker = new YJColorPicker({
|
||||
el: contentElm.getElementsByClassName("lineColor")[0],
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -1210,7 +1210,7 @@ class AttackArrowObject extends Base {
|
||||
this.lineColor = 'rgba(255,255,255,1)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
let labelColorPicker = new ewPlugins('colorpicker', {
|
||||
let labelColorPicker = new YJColorPicker({
|
||||
el: contentElm.getElementsByClassName("labelColor")[0],
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -1224,7 +1224,7 @@ class AttackArrowObject extends Base {
|
||||
this.labelColor = 'rgba(255,255,255,1)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
let labellineColorPicker = new ewPlugins('colorpicker', {
|
||||
let labellineColorPicker = new YJColorPicker({
|
||||
el: contentElm.getElementsByClassName("labelLineColor")[0],
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
@ -1238,7 +1238,7 @@ class AttackArrowObject extends Base {
|
||||
this.labelLineColor = 'rgba(255,255,255,1)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
let labelBackgroundColorStartPicker = new ewPlugins('colorpicker', {
|
||||
let labelBackgroundColorStartPicker = new YJColorPicker({
|
||||
el: contentElm.getElementsByClassName("labelBackgroundColorStart")[0],
|
||||
size: 'mini',
|
||||
alpha: true,
|
||||
@ -1252,7 +1252,7 @@ class AttackArrowObject extends Base {
|
||||
this.labelBackgroundColorStart = 'rgba(255,255,255,1)'
|
||||
},
|
||||
})
|
||||
let labelBackgroundColorEndPicker = new ewPlugins('colorpicker', {
|
||||
let labelBackgroundColorEndPicker = new YJColorPicker({
|
||||
el: contentElm.getElementsByClassName("labelBackgroundColorEnd")[0],
|
||||
size: 'mini',
|
||||
alpha: true,
|
||||
|
Reference in New Issue
Block a user