|
|
|
@ -18,6 +18,7 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Gl
|
|
|
|
|
import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen'
|
|
|
|
|
|
|
|
|
|
class GroundSvg extends Base {
|
|
|
|
|
#_textPosPickDrawEvent = null
|
|
|
|
|
/**
|
|
|
|
|
* @constructor
|
|
|
|
|
* @param sdk
|
|
|
|
@ -243,7 +244,7 @@ class GroundSvg extends Base {
|
|
|
|
|
|
|
|
|
|
set color(v) {
|
|
|
|
|
this.options.color = v
|
|
|
|
|
if (this.entity.values) {
|
|
|
|
|
if (this.entity.values && this.entity.values.length > 0) {
|
|
|
|
|
if (this.options.color) {
|
|
|
|
|
for (let i = 0; i < this.entity.values.length; i++) {
|
|
|
|
|
this.entity.values[i].polygon.material = Cesium.Color.fromCssColorString(this.options.color)
|
|
|
|
@ -345,7 +346,9 @@ class GroundSvg extends Base {
|
|
|
|
|
this.text.text = v
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
GroundSvg.createText(this)
|
|
|
|
|
if (this.mode == 0) {
|
|
|
|
|
GroundSvg.createText(this)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this._elms.textValue && this._elms.textValue.forEach((item) => {
|
|
|
|
|
item.value = v
|
|
|
|
@ -656,6 +659,9 @@ class GroundSvg extends Base {
|
|
|
|
|
return this.options.mode
|
|
|
|
|
}
|
|
|
|
|
set mode(v) {
|
|
|
|
|
if (this.#_textPosPickDrawEvent) {
|
|
|
|
|
this.#_textPosPickDrawEvent.end()
|
|
|
|
|
}
|
|
|
|
|
this.options.mode = v ? 1 : 0
|
|
|
|
|
this.drag(false)
|
|
|
|
|
if (this._DialogObject && this._DialogObject._element && this._DialogObject._element.body) {
|
|
|
|
@ -1252,58 +1258,58 @@ class GroundSvg extends Base {
|
|
|
|
|
if (this.sdk.viewer._element.className === 'cesium-viewer 2d') {
|
|
|
|
|
perPositionHeight = true
|
|
|
|
|
}
|
|
|
|
|
for (let i = 0; i < this.hierarchys.length; i++) {
|
|
|
|
|
for (let m = 0; m < this.hierarchys[i].length; m++) {
|
|
|
|
|
let id = this.options.id + `-${i}_${m}}`
|
|
|
|
|
let oldEntity = this.sdk.viewer.entities.getById(id)
|
|
|
|
|
if (oldEntity) {
|
|
|
|
|
this.sdk.viewer.entities.remove(oldEntity)
|
|
|
|
|
}
|
|
|
|
|
let entity = this.sdk.viewer.entities.add({
|
|
|
|
|
id: this.options.id + `-${i}_${m}}`,
|
|
|
|
|
show: this.options.show,
|
|
|
|
|
polygon: {
|
|
|
|
|
hierarchy: new Cesium.CallbackProperty(() => {
|
|
|
|
|
let hierarchy = this.hierarchys[i][m]
|
|
|
|
|
let holes = []
|
|
|
|
|
for (let n = 0; n < hierarchy.holes.length; n++) {
|
|
|
|
|
holes.push({
|
|
|
|
|
positions: hierarchy.holes[n]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
positions: hierarchy.positions,
|
|
|
|
|
holes: holes
|
|
|
|
|
}
|
|
|
|
|
}, true),
|
|
|
|
|
perPositionHeight: perPositionHeight,
|
|
|
|
|
zIndex: this.sdk._entityZIndex,
|
|
|
|
|
material: new Cesium.CustomColorMaterialSource({
|
|
|
|
|
color: this.options.color || this.geojson.features[i].properties.color
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
id: this.options.id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.sdk._entityZIndex++
|
|
|
|
|
if (this.geojson.features[i].properties.color) {
|
|
|
|
|
entity.properties = {
|
|
|
|
|
id: this.options.id,
|
|
|
|
|
color: this.geojson.features[i].properties.color
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this._entityArray.push(entity)
|
|
|
|
|
this.entity.add(entity)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// for (let i = 0; i < this.hierarchys.length; i++) {
|
|
|
|
|
// for (let m = 0; m < this.hierarchys[i].length; m++) {
|
|
|
|
|
// let id = this.options.id + `-${i}_${m}}`
|
|
|
|
|
// let oldEntity = this.sdk.viewer.entities.getById(id)
|
|
|
|
|
// if (oldEntity) {
|
|
|
|
|
// this.sdk.viewer.entities.remove(oldEntity)
|
|
|
|
|
// }
|
|
|
|
|
// let entity = this.sdk.viewer.entities.add({
|
|
|
|
|
// id: this.options.id + `-${i}_${m}}`,
|
|
|
|
|
// show: this.options.show,
|
|
|
|
|
// polygon: {
|
|
|
|
|
// hierarchy: new Cesium.CallbackProperty(() => {
|
|
|
|
|
// let hierarchy = this.hierarchys[i][m]
|
|
|
|
|
// let holes = []
|
|
|
|
|
// for (let n = 0; n < hierarchy.holes.length; n++) {
|
|
|
|
|
// holes.push({
|
|
|
|
|
// positions: hierarchy.holes[n]
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// return {
|
|
|
|
|
// positions: hierarchy.positions,
|
|
|
|
|
// holes: holes
|
|
|
|
|
// }
|
|
|
|
|
// }, true),
|
|
|
|
|
// perPositionHeight: perPositionHeight,
|
|
|
|
|
// zIndex: this.sdk._entityZIndex,
|
|
|
|
|
// material: new Cesium.CustomColorMaterialSource({
|
|
|
|
|
// color: this.options.color || this.geojson.features[i].properties.color
|
|
|
|
|
// })
|
|
|
|
|
// },
|
|
|
|
|
// properties: {
|
|
|
|
|
// id: this.options.id
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// this.sdk._entityZIndex++
|
|
|
|
|
// if (this.geojson.features[i].properties.color) {
|
|
|
|
|
// entity.properties = {
|
|
|
|
|
// id: this.options.id,
|
|
|
|
|
// color: this.geojson.features[i].properties.color
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// this._entityArray.push(entity)
|
|
|
|
|
// this.entity.add(entity)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
this.loaded = true
|
|
|
|
|
this.#loaded = true
|
|
|
|
|
if (this.#loadEvent) {
|
|
|
|
|
this.#loadEvent()
|
|
|
|
|
}
|
|
|
|
|
this.scale = this.scale
|
|
|
|
|
GroundSvg.createText(this)
|
|
|
|
|
// GroundSvg.createText(this)
|
|
|
|
|
// GroundSvg.initText(this)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -2292,6 +2298,9 @@ class GroundSvg extends Base {
|
|
|
|
|
if (!this.#loaded || !this.sdk || !this.sdk.viewer) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let greenImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA+0lEQVR4AZSTPQ7CMAyFk0jAFYCRCbgEbHAKBqRyKCoYOAVs5RLAQseKKxQkwntWVCltJdzK+bO/59ZW6kztGX6mi/F7dhiV0ydWzxH2B8ZquIkSAN47bzNAW2vtBKtY2G8ZIyPOMFUJxuX8DF+C8c+SwAonCSSr9SvxaCawogHrQl2aNwOPLKHWoa5N5O5woNZ575cdNBFKrQsdjgLaA7XSRK2gjWMJeVtA40MJOUvgxdHwDQYlZO5r/akRUTqoda/e4wo+xehqKbXSxKJ/3xlvL+oMYEUDgSTAaorBbY1V8yVpYIGb+G9kVtTFi3Vkh4XAFPZHxsjAVdkPAAD//0PYov0AAAAGSURBVAMA5pZjby819WUAAAAASUVORK5CYII='
|
|
|
|
|
let redImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA1klEQVR4AZST0Q2CQBBEF0qhEfjDKvgwwaIk+kEV8oeFSCs4D4+gB4l7ZIfszc7OLXDkFl2zWSnchJcwB5DDlZHcfgwkvkowCmehENYghxuDZuU3AxUeYlvhX7RBu+iWCUSwc70wvlsdeixXwnN5do6tmaRkgiauJKwbDKqEhlhaYcAbjgvedYGBV3yow2A6rPjICQMOjk++V40Y9HvezfR5ZvaUvBNSo6OXCUzJRd2D4I0h9Gz/goiTuj2TsDNayW0zYJWZMQkH667199chh6uCRuVPvAEAAP//mBlPPAAAAAZJREFUAwAzdy+JgzpBHQAAAABJRU5ErkJggg=='
|
|
|
|
|
let yellowImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA8ElEQVR4AZyQMY7CQAxFbbe7W7IH2GrJJaCDU1AgwaFAUHAK6OASQAM9UAJtzLxRBikUKMwo1jjf//0oNnk518t/534uZtdTcbidC6fooxZmL3apBdwv7Ym6rV1kqCp/yUwftTDDk3TuZ0D40tJdR4jvCg/e5IkBVWoviQ3uXsWI8c+kNoBqFhhYM7dBbfLBC6yVLl3JPLDGhjN5gY1LzA2AM3c50uQUrJnKWjIPrJVaLjJ5gbWf1n6j6tNPQ2Bg4xK/WrtxCFiFavqsKkZiANT377ZPKv27woM3eZ4BCKS6ll0VmbNhNIo+amGGBy3VAwAA//9///lSAAAABklEQVQDAADzbcvdBag1AAAAAElFTkSuQmCC'
|
|
|
|
|
this.ismove = false
|
|
|
|
|
this._isdrag = status
|
|
|
|
|
if (this.ScreenSpaceEventHandler) {
|
|
|
|
@ -2379,29 +2388,45 @@ class GroundSvg extends Base {
|
|
|
|
|
flag2 = true
|
|
|
|
|
}
|
|
|
|
|
if (flag && flag2) {
|
|
|
|
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[1].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[3].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[7].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[9].billboard.image = redImg
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (flag) {
|
|
|
|
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[1].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[3].billboard.image = redImg
|
|
|
|
|
this.pointEntityCollection.values[7].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[9].billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
else if (flag2) {
|
|
|
|
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[1].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[3].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[7].billboard.image = redImg
|
|
|
|
|
this.pointEntityCollection.values[9].billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[1].billboard.image = redImg
|
|
|
|
|
this.pointEntityCollection.values[3].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[7].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[9].billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2421,12 +2446,16 @@ class GroundSvg extends Base {
|
|
|
|
|
|
|
|
|
|
if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) {
|
|
|
|
|
angleH = angleH + 180
|
|
|
|
|
this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[2].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[8].billboard.image = redImg
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[2].billboard.image = redImg
|
|
|
|
|
this.pointEntityCollection.values[8].billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
radiansH = (Math.PI / 180) * angleH
|
|
|
|
@ -2451,29 +2480,45 @@ class GroundSvg extends Base {
|
|
|
|
|
flag2 = true
|
|
|
|
|
}
|
|
|
|
|
if (flag && flag2) {
|
|
|
|
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[1].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[3].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[7].billboard.image = redImg
|
|
|
|
|
this.pointEntityCollection.values[9].billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (flag) {
|
|
|
|
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[1].billboard.image = redImg
|
|
|
|
|
this.pointEntityCollection.values[3].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[7].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[9].billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
else if (flag2) {
|
|
|
|
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[1].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[3].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[7].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[9].billboard.image = redImg
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[1].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[3].billboard.image = redImg
|
|
|
|
|
this.pointEntityCollection.values[7].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[9].billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2492,12 +2537,16 @@ class GroundSvg extends Base {
|
|
|
|
|
|
|
|
|
|
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
|
|
|
|
angleW = angleW + 180
|
|
|
|
|
this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[4].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[6].billboard.image = redImg
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[6].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[4].billboard.image = redImg
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
radiansW = (Math.PI / 180) * angleW
|
|
|
|
@ -2528,12 +2577,16 @@ class GroundSvg extends Base {
|
|
|
|
|
|
|
|
|
|
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
|
|
|
|
angleW = angleW + 180
|
|
|
|
|
this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[6].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[4].billboard.image = redImg
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[4].billboard.image = greenImg
|
|
|
|
|
this.pointEntityCollection.values[6].billboard.image = redImg
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
radiansW = (Math.PI / 180) * angleW
|
|
|
|
@ -2598,18 +2651,22 @@ class GroundSvg extends Base {
|
|
|
|
|
}
|
|
|
|
|
for (let i = 0; i < this.pointEntityCollection.values.length; i++) {
|
|
|
|
|
if (pickPoint && this.pointEntityCollection.values[i].id === pickPoint.id) {
|
|
|
|
|
pickPoint.point.color = Cesium.Color.fromCssColorString('#ffff00')
|
|
|
|
|
// pickPoint.point.color = Cesium.Color.fromCssColorString('#ffff00')
|
|
|
|
|
pickPoint.billboard.image = yellowImg
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
switch (this.pointEntityCollection.values[i].id) {
|
|
|
|
|
case 'svg-control-points_5':
|
|
|
|
|
this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#ffff00')
|
|
|
|
|
// this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#ffff00')
|
|
|
|
|
this.pointEntityCollection.values[i].billboard.image = yellowImg
|
|
|
|
|
break
|
|
|
|
|
case 'svg-control-points_0':
|
|
|
|
|
this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pointEntityCollection.values[i].billboard.image = redImg
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pointEntityCollection.values[i].billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2624,7 +2681,8 @@ class GroundSvg extends Base {
|
|
|
|
|
) {
|
|
|
|
|
YJ.Global.CameraController(this.sdk, false)
|
|
|
|
|
this.pickPoint = pickedObject.primitive._id
|
|
|
|
|
this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pickPoint.billboard.image = redImg
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2634,13 +2692,16 @@ class GroundSvg extends Base {
|
|
|
|
|
YJ.Global.CameraController(this.sdk, true)
|
|
|
|
|
switch (this.pickPoint.id) {
|
|
|
|
|
case 'svg-control-points_4':
|
|
|
|
|
this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ffff00')
|
|
|
|
|
// this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ffff00')
|
|
|
|
|
this.pickPoint.billboard.image = yellowImg
|
|
|
|
|
break
|
|
|
|
|
case 'svg-control-points_9':
|
|
|
|
|
this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
// this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ff0000')
|
|
|
|
|
this.pickPoint.billboard.image = redImg
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
this.pickPoint.point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
// this.pickPoint.point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
|
|
|
|
this.pickPoint.billboard.image = greenImg
|
|
|
|
|
}
|
|
|
|
|
this.pickPoint = null
|
|
|
|
|
}
|
|
|
|
@ -2684,11 +2745,14 @@ class GroundSvg extends Base {
|
|
|
|
|
}
|
|
|
|
|
for (let i = 0; i < this.controlPoints.length; i++) {
|
|
|
|
|
let color = '#00ff0a'
|
|
|
|
|
let img = greenImg
|
|
|
|
|
if (i === 5) {
|
|
|
|
|
color = '#ffff00'
|
|
|
|
|
img = yellowImg
|
|
|
|
|
}
|
|
|
|
|
if (i === 0) {
|
|
|
|
|
color = '#ff0000'
|
|
|
|
|
img = redImg
|
|
|
|
|
}
|
|
|
|
|
let entity = this.sdk.viewer.entities.getOrCreateEntity('svg-control-points_' + i)
|
|
|
|
|
entity.show = true
|
|
|
|
@ -2696,9 +2760,17 @@ class GroundSvg extends Base {
|
|
|
|
|
entity.position = new Cesium.CallbackProperty(() => {
|
|
|
|
|
return Cesium.Cartesian3.fromDegrees(...this.controlPoints[i])
|
|
|
|
|
})
|
|
|
|
|
entity.point = new Cesium.PointGraphics({
|
|
|
|
|
color: Cesium.Color.fromCssColorString(color), // 点的颜色
|
|
|
|
|
pixelSize: 10, // 点的大小
|
|
|
|
|
// entity.point = new Cesium.PointGraphics({
|
|
|
|
|
// color: Cesium.Color.fromCssColorString(color), // 点的颜色
|
|
|
|
|
// pixelSize: 10, // 点的大小
|
|
|
|
|
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
|
|
// scaleByDistance: new Cesium.NearFarScalar(0.0, 1.0, 1.0e10, 1.0),
|
|
|
|
|
// disableDepthTestDistance: Number.POSITIVE_INFINITY // 不应用深度测试
|
|
|
|
|
// })
|
|
|
|
|
entity.billboard = new Cesium.BillboardGraphics({
|
|
|
|
|
image: img,
|
|
|
|
|
width: 10,
|
|
|
|
|
height: 10,
|
|
|
|
|
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
|
|
scaleByDistance: new Cesium.NearFarScalar(0.0, 1.0, 1.0e10, 1.0),
|
|
|
|
|
disableDepthTestDistance: Number.POSITIVE_INFINITY // 不应用深度测试
|
|
|
|
@ -2922,7 +2994,7 @@ class GroundSvg extends Base {
|
|
|
|
|
})
|
|
|
|
|
this.hierarchys = [...hierarchys]
|
|
|
|
|
|
|
|
|
|
if (!this.entity || !this.entity.values) {
|
|
|
|
|
if (!this.entity || !this.entity.values || this.entity.values.length == 0) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3140,8 +3212,17 @@ class GroundSvg extends Base {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
textPosPick() {
|
|
|
|
|
let Draw = new DrawPoint(this.sdk)
|
|
|
|
|
Draw.start(async (a, position) => {
|
|
|
|
|
if (this.#_textPosPickDrawEvent) {
|
|
|
|
|
this.#_textPosPickDrawEvent.end()
|
|
|
|
|
}
|
|
|
|
|
this.#_textPosPickDrawEvent = new DrawPoint(this.sdk)
|
|
|
|
|
if (!this.entity || !this.entity.values || this.entity.values.length == 0) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.#_textPosPickDrawEvent.start(async (a, position) => {
|
|
|
|
|
if (!position) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let point1 = turf.point([this.position.lng, this.position.lat])
|
|
|
|
|
let point2 = turf.point([position.lng, position.lat])
|
|
|
|
|
let distance = turf.distance(point1, point2, { units: 'kilometers' });
|
|
|
|
@ -3155,7 +3236,9 @@ class GroundSvg extends Base {
|
|
|
|
|
this.text.position = [position.lng, position.lat, position.alt]
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
GroundSvg.createText(this)
|
|
|
|
|
if (this.mode == 0) {
|
|
|
|
|
GroundSvg.createText(this)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -3181,8 +3264,10 @@ class GroundSvg extends Base {
|
|
|
|
|
}
|
|
|
|
|
this.sdk.viewer.entities.remove(this.entity)
|
|
|
|
|
this.text && this.text.remove()
|
|
|
|
|
for (let i = this.entity.values.length; i >= 0; i--) {
|
|
|
|
|
this.sdk.viewer.entities.remove(this.entity.values[i])
|
|
|
|
|
if (this.entity.values) {
|
|
|
|
|
for (let i = this.entity.values.length; i >= 0; i--) {
|
|
|
|
|
this.sdk.viewer.entities.remove(this.entity.values[i])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this._DialogObject && !this._DialogObject.isDestroy) {
|
|
|
|
|
this._DialogObject.close()
|
|
|
|
|