Compare commits
7 Commits
b0ae9c7042
...
e45b67298a
Author | SHA1 | Date | |
---|---|---|---|
e45b67298a | |||
579b76dc0e | |||
399725ed06 | |||
574538e7bb | |||
ff4f823a27 | |||
c6aa99792f | |||
16942a2e63 |
@ -278,7 +278,7 @@ async function init(sdk) {
|
||||
sdk.viewer.scene.preRender.addEventListener(syncViewer, syncObject)
|
||||
|
||||
// sdk.viewer.imageryLayers.layerAdded.addEventListener(syncImageryLayerAdded);
|
||||
// sdk.viewer.imageryLayers.layerMoved.addEventListener(syncImageryLayerMoved);
|
||||
sdk.viewer.imageryLayers.layerMoved.addEventListener(syncImageryLayerMoved);
|
||||
// sdk.viewer.imageryLayers.layerRemoved.addEventListener(syncImageryLayerRemoved);
|
||||
// sdk.viewer.imageryLayers.layerShownOrHidden.addEventListener(syncImageryLayerShownOrHidden);
|
||||
|
||||
@ -711,6 +711,9 @@ async function setSplitDirection(v, id, isoff = false, entityId) {
|
||||
status.P = true
|
||||
status.D = true
|
||||
options.show = true
|
||||
if(thatP.type==='layer') {
|
||||
options.layer_index = thatP.layer_index
|
||||
}
|
||||
target = await new thatP.constructor(sdkD, options)
|
||||
if (thatP.onClick) {
|
||||
target.onClick = thatP.onClick
|
||||
@ -794,6 +797,9 @@ async function setSplitDirection(v, id, isoff = false, entityId) {
|
||||
status.P = false
|
||||
status.D = true
|
||||
options.show = true
|
||||
if(thatP.type==='layer') {
|
||||
options.layer_index = thatP.layer_index
|
||||
}
|
||||
target = await new thatP.constructor(sdkD, options)
|
||||
if (thatP.onClick) {
|
||||
target.onClick = thatP.onClick
|
||||
@ -1033,7 +1039,13 @@ function syncImageryLayerAdded(layer, index) {
|
||||
sdkD.viewer.imageryLayers.addImageryProvider(layer.imageryProvider, index)
|
||||
}
|
||||
function syncImageryLayerMoved(layer, newindxe, oldindex) {
|
||||
let layerD = sdkD.viewer.imageryLayers._layers[oldindex]
|
||||
let layerD
|
||||
for (let i = 0; i < sdkD.viewer.imageryLayers._layers.length; i++) {
|
||||
if (sdkD.viewer.imageryLayers._layers[i]._id === layer._id) {
|
||||
layerD = sdkD.viewer.imageryLayers._layers[i]
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!layerD) {
|
||||
return
|
||||
}
|
||||
@ -1042,12 +1054,14 @@ function syncImageryLayerMoved(layer, newindxe, oldindex) {
|
||||
sdkD.viewer.imageryLayers.lowerToBottom(layerD)
|
||||
}
|
||||
// 移到最高层
|
||||
else if (newindxe === sdk.viewer.imageryLayers._layers.length - 1) {
|
||||
else if (newindxe === sdkD.viewer.imageryLayers._layers.length - 1) {
|
||||
sdkD.viewer.imageryLayers.raiseToTop(layerD)
|
||||
}
|
||||
else {
|
||||
if (newindxe < oldindex) {
|
||||
sdkD.viewer.imageryLayers.lower(layerD)
|
||||
if(newindxe<sdkD.viewer.imageryLayers._layers.length-1) {
|
||||
sdkD.viewer.imageryLayers.lower(layerD)
|
||||
}
|
||||
}
|
||||
else {
|
||||
sdkD.viewer.imageryLayers.raise(layerD)
|
||||
|
@ -14,6 +14,7 @@ import { getTheme, setTheme } from "../Obj/Element/theme";
|
||||
import { setActiveViewer as setMultiViewportActiveViewer } from './MultiViewportMode'
|
||||
import { setActiveViewer as setSplitActiveViewer, getSdk } from './SplitScreen'
|
||||
import { updateCluster } from './cluster/cluster'
|
||||
import { getHost } from "../on";
|
||||
|
||||
let coordinateSystem = 'EPSG:4326'
|
||||
let _cartesian
|
||||
@ -244,6 +245,16 @@ function setBillboardDefaultUrl(url, name) {
|
||||
else {
|
||||
name = 'billboard_default_url'
|
||||
}
|
||||
let host = getHost()
|
||||
if (!url.startsWith("http")) {
|
||||
//说明是本地的json,在磁盘中存在的
|
||||
if (!url.includes(":")) {
|
||||
if (host) {
|
||||
let o = new URL(url, host)
|
||||
url = o.href
|
||||
}
|
||||
}
|
||||
}
|
||||
localStorage.setItem(name, url);
|
||||
}
|
||||
/*获取广告牌默认图标*/
|
||||
|
@ -62,7 +62,7 @@ class PolygonObject extends Base {
|
||||
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',
|
||||
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,
|
||||
|
@ -24,7 +24,7 @@ class AssembleObject 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 AssembleObject 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)
|
||||
@ -57,8 +57,8 @@ class AssembleObject 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,
|
||||
@ -106,14 +106,14 @@ class AssembleObject 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
|
||||
@ -123,14 +123,14 @@ class AssembleObject 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,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.color[i] = colorPicker
|
||||
@ -238,25 +238,25 @@ class AssembleObject extends Base {
|
||||
return this.options.line.color
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.line.color = v
|
||||
this.options.line.color = v || '#ff000080'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polyline) {
|
||||
return
|
||||
}
|
||||
this.entity.polyline.material = Cesium.Color.fromCssColorString(v)
|
||||
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', {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.line.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
this.lineColor = c
|
||||
},//点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.lineColor = 'rgba(255,255,255,1)'
|
||||
this.lineColor = 'rgba(255,0,0,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.lineColor[i] = lineColorPicker
|
||||
@ -268,10 +268,10 @@ class AssembleObject extends Base {
|
||||
return this.options.line.width
|
||||
}
|
||||
set lineWidth(v) {
|
||||
this.options.line.width = v
|
||||
this.entity.polyline.width = v
|
||||
this.options.line.width = ((v || v === 0) ? v : 3)
|
||||
this.entity.polyline.width = this.options.line.width
|
||||
this._elms.lineColor && this._elms.lineColor.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.line.width
|
||||
})
|
||||
}
|
||||
|
||||
@ -464,7 +464,7 @@ class AssembleObject 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
|
||||
|
@ -24,7 +24,7 @@ class AttackArrowObject 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 AttackArrowObject 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.positions = options.positions || []
|
||||
this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2
|
||||
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)
|
||||
@ -61,8 +61,8 @@ class AttackArrowObject 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,
|
||||
@ -110,14 +110,14 @@ class AttackArrowObject 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
|
||||
@ -127,14 +127,14 @@ class AttackArrowObject 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,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.color[i] = colorPicker
|
||||
@ -243,25 +243,25 @@ class AttackArrowObject extends Base {
|
||||
return this.options.line.color
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.line.color = v
|
||||
this.options.line.color = v || '#ff000080'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polyline) {
|
||||
return
|
||||
}
|
||||
this.entity.polyline.material = Cesium.Color.fromCssColorString(v)
|
||||
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', {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.line.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
this.lineColor = c
|
||||
},//点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.lineColor = 'rgba(255,255,255,1)'
|
||||
this.lineColor = 'rgba(255,0,0,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.lineColor[i] = lineColorPicker
|
||||
@ -273,8 +273,8 @@ class AttackArrowObject extends Base {
|
||||
return this.options.line.width
|
||||
}
|
||||
set lineWidth(v) {
|
||||
this.options.line.width = v
|
||||
this.entity.polyline.width = v
|
||||
this.options.line.width = ((v || v === 0) ? v : 3)
|
||||
this.entity.polyline.width = this.options.line.width
|
||||
this._elms.lineColor && this._elms.lineColor.forEach((item) => {
|
||||
item.value = v
|
||||
})
|
||||
@ -469,7 +469,7 @@ class AttackArrowObject 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
|
||||
|
@ -33,6 +33,7 @@ class ArcgisLayer extends BaseLayer {
|
||||
} else {
|
||||
this.entity = this.sdk.viewer.imageryLayers.addImageryProvider(imageryProvider,)
|
||||
}
|
||||
this.entity._id = this.options.id
|
||||
for (let i = 0; i < this.sdk.viewer.imageryLayers._layers.length; i++) {
|
||||
if (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider && this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type && (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'flw' || this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'jww')) {
|
||||
let layer = this.sdk.viewer.imageryLayers._layers[i]
|
||||
|
@ -30,6 +30,7 @@ class GdImagery extends BaseLayer {
|
||||
} else {
|
||||
this.entity = this.sdk.viewer.imageryLayers.addImageryProvider(gdLayer,)
|
||||
}
|
||||
this.entity._id = this.options.id
|
||||
for (let i = 0; i < this.sdk.viewer.imageryLayers._layers.length; i++) {
|
||||
if (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider && this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type && (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'flw' || this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'jww')) {
|
||||
let layer = this.sdk.viewer.imageryLayers._layers[i]
|
||||
|
@ -126,6 +126,7 @@ class Layer extends BaseLayer {
|
||||
this.entity =
|
||||
this.sdk.viewer.scene.imageryLayers.addImageryProvider(layer,)
|
||||
}
|
||||
this.entity._id = this.options.id
|
||||
for (let i = 0; i < this.sdk.viewer.imageryLayers._layers.length; i++) {
|
||||
if (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider && this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type && (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'flw' || this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'jww')) {
|
||||
let layer = this.sdk.viewer.imageryLayers._layers[i]
|
||||
|
@ -37,6 +37,7 @@ class Layer3rdparty extends BaseLayer {
|
||||
this.entity =
|
||||
this.sdk.viewer.scene.imageryLayers.addImageryProvider(layer,)
|
||||
}
|
||||
this.entity._id = this.options.id
|
||||
for (let i = 0; i < this.sdk.viewer.imageryLayers._layers.length; i++) {
|
||||
if (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider && this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type && (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'flw' || this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'jww')) {
|
||||
let layer = this.sdk.viewer.imageryLayers._layers[i]
|
||||
|
@ -28,11 +28,11 @@ class BaseLayer extends BaseSource {
|
||||
}
|
||||
|
||||
get layerIndex() {
|
||||
return this.entity._layerIndex
|
||||
return this.entity ? this.entity._layerIndex : undefined
|
||||
}
|
||||
|
||||
get layer_index() {
|
||||
return this.entity._layerIndex
|
||||
return this.entity ? this.entity._layerIndex : undefined
|
||||
}
|
||||
|
||||
get brightness() {
|
||||
|
@ -56,7 +56,7 @@ function html(that) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">视野缩放</span>
|
||||
<span class="label">固定大小</span>
|
||||
<input class="btn-switch" type="checkbox" @model="scaleByDistance">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -100,8 +100,8 @@ class Model extends BaseModel {
|
||||
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,
|
||||
@ -145,15 +145,7 @@ class Model extends BaseModel {
|
||||
if (!this.sdk || !this.sdk.viewer || !this.sdk.viewer.scene) {
|
||||
return
|
||||
}
|
||||
if (!url.startsWith("http")) {
|
||||
//说明是本地的json,在磁盘中存在的
|
||||
if (!url.includes(":")) {
|
||||
if (this.options.host) {
|
||||
let o = new URL(url, this.options.host)
|
||||
url = o.href
|
||||
}
|
||||
}
|
||||
}
|
||||
url = this.replaceHost(url, this.options.host)
|
||||
// this.handler = new Cesium.ScreenSpaceEventHandler(
|
||||
// this.sdk.viewer.canvas
|
||||
// )
|
||||
@ -791,7 +783,7 @@ class Model extends BaseModel {
|
||||
this.labelLineColor = color
|
||||
},//点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.labelLineColor = 'rgba(255,255,255,1)'
|
||||
this.labelLineColor = 'rgba(0,255,255,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.labelLineColor[i] = lineColorPicker
|
||||
@ -1336,7 +1328,9 @@ class Model extends BaseModel {
|
||||
this.name = this.options.name || '未命名对象'
|
||||
this.originalOptions = this.deepCopyObj(this.options)
|
||||
this._DialogObject.close()
|
||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions)
|
||||
let cdoptions = this.deepCopyObj(this.options)
|
||||
cdoptions.host = ''
|
||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(cdoptions)
|
||||
syncData(this.sdk, this.options.id)
|
||||
syncSplitData(this.sdk, this.options.id)
|
||||
},
|
||||
|
@ -247,7 +247,9 @@ class BaseTerrain extends BaseSource {
|
||||
}
|
||||
this.originalOptions = this.deepCopyObj(this.options)
|
||||
this._DialogObject.close()
|
||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions)
|
||||
let cdoptions = this.deepCopyObj(this.options)
|
||||
cdoptions.host = ''
|
||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(cdoptions)
|
||||
},
|
||||
// resetCallBack: () => {
|
||||
// this.name = this.originalOptions.name
|
||||
|
@ -63,9 +63,9 @@ class BillboardObject extends Base {
|
||||
*@param options.label {object} 标注文字的参数
|
||||
*@param [options.label.text] {string} 标注中文字
|
||||
*@param [options.label.show=true] {boolean} 标注文字显示/隐藏
|
||||
*@param [options.label.fontFamily=0] {number} 标注文字字体 0:思源黑体;1:庞门正道标题体;2:数黑体
|
||||
*@param [options.label.fontFamily=0] {number} 标注文字字体 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
*@param [options.label.fontSize=39] {number} 标注文字大小 单位px,微软雅黑
|
||||
*@param [options.label.color=#07f8e4] {string} 标注文字颜色
|
||||
*@param [options.label.color=#00ffff] {string} 标注文字颜色
|
||||
*@param _Dialog {object} 弹框事件
|
||||
*@param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
*@param _Dialog.instructSubmit(id,name,instruct) {function} 提交指令(ID, 名称,指令内容)
|
||||
@ -107,7 +107,7 @@ class BillboardObject extends Base {
|
||||
: true
|
||||
this.options.label.fontFamily = options.label.fontFamily || 0
|
||||
this.options.label.fontSize = options.label.fontSize || 39
|
||||
this.options.label.color = options.label.color || '#FFFF00'
|
||||
this.options.label.color = options.label.color || '#00ffff'
|
||||
this.options.positions = options.positions = options.positions || {}
|
||||
this.options.positions.lng = Number(
|
||||
Number(options.positions.lng || 0).toFixed(8)
|
||||
@ -211,8 +211,9 @@ class BillboardObject extends Base {
|
||||
let index = 0
|
||||
|
||||
let font = getFontFamily(that.labelFontFamily) || 'Helvetica'
|
||||
let url = that.replaceHost(that.options.billboard.image, that.options.host)
|
||||
that._frameImages = []
|
||||
if (that.options.billboard.image && that.options.billboard.image.endsWith('gif')) {
|
||||
if (url && url.endsWith('gif')) {
|
||||
isGlf = true
|
||||
switch (that.options.heightMode) {
|
||||
case 2:
|
||||
@ -222,7 +223,7 @@ class BillboardObject extends Base {
|
||||
}
|
||||
|
||||
let gifImg = document.createElement('img')
|
||||
gifImg.setAttribute('rel:animated_src', that.options.billboard.image)
|
||||
gifImg.setAttribute('rel:animated_src', url)
|
||||
gifImg.setAttribute('rel:auto_play', '1')
|
||||
const imgDiv = document.createElement('div')
|
||||
imgDiv.appendChild(gifImg)
|
||||
@ -272,7 +273,7 @@ class BillboardObject extends Base {
|
||||
else {
|
||||
let image = new Image()
|
||||
image.src =
|
||||
that.options.billboard.image ||
|
||||
url ||
|
||||
that.getSourceRootPath() + '/img/A-ablu-blank.png'
|
||||
switch (that.options.heightMode) {
|
||||
case 2:
|
||||
@ -720,11 +721,21 @@ class BillboardObject extends Base {
|
||||
}
|
||||
|
||||
get billboardImage() {
|
||||
return this.options.billboard.image
|
||||
let url = this.options.billboard.image
|
||||
if (url && !url.startsWith("http")) {
|
||||
//说明是本地的json,在磁盘中存在的
|
||||
if (!url.includes(":")) {
|
||||
if (this.options.host) {
|
||||
let o = new URL(url, this.options.host)
|
||||
url = o.href
|
||||
}
|
||||
}
|
||||
}
|
||||
return url
|
||||
}
|
||||
set billboardImage(v) {
|
||||
let _this = this
|
||||
this.options.billboard.image = v
|
||||
this.options.billboard.image = this.replaceHost(v, this.options.host)
|
||||
let url =
|
||||
this.options.billboard.image ||
|
||||
getBillboardDefaultUrl(this.options.billboard.defaultImage) ||
|
||||
@ -916,7 +927,7 @@ class BillboardObject extends Base {
|
||||
return this.options.label.color
|
||||
}
|
||||
set labelColor(v) {
|
||||
this.options.label.color = v
|
||||
this.options.label.color = v || '#00ffff'
|
||||
this.renewPoint()
|
||||
if (this._elms.labelColor) {
|
||||
this._elms.labelColor.forEach((item, i) => {
|
||||
@ -924,14 +935,14 @@ class BillboardObject extends Base {
|
||||
el: item.el,
|
||||
size: 'mini', //颜色box类型
|
||||
alpha: true, //是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.label.color,
|
||||
disabled: false, //是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity', //打开颜色选择器动画
|
||||
sure: c => {
|
||||
this.labelColor = c
|
||||
}, //点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.labelColor = 'rgba(255,255,255,1)'
|
||||
this.labelColor = 'rgba(0,255,255,1)'
|
||||
} //点击清空按钮事件回调
|
||||
})
|
||||
this._elms.labelColor[i] = colorPicker
|
||||
@ -1497,10 +1508,11 @@ class BillboardObject extends Base {
|
||||
}
|
||||
|
||||
set billboardDefaultImage(v) {
|
||||
setBillboardDefaultUrl(v, this.options.billboard.defaultImage)
|
||||
let url = this.replaceHost(v, this.options.host)
|
||||
setBillboardDefaultUrl(url, this.options.billboard.defaultImage)
|
||||
this._elms.billboardDefaultImage &&
|
||||
this._elms.billboardDefaultImage.forEach(item => {
|
||||
item.src = v
|
||||
item.src = url
|
||||
})
|
||||
}
|
||||
|
||||
@ -1575,8 +1587,10 @@ class BillboardObject extends Base {
|
||||
}
|
||||
this.originalOptions = this.deepCopyObj(this.options)
|
||||
this._DialogObject.close()
|
||||
let cdoptions = this.deepCopyObj(this.options)
|
||||
cdoptions.host = ''
|
||||
this.Dialog.confirmCallBack &&
|
||||
this.Dialog.confirmCallBack(this.originalOptions)
|
||||
this.Dialog.confirmCallBack(cdoptions)
|
||||
syncData(this.sdk, this.options.id)
|
||||
syncSplitData(this.sdk, this.options.id)
|
||||
},
|
||||
@ -1812,7 +1826,13 @@ class BillboardObject extends Base {
|
||||
case '2':
|
||||
case 3:
|
||||
case '3':
|
||||
this.getClampToHeight(this.options.positions).then(h => {
|
||||
let objectsToExclude = []
|
||||
for (let [key, value] of this.sdk.entityMap) {
|
||||
if (value.type === 'RadarScanStereoscopic' && value.entity) {
|
||||
objectsToExclude.push(value.entity)
|
||||
}
|
||||
}
|
||||
this.getClampToHeight(this.options.positions, objectsToExclude).then(h => {
|
||||
this.alt = Number(h.toFixed(2))
|
||||
heightElm.value = this.alt
|
||||
})
|
||||
@ -1876,7 +1896,13 @@ class BillboardObject extends Base {
|
||||
break
|
||||
case 3:
|
||||
case '3':
|
||||
this.getClampToHeight(this.options.positions).then(h => {
|
||||
let objectsToExclude = []
|
||||
for (let [key, value] of this.sdk.entityMap) {
|
||||
if (value.type === 'RadarScanStereoscopic' && value.entity) {
|
||||
objectsToExclude.push(value.entity)
|
||||
}
|
||||
}
|
||||
this.getClampToHeight(this.options.positions, objectsToExclude).then(h => {
|
||||
this.alt = Number(h.toFixed(2))
|
||||
})
|
||||
this.heightMode = 3
|
||||
@ -2330,9 +2356,14 @@ class BillboardObject extends Base {
|
||||
this.options.positions.lat,
|
||||
10000000000000
|
||||
)
|
||||
let updatedCartesians = await this.sdk.viewer.scene.clampToHeightMostDetailed(
|
||||
[point1]
|
||||
)
|
||||
|
||||
let objectsToExclude = []
|
||||
for (let [key, value] of this.sdk.entityMap) {
|
||||
if (value.type === 'RadarScanStereoscopic' && value.entity) {
|
||||
objectsToExclude.push(value.entity)
|
||||
}
|
||||
}
|
||||
let updatedCartesians = await this.sdk.viewer.scene.clampToHeightMostDetailed([point1], objectsToExclude)
|
||||
if (updatedCartesians && updatedCartesians[0]) {
|
||||
height = this.cartesian3Towgs84(updatedCartesians[0], this.sdk.viewer).alt
|
||||
}
|
||||
@ -2471,7 +2502,13 @@ class BillboardObject extends Base {
|
||||
}
|
||||
// 如果没有高度值,则获取紧贴高度计算
|
||||
if (!position.hasOwnProperty('alt')) {
|
||||
position.alt = await this.getClampToHeight(position)
|
||||
let objectsToExclude = []
|
||||
for (let [key, value] of this.sdk.entityMap) {
|
||||
if (value.type === 'RadarScanStereoscopic' && value.entity) {
|
||||
objectsToExclude.push(value.entity)
|
||||
}
|
||||
}
|
||||
position.alt = await this.getClampToHeight(position, objectsToExclude)
|
||||
}
|
||||
lng = this.options.customView.relativePosition.lng + position.lng
|
||||
lat = this.options.customView.relativePosition.lat + position.lat
|
||||
@ -2482,7 +2519,13 @@ class BillboardObject extends Base {
|
||||
orientation: orientation
|
||||
})
|
||||
} else {
|
||||
let height = await this.getClampToHeight(this.options.positions)
|
||||
let objectsToExclude = []
|
||||
for (let [key, value] of this.sdk.entityMap) {
|
||||
if (value.type === 'RadarScanStereoscopic' && value.entity) {
|
||||
objectsToExclude.push(value.entity)
|
||||
}
|
||||
}
|
||||
let height = await this.getClampToHeight(this.options.positions, objectsToExclude)
|
||||
this.sdk.viewer.camera.flyTo({
|
||||
orientation: options.orientation,
|
||||
destination: Cesium.Cartesian3.fromDegrees(
|
||||
@ -2650,7 +2693,13 @@ class BillboardObject extends Base {
|
||||
}
|
||||
// 如果没有高度值,则获取紧贴高度计算
|
||||
if (!position.hasOwnProperty('alt')) {
|
||||
position.alt = await this.getClampToHeight(position)
|
||||
let objectsToExclude = []
|
||||
for (let [key, value] of this.sdk.entityMap) {
|
||||
if (value.type === 'RadarScanStereoscopic' && value.entity) {
|
||||
objectsToExclude.push(value.entity)
|
||||
}
|
||||
}
|
||||
position.alt = await this.getClampToHeight(position, objectsToExclude)
|
||||
}
|
||||
relativePosition = {
|
||||
lng: cameraPosition84.lng - position.lng,
|
||||
|
@ -75,8 +75,8 @@ class CircleDiffuse 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,
|
||||
@ -573,7 +573,7 @@ class CircleDiffuse 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
|
||||
|
@ -23,7 +23,7 @@ class CircleObject extends Base {
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.color="#36c4ff" {string} 颜色
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.center {object} 位置
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 纬度
|
||||
@ -31,21 +31,21 @@ class CircleObject extends Base {
|
||||
* @param options.radius=10 {object}半径
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param options.line.color="#ff000080" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
*/
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
this.options.name = options.name || '未命名对象'
|
||||
this.options.color = options.color || "#36c4ff"
|
||||
this.options.color = options.color || "#ff000080"
|
||||
this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2
|
||||
this.options.radius = (options.radius || options.radius === 0) ? options.radius : 10
|
||||
this.options.show = (options.show || options.show === false) ? options.show : true
|
||||
this.options.center = options.center || {}
|
||||
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'] || '平方米'
|
||||
options.label = options.label || {}
|
||||
this._elms = {};
|
||||
@ -58,8 +58,8 @@ class CircleObject 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,
|
||||
@ -216,14 +216,14 @@ class CircleObject 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
|
||||
@ -233,14 +233,14 @@ class CircleObject 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,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.color[i] = colorPicker
|
||||
@ -252,25 +252,25 @@ class CircleObject extends Base {
|
||||
return this.options.line.color
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.line.color = v
|
||||
this.options.line.color = v || '#ff000080'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polyline) {
|
||||
return
|
||||
}
|
||||
this.entity.polyline.material = Cesium.Color.fromCssColorString(v)
|
||||
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', {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.line.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
this.lineColor = c
|
||||
},//点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.lineColor = 'rgba(255,255,255,1)'
|
||||
this.lineColor = 'rgba(255,0,0,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.lineColor[i] = lineColorPicker
|
||||
@ -282,8 +282,8 @@ class CircleObject extends Base {
|
||||
return this.options.line.width
|
||||
}
|
||||
set lineWidth(v) {
|
||||
this.options.line.width = v
|
||||
this.entity.polyline.width = v
|
||||
this.options.line.width = ((v || v === 0) ? v : 3)
|
||||
this.entity.polyline.width = this.options.line.width
|
||||
this._elms.lineWidth && this._elms.lineWidth.forEach((item) => {
|
||||
item.value = v
|
||||
})
|
||||
@ -478,7 +478,7 @@ class CircleObject 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
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* 圆
|
||||
* 椭圆
|
||||
*/
|
||||
import Dialog from '../../Element/Dialog';
|
||||
import cy_tabs from "../../Element/cy_html_tabs";
|
||||
@ -24,7 +24,7 @@ class EllipseObject extends Base {
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.center {object} 位置
|
||||
* @param options.color="#36c4ff" {string} 颜色
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 维度
|
||||
* @param options.semiMinorAxis=10 {number} 短半轴长度
|
||||
@ -32,22 +32,22 @@ class EllipseObject extends Base {
|
||||
* @param options.bearing=0 {number} 旋转角度
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param options.line.color="#ff000080" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
*/
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
this.options.name = options.name || '未命名对象'
|
||||
this.options.color = options.color || "#36c4ff"
|
||||
this.options.color = options.color || "#ff000080"
|
||||
this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2
|
||||
this.options.semiMinorAxis = (options.semiMinorAxis || options.semiMinorAxis === 0) ? options.semiMinorAxis : 10
|
||||
this.options.semiMajorAxis = (options.semiMajorAxis || options.semiMajorAxis === 0) ? options.semiMajorAxis : 20
|
||||
this.options.show = (options.show || options.show === false) ? options.show : true
|
||||
this.options.center = options.center || {}
|
||||
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'] || '平方米'
|
||||
options.label = options.label || {}
|
||||
this._elms = {};
|
||||
@ -60,8 +60,8 @@ class EllipseObject 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,
|
||||
@ -229,14 +229,14 @@ class EllipseObject 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
|
||||
@ -247,14 +247,14 @@ class EllipseObject 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,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.color[i] = colorPicker
|
||||
@ -266,25 +266,25 @@ class EllipseObject extends Base {
|
||||
return this.options.line.color
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.line.color = v
|
||||
this.options.line.color = v || '#ff000080'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polyline) {
|
||||
return
|
||||
}
|
||||
this.entity.polyline.material = Cesium.Color.fromCssColorString(v)
|
||||
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', {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.line.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
this.lineColor = c
|
||||
},//点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.lineColor = 'rgba(255,255,255,1)'
|
||||
this.lineColor = 'rgba(255,0,0,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.lineColor[i] = lineColorPicker
|
||||
@ -296,10 +296,10 @@ class EllipseObject extends Base {
|
||||
return this.options.line.width
|
||||
}
|
||||
set lineWidth(v) {
|
||||
this.options.line.width = v
|
||||
this.entity.polyline.width = v
|
||||
this.options.line.width = ((v || v === 0) ? v : 3)
|
||||
this.entity.polyline.width = this.options.line.width
|
||||
this._elms.lineWidth && this._elms.lineWidth.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.line.width
|
||||
})
|
||||
}
|
||||
|
||||
@ -492,7 +492,7 @@ class EllipseObject 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
|
||||
|
@ -594,12 +594,13 @@ class GroundSvg extends Base {
|
||||
}
|
||||
|
||||
init() {
|
||||
let url = this.replaceHost(this.options.url, this.options.host)
|
||||
syncData(this.sdk, this.options.id)
|
||||
this.hierarchys = []
|
||||
this.originalOptions = this.deepCopyObj(this.options)
|
||||
let geometryArray = []
|
||||
const loader = new SVGLoader();
|
||||
loader.load(this.options.url, (data) => {
|
||||
loader.load(url, (data) => {
|
||||
if (!this.sdk || !this.sdk.viewer || !this.sdk.viewer.entities) {
|
||||
return
|
||||
}
|
||||
@ -923,7 +924,9 @@ class GroundSvg extends Base {
|
||||
this.text && (this.options.text.position = { lng: this.text.position[0], lat: this.text.position[1], alt: this.text.position[2] })
|
||||
this.originalOptions = this.deepCopyObj(this.options)
|
||||
this._DialogObject.close()
|
||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions)
|
||||
let cdoptions = this.deepCopyObj(this.options)
|
||||
cdoptions.host = ''
|
||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(cdoptions)
|
||||
syncData(this.sdk, this.options.id)
|
||||
syncSplitData(this.sdk, this.options.id)
|
||||
},
|
||||
|
@ -34,10 +34,10 @@ class LabelObject extends Base {
|
||||
}
|
||||
this.options.text = textArray.join('\n')
|
||||
this.options.fontFamily = options.fontFamily || 0
|
||||
this.font = getFontFamily(this.options.fontFamily) || 'Helvetica'
|
||||
this.font = getFontFamily(this.options.fontFamily) || 'SimHei'
|
||||
this.options.fontSize = options.fontSize || 20
|
||||
this.options.lineWidth = options.lineWidth || 4
|
||||
this.options.lineColor = options.lineColor || '#fff000'
|
||||
this.options.lineColor = options.lineColor || '#00ffff80'
|
||||
this.options.color = options.color || '#ffffff'
|
||||
this.options.ground =
|
||||
options.ground || options.ground === false ? options.ground : true
|
||||
@ -46,8 +46,8 @@ class LabelObject extends Base {
|
||||
? options.pixelOffset
|
||||
: 20
|
||||
this.options.backgroundColor = options.backgroundColor || [
|
||||
'#42c6ef',
|
||||
'#42c6ef'
|
||||
'#00ffff80',
|
||||
'#00ffff80'
|
||||
]
|
||||
this.event = new MouseEvent(this.sdk)
|
||||
this.entity
|
||||
@ -407,7 +407,7 @@ class LabelObject extends Base {
|
||||
|
||||
set fontFamily(v) {
|
||||
this.options.fontFamily = v || 0
|
||||
this.font = getFontFamily(this.options.fontFamily) || 'Helvetica'
|
||||
this.font = getFontFamily(this.options.fontFamily) || 'SimHei'
|
||||
this.updateBillboardImage()
|
||||
}
|
||||
|
||||
@ -415,7 +415,7 @@ class LabelObject extends Base {
|
||||
return this.options.lineWidth
|
||||
}
|
||||
set lineWidth(v) {
|
||||
this.options.lineWidth = Number(v)
|
||||
this.options.lineWidth = ((Number(v) || Number(v) === 0) ? Number(v) : 4)
|
||||
if (!this.entity) {
|
||||
return
|
||||
}
|
||||
@ -443,7 +443,7 @@ class LabelObject extends Base {
|
||||
return this.options.pixelOffset
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.lineColor = v
|
||||
this.options.lineColor = v || '#00ffff80'
|
||||
if (!this.entity) {
|
||||
return
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class PincerArrowObject 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 PincerArrowObject 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.positions = options.positions || []
|
||||
this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2
|
||||
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.options.height = options.height
|
||||
this.options.loop = options.loop || false
|
||||
@ -62,8 +62,8 @@ class PincerArrowObject 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,
|
||||
@ -122,14 +122,14 @@ class PincerArrowObject 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
|
||||
@ -139,14 +139,14 @@ class PincerArrowObject 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,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.color[i] = colorPicker
|
||||
@ -253,25 +253,25 @@ class PincerArrowObject extends Base {
|
||||
return this.options.line.color
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.line.color = v
|
||||
this.options.line.color = v || '#ff000080'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polyline) {
|
||||
return
|
||||
}
|
||||
this.entity.polyline.material = Cesium.Color.fromCssColorString(v)
|
||||
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', {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.line.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
this.lineColor = c
|
||||
},//点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.lineColor = 'rgba(255,255,255,1)'
|
||||
this.lineColor = 'rgba(255,0,0,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.lineColor[i] = lineColorPicker
|
||||
@ -283,10 +283,10 @@ class PincerArrowObject extends Base {
|
||||
return this.options.line.width
|
||||
}
|
||||
set lineWidth(v) {
|
||||
this.options.line.width = v
|
||||
this.entity.polyline.width = v
|
||||
this.options.line.width = ((v || v === 0) ? v : 3)
|
||||
this.entity.polyline.width = this.options.line.width
|
||||
this._elms.lineWidth && this._elms.lineWidth.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.line.width
|
||||
})
|
||||
}
|
||||
|
||||
@ -479,7 +479,7 @@ class PincerArrowObject 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
|
||||
|
@ -25,7 +25,7 @@ class PolygonObject extends Base {
|
||||
* @param options.id {string} 唯一标识
|
||||
* @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 options.line {object} 边框
|
||||
@ -39,15 +39,15 @@ class PolygonObject 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.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3)
|
||||
this.options.line.color =
|
||||
this.options.line.color || 'rgba(155, 155, 124, 0.89)'
|
||||
this.options.line.color || '#ff000080'
|
||||
this.options['area-unit'] = options['area-unit'] || '平方米'
|
||||
this.entity
|
||||
this.event = new MouseEvent(this.sdk)
|
||||
@ -74,8 +74,8 @@ class PolygonObject 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
|
||||
@ -133,18 +133,18 @@ class PolygonObject 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
|
||||
}
|
||||
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) {
|
||||
this.heightMode = 0
|
||||
material = new Cesium.CustomColorMaterialSource({
|
||||
color: v
|
||||
color: this.options.color
|
||||
})
|
||||
}
|
||||
this.entity.polygon.material = material
|
||||
@ -154,14 +154,14 @@ class PolygonObject 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,0.5)'
|
||||
} //点击清空按钮事件回调
|
||||
})
|
||||
this._elms.color[i] = colorPicker
|
||||
@ -269,25 +269,25 @@ class PolygonObject extends Base {
|
||||
return this.options.line.color
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.line.color = v
|
||||
this.options.line.color = v || '#ff000080'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polyline) {
|
||||
return
|
||||
}
|
||||
this.entity.polyline.material = Cesium.Color.fromCssColorString(v)
|
||||
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', {
|
||||
el: item.el,
|
||||
size: 'mini', //颜色box类型
|
||||
alpha: true, //是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.line.color,
|
||||
disabled: false, //是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity', //打开颜色选择器动画
|
||||
sure: c => {
|
||||
this.lineColor = c
|
||||
}, //点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.lineColor = 'rgba(255,255,255,1)'
|
||||
this.lineColor = 'rgba(255,0,0,0.5)'
|
||||
} //点击清空按钮事件回调
|
||||
})
|
||||
this._elms.lineColor[i] = lineColorPicker
|
||||
@ -299,8 +299,8 @@ class PolygonObject extends Base {
|
||||
return this.options.line.width
|
||||
}
|
||||
set lineWidth(v) {
|
||||
this.options.line.width = v
|
||||
this.entity.polyline.width = v
|
||||
this.options.line.width = ((v || v === 0) ? v : 3)
|
||||
this.entity.polyline.width = this.options.line.width
|
||||
this._elms.lineWidth &&
|
||||
this._elms.lineWidth.forEach(item => {
|
||||
item.value = v
|
||||
@ -504,7 +504,7 @@ class PolygonObject 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
|
||||
|
@ -24,7 +24,7 @@ class PolyhedronObject extends Base {
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color="#0df7f8" {string} 颜色
|
||||
* @param options.color="#ff0000" {string} 颜色
|
||||
* @param options.height=10 {number} 高
|
||||
* @param {Array.<object>} options.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
@ -32,7 +32,7 @@ class PolyhedronObject extends Base {
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
this.options.color = options.color || "#0df7f8"
|
||||
this.options.color = options.color || "#ff0000"
|
||||
this.options.show = (options.show || options.show === false) ? options.show : true
|
||||
this.options.height = (options.height || options.height === 0) ? options.height : 10
|
||||
if (this.options.height <= 0.01) {
|
||||
@ -54,8 +54,8 @@ class PolyhedronObject 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,
|
||||
@ -381,7 +381,7 @@ class PolyhedronObject extends Base {
|
||||
return this.options.color
|
||||
}
|
||||
set color(v) {
|
||||
this.options.color = v
|
||||
this.options.color = v || '#ff0000'
|
||||
if(!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polygon) {
|
||||
return
|
||||
}
|
||||
@ -398,7 +398,7 @@ class PolyhedronObject extends Base {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
@ -662,7 +662,7 @@ class PolyhedronObject 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
|
||||
|
@ -53,8 +53,8 @@ class PolyhedronObject 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,
|
||||
@ -599,7 +599,7 @@ class PolyhedronObject 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
|
||||
|
@ -23,8 +23,8 @@ class PolylineObject 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=2{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
@ -51,8 +51,8 @@ class PolylineObject 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.smooth = options.smooth || false
|
||||
@ -91,8 +91,8 @@ class PolylineObject 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
|
||||
@ -149,22 +149,22 @@ class PolylineObject extends Base {
|
||||
return this.options.color
|
||||
}
|
||||
set color(v) {
|
||||
this.options.color = v
|
||||
this.entity.polyline.material = this.getMaterial(v, this.options.type, this.entity, this.options)
|
||||
this.options.color = v || '#ff0000'
|
||||
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
|
||||
if (this._elms.color) {
|
||||
this._elms.color.forEach((item, i) => {
|
||||
let colorPicker = new ewPlugins('colorpicker', {
|
||||
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
|
||||
@ -332,10 +332,10 @@ class PolylineObject 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 &&
|
||||
@ -809,7 +809,7 @@ class PolylineObject 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
|
||||
|
@ -53,8 +53,8 @@ class RadarScan 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,
|
||||
@ -594,7 +594,7 @@ class RadarScan 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
|
||||
|
@ -58,8 +58,8 @@ class RadarScanStereoscopic 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,
|
||||
@ -86,6 +86,10 @@ class RadarScanStereoscopic extends Base {
|
||||
RadarScanStereoscopic.radarSolidScan(this)
|
||||
}
|
||||
|
||||
get type() {
|
||||
return 'RadarScanStereoscopic'
|
||||
}
|
||||
|
||||
static radarSolidScan(that) {
|
||||
let viewer = that.sdk.viewer
|
||||
let options = that.options
|
||||
@ -565,7 +569,7 @@ class RadarScanStereoscopic 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
|
||||
|
@ -23,7 +23,7 @@ class SectorObject extends Base {
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.color="#36c4ff" {string} 颜色
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.center {object} 位置
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 维度
|
||||
@ -31,7 +31,7 @@ class SectorObject extends Base {
|
||||
* @param options.startAngle=10 {number} 起始方向
|
||||
* @param options.endAngle=0 {number} 结束方向
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.width=3 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
@ -39,15 +39,15 @@ class SectorObject extends Base {
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
this.options.name = options.name || '未命名对象'
|
||||
this.options.color = options.color || "#36c4ff"
|
||||
this.options.color = options.color || "#ff000080"
|
||||
this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2
|
||||
this.options.semiMinorAxis = (options.semiMinorAxis || options.semiMinorAxis === 0) ? options.semiMinorAxis : 10
|
||||
this.options.semiMajorAxis = (options.semiMajorAxis || options.semiMajorAxis === 0) ? options.semiMajorAxis : 20
|
||||
this.options.show = (options.show || options.show === false) ? options.show : true
|
||||
this.options.center = options.center || {}
|
||||
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'] || '平方米'
|
||||
options.label = options.label || {}
|
||||
this._elms = {};
|
||||
@ -60,8 +60,8 @@ class SectorObject 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,
|
||||
@ -226,14 +226,14 @@ class SectorObject 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
|
||||
@ -244,14 +244,14 @@ class SectorObject 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,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.color[i] = colorPicker
|
||||
@ -263,25 +263,25 @@ class SectorObject extends Base {
|
||||
return this.options.line.color
|
||||
}
|
||||
set lineColor(v) {
|
||||
this.options.line.color = v
|
||||
this.options.line.color = v || '#ff000080'
|
||||
if (!this.sdk || !this.sdk.viewer || !this.entity || !this.entity.polyline) {
|
||||
return
|
||||
}
|
||||
this.entity.polyline.material = Cesium.Color.fromCssColorString(v)
|
||||
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', {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.line.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
this.lineColor = c
|
||||
},//点击确认按钮事件回调
|
||||
clear: () => {
|
||||
this.lineColor = 'rgba(255,255,255,1)'
|
||||
this.lineColor = 'rgba(255,0,0,0.5)'
|
||||
},//点击清空按钮事件回调
|
||||
})
|
||||
this._elms.lineColor[i] = lineColorPicker
|
||||
@ -293,10 +293,10 @@ class SectorObject extends Base {
|
||||
return this.options.line.width
|
||||
}
|
||||
set lineWidth(v) {
|
||||
this.options.line.width = v
|
||||
this.entity.polyline.width = v
|
||||
this.options.line.width = ((v || v === 0) ? v : 3)
|
||||
this.entity.polyline.width = this.options.line.width
|
||||
this._elms.lineWidth && this._elms.lineWidth.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.line.width
|
||||
})
|
||||
}
|
||||
|
||||
@ -489,7 +489,7 @@ class SectorObject 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
|
||||
|
@ -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
|
||||
|
@ -100,7 +100,7 @@ class TrajectoryMotion extends Base {
|
||||
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',
|
||||
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,
|
||||
@ -1305,9 +1305,10 @@ class TrajectoryMotion extends Base {
|
||||
}
|
||||
// 创建模型
|
||||
static async addModel(that) {
|
||||
let url = that.replaceHost(that.options.model.url, that.options.host)
|
||||
let options = {
|
||||
id: that.options.id,
|
||||
url: that.options.model.url,
|
||||
url: url,
|
||||
show: that.options.show ? that.options.model.show : false,
|
||||
scale: that.options.model.scale,
|
||||
// minimumPixelSize: that.options.model.pixelSize,
|
||||
@ -2285,7 +2286,7 @@ class TrajectoryMotion extends Base {
|
||||
|
||||
async changeModelUrl(url) {
|
||||
this.sdk.viewer.scene.primitives.remove(this.model)
|
||||
this.options.model.url = url
|
||||
this.options.model.url = this.replaceHost(url, this.options.host)
|
||||
let matrix = this.model.modelMatrix
|
||||
let position = this.model.position
|
||||
let options = {
|
||||
|
@ -41,7 +41,7 @@ function html(that) {
|
||||
<div class="corner-type"></div>
|
||||
</div>
|
||||
<div class="col material-box">
|
||||
<span class="label">材质样式</span>
|
||||
<span class="label">墙体样式</span>
|
||||
<div class="material"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -32,7 +32,7 @@ class WallRealStereoscopic extends Base {
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.extrudedHeight=2.4 {number} 拉伸高度
|
||||
* @param options.cornerType=0 {string} 拐角类型;0:直角;1:斜角;2:圆角
|
||||
* @param options.material=0 {number} 材质,0:纯色墙;1:砖墙1;2:砖墙2;3:砖墙3
|
||||
* @param options.material=0 {number} 材质,0:纯色墙;1:红砖;2:黄砖;3:灰瓷
|
||||
* @param {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
@ -60,8 +60,8 @@ class WallRealStereoscopic 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,
|
||||
@ -398,7 +398,7 @@ class WallRealStereoscopic 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
|
||||
@ -1368,20 +1368,20 @@ class WallRealStereoscopic extends Base {
|
||||
icon: 'icon-wall'
|
||||
},
|
||||
{
|
||||
name: '<i class="icon icon-wall-brick1"></i>砖墙1',
|
||||
value: '砖墙1',
|
||||
name: '<i class="icon icon-wall-brick1"></i>红砖墙',
|
||||
value: '红砖墙',
|
||||
key: 1,
|
||||
icon: 'icon-wall-brick1'
|
||||
},
|
||||
{
|
||||
name: '<i class="icon icon-wall-brick2"></i>砖墙2',
|
||||
value: '砖墙2',
|
||||
name: '<i class="icon icon-wall-brick2"></i>黄砖墙',
|
||||
value: '黄砖墙',
|
||||
key: 2,
|
||||
icon: 'icon-wall-brick2'
|
||||
},
|
||||
{
|
||||
name: '<i class="icon icon-wall-brick3"></i>砖墙3',
|
||||
value: '砖墙3',
|
||||
name: '<i class="icon icon-wall-brick3"></i>灰瓷墙',
|
||||
value: '灰瓷墙',
|
||||
key: 3,
|
||||
icon: 'icon-wall-brick3'
|
||||
}
|
||||
|
@ -47,8 +47,8 @@ class WallStereoscopic 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,
|
||||
@ -287,7 +287,7 @@ class WallStereoscopic 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
|
||||
|
@ -58,8 +58,8 @@ class WallRealStereoscopic 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,
|
||||
@ -373,7 +373,7 @@ class WallRealStereoscopic 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
|
||||
|
@ -47,8 +47,8 @@ class WallStereoscopic 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,
|
||||
@ -287,7 +287,7 @@ class WallStereoscopic 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
|
||||
|
@ -32,10 +32,10 @@ class WallStereoscopic extends Base {
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
this.options.color = options.color || "#00d9ff"
|
||||
this.options.color = options.color || "#ff0000"
|
||||
this.options.extrudedHeight = options.extrudedHeight || 2.4
|
||||
this.options.positions = options.positions
|
||||
this.options.material = Number(options.material) || 0
|
||||
this.options.material = (Number(options.material) || Number(options.material) === 0) ? Number(options.material) : 3
|
||||
this.options.duration = (options.duration || options.duration === 0) ? options.duration : 1000
|
||||
this.options.show = (options.show || options.show === false) ? options.show : true
|
||||
this.options['nose-to-tail'] = options['nose-to-tail'] || false
|
||||
@ -51,8 +51,8 @@ class WallStereoscopic 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,
|
||||
@ -113,7 +113,7 @@ class WallStereoscopic extends Base {
|
||||
return this.options.color
|
||||
}
|
||||
set color(v) {
|
||||
this.options.color = v
|
||||
this.options.color = v || '#ff0000'
|
||||
this.entity.polylineVolume.material = this.getMaterial()
|
||||
if (this._elms.color) {
|
||||
this._elms.color.forEach((item, i) => {
|
||||
@ -121,7 +121,7 @@ class WallStereoscopic extends Base {
|
||||
el: item.el,
|
||||
size: 'mini',//颜色box类型
|
||||
alpha: true,//是否开启透明度
|
||||
defaultColor: v,
|
||||
defaultColor: this.options.color,
|
||||
disabled: false,//是否禁止打开颜色选择器
|
||||
openPickerAni: 'opacity',//打开颜色选择器动画
|
||||
sure: (c) => {
|
||||
@ -140,10 +140,10 @@ class WallStereoscopic extends Base {
|
||||
return this.options.material
|
||||
}
|
||||
set material(v) {
|
||||
this.options.material = Number(v)
|
||||
this.options.material = (Number(v) || Number(v) === 0) ? Number(v) : 3
|
||||
this.entity.polylineVolume.material = this.getMaterial()
|
||||
this._elms.material && this._elms.material.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.material
|
||||
})
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ class WallStereoscopic 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
|
||||
|
@ -47,8 +47,8 @@ class WallStereoscopic 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,
|
||||
@ -287,7 +287,7 @@ class WallStereoscopic 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
|
||||
|
@ -47,8 +47,8 @@ class WallStereoscopic2 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,
|
||||
@ -306,7 +306,7 @@ class WallStereoscopic2 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
|
||||
|
@ -47,8 +47,8 @@ class WallStereoscopic 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,
|
||||
@ -287,7 +287,7 @@ class WallStereoscopic 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
|
||||
|
@ -6,6 +6,7 @@
|
||||
* @update: 2023-12-01 12:12
|
||||
*/
|
||||
import Tools from "../../Tools";
|
||||
import { getHost, getToken } from "../../on";
|
||||
import { regLeftClickCallback, regRightClickCallback, regMoveCallback } from "../../Global/ClickCallback";
|
||||
import { regLeftClickCallback as regLeftClickCallback2, regRightClickCallback as regRightClickCallback2, regMoveCallback as regMoveCallback2 } from "../../Global/SplitScreen/ClickCallback";
|
||||
import { setSplitDirection, syncSplitData, getSdk } from "../../Global/SplitScreen";
|
||||
@ -27,6 +28,7 @@ class Base extends Tools {
|
||||
this.clickCallBack = null
|
||||
this.rightClickCallBack = null
|
||||
this.picking = true
|
||||
this.options.host = this.options.host || getHost()
|
||||
this.setDefaultValue()
|
||||
|
||||
// this.sdk.addIncetance(this.options.id, this)
|
||||
|
@ -1,21 +1,27 @@
|
||||
let fontData = [
|
||||
{
|
||||
name: '黑体',
|
||||
value: '黑体',
|
||||
font: 'SimHei',
|
||||
key: '0'
|
||||
},
|
||||
{
|
||||
name: '思源黑体',
|
||||
value: '思源黑体',
|
||||
font: 'SourceHanSansTi',
|
||||
key: '0'
|
||||
key: '1'
|
||||
},
|
||||
{
|
||||
name: '庞门正道标题体',
|
||||
value: '庞门正道标题体',
|
||||
font: 'PMZDBTTi',
|
||||
key: '1'
|
||||
key: '2'
|
||||
},
|
||||
{
|
||||
name: '数黑体',
|
||||
value: '数黑体',
|
||||
font: 'AlimamaShuHeiTi',
|
||||
key: '2'
|
||||
key: '3'
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -1271,6 +1271,55 @@ class Tools {
|
||||
return `${year}${month}${day}${hours}${minutes}${seconds}${milliseconds}`;
|
||||
}
|
||||
|
||||
replaceHost(url, host) {
|
||||
let newUrl = url
|
||||
if(!url || !host) {
|
||||
return url
|
||||
}
|
||||
try {
|
||||
if (!url.startsWith("http")) {
|
||||
//说明是本地的json,在磁盘中存在的
|
||||
if (!url.includes(":")) {
|
||||
if (this.options.host) {
|
||||
let o = new URL(url, this.options.host)
|
||||
newUrl = o.href
|
||||
}
|
||||
}
|
||||
return newUrl
|
||||
}
|
||||
else {
|
||||
// 移除可能的用户名:密码前缀
|
||||
const authRegex = /^[^@]+@/;
|
||||
if (authRegex.test(url)) {
|
||||
url = url.replace(authRegex, '');
|
||||
}
|
||||
|
||||
// 添加协议前缀(如果没有)
|
||||
if (!/^[a-z]+:\/\//i.test(url)) {
|
||||
url = 'http://' + url;
|
||||
}
|
||||
|
||||
const parsedUrl = new URL(url);
|
||||
const parsedUrl2 = new URL(host);
|
||||
let hostname = parsedUrl.hostname;
|
||||
let port = parsedUrl.port;
|
||||
|
||||
// 处理IPv6地址(如果有括号)
|
||||
if (hostname.startsWith('[') && hostname.endsWith(']')) {
|
||||
hostname = hostname.slice(1, -1);
|
||||
}
|
||||
if ((hostname === 'localhost' || hostname === '127.0.0.1') && parseInt(port, 10) !== 55110) {
|
||||
parsedUrl.port = parsedUrl2.port
|
||||
parsedUrl.protocol = parsedUrl2.protocol
|
||||
newUrl = parsedUrl.toString()
|
||||
}
|
||||
return newUrl
|
||||
}
|
||||
} catch (error) {
|
||||
return newUrl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user