Compare commits
9 Commits
e38dd4d029
...
b7e0249757
Author | SHA1 | Date | |
---|---|---|---|
b7e0249757 | |||
67540c1808 | |||
a888969c5d | |||
6bd3778ad9 | |||
0007343353 | |||
e6da82c76c | |||
d8962ff3cc | |||
7958e40494 | |||
00f1a40e2a |
@ -517,7 +517,7 @@ async function setSplitDirection(v, id, isoff = false, entityId) {
|
||||
thatD.textShow = thatP.textShow
|
||||
}
|
||||
if (thatP.label && thatP.labelShow) {
|
||||
thatP.label.entity.show = true
|
||||
thatP.labelShow = true
|
||||
}
|
||||
if (thatD.label) {
|
||||
thatD.label.options.ground = false
|
||||
|
@ -56,7 +56,7 @@ function html(that) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">固定大小</span>
|
||||
<span class="label" style="flex: 0 0 60px;">固定大小</span>
|
||||
<input class="btn-switch" type="checkbox" @model="scaleByDistance">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { attributeElm, labelStyleElm1, labelStyleElm2 } from '../../Element/elm_html'
|
||||
|
||||
function html(that) {
|
||||
return `
|
||||
return `
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
<div class="row" style="align-items: flex-start;">
|
||||
@ -9,22 +9,15 @@ function html(that) {
|
||||
<span class="label">名称</span>
|
||||
<input class="input" maxlength="40" type="text" @model="name">
|
||||
</div>
|
||||
<div class="col" style="flex: 0 0 54%;">
|
||||
<div class="col" style="flex: 0 0 56%;">
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col input-select-unit-box">
|
||||
<span class="label">原始长度:</span>
|
||||
<div class="input-select-unit"></div>
|
||||
<input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="length">
|
||||
<div class="input-select-unit"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col input-select-fit-unit-box">
|
||||
<span class="label">拟合长度:</span>
|
||||
<input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="fitLength">
|
||||
<div class="input-select-fit-unit"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -58,6 +58,7 @@ class CurvelineObject extends Base {
|
||||
this.options.extend = options.extend || false
|
||||
this.options['length-unit'] = options['length-unit'] || '米'
|
||||
this.options['fit-length-unit'] = options['fit-length-unit'] || '米'
|
||||
this.options['words-name'] = options['words-name'] || '空间长度'
|
||||
this.options['extend-width'] =
|
||||
options['extend-width'] || options['extend-width'] === 0
|
||||
? options['extend-width']
|
||||
@ -116,6 +117,7 @@ class CurvelineObject extends Base {
|
||||
this.options.attributeType = options.attributeType || 'richText'
|
||||
this.operate = {}
|
||||
this.nodePoints = []
|
||||
this.unitNum = 0
|
||||
this.Dialog = _Dialog
|
||||
if (!this.options.positions || this.options.positions.length < 2) {
|
||||
this._error = '线段最少需要两个坐标!'
|
||||
@ -172,6 +174,8 @@ class CurvelineObject extends Base {
|
||||
|
||||
set length(v) {
|
||||
this.options.length = v
|
||||
//判断数值是否大于1000m
|
||||
|
||||
this._elms.length &&
|
||||
this._elms.length.forEach(item => {
|
||||
item.value = v
|
||||
@ -194,25 +198,60 @@ class CurvelineObject extends Base {
|
||||
return this.options['length-unit']
|
||||
}
|
||||
set lengthUnit(v) {
|
||||
this.unitNum++
|
||||
this.options['length-unit'] = v
|
||||
this._elms.lengthUnit &&
|
||||
this._elms.lengthUnit.forEach(item => {
|
||||
item.value = v
|
||||
})
|
||||
if (this.options.lengthByMeter) {
|
||||
switch (v) {
|
||||
case '米':
|
||||
this.length = this.options.lengthByMeter
|
||||
break
|
||||
case '千米':
|
||||
this.length = (this.options.lengthByMeter / 1000).toFixed(5)
|
||||
break
|
||||
default:
|
||||
this.length = this.options.lengthByMeter
|
||||
if (this.unitNum > 2) {
|
||||
switch (v) {
|
||||
case '米':
|
||||
this.length = this.noseToTail ? this.options.fitLengthByMeter : this.options.lengthByMeter
|
||||
|
||||
break
|
||||
case '千米':
|
||||
this.length = this.noseToTail ? (this.options.fitLengthByMeter / 1000).toFixed(5) : (this.options.lengthByMeter / 1000).toFixed(5)
|
||||
|
||||
break
|
||||
default:
|
||||
this.length = this.noseToTail ? this.options.fitLengthByMeter : this.options.lengthByMeter
|
||||
|
||||
break
|
||||
}
|
||||
} else {
|
||||
let length = this.noseToTail ? this.options.fitLengthByMeter : this.options.lengthByMeter
|
||||
this.lengthUnit = length > 1000 || length == 1000 ? '千米' : '米'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get wordsName() {
|
||||
return this.options['words-name']
|
||||
}
|
||||
set wordsName(v) {
|
||||
this.options['words-name'] = v
|
||||
this._elms.wordsName &&
|
||||
this._elms.wordsName.forEach(item => {
|
||||
item.value = v
|
||||
})
|
||||
|
||||
let _this = this
|
||||
if (!this.noseToTail) {
|
||||
this.computeDistance(
|
||||
this.smoothHandle(this.options.positions),
|
||||
2,
|
||||
v
|
||||
).then(res => {
|
||||
_this.options.lengthByMeter = res
|
||||
_this.lengthUnit = this.options['length-unit']
|
||||
})
|
||||
} else {
|
||||
let fromDegreesArray = this.renewPositions(this.options.positions)
|
||||
}
|
||||
}
|
||||
|
||||
get fitLengthUnit() {
|
||||
return this.options['fit-length-unit']
|
||||
}
|
||||
@ -310,8 +349,28 @@ class CurvelineObject extends Base {
|
||||
)
|
||||
this.renewPolygon(fromDegreesArray)
|
||||
}
|
||||
this.lengthUnit = this.options['length-unit']
|
||||
// if (v) {
|
||||
// if (this.options.fitLengthByMeter > 1000 || this.options.fitLengthByMeter == 1000) {
|
||||
// let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
// dom && dom.querySelectorAll('dd')[1] && dom.querySelectorAll('dd')[1].click()
|
||||
// } else {
|
||||
// let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
// dom && dom.querySelectorAll('dd')[0] && dom.querySelectorAll('dd')[0].click()
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// if (this.options.lengthByMeter > 1000 || this.options.lengthByMeter == 1000) {
|
||||
// let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
// dom && dom.querySelectorAll('dd')[1] && dom.querySelectorAll('dd')[1].click()
|
||||
// } else {
|
||||
// let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
// dom && dom.querySelectorAll('dd')[0] && dom.querySelectorAll('dd')[0].click()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
get heightMode() {
|
||||
return this.options.heightMode ? this.options.heightMode : 0
|
||||
}
|
||||
@ -349,11 +408,11 @@ class CurvelineObject extends Base {
|
||||
break
|
||||
}
|
||||
|
||||
this.options.lengthByMeter = this.computeDistance2(
|
||||
this.smoothHandle(this.options.positions),
|
||||
2,
|
||||
ground
|
||||
)
|
||||
// this.options.lengthByMeter = this.computeDistance2(
|
||||
// this.smoothHandle(this.options.positions),
|
||||
// 2,
|
||||
// ground
|
||||
// )
|
||||
this.lengthUnit = this.lengthUnit
|
||||
this._elms.heightMode && (this._elms.heightMode.value = heightModeName)
|
||||
this._elms.heightModeObject && (this._elms.heightModeObject.legp_searchActive(
|
||||
@ -1157,12 +1216,25 @@ class CurvelineObject extends Base {
|
||||
CurvelineObject.createLabel(that)
|
||||
// that.entity.polyline.positionsLngLat = positions
|
||||
that.renewPolygon(fromDegreesArray)
|
||||
that.options.lengthByMeter = that.computeDistance2(that.smoothHandle(positions), 2, ground)
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
// that.options.lengthByMeter = that.computeDistance2(that.smoothHandle(positions), 2, ground)
|
||||
// that.lengthUnit = that.options['length-unit']
|
||||
// syncData(that.sdk, that.options.id)
|
||||
// if (that.options.show) {
|
||||
// setSplitDirection(0, that.options.id)
|
||||
// }
|
||||
|
||||
that.computeDistance(
|
||||
that.smoothHandle(positions),
|
||||
2,
|
||||
that.options['words-name']
|
||||
).then(res => {
|
||||
that.options.lengthByMeter = res
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
})
|
||||
|
||||
// if (this.options['nose-to-tail']) {
|
||||
// let array = []
|
||||
@ -1389,6 +1461,50 @@ class CurvelineObject extends Base {
|
||||
})
|
||||
}
|
||||
|
||||
let nameData = [
|
||||
{
|
||||
name: '空间长度',
|
||||
value: '空间长度'
|
||||
},
|
||||
{
|
||||
name: '投影长度',
|
||||
value: '投影长度'
|
||||
},
|
||||
{
|
||||
name: '地表长度',
|
||||
value: '地表长度'
|
||||
}
|
||||
]
|
||||
|
||||
let nameDataLegpObject = legp(
|
||||
this._DialogObject._element.content.getElementsByClassName(
|
||||
'input-select-unit-box'
|
||||
)[0],
|
||||
'.input-select-unit'
|
||||
)
|
||||
if (nameDataLegpObject) {
|
||||
nameDataLegpObject.legp_search(nameData)
|
||||
let nameDataLegpElm = this._DialogObject._element.content
|
||||
.getElementsByClassName('input-select-unit')[0]
|
||||
.getElementsByTagName('input')[0]
|
||||
this._elms.wordsName = [nameDataLegpElm]
|
||||
nameDataLegpElm.value = this.options['words-name']
|
||||
for (let i = 0; i < nameData.length; i++) {
|
||||
if (nameData[i].value === nameDataLegpElm.value) {
|
||||
nameDataLegpObject.legp_searchActive(nameData[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
nameDataLegpElm.addEventListener('input', () => {
|
||||
for (let i = 0; i < nameData.length; i++) {
|
||||
if (nameData[i].value === nameDataLegpElm.value) {
|
||||
this.wordsName = nameData[i].value
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 原始长度单位
|
||||
let unitData = [
|
||||
{
|
||||
@ -1405,12 +1521,13 @@ class CurvelineObject extends Base {
|
||||
this._DialogObject._element.content.getElementsByClassName(
|
||||
'input-select-unit-box'
|
||||
)[0],
|
||||
'.input-select-unit'
|
||||
'.input-select-unit',
|
||||
1
|
||||
)
|
||||
if (unitDataLegpObject) {
|
||||
unitDataLegpObject.legp_search(unitData)
|
||||
let unitDataLegpElm = this._DialogObject._element.content
|
||||
.getElementsByClassName('input-select-unit')[0]
|
||||
.getElementsByClassName('input-select-unit')[1]
|
||||
.getElementsByTagName('input')[0]
|
||||
this._elms.lengthUnit = [unitDataLegpElm]
|
||||
unitDataLegpElm.value = this.options['length-unit']
|
||||
@ -1431,45 +1548,45 @@ class CurvelineObject extends Base {
|
||||
}
|
||||
|
||||
// 拟合长度单位
|
||||
let fitUnitData = [
|
||||
{
|
||||
name: '米',
|
||||
value: '米'
|
||||
},
|
||||
{
|
||||
name: '千米',
|
||||
value: '千米'
|
||||
}
|
||||
]
|
||||
// let fitUnitData = [
|
||||
// {
|
||||
// name: '米',
|
||||
// value: '米'
|
||||
// },
|
||||
// {
|
||||
// name: '千米',
|
||||
// value: '千米'
|
||||
// }
|
||||
// ]
|
||||
|
||||
let fitUnitDataLegpObject = legp(
|
||||
this._DialogObject._element.content.getElementsByClassName(
|
||||
'input-select-fit-unit-box'
|
||||
)[0],
|
||||
'.input-select-fit-unit'
|
||||
)
|
||||
if (fitUnitDataLegpObject) {
|
||||
fitUnitDataLegpObject.legp_search(fitUnitData)
|
||||
let fitUnitDataLegpElm = this._DialogObject._element.content
|
||||
.getElementsByClassName('input-select-fit-unit')[0]
|
||||
.getElementsByTagName('input')[0]
|
||||
this._elms.fitLengthUnit = [fitUnitDataLegpElm]
|
||||
fitUnitDataLegpElm.value = this.options['fit-length-unit']
|
||||
for (let i = 0; i < fitUnitData.length; i++) {
|
||||
if (fitUnitData[i].value === fitUnitDataLegpElm.value) {
|
||||
fitUnitDataLegpObject.legp_searchActive(fitUnitData[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
fitUnitDataLegpElm.addEventListener('input', () => {
|
||||
for (let i = 0; i < fitUnitData.length; i++) {
|
||||
if (fitUnitData[i].value === fitUnitDataLegpElm.value) {
|
||||
this.fitLengthUnit = fitUnitData[i].value
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// let fitUnitDataLegpObject = legp(
|
||||
// this._DialogObject._element.content.getElementsByClassName(
|
||||
// 'input-select-fit-unit-box'
|
||||
// )[0],
|
||||
// '.input-select-fit-unit'
|
||||
// )
|
||||
// if (fitUnitDataLegpObject) {
|
||||
// fitUnitDataLegpObject.legp_search(fitUnitData)
|
||||
// let fitUnitDataLegpElm = this._DialogObject._element.content
|
||||
// .getElementsByClassName('input-select-fit-unit')[0]
|
||||
// .getElementsByTagName('input')[0]
|
||||
// this._elms.fitLengthUnit = [fitUnitDataLegpElm]
|
||||
// fitUnitDataLegpElm.value = this.options['fit-length-unit']
|
||||
// for (let i = 0; i < fitUnitData.length; i++) {
|
||||
// if (fitUnitData[i].value === fitUnitDataLegpElm.value) {
|
||||
// fitUnitDataLegpObject.legp_searchActive(fitUnitData[i].value)
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// fitUnitDataLegpElm.addEventListener('input', () => {
|
||||
// for (let i = 0; i < fitUnitData.length; i++) {
|
||||
// if (fitUnitData[i].value === fitUnitDataLegpElm.value) {
|
||||
// this.fitLengthUnit = fitUnitData[i].value
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
let lineTypeData = [
|
||||
{
|
||||
@ -1848,22 +1965,74 @@ class CurvelineObject extends Base {
|
||||
|
||||
|
||||
// 计算长度
|
||||
let array = []
|
||||
for (let i = 0; i < fromDegreesArray.length; i += 3) {
|
||||
array.push({
|
||||
lng: fromDegreesArray[i],
|
||||
lat: fromDegreesArray[i + 1],
|
||||
alt: fromDegreesArray[i + 2]
|
||||
// let array = []
|
||||
// for (let i = 0; i < fromDegreesArray.length; i += 3) {
|
||||
// array.push({
|
||||
// lng: fromDegreesArray[i],
|
||||
// lat: fromDegreesArray[i + 1],
|
||||
// alt: fromDegreesArray[i + 2]
|
||||
// })
|
||||
// }
|
||||
// this.options.fitLengthByMeter = this.computeDistance2(
|
||||
// array,
|
||||
// 2,
|
||||
// ground
|
||||
// )
|
||||
// this.fitLengthUnit = this.options['fit-length-unit']
|
||||
// this.options.lengthByMeter = this.computeDistance2(this.smoothHandle(positions), 2, ground)
|
||||
// this.lengthUnit = this.options['length-unit']
|
||||
|
||||
|
||||
if (
|
||||
(this.options['nose-to-tail'] &&
|
||||
this.options['nose-to-tail'] !== 'false') ||
|
||||
(this.options.smooth && this.options.smooth !== 'false')
|
||||
) {
|
||||
let array = []
|
||||
for (let i = 0; i < fromDegreesArray.length; i += 3) {
|
||||
array.push({
|
||||
lng: fromDegreesArray[i],
|
||||
lat: fromDegreesArray[i + 1],
|
||||
alt: fromDegreesArray[i + 2]
|
||||
})
|
||||
}
|
||||
// this.options.fitLengthByMeter = this.computeDistance(
|
||||
// array,
|
||||
// 2,
|
||||
// ground
|
||||
// )
|
||||
let _this = this
|
||||
this.computeDistance(
|
||||
array,
|
||||
2,
|
||||
this.options['words-name']
|
||||
).then(res => {
|
||||
_this.options.fitLengthByMeter = res
|
||||
_this.lengthUnit = _this.options['length-unit']
|
||||
})
|
||||
} else {
|
||||
let _this = this
|
||||
this.computeDistance(
|
||||
_this.smoothHandle(positions),
|
||||
2,
|
||||
this.options['words-name']
|
||||
).then(res => {
|
||||
_this.options.fitLengthByMeter = res
|
||||
_this.lengthUnit = _this.options['length-unit']
|
||||
|
||||
})
|
||||
}
|
||||
this.options.fitLengthByMeter = this.computeDistance2(
|
||||
array,
|
||||
|
||||
let _this = this
|
||||
this.computeDistance(
|
||||
this.smoothHandle(positions),
|
||||
2,
|
||||
ground
|
||||
)
|
||||
this.fitLengthUnit = this.options['fit-length-unit']
|
||||
this.options.lengthByMeter = this.computeDistance2(this.smoothHandle(positions), 2, ground)
|
||||
this.lengthUnit = this.options['length-unit']
|
||||
this.options['words-name']
|
||||
).then(res => {
|
||||
_this.options.lengthByMeter = res
|
||||
_this.lengthUnit = this.options['length-unit']
|
||||
})
|
||||
|
||||
return fromDegreesArray
|
||||
}
|
||||
|
||||
@ -2035,7 +2204,7 @@ class CurvelineObject extends Base {
|
||||
)[0].value
|
||||
) {
|
||||
this.options.attribute.vr.content.push({
|
||||
name: '全景图' ,
|
||||
name: '全景图',
|
||||
url: this._DialogObject._element.content.getElementsByClassName(
|
||||
'vr_add'
|
||||
)[0].value
|
||||
@ -2051,7 +2220,7 @@ class CurvelineObject extends Base {
|
||||
|
||||
addAttributeRr(vr) {
|
||||
this.options.attribute.vr.content.push({
|
||||
name: '全景图' ,
|
||||
name: '全景图',
|
||||
url: vr
|
||||
})
|
||||
this.attributeVr = this.options.attribute.vr.content
|
||||
|
@ -8,7 +8,7 @@ function html() {
|
||||
<input class="input" maxlength="40" type="text" @model="name">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="anchor btn" @click="setAnchorPoint">调整锚点</button>
|
||||
<button class="anchor btn">调整锚点</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -24,7 +24,7 @@ class GroundImage extends Base {
|
||||
* @param options.flipe.x=false {boolean} 绕X轴翻转
|
||||
* @param options.flipe.y=false {boolean} 绕Y轴翻转
|
||||
* @param options.url {string} 图片地址
|
||||
* @param {Array.<object>} options.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param {Array.<object>} options.position 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
@ -35,8 +35,8 @@ class GroundImage extends Base {
|
||||
this.options.url = options.url
|
||||
this.options.angle = options.angle || 0
|
||||
this.options.scale = (options.scale || options.scale === 0) ? options.scale : 1
|
||||
this.options.positions = options.positions
|
||||
this.options.offset = { x: 0.5, y: 0.5 }
|
||||
this.options.position = options.position
|
||||
this.options.offset = options.offset || { x: 0.5, y: 0.5 }
|
||||
|
||||
this.options.flipe = options.flipe || {}
|
||||
this.options.flipe.x = this.options.flipe.x || false
|
||||
@ -49,7 +49,7 @@ class GroundImage extends Base {
|
||||
this.Dialog = _Dialog
|
||||
this._elms = {};
|
||||
this.previous = {
|
||||
positions: { ...this.options.positions }
|
||||
position: { ...this.options.position }
|
||||
}
|
||||
this._EventBinding = new EventBinding()
|
||||
this.event = new MouseEvent(this.sdk)
|
||||
@ -62,6 +62,32 @@ class GroundImage extends Base {
|
||||
}
|
||||
set offset(v) {
|
||||
this.options.offset = v
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.src = this.replaceHost(this.options.url, this.options.host);
|
||||
img.onload = () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// 设置画布大小
|
||||
canvas.width = img.width * 2;
|
||||
canvas.height = img.height * 2;
|
||||
|
||||
// 绘制图像
|
||||
if (this.flipeX) {
|
||||
ctx.scale(1, -1);
|
||||
ctx.translate(0, -canvas.height)
|
||||
}
|
||||
if (this.flipeY) {
|
||||
ctx.scale(-1, 1);
|
||||
ctx.translate(-canvas.width, 0);
|
||||
}
|
||||
ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y));
|
||||
this.entity.rectangle.material = new Cesium.ImageMaterialProperty({
|
||||
image: canvas,
|
||||
transparent: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
get angle() {
|
||||
@ -97,14 +123,15 @@ class GroundImage extends Base {
|
||||
}
|
||||
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.src = this.replaceHost(this.options.url, this.options.host);
|
||||
img.onload = () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// 设置画布大小
|
||||
canvas.width = img.width;
|
||||
canvas.height = img.height;
|
||||
canvas.width = img.width * 2;
|
||||
canvas.height = img.height * 2;
|
||||
|
||||
// 绘制图像
|
||||
if (this.flipeX) {
|
||||
@ -115,7 +142,7 @@ class GroundImage extends Base {
|
||||
ctx.scale(-1, 1);
|
||||
ctx.translate(-canvas.width, 0);
|
||||
}
|
||||
ctx.drawImage(img, 0, 0);
|
||||
ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y));
|
||||
this.entity && (this.entity.rectangle.material = new Cesium.ImageMaterialProperty({
|
||||
image: canvas,
|
||||
transparent: true
|
||||
@ -140,14 +167,15 @@ class GroundImage extends Base {
|
||||
}
|
||||
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.src = this.replaceHost(this.options.url, this.options.host);
|
||||
img.onload = () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// 设置画布大小
|
||||
canvas.width = img.width;
|
||||
canvas.height = img.height;
|
||||
canvas.width = img.width * 2;
|
||||
canvas.height = img.height * 2;
|
||||
|
||||
// 绘制图像
|
||||
if (this.flipeX) {
|
||||
@ -158,7 +186,7 @@ class GroundImage extends Base {
|
||||
ctx.scale(-1, 1);
|
||||
ctx.translate(-canvas.width, 0);
|
||||
}
|
||||
ctx.drawImage(img, 0, 0);
|
||||
ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y));
|
||||
this.entity.rectangle.material = new Cesium.ImageMaterialProperty({
|
||||
image: canvas,
|
||||
transparent: true
|
||||
@ -174,12 +202,12 @@ class GroundImage extends Base {
|
||||
}
|
||||
|
||||
async create() {
|
||||
// let gap = Math.abs(Math.cos(Math.PI/180 * this.options.positions.lat)) * (0.0001*this.options.scale)
|
||||
// let gap = Math.abs(Math.cos(Math.PI/180 * this.options.position.lat)) * (0.0001*this.options.scale)
|
||||
// let fromDegreesArray = [
|
||||
// this.options.positions.lng - 0.05, this.options.positions.lat - 0.05,
|
||||
// this.options.positions.lng + 0.05, this.options.positions.lat - 0.05,
|
||||
// this.options.positions.lng + 0.05, this.options.positions.lat + 0.05,
|
||||
// this.options.positions.lng - 0.05, this.options.positions.lat + 0.05,
|
||||
// this.options.position.lng - 0.05, this.options.position.lat - 0.05,
|
||||
// this.options.position.lng + 0.05, this.options.position.lat - 0.05,
|
||||
// this.options.position.lng + 0.05, this.options.position.lat + 0.05,
|
||||
// this.options.position.lng - 0.05, this.options.position.lat + 0.05,
|
||||
// ]
|
||||
let response = await fetch(this.replaceHost(this.options.url, this.options.host), {
|
||||
method: 'get',
|
||||
@ -192,14 +220,15 @@ class GroundImage extends Base {
|
||||
// let arrayBuffer = await data.arrayBuffer()
|
||||
// const str = String.fromCharCode(...new Uint8Array(arrayBuffer));
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.src = this.replaceHost(this.options.url, this.options.host);
|
||||
img.onload = () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// 设置画布大小
|
||||
canvas.width = img.width;
|
||||
canvas.height = img.height;
|
||||
canvas.width = img.width * 2;
|
||||
canvas.height = img.height * 2;
|
||||
// 绘制图像
|
||||
if (this.flipeX) {
|
||||
ctx.scale(1, -1);
|
||||
@ -209,35 +238,45 @@ class GroundImage extends Base {
|
||||
ctx.scale(-1, 1);
|
||||
ctx.translate(-canvas.width, 0);
|
||||
}
|
||||
ctx.drawImage(img, 0, 0);
|
||||
ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y));
|
||||
|
||||
this.entity = this.sdk.viewer.entities.add({
|
||||
id: this.options.id,
|
||||
show: this.options.show,
|
||||
rectangle: {
|
||||
coordinates: new Cesium.CallbackProperty(() => {
|
||||
let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.positions.lat)) * (0.0001 * this.options.scale)
|
||||
let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.position.lat)) * (0.0001 * this.options.scale)
|
||||
let offset = {
|
||||
x: this.flipeY ? Math.abs(this.options.offset.x - 1) : this.options.offset.x,
|
||||
y: this.flipeX ? Math.abs(this.options.offset.y - 1) : this.options.offset.y,
|
||||
}
|
||||
offset = {
|
||||
lng: offset.x * ((0.0001 * this.options.scale) * 2),
|
||||
lat: Math.abs(offset.y-1) * (gap * 2)
|
||||
lat: Math.abs(offset.y - 1) * (gap * 2)
|
||||
}
|
||||
// let point1 = [this.options.position.lng - offset.lng + 360, this.options.position.lat - offset.lat];
|
||||
// let point2 = [(this.options.position.lng - offset.lng) + ((0.0001 * this.options.scale) * 2) + 360, (this.options.position.lat - offset.lat) + (gap * 2)];
|
||||
// let midpoint = turf.point([point1[0]+point2[0]/2, point1[1]+point2[1]/2]);
|
||||
// let rotatedPot = turf.transformRotate(midpoint, -Number(this.options.angle), {pivot: [this.options.position.lng, this.options.position.lat]});
|
||||
// console.log(midpoint.geometry.coordinates, rotatedPot.geometry.coordinates, this.options.position)
|
||||
// let fromDegreesArray = [
|
||||
// rotatedPot.geometry.coordinates[0]-(0.0001 * this.options.scale), rotatedPot.geometry.coordinates[1]-(0.0001 * this.options.scale),
|
||||
// rotatedPot.geometry.coordinates[0]+(0.0001 * this.options.scale), rotatedPot.geometry.coordinates[1]+(0.0001 * this.options.scale),
|
||||
|
||||
// ]
|
||||
let fromDegreesArray = [
|
||||
this.options.positions.lng - offset.lng, this.options.positions.lat - offset.lat,
|
||||
(this.options.positions.lng - offset.lng) + ((0.0001 * this.options.scale) * 2), (this.options.positions.lat - offset.lat) + (gap * 2),
|
||||
// this.options.position.lng - offset.lng, this.options.position.lat - offset.lat,
|
||||
// (this.options.position.lng - offset.lng) + ((0.0001 * this.options.scale) * 2), (this.options.position.lat - offset.lat) + (gap * 2),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// this.options.positions.lng - (0.0001 * this.options.scale), this.options.positions.lat - gap,
|
||||
// // this.options.positions.lng + 0.05, this.options.positions.lat - 0.05,
|
||||
// this.options.positions.lng + (0.0001 * this.options.scale), this.options.positions.lat + gap,
|
||||
// // this.options.positions.lng - 0.05, this.options.positions.lat + 0.05,
|
||||
this.options.position.lng - (0.0001 * this.options.scale), this.options.position.lat - gap,
|
||||
// this.options.position.lng + 0.05, this.options.position.lat - 0.05,
|
||||
this.options.position.lng + (0.0001 * this.options.scale), this.options.position.lat + gap,
|
||||
// this.options.position.lng - 0.05, this.options.position.lat + 0.05,
|
||||
]
|
||||
|
||||
return Cesium.Rectangle.fromDegrees(...fromDegreesArray)
|
||||
@ -281,7 +320,7 @@ class GroundImage extends Base {
|
||||
// 编辑框
|
||||
async edit(state) {
|
||||
let _this = this
|
||||
this.originalOptions = { ...this.options }
|
||||
this.originalOptions = this.deepCopyObj(this.options)
|
||||
if (this._DialogObject && this._DialogObject.close) {
|
||||
this._DialogObject.close()
|
||||
this._DialogObject = null
|
||||
@ -312,16 +351,19 @@ class GroundImage extends Base {
|
||||
this.Dialog.removeCallBack && this.Dialog.removeCallBack()
|
||||
},
|
||||
closeCallBack: () => {
|
||||
this.previous = null
|
||||
this.reset()
|
||||
// this.entity.style = new Cesium.Cesium3DTileStyle({
|
||||
// color: "color('rgba(255,255,255," + this.newData.transparency + ")')",
|
||||
// show: true,
|
||||
// });
|
||||
this.positionEditing = false
|
||||
|
||||
if (anchorSetDialogObject && anchorSetDialogObject.close) {
|
||||
anchorSetDialogObject.close()
|
||||
}
|
||||
this.Dialog.closeCallBack && this.Dialog.closeCallBack()
|
||||
YJ.Measure.SetMeasureStatus(false)
|
||||
this.positionEditing = false
|
||||
},
|
||||
showCallBack: (show) => {
|
||||
this.show = show
|
||||
@ -491,17 +533,17 @@ class GroundImage extends Base {
|
||||
return
|
||||
}
|
||||
this._positionEditing = status
|
||||
this.previous = {
|
||||
positions: { ...this.options.positions }
|
||||
}
|
||||
if (status === true) {
|
||||
this.previous = {
|
||||
position: { ...this.options.position }
|
||||
}
|
||||
this.tip && this.tip.destroy()
|
||||
this.tip = new MouseTip('点击鼠标左键确认,右键取消', this.sdk)
|
||||
this.event.mouse_move((movement, cartesian) => {
|
||||
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||
this.options.positions.lng = positions.lng
|
||||
this.options.positions.lat = positions.lat
|
||||
this.options.positions.alt = positions.alt
|
||||
let position = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||
this.options.position.lng = position.lng
|
||||
this.options.position.lat = position.lat
|
||||
this.options.position.alt = position.alt
|
||||
this.tip.setPosition(
|
||||
cartesian,
|
||||
movement.endPosition.x,
|
||||
@ -509,21 +551,22 @@ class GroundImage extends Base {
|
||||
)
|
||||
})
|
||||
this.event.mouse_left((movement, cartesian) => {
|
||||
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||
this.options.positions.lng = positions.lng
|
||||
this.options.positions.lat = positions.lat
|
||||
this.options.positions.alt = positions.alt
|
||||
let position = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||
this.options.position.lng = position.lng
|
||||
this.options.position.lat = position.lat
|
||||
this.options.position.alt = position.alt
|
||||
this.event.mouse_move(() => { })
|
||||
this.event.mouse_left(() => { })
|
||||
this.event.mouse_right(() => { })
|
||||
this.event.gesture_pinck_start(() => { })
|
||||
this.event.gesture_pinck_end(() => { })
|
||||
this.previous = null
|
||||
this.positionEditing = false
|
||||
})
|
||||
this.event.mouse_right((movement, cartesian) => {
|
||||
this.options.positions.lng = this.previous.positions.lng
|
||||
this.options.positions.lat = this.previous.positions.lat
|
||||
this.options.positions.alt = this.previous.positions.alt
|
||||
this.options.position.lng = this.previous.position.lng
|
||||
this.options.position.lat = this.previous.position.lat
|
||||
this.options.position.alt = this.previous.position.alt
|
||||
this.positionEditing = false
|
||||
})
|
||||
|
||||
@ -533,16 +576,16 @@ class GroundImage extends Base {
|
||||
let endTime = new Date()
|
||||
if (endTime - startTime >= 500) {
|
||||
// 长按取消
|
||||
this.options.positions.lng = this.previous.positions.lng
|
||||
this.options.positions.lat = this.previous.positions.lat
|
||||
this.options.positions.alt = this.previous.positions.alt
|
||||
this.options.position.lng = this.previous.position.lng
|
||||
this.options.position.lat = this.previous.position.lat
|
||||
this.options.position.alt = this.previous.position.alt
|
||||
this.positionEditing = false
|
||||
}
|
||||
else {
|
||||
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||
this.options.positions.lng = positions.lng
|
||||
this.options.positions.lat = positions.lat
|
||||
this.options.positions.alt = positions.alt
|
||||
let position = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||
this.options.position.lng = position.lng
|
||||
this.options.position.lat = position.lat
|
||||
this.options.position.alt = position.alt
|
||||
this.event.mouse_move(() => { })
|
||||
this.event.mouse_left(() => { })
|
||||
this.event.mouse_right(() => { })
|
||||
@ -562,9 +605,17 @@ class GroundImage extends Base {
|
||||
this.event.gesture_pinck_end(() => { })
|
||||
}
|
||||
this.tip && this.tip.destroy()
|
||||
this.options.positions.lng = this.previous.positions.lng
|
||||
this.options.positions.lat = this.previous.positions.lat
|
||||
this.options.positions.alt = this.previous.positions.alt
|
||||
if (!this.previous) {
|
||||
this.previous = {
|
||||
position: { ...this.options.position }
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.options.position.lng = this.previous.position.lng
|
||||
this.options.position.lat = this.previous.position.lat
|
||||
this.options.position.alt = this.previous.position.alt
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -596,8 +647,8 @@ class GroundImage extends Base {
|
||||
if (this.options.position) {
|
||||
position = { ...this.options.position }
|
||||
}
|
||||
else if (this.options.positions) {
|
||||
position = { ...this.options.positions[0] }
|
||||
else if (this.options.position) {
|
||||
position = { ...this.options.position[0] }
|
||||
}
|
||||
else if (this.options.center) {
|
||||
position = { ...this.options.center }
|
||||
@ -630,14 +681,14 @@ class GroundImage extends Base {
|
||||
})
|
||||
}
|
||||
else {
|
||||
let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.positions.lat)) * (0.0001 * this.options.scale)
|
||||
let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.position.lat)) * (0.0001 * this.options.scale)
|
||||
let fromDegreesArray = [
|
||||
[this.options.positions.lng - (0.0001 * this.options.scale), this.options.positions.lat - gap],
|
||||
[this.options.positions.lng + (0.0001 * this.options.scale), this.options.positions.lat + gap],
|
||||
[this.options.position.lng - (0.0001 * this.options.scale), this.options.position.lat - gap],
|
||||
[this.options.position.lng + (0.0001 * this.options.scale), this.options.position.lat + gap],
|
||||
]
|
||||
let positionArray = []
|
||||
let height = 0
|
||||
let position = this.options.positions
|
||||
let position = this.options.position
|
||||
let point1 = Cesium.Cartesian3.fromDegrees(position.lng, position.lat, 0);
|
||||
let point2 = Cesium.Cartesian3.fromDegrees(position.lng, position.lat, 10000000);
|
||||
let direction = Cesium.Cartesian3.subtract(point2, point1, new Cesium.Cartesian3());
|
||||
@ -680,9 +731,14 @@ class GroundImage extends Base {
|
||||
if (!this.entity) {
|
||||
return
|
||||
}
|
||||
this.name = this.originalOptions.name
|
||||
this.angle = this.originalOptions.angle
|
||||
this.scale = this.originalOptions.scale
|
||||
this.options = this.deepCopyObj(this.originalOptions)
|
||||
this.name = this.options.name
|
||||
this.angle = this.options.angle
|
||||
this.scale = this.options.scale
|
||||
this.offset = this.options.offset
|
||||
this.flipeX = this.options.flipe.x
|
||||
this.flipeY = this.options.flipe.y
|
||||
this.show = this.options.show
|
||||
}
|
||||
|
||||
async remove() {
|
||||
@ -699,9 +755,9 @@ class GroundImage extends Base {
|
||||
}
|
||||
|
||||
setPosition(v) {
|
||||
this.options.positions.lng = v.position.lng
|
||||
this.options.positions.lat = v.position.lat
|
||||
this.options.positions.alt = v.position.alt
|
||||
this.options.position.lng = v.position.lng
|
||||
this.options.position.lat = v.position.lat
|
||||
this.options.position.alt = v.position.alt
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ class eventBinding {
|
||||
let Event = []
|
||||
let isEvent = false
|
||||
let removeName = []
|
||||
let blurEvent = () => { }
|
||||
if (!elements[i] || !elements[i].attributes) {
|
||||
continue
|
||||
}
|
||||
@ -36,7 +37,8 @@ class eventBinding {
|
||||
Event.push((e) => {
|
||||
let value = e.target.value
|
||||
if (e.target.type == 'number') {
|
||||
if (e.data != '.' && (e.data != '-' || e.target.value)) {
|
||||
let str = e.target.value + ''
|
||||
if (e.data != '.' && (e.data != '-' || e.target.value) && !(str.charAt(str.length - 1) == '0' && e.target.value.toString().includes('.')) && e.target.value != '0') {
|
||||
value = Number(value)
|
||||
if((e.target.max) && value>Number(e.target.max)) {
|
||||
value = Number(e.target.max)
|
||||
@ -57,6 +59,22 @@ class eventBinding {
|
||||
that[m.value] = value
|
||||
}
|
||||
})
|
||||
blurEvent = (e) => {
|
||||
let value = e.target.value
|
||||
if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) {
|
||||
value = Number(value)
|
||||
if ((e.target.max) && value > Number(e.target.max)) {
|
||||
value = Number(e.target.max)
|
||||
}
|
||||
if ((e.target.min) && value < Number(e.target.min)) {
|
||||
value = Number(e.target.min)
|
||||
}
|
||||
if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) {
|
||||
value = Number(e.target.dataset.min)
|
||||
}
|
||||
}
|
||||
that[m.value] = value
|
||||
}
|
||||
if(elements[i].nodeName=='IMG') {
|
||||
elements[i].src = that[m.value]
|
||||
}
|
||||
@ -114,6 +132,7 @@ class eventBinding {
|
||||
Event[t](e)
|
||||
}
|
||||
});
|
||||
elements[i].addEventListener('blur', blurEvent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import LabelObject from '../LabelObject'
|
||||
import MouseEvent from '../../../Event/index'
|
||||
import MouseTip from '../../../MouseTip'
|
||||
import Controller from '../../../Controller/index'
|
||||
import { syncData } from '../../../Global/MultiViewportMode'
|
||||
import { syncData, get3DView } from '../../../Global/MultiViewportMode'
|
||||
import { legp } from '../../Element/datalist'
|
||||
import { getFontList, getFontFamilyName } from '../../Element/fontSelect'
|
||||
import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen'
|
||||
@ -291,14 +291,16 @@ class PolylineObject extends Base {
|
||||
2,
|
||||
v
|
||||
).then(res => {
|
||||
// _this.options.lengthByMeter = res
|
||||
// if (res > 1000 || res == 1000) {
|
||||
// _this.length = (res / 1000).toFixed(5)
|
||||
// _this.lengthUnit = '千米'
|
||||
// } else {
|
||||
// _this.length = res
|
||||
// _this.lengthUnit = '米'
|
||||
// }
|
||||
_this.options.lengthByMeter = res
|
||||
if (res > 1000 || res == 1000) {
|
||||
_this.length = (res / 1000).toFixed(5)
|
||||
_this.lengthUnit = '千米'
|
||||
} else {
|
||||
_this.length = res
|
||||
_this.lengthUnit = '米'
|
||||
}
|
||||
_this.lengthUnit = _this.options['length-unit']
|
||||
})
|
||||
} else {
|
||||
let fromDegreesArray = this.renewPositions(this.options.positions)
|
||||
@ -483,24 +485,25 @@ class PolylineObject extends Base {
|
||||
)
|
||||
this.renewPolygon(fromDegreesArray)
|
||||
}
|
||||
if (v) {
|
||||
if (this.options.fitLengthByMeter > 1000 || this.options.fitLengthByMeter == 1000) {
|
||||
let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
dom && dom.querySelectorAll('dd')[1] && dom.querySelectorAll('dd')[1].click()
|
||||
} else {
|
||||
let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
dom && dom.querySelectorAll('dd')[0] && dom.querySelectorAll('dd')[0].click()
|
||||
}
|
||||
this.lengthUnit = this.options['length-unit']
|
||||
// if (v) {
|
||||
// if (this.options.fitLengthByMeter > 1000 || this.options.fitLengthByMeter == 1000) {
|
||||
// let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
// dom && dom.querySelectorAll('dd')[1] && dom.querySelectorAll('dd')[1].click()
|
||||
// } else {
|
||||
// let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
// dom && dom.querySelectorAll('dd')[0] && dom.querySelectorAll('dd')[0].click()
|
||||
// }
|
||||
|
||||
} else {
|
||||
if (this.options.lengthByMeter > 1000 || this.options.lengthByMeter == 1000) {
|
||||
let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
dom && dom.querySelectorAll('dd')[1] && dom.querySelectorAll('dd')[1].click()
|
||||
} else {
|
||||
let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
dom && dom.querySelectorAll('dd')[0] && dom.querySelectorAll('dd')[0].click()
|
||||
}
|
||||
}
|
||||
// } else {
|
||||
// if (this.options.lengthByMeter > 1000 || this.options.lengthByMeter == 1000) {
|
||||
// let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
// dom && dom.querySelectorAll('dd')[1] && dom.querySelectorAll('dd')[1].click()
|
||||
// } else {
|
||||
// let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||
// dom && dom.querySelectorAll('dd')[0] && dom.querySelectorAll('dd')[0].click()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
get smooth() {
|
||||
@ -1323,6 +1326,7 @@ class PolylineObject extends Base {
|
||||
}
|
||||
|
||||
static create(that) {
|
||||
|
||||
let ground
|
||||
if (that.heightMode == 2) {
|
||||
ground = true
|
||||
@ -1439,9 +1443,17 @@ class PolylineObject extends Base {
|
||||
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||
repeatX *= groundResolution / cameraHeight / (param.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||
// if (entity.polyline.material.oriRepeat) {
|
||||
let speed = repeatX / entity.polyline.oriRepeat
|
||||
entity.polyline.oriSpeed = speed
|
||||
entity.polyline.oriRepeatX = repeatX
|
||||
|
||||
if (that.sdk.viewer.scene.mode === Cesium.SceneMode.SCENE3D) {
|
||||
let speed = repeatX / entity.polyline.oriRepeat
|
||||
entity.polyline.oriSpeed = speed
|
||||
entity.polyline.oriRepeatX = repeatX
|
||||
} else {
|
||||
let sdk3d = get3DView()
|
||||
let sdk3dEntity = sdk3d.viewer.entities.getById(that.options.id)
|
||||
entity.polyline.oriSpeed = sdk3dEntity.polyline.oriSpeed
|
||||
entity.polyline.oriRepeatX = sdk3dEntity.polyline.oriRepeatX
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1453,8 +1465,21 @@ class PolylineObject extends Base {
|
||||
getSceenLine(entity, options, canvasEle) {
|
||||
let point1 = new Cesium.Cartesian2(0, this.sdk.viewer.canvas.clientHeight)
|
||||
let point2 = new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth / 2, this.sdk.viewer.canvas.clientHeight)
|
||||
var cartesian1 = this.sdk.viewer.scene.pickPosition(point1)
|
||||
var cartesian2 = this.sdk.viewer.scene.pickPosition(point2)
|
||||
// var cartesian1 = this.sdk.viewer.scene.pickPosition(point1)
|
||||
// var cartesian2 = this.sdk.viewer.scene.pickPosition(point2)
|
||||
|
||||
let ray = this.sdk.viewer.camera.getPickRay(point1);
|
||||
let cartesian1 = this.sdk.viewer.scene.globe.pick(ray, this.sdk.viewer.scene);
|
||||
|
||||
let ray2 = this.sdk.viewer.camera.getPickRay(point2);
|
||||
let cartesian2 = this.sdk.viewer.scene.globe.pick(ray2, this.sdk.viewer.scene);
|
||||
// if (!cartesian1 || !cartesian2) {
|
||||
// let ray = this.sdk.viewer.camera.getPickRay(point1);
|
||||
// cartesian1 = this.sdk.viewer.scene.globe.pick(ray, this.sdk.viewer.scene);
|
||||
|
||||
// let ray2 = this.sdk.viewer.camera.getPickRay(point2);
|
||||
// cartesian2 = this.sdk.viewer.scene.globe.pick(ray2, this.sdk.viewer.scene);
|
||||
// }
|
||||
|
||||
var distance = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||
|
||||
@ -1466,6 +1491,7 @@ class PolylineObject extends Base {
|
||||
500000 // 半径(距离)
|
||||
);
|
||||
|
||||
|
||||
// 获取绘图缓冲区的宽度和高度(通常是屏幕的分辨率)
|
||||
var drawingBufferWidth = this.sdk.viewer.canvas.clientWidth;
|
||||
var drawingBufferHeight = this.sdk.viewer.canvas.clientHeight;
|
||||
@ -1479,7 +1505,14 @@ class PolylineObject extends Base {
|
||||
repeatX = undefined;
|
||||
}
|
||||
|
||||
return repeatX
|
||||
if (this.sdk.viewer.scene.mode === Cesium.SceneMode.SCENE3D) {
|
||||
return repeatX
|
||||
} else {
|
||||
let sdk3d = get3DView()
|
||||
let sdk3dEntity = sdk3d.viewer.entities.getById(this.options.id)
|
||||
return sdk3dEntity.polyline.oriRepeatX
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 编辑框
|
||||
@ -1529,6 +1562,9 @@ class PolylineObject extends Base {
|
||||
}
|
||||
this.nodePoints = []
|
||||
this.positionEditing = false
|
||||
YJ.Measure.SetMeasureStatus(false)
|
||||
this.event && this.event.destroy()
|
||||
this.tip && this.tip.destroy()
|
||||
},
|
||||
showCallBack: show => {
|
||||
this.options.show = show
|
||||
|
@ -21,6 +21,7 @@ class eventBinding {
|
||||
let Event = []
|
||||
let isEvent = false
|
||||
let removeName = []
|
||||
let blurEvent = ()=>{}
|
||||
if (!elements[i] ||!elements[i].attributes) {
|
||||
continue;
|
||||
}
|
||||
@ -37,14 +38,14 @@ class eventBinding {
|
||||
let value = e.target.value
|
||||
if (e.target.type == 'number') {
|
||||
if (e.data != '.' && (e.data != '-' || e.target.value)) {
|
||||
value = Number(value)
|
||||
if((e.target.max) && value>Number(e.target.max)) {
|
||||
let v = Number(value)
|
||||
if((e.target.max) && v>Number(e.target.max)) {
|
||||
value = Number(e.target.max)
|
||||
}
|
||||
if((e.target.min) && value<Number(e.target.min)) {
|
||||
if((e.target.min) && v<Number(e.target.min)) {
|
||||
value = Number(e.target.min)
|
||||
}
|
||||
if((e.target.dataset.min) && value<Number(e.target.dataset.min)) {
|
||||
if((e.target.dataset.min) && v<Number(e.target.dataset.min)) {
|
||||
value = Number(e.target.dataset.min)
|
||||
}
|
||||
that[m.value] = value
|
||||
@ -54,6 +55,22 @@ class eventBinding {
|
||||
that[m.value] = value
|
||||
}
|
||||
})
|
||||
blurEvent = (e) => {
|
||||
let value = e.target.value
|
||||
if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) {
|
||||
value = Number(value)
|
||||
if ((e.target.max) && value > Number(e.target.max)) {
|
||||
value = Number(e.target.max)
|
||||
}
|
||||
if ((e.target.min) && value < Number(e.target.min)) {
|
||||
value = Number(e.target.min)
|
||||
}
|
||||
if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) {
|
||||
value = Number(e.target.dataset.min)
|
||||
}
|
||||
}
|
||||
that[m.value] = value
|
||||
}
|
||||
if(elements[i].nodeName=='IMG') {
|
||||
elements[i].src = that[m.value]
|
||||
}
|
||||
@ -111,6 +128,9 @@ class eventBinding {
|
||||
Event[t](e)
|
||||
}
|
||||
});
|
||||
elements[i].addEventListener('blur', (e) => {
|
||||
blurEvent(e)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,9 @@ class eventBinding {
|
||||
let Event = []
|
||||
let isEvent = false
|
||||
let removeName = []
|
||||
if (!elements[i] ||!elements[i].attributes) {
|
||||
continue;
|
||||
let blurEvent = () => { }
|
||||
if (!elements[i] || !elements[i].attributes) {
|
||||
continue;
|
||||
}
|
||||
for (let m of elements[i].attributes) {
|
||||
switch (m.name) {
|
||||
@ -37,11 +38,11 @@ class eventBinding {
|
||||
let value = e.target.value
|
||||
if (e.target.type == 'number') {
|
||||
if (e.data != '.' && (e.data != '-' || e.target.value)) {
|
||||
value = Number(value)
|
||||
if((e.target.max) && value>Number(e.target.max)) {
|
||||
let v = Number(value)
|
||||
if ((e.target.max) && v > Number(e.target.max)) {
|
||||
value = Number(e.target.max)
|
||||
}
|
||||
if((e.target.min) && value<Number(e.target.min)) {
|
||||
if ((e.target.min) && v < Number(e.target.min)) {
|
||||
value = Number(e.target.min)
|
||||
}
|
||||
that[m.value] = value
|
||||
@ -51,14 +52,32 @@ class eventBinding {
|
||||
that[m.value] = value
|
||||
}
|
||||
})
|
||||
if(elements[i].nodeName=='IMG') {
|
||||
blurEvent = (e) => {
|
||||
let value = e.target.value
|
||||
if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) {
|
||||
value = Number(value)
|
||||
if ((e.target.max) && value > Number(e.target.max)) {
|
||||
value = Number(e.target.max)
|
||||
}
|
||||
if ((e.target.min) && value < Number(e.target.min)) {
|
||||
value = Number(e.target.min)
|
||||
}
|
||||
if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) {
|
||||
value = Number(e.target.dataset.min)
|
||||
}
|
||||
}
|
||||
that[m.value] = value
|
||||
}
|
||||
|
||||
|
||||
if (elements[i].nodeName == 'IMG') {
|
||||
elements[i].src = that[m.value]
|
||||
}
|
||||
else {
|
||||
elements[i].value = that[m.value]
|
||||
}
|
||||
}
|
||||
if(this.element[m.value]) {
|
||||
if (this.element[m.value]) {
|
||||
this.element[m.value].push(elements[i])
|
||||
}
|
||||
else {
|
||||
@ -81,7 +100,7 @@ class eventBinding {
|
||||
isEvent = true
|
||||
Event.push((e) => {
|
||||
let value = e.target.value
|
||||
if(e.target.type == 'number' && value!='') {
|
||||
if (e.target.type == 'number' && value != '') {
|
||||
value = Number(value)
|
||||
e.target.value = value
|
||||
}
|
||||
@ -94,7 +113,7 @@ class eventBinding {
|
||||
}
|
||||
// elements[i].attributes[m] = undefined
|
||||
}
|
||||
for(let n=0;n<removeName.length;n++) {
|
||||
for (let n = 0; n < removeName.length; n++) {
|
||||
elements[i].attributes.removeNamedItem(removeName[n])
|
||||
}
|
||||
|
||||
@ -108,6 +127,9 @@ class eventBinding {
|
||||
Event[t](e)
|
||||
}
|
||||
});
|
||||
elements[i].addEventListener('blur', (e) => {
|
||||
blurEvent(e)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,8 @@ class eventBinding {
|
||||
else {
|
||||
Event.push((e) => {
|
||||
let value = e.target.value
|
||||
if (e.target.type == 'number') {
|
||||
let str = e.target.value + ''
|
||||
if (e.target.type == 'number' && !(str.charAt(str.length - 1) == '0' && e.target.value.toString().includes('.'))) {
|
||||
value = Number(value)
|
||||
}
|
||||
that[m.value] = value
|
||||
|
@ -45,8 +45,14 @@ class EventBinding {
|
||||
let value = e.target.value
|
||||
value = Number(value)
|
||||
if (e.data != '.' && (e.data != '-' || e.target.value)) {
|
||||
if (((!e.target.max) && (!e.target.min)) || ((value <= Number(e.target.max)) && value >= Number(e.target.min))) {
|
||||
that[m.value] = value
|
||||
if ((e.target.max) && value > Number(e.target.max)) {
|
||||
value = Number(e.target.max)
|
||||
}
|
||||
if ((e.target.min) && value < Number(e.target.min)) {
|
||||
value = Number(e.target.min)
|
||||
}
|
||||
if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) {
|
||||
value = Number(e.target.dataset.min)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import { open as projConvertOpen, close as projConvertClose } from './projConver
|
||||
import { open as projectionConvertOpen, close as projectionConvertClose } from './projectionConvert'
|
||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../Global/global'
|
||||
import FlowPictureMaterialProperty from '../Obj/Materail/FlowPictureMaterialProperty'
|
||||
import { syncData, get3DView } from '../Global/MultiViewportMode'
|
||||
|
||||
class Tools {
|
||||
/**
|
||||
@ -646,25 +647,52 @@ class Tools {
|
||||
// dashSize: newParam.dashSize,
|
||||
space: newParam.space,
|
||||
scale: new Cesium.CallbackProperty(function () {
|
||||
var oriPositions = entity.polyline.positions.getValue();
|
||||
|
||||
if (!Cesium.defined(oriPositions)) {
|
||||
return 1.0;
|
||||
if (that.sdk.viewer.scene.mode === Cesium.SceneMode.SCENE3D) {
|
||||
let oriPositions = entity.polyline.positions.getValue();
|
||||
|
||||
if (!Cesium.defined(oriPositions)) {
|
||||
return 1.0;
|
||||
}
|
||||
let distance = 0;
|
||||
for (let i = 0; i < oriPositions.length - 1; ++i) {
|
||||
distance += Cesium.Cartesian3.distance(oriPositions[i], oriPositions[i + 1]);
|
||||
}
|
||||
//屏幕坐标
|
||||
let point1 = new Cesium.Cartesian2(0, that.sdk.viewer.canvas.clientHeight)
|
||||
let point2 = new Cesium.Cartesian2(that.sdk.viewer.canvas.clientWidth / 2, that.sdk.viewer.canvas.clientHeight)
|
||||
let cartesian1 = that.sdk.viewer.scene.pickPosition(point1)
|
||||
let cartesian2 = that.sdk.viewer.scene.pickPosition(point2)
|
||||
if (cartesian1 && cartesian2) {
|
||||
let distance2 = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||
repeatX = distance2 * 2 / distance
|
||||
}
|
||||
return repeatX;
|
||||
} else {
|
||||
let sdk3d = get3DView()
|
||||
let sdk3dEntity = sdk3d.viewer.entities.getById(that.options.id)
|
||||
let oriPositions = sdk3dEntity.polyline.positions.getValue();
|
||||
|
||||
if (!Cesium.defined(oriPositions)) {
|
||||
return 1.0;
|
||||
}
|
||||
let distance = 0;
|
||||
for (let i = 0; i < oriPositions.length - 1; ++i) {
|
||||
distance += Cesium.Cartesian3.distance(oriPositions[i], oriPositions[i + 1]);
|
||||
}
|
||||
//屏幕坐标
|
||||
let point1 = new Cesium.Cartesian2(0, sdk3d.viewer.canvas.clientHeight)
|
||||
let point2 = new Cesium.Cartesian2(sdk3d.viewer.canvas.clientWidth / 2, sdk3d.viewer.canvas.clientHeight)
|
||||
let cartesian1 = sdk3d.viewer.scene.pickPosition(point1)
|
||||
let cartesian2 = sdk3d.viewer.scene.pickPosition(point2)
|
||||
if (cartesian1 && cartesian2) {
|
||||
let distance2 = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||
repeatX = distance2 * 2 / distance
|
||||
}
|
||||
return repeatX;
|
||||
}
|
||||
var distance = 0;
|
||||
for (var i = 0; i < oriPositions.length - 1; ++i) {
|
||||
distance += Cesium.Cartesian3.distance(oriPositions[i], oriPositions[i + 1]);
|
||||
}
|
||||
//屏幕坐标
|
||||
let point1 = new Cesium.Cartesian2(0, that.sdk.viewer.canvas.clientHeight)
|
||||
let point2 = new Cesium.Cartesian2(that.sdk.viewer.canvas.clientWidth / 2, that.sdk.viewer.canvas.clientHeight)
|
||||
var cartesian1 = that.sdk.viewer.scene.pickPosition(point1)
|
||||
var cartesian2 = that.sdk.viewer.scene.pickPosition(point2)
|
||||
if (cartesian1 && cartesian2) {
|
||||
var distance2 = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||
repeatX = distance2 * 2 / distance
|
||||
}
|
||||
return repeatX;
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
@ -730,51 +758,109 @@ class Tools {
|
||||
image: canvasEle,
|
||||
speed: options.speed,
|
||||
repeat: new Cesium.CallbackProperty(function () {
|
||||
var positionProperty = entity.polyline.positions;
|
||||
var positions = positionProperty.getValue(that.sdk.viewer.clock.currentTime);
|
||||
|
||||
if (!Cesium.defined(positions)) {
|
||||
return new Cesium.Cartesian2(1.0, 1.0);
|
||||
// return 1.0;
|
||||
}
|
||||
if (that.sdk.viewer.scene.mode === Cesium.SceneMode.SCENE3D) {
|
||||
let positionProperty = entity.polyline.positions;
|
||||
let positions = positionProperty.getValue(that.sdk.viewer.clock.currentTime);
|
||||
|
||||
var distance = 0;
|
||||
for (var i = 0; i < positions.length - 1; ++i) {
|
||||
distance += Cesium.Cartesian3.distance(positions[i], positions[i + 1]);
|
||||
}
|
||||
if (!Cesium.defined(positions)) {
|
||||
return new Cesium.Cartesian2(1.0, 1.0);
|
||||
// return 1.0;
|
||||
}
|
||||
|
||||
var repeatX = distance / entity.polyline.width.getValue();
|
||||
// 根据地图缩放程度调整repeatX
|
||||
var cameraHeight = that.sdk.viewer.camera.positionCartographic.height;
|
||||
var boundingSphere = new Cesium.BoundingSphere(
|
||||
new Cesium.Cartesian3(-1000000, 0, 0), // 中心点坐标
|
||||
500000 // 半径(距离)
|
||||
);
|
||||
let distance = 0;
|
||||
for (let i = 0; i < positions.length - 1; ++i) {
|
||||
// if (that.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D){}
|
||||
distance += Cesium.Cartesian3.distance(positions[i], positions[i + 1]);
|
||||
}
|
||||
|
||||
let repeatX = distance / entity.polyline.width.getValue();
|
||||
// 根据地图缩放程度调整repeatX
|
||||
let cameraHeight = that.sdk.viewer.camera.positionCartographic.height;
|
||||
let boundingSphere = new Cesium.BoundingSphere(
|
||||
new Cesium.Cartesian3(-1000000, 0, 0), // 中心点坐标
|
||||
500000 // 半径(距离)
|
||||
);
|
||||
|
||||
// 获取绘图缓冲区的宽度和高度(通常是屏幕的分辨率)
|
||||
let drawingBufferWidth = that.sdk.viewer.canvas.clientWidth;
|
||||
let drawingBufferHeight = that.sdk.viewer.canvas.clientHeight;
|
||||
|
||||
// 使用 getPixelSize 方法获取包围球在屏幕上的像素大小
|
||||
let groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||
let result
|
||||
if (groundResolution > 700) {
|
||||
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||
// if (entity.polyline.material.oriRepeat) {
|
||||
let speed = repeatX / entity.polyline.oriRepeat
|
||||
entity.polyline.oriSpeed = speed
|
||||
entity.polyline.oriRepeatX = repeatX
|
||||
// } else {
|
||||
// entity.polyline.material.oriRepeat = repeatX
|
||||
// }
|
||||
beforeSpeed = speed
|
||||
repeat = repeatX
|
||||
result = new Cesium.Cartesian2(repeatX, speed || 1.0)
|
||||
} else {
|
||||
result = new Cesium.Cartesian2(repeat || entity.polyline.oriRepeatX, beforeSpeed || entity.polyline.oriSpeed)
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
// 获取绘图缓冲区的宽度和高度(通常是屏幕的分辨率)
|
||||
var drawingBufferWidth = that.sdk.viewer.canvas.clientWidth;
|
||||
var drawingBufferHeight = that.sdk.viewer.canvas.clientHeight;
|
||||
|
||||
// 使用 getPixelSize 方法获取包围球在屏幕上的像素大小
|
||||
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||
let result
|
||||
if (groundResolution > 700) {
|
||||
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||
// if (entity.polyline.material.oriRepeat) {
|
||||
let speed = repeatX / entity.polyline.oriRepeat
|
||||
entity.polyline.oriSpeed = speed
|
||||
entity.polyline.oriRepeatX = repeatX
|
||||
// } else {
|
||||
// entity.polyline.material.oriRepeat = repeatX
|
||||
// }
|
||||
beforeSpeed = speed
|
||||
repeat = repeatX
|
||||
result = new Cesium.Cartesian2(repeatX, speed || 1.0)
|
||||
} else {
|
||||
result = new Cesium.Cartesian2(repeat || entity.polyline.oriRepeatX, beforeSpeed || entity.polyline.oriSpeed)
|
||||
let sdk3d = get3DView()
|
||||
let sdk3dEntity = sdk3d.viewer.entities.getById(that.options.id)
|
||||
let positionProperty = sdk3dEntity.polyline.positions;
|
||||
let positions = positionProperty.getValue(sdk3d.viewer.clock.currentTime);
|
||||
|
||||
if (!Cesium.defined(positions)) {
|
||||
return new Cesium.Cartesian2(1.0, 1.0);
|
||||
// return 1.0;
|
||||
}
|
||||
|
||||
let distance = 0;
|
||||
for (let i = 0; i < positions.length - 1; ++i) {
|
||||
// if (that.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D){}
|
||||
distance += Cesium.Cartesian3.distance(positions[i], positions[i + 1]);
|
||||
}
|
||||
|
||||
let repeatX = distance / sdk3dEntity.polyline.width.getValue();
|
||||
// 根据地图缩放程度调整repeatX
|
||||
let cameraHeight = sdk3d.viewer.camera.positionCartographic.height;
|
||||
let boundingSphere = new Cesium.BoundingSphere(
|
||||
new Cesium.Cartesian3(-1000000, 0, 0), // 中心点坐标
|
||||
500000 // 半径(距离)
|
||||
);
|
||||
|
||||
// 获取绘图缓冲区的宽度和高度(通常是屏幕的分辨率)
|
||||
let drawingBufferWidth = sdk3d.viewer.canvas.clientWidth;
|
||||
let drawingBufferHeight = sdk3d.viewer.canvas.clientHeight;
|
||||
|
||||
// 使用 getPixelSize 方法获取包围球在屏幕上的像素大小
|
||||
let groundResolution = sdk3d.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||
let result
|
||||
if (groundResolution > 700) {
|
||||
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||
// if (entity.polyline.material.oriRepeat) {
|
||||
let speed = repeatX / sdk3dEntity.polyline.oriRepeat
|
||||
sdk3dEntity.polyline.oriSpeed = speed
|
||||
sdk3dEntity.polyline.oriRepeatX = repeatX
|
||||
// } else {
|
||||
// entity.polyline.material.oriRepeat = repeatX
|
||||
// }
|
||||
beforeSpeed = speed
|
||||
repeat = repeatX
|
||||
result = new Cesium.Cartesian2(repeatX, speed || 1.0)
|
||||
} else {
|
||||
result = new Cesium.Cartesian2(repeat || sdk3dEntity.polyline.oriRepeatX, beforeSpeed || sdk3dEntity.polyline.oriSpeed)
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
// return repeatX;
|
||||
})
|
||||
}
|
||||
@ -787,8 +873,13 @@ class Tools {
|
||||
getSceenLine(entity, options, canvasEle) {
|
||||
let point1 = new Cesium.Cartesian2(0, this.sdk.viewer.canvas.clientHeight)
|
||||
let point2 = new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth / 2, this.sdk.viewer.canvas.clientHeight)
|
||||
var cartesian1 = this.sdk.viewer.scene.pickPosition(point1)
|
||||
var cartesian2 = this.sdk.viewer.scene.pickPosition(point2)
|
||||
// var cartesian1 = this.sdk.viewer.scene.pickPosition(point1)
|
||||
// var cartesian2 = this.sdk.viewer.scene.pickPosition(point2)
|
||||
let ray = this.sdk.viewer.camera.getPickRay(point1);
|
||||
let cartesian1 = this.sdk.viewer.scene.globe.pick(ray, this.sdk.viewer.scene);
|
||||
|
||||
let ray2 = this.sdk.viewer.camera.getPickRay(point2);
|
||||
let cartesian2 = this.sdk.viewer.scene.globe.pick(ray2, this.sdk.viewer.scene);
|
||||
|
||||
var distance = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||
|
||||
@ -813,7 +904,14 @@ class Tools {
|
||||
repeatX = undefined;
|
||||
}
|
||||
|
||||
return repeatX
|
||||
if (this.sdk.viewer.scene.mode === Cesium.SceneMode.SCENE3D) {
|
||||
return repeatX
|
||||
} else {
|
||||
let sdk3d = get3DView()
|
||||
let sdk3dEntity = sdk3d.viewer.entities.getById(this.options.id)
|
||||
return sdk3dEntity.polyline.oriRepeatX
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*创建直箭头图片*/
|
||||
|
Reference in New Issue
Block a user