Compare commits
4 Commits
ef3a682724
...
656a21a6dd
Author | SHA1 | Date | |
---|---|---|---|
656a21a6dd | |||
bdc7e58263 | |||
d47ab3715d | |||
20a9388579 |
@ -273,7 +273,7 @@ class BillboardObject extends Base {
|
|||||||
else {
|
else {
|
||||||
let image = new Image()
|
let image = new Image()
|
||||||
image.src =
|
image.src =
|
||||||
url ||
|
url ||
|
||||||
that.getSourceRootPath() + '/img/A-ablu-blank.png'
|
that.getSourceRootPath() + '/img/A-ablu-blank.png'
|
||||||
switch (that.options.heightMode) {
|
switch (that.options.heightMode) {
|
||||||
case 2:
|
case 2:
|
||||||
@ -766,6 +766,8 @@ class BillboardObject extends Base {
|
|||||||
_this._frameImages = []
|
_this._frameImages = []
|
||||||
superGif.load(function (status) {
|
superGif.load(function (status) {
|
||||||
if (status == 404) {
|
if (status == 404) {
|
||||||
|
let width = 31
|
||||||
|
let height = 36
|
||||||
canvas = document.createElement('canvas')
|
canvas = document.createElement('canvas')
|
||||||
canvas.width = 0
|
canvas.width = 0
|
||||||
canvas.height = 0
|
canvas.height = 0
|
||||||
@ -855,6 +857,8 @@ class BillboardObject extends Base {
|
|||||||
billboardH = height * (31 / width)
|
billboardH = height * (31 / width)
|
||||||
}
|
}
|
||||||
image.onerror = function (err) {
|
image.onerror = function (err) {
|
||||||
|
let width = 31
|
||||||
|
let height = 36
|
||||||
canvas.width = 0
|
canvas.width = 0
|
||||||
canvas.height = 0
|
canvas.height = 0
|
||||||
billboardH = 0
|
billboardH = 0
|
||||||
@ -2344,7 +2348,7 @@ class BillboardObject extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateHeight() {
|
async updateHeight() {
|
||||||
if(!this.sdk || !this.sdk.viewer || !this.sdk.viewer.scene) {
|
if (!this.sdk || !this.sdk.viewer || !this.sdk.viewer.scene) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let height
|
let height
|
||||||
|
@ -315,9 +315,9 @@ class FlowLine extends Base {
|
|||||||
this.reset()
|
this.reset()
|
||||||
this.Dialog.resetCallBack && this.Dialog.resetCallBack()
|
this.Dialog.resetCallBack && this.Dialog.resetCallBack()
|
||||||
},
|
},
|
||||||
// removeCallBack: () => {
|
removeCallBack: () => {
|
||||||
// this.Dialog.removeCallBack && this.Dialog.removeCallBack()
|
this.Dialog.removeCallBack && this.Dialog.removeCallBack()
|
||||||
// },
|
},
|
||||||
closeCallBack: () => {
|
closeCallBack: () => {
|
||||||
this.reset()
|
this.reset()
|
||||||
// this.entity.style = new Cesium.Cesium3DTileStyle({
|
// this.entity.style = new Cesium.Cesium3DTileStyle({
|
||||||
|
@ -441,16 +441,16 @@ class PolylineObject extends Base {
|
|||||||
this._elms.lineType.forEach(item => {
|
this._elms.lineType.forEach(item => {
|
||||||
item.value = lineTypeData[i].value
|
item.value = lineTypeData[i].value
|
||||||
if (2 < item.value && item.value < 13) {//贴图参数
|
if (2 < item.value && item.value < 13) {//贴图参数
|
||||||
document.getElementById('dashTextureDom').style.display = 'flex'
|
document.getElementById('dashTextureDom') && (document.getElementById('dashTextureDom').style.display = 'flex')
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('dashTextureDom').style.display = 'none'
|
document.getElementById('dashTextureDom') && (document.getElementById('dashTextureDom').style.display = 'none')
|
||||||
}
|
}
|
||||||
if (2 < item.value && item.value < 5) {//尾迹参数
|
if (2 < item.value && item.value < 5) {//尾迹参数
|
||||||
document.getElementsByClassName('lineSpace')[0].style.display = 'none'
|
document.getElementsByClassName('lineSpace')[0] && (document.getElementsByClassName('lineSpace')[0].style.display = 'none')
|
||||||
document.getElementsByClassName('lineSpace')[1].style.display = 'none'
|
document.getElementsByClassName('lineSpace')[1] && (document.getElementsByClassName('lineSpace')[1].style.display = 'none')
|
||||||
} else {
|
} else {
|
||||||
document.getElementsByClassName('lineSpace')[0].style.display = 'flex'
|
document.getElementsByClassName('lineSpace')[0] && (document.getElementsByClassName('lineSpace')[0].style.display = 'flex')
|
||||||
document.getElementsByClassName('lineSpace')[1].style.display = 'flex'
|
document.getElementsByClassName('lineSpace')[1] && (document.getElementsByClassName('lineSpace')[1].style.display = 'flex')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
@ -822,6 +822,7 @@ class PolylineObject extends Base {
|
|||||||
set labelLineColor(v) {
|
set labelLineColor(v) {
|
||||||
this.options.label.lineColor = v
|
this.options.label.lineColor = v
|
||||||
this.label.lineColor = v
|
this.label.lineColor = v
|
||||||
|
let _this = this
|
||||||
if (this._elms.labelLineColor) {
|
if (this._elms.labelLineColor) {
|
||||||
this._elms.labelLineColor.forEach((item, i) => {
|
this._elms.labelLineColor.forEach((item, i) => {
|
||||||
let lineColorPicker = new YJColorPicker({
|
let lineColorPicker = new YJColorPicker({
|
||||||
@ -844,7 +845,7 @@ class PolylineObject extends Base {
|
|||||||
})
|
})
|
||||||
this._elms.labelBackgroundColorStart[
|
this._elms.labelBackgroundColorStart[
|
||||||
i
|
i
|
||||||
] = labelBackgroundColorStartPicker
|
] = _this.labelBackgroundColorStartPicker
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1337,12 +1338,19 @@ class PolylineObject extends Base {
|
|||||||
positions: Cesium.Cartesian3.fromDegreesArrayHeights(fromDegreesArray),
|
positions: Cesium.Cartesian3.fromDegreesArrayHeights(fromDegreesArray),
|
||||||
width: that.options.width,
|
width: that.options.width,
|
||||||
clampToGround: ground,
|
clampToGround: ground,
|
||||||
material: that.getMaterial(that.options.color, that.options.type, that.entity, that.options),
|
// material: that.getMaterial(that.options.color, that.options.type, that.entity, that.options),
|
||||||
zIndex: that.sdk._entityZIndex
|
zIndex: that.sdk._entityZIndex
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
that.entity.polyline.oriWidth = that.options.width
|
that.entity.polyline.oriWidth = that.options.width
|
||||||
that.judgeLine(that.entity, that.options)
|
that.judgeLine(that.entity, that.options)
|
||||||
|
that.entity.polyline.material = that.getMaterial(
|
||||||
|
that.options.color,
|
||||||
|
that.options.type,
|
||||||
|
that.entity,
|
||||||
|
that.options
|
||||||
|
)
|
||||||
that.sdk._entityZIndex++
|
that.sdk._entityZIndex++
|
||||||
PolylineObject.createLabel(that)
|
PolylineObject.createLabel(that)
|
||||||
// that.entity.polyline.positionsLngLat = positions
|
// that.entity.polyline.positionsLngLat = positions
|
||||||
@ -1549,10 +1557,20 @@ class PolylineObject extends Base {
|
|||||||
// this.attributeCamera = this.options.attribute.camera.content
|
// this.attributeCamera = this.options.attribute.camera.content
|
||||||
// this.attributeGoods = this.options.attribute.goods.content
|
// this.attributeGoods = this.options.attribute.goods.content
|
||||||
|
|
||||||
|
function tabClick(e) {
|
||||||
|
if (e === '2' || e === 2) {//点击线条样式
|
||||||
|
if (2 < _this.options.type && _this.options.type < 13) {//贴图参数
|
||||||
|
document.getElementById('dashTextureDom') && (document.getElementById('dashTextureDom').style.display = 'flex')
|
||||||
|
} else {
|
||||||
|
document.getElementById('dashTextureDom') && (document.getElementById('dashTextureDom').style.display = 'none')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 创建标签页
|
// 创建标签页
|
||||||
let tabsElm = new cy_tabs(
|
let tabsElm = new cy_tabs(
|
||||||
'polyline-object-edit-tabs',
|
'polyline-object-edit-tabs',
|
||||||
undefined,
|
tabClick,
|
||||||
this.sdk
|
this.sdk
|
||||||
)
|
)
|
||||||
// 颜色组件
|
// 颜色组件
|
||||||
@ -1612,7 +1630,7 @@ class PolylineObject extends Base {
|
|||||||
this.labelLineColor = 'rgba(255,255,255,1)'
|
this.labelLineColor = 'rgba(255,255,255,1)'
|
||||||
} //点击清空按钮事件回调
|
} //点击清空按钮事件回调
|
||||||
})
|
})
|
||||||
let labelBackgroundColorStartPicker = new YJColorPicker({
|
_this.labelBackgroundColorStartPicker = new YJColorPicker({
|
||||||
el: contentElm.getElementsByClassName('labelBackgroundColorStart')[0],
|
el: contentElm.getElementsByClassName('labelBackgroundColorStart')[0],
|
||||||
size: 'mini',
|
size: 'mini',
|
||||||
alpha: true,
|
alpha: true,
|
||||||
@ -1647,7 +1665,7 @@ class PolylineObject extends Base {
|
|||||||
this._elms.labelColor = [labelColorPicker]
|
this._elms.labelColor = [labelColorPicker]
|
||||||
this._elms.extendColor = [extendColorPicker]
|
this._elms.extendColor = [extendColorPicker]
|
||||||
this._elms.labelLineColor = [lineColorPicker]
|
this._elms.labelLineColor = [lineColorPicker]
|
||||||
this._elms.labelBackgroundColorStart = [labelBackgroundColorStartPicker]
|
this._elms.labelBackgroundColorStart = [_this.labelBackgroundColorStartPicker]
|
||||||
this._elms.labelBackgroundColorEnd = [labelBackgroundColorEndPicker]
|
this._elms.labelBackgroundColorEnd = [labelBackgroundColorEndPicker]
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -1925,16 +1943,16 @@ class PolylineObject extends Base {
|
|||||||
|
|
||||||
//控制参数显隐
|
//控制参数显隐
|
||||||
if (2 < this.lineType && this.lineType < 13) {//贴图参数
|
if (2 < this.lineType && this.lineType < 13) {//贴图参数
|
||||||
document.getElementById('dashTextureDom').style.display = 'flex'
|
document.getElementById('dashTextureDom') && (document.getElementById('dashTextureDom').style.display = 'flex')
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('dashTextureDom').style.display = 'none'
|
document.getElementById('dashTextureDom') && (document.getElementById('dashTextureDom').style.display = 'none')
|
||||||
}
|
}
|
||||||
if (2 < this.lineType && this.lineType < 5) {//尾迹参数
|
if (2 < this.lineType && this.lineType < 5) {//尾迹参数
|
||||||
document.getElementsByClassName('lineSpace')[0].style.display = 'none'
|
document.getElementsByClassName('lineSpace')[0] && (document.getElementsByClassName('lineSpace')[0].style.display = 'none')
|
||||||
document.getElementsByClassName('lineSpace')[1].style.display = 'none'
|
document.getElementsByClassName('lineSpace')[1] && (document.getElementsByClassName('lineSpace')[1].style.display = 'none')
|
||||||
} else {
|
} else {
|
||||||
document.getElementsByClassName('lineSpace')[0].style.display = 'flex'
|
document.getElementsByClassName('lineSpace')[0] && (document.getElementsByClassName('lineSpace')[0].style.display = 'flex')
|
||||||
document.getElementsByClassName('lineSpace')[1].style.display = 'flex'
|
document.getElementsByClassName('lineSpace')[1] && (document.getElementsByClassName('lineSpace')[1].style.display = 'flex')
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -1,76 +1,77 @@
|
|||||||
class cy_tabs {
|
class cy_tabs {
|
||||||
constructor(id, clickTabCallBack, sdk) {
|
constructor(id, clickTabCallBack, sdk) {
|
||||||
let elm = document.getElementById(id);
|
let elm = document.getElementById(id);
|
||||||
let pane = elm.getElementsByTagName('DIV-cy-tab-pane')
|
let pane = elm.getElementsByTagName('DIV-cy-tab-pane')
|
||||||
|
|
||||||
let tabTop = `<div class="DIV-cy-tab-top">`
|
let tabTop = `<div class="DIV-cy-tab-top">`
|
||||||
let tabContent = `<div class="DIV-cy-tab-content">`
|
let tabContent = `<div class="DIV-cy-tab-content">`
|
||||||
let tabindex = 0
|
let tabindex = 0
|
||||||
for (let i = 0; i < pane.length; i++) {
|
for (let i = 0; i < pane.length; i++) {
|
||||||
let flag = false
|
let flag = false
|
||||||
if (sdk && sdk.tabHide && Array.isArray(sdk.tabHide)) {
|
if (sdk && sdk.tabHide && Array.isArray(sdk.tabHide)) {
|
||||||
for (let m = 0; m < sdk.tabHide.length; m++) {
|
for (let m = 0; m < sdk.tabHide.length; m++) {
|
||||||
if (pane[i].getAttribute('label') === sdk.tabHide[m]) {
|
if (pane[i].getAttribute('label') === sdk.tabHide[m]) {
|
||||||
flag = true
|
flag = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flag) {
|
if (flag) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
let style = 'display: none;'
|
let style = 'display: none;'
|
||||||
let active = ''
|
let active = ''
|
||||||
if (tabindex == 0) {
|
if (tabindex == 0) {
|
||||||
style = ''
|
style = ''
|
||||||
active = 'is-active'
|
active = 'is-active'
|
||||||
}
|
}
|
||||||
tabTop = tabTop + `
|
tabTop = tabTop + `
|
||||||
<div class="DIV-cy-tab-pane-title">
|
<div class="DIV-cy-tab-pane-title">
|
||||||
<div class="DIV-cy-tab-pane-title-p `+ active + `" tabindex="` + tabindex + `"><span>` + pane[i].getAttribute('label') + `</span></div>
|
<div class="DIV-cy-tab-pane-title-p `+ active + `" tabindex="` + tabindex + `"><span>` + pane[i].getAttribute('label') + `</span></div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
tabContent = tabContent + `<div class="DIV-cy-tab-content-pane ${pane[i].className}" style="` + style + `">` + pane[i].innerHTML + `</div>`
|
tabContent = tabContent + `<div class="DIV-cy-tab-content-pane ${pane[i].className}" style="` + style + `">` + pane[i].innerHTML + `</div>`
|
||||||
tabindex++
|
tabindex++
|
||||||
|
}
|
||||||
|
tabTop = tabTop + `</div>`
|
||||||
|
tabContent = tabContent + `</div>`
|
||||||
|
|
||||||
|
let BoxElm = document.createElement('div');
|
||||||
|
BoxElm.setAttribute('id', id)
|
||||||
|
BoxElm.setAttribute('class', 'DIV-cy-tabs')
|
||||||
|
BoxElm.innerHTML = tabTop + tabContent
|
||||||
|
elm.parentNode.insertBefore(BoxElm, elm);
|
||||||
|
elm.parentNode.removeChild(elm);
|
||||||
|
|
||||||
|
// 点击事件
|
||||||
|
let tabs = BoxElm.getElementsByClassName('DIV-cy-tab-pane-title-p')
|
||||||
|
for (let i = 0; i < tabs.length; i++) {
|
||||||
|
tabs[i].addEventListener('click', (e) => {
|
||||||
|
let tabindex = e.target.getAttribute('tabindex')
|
||||||
|
let contentElm = BoxElm.getElementsByClassName('DIV-cy-tab-content-pane')
|
||||||
|
clickTabCallBack && clickTabCallBack(tabindex)
|
||||||
|
for (let i = 0; i < contentElm.length; i++) {
|
||||||
|
if (i === parseInt(tabindex)) {
|
||||||
|
contentElm[i].style.display = ''
|
||||||
|
tabs[i].className = 'DIV-cy-tab-pane-title-p is-active'
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
contentElm[i].style.display = 'none'
|
||||||
|
tabs[i].className = 'DIV-cy-tab-pane-title-p'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tabTop = tabTop + `</div>`
|
contentElm[parseInt(tabindex)].style.display = ''
|
||||||
tabContent = tabContent + `</div>`
|
})
|
||||||
|
|
||||||
let BoxElm = document.createElement('div');
|
|
||||||
BoxElm.setAttribute('id', id)
|
|
||||||
BoxElm.setAttribute('class', 'DIV-cy-tabs')
|
|
||||||
BoxElm.innerHTML = tabTop + tabContent
|
|
||||||
elm.parentNode.insertBefore(BoxElm, elm);
|
|
||||||
elm.parentNode.removeChild(elm);
|
|
||||||
|
|
||||||
// 点击事件
|
|
||||||
let tabs = BoxElm.getElementsByClassName('DIV-cy-tab-pane-title-p')
|
|
||||||
for (let i = 0; i < tabs.length; i++) {
|
|
||||||
tabs[i].addEventListener('click', (e) => {
|
|
||||||
let tabindex = e.target.getAttribute('tabindex')
|
|
||||||
let contentElm = BoxElm.getElementsByClassName('DIV-cy-tab-content-pane')
|
|
||||||
for (let i = 0; i < contentElm.length; i++) {
|
|
||||||
if (i === parseInt(tabindex)) {
|
|
||||||
contentElm[i].style.display = ''
|
|
||||||
tabs[i].className = 'DIV-cy-tab-pane-title-p is-active'
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
contentElm[i].style.display = 'none'
|
|
||||||
tabs[i].className = 'DIV-cy-tab-pane-title-p'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
contentElm[parseInt(tabindex)].style.display = ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
this.clickTabCallBack = clickTabCallBack
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clickTabCallBack() {
|
this.clickTabCallBack = clickTabCallBack
|
||||||
if (this.clickTabCallBack) {
|
}
|
||||||
this.clickTabCallBack()
|
|
||||||
}
|
clickTabCallBack() {
|
||||||
|
if (this.clickTabCallBack) {
|
||||||
|
this.clickTabCallBack()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default cy_tabs
|
export default cy_tabs
|
@ -638,7 +638,7 @@ class Tools {
|
|||||||
// break
|
// break
|
||||||
case 6: //流动虚线2
|
case 6: //流动虚线2
|
||||||
let that = this
|
let that = this
|
||||||
|
let repeatX
|
||||||
material = new Cesium.FlowDashedLineFlowMaterialProperty({
|
material = new Cesium.FlowDashedLineFlowMaterialProperty({
|
||||||
color: color,
|
color: color,
|
||||||
uType: type == 5 ? 0 : 1,
|
uType: type == 5 ? 0 : 1,
|
||||||
@ -660,11 +660,10 @@ class Tools {
|
|||||||
let point2 = new Cesium.Cartesian2(that.sdk.viewer.canvas.clientWidth / 2, 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 cartesian1 = that.sdk.viewer.scene.pickPosition(point1)
|
||||||
var cartesian2 = that.sdk.viewer.scene.pickPosition(point2)
|
var cartesian2 = that.sdk.viewer.scene.pickPosition(point2)
|
||||||
|
if (cartesian1 && cartesian2) {
|
||||||
var distance2 = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
var distance2 = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||||
|
repeatX = distance2 * 2 / distance
|
||||||
let repeatX = distance2 * 2 / distance
|
}
|
||||||
|
|
||||||
return repeatX;
|
return repeatX;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user