Compare commits
12 Commits
master
...
8f41d5907a
Author | SHA1 | Date | |
---|---|---|---|
8f41d5907a | |||
9866588986 | |||
5ab4a3b925 | |||
2604512f47 | |||
0bb1e5bd54 | |||
5d6679d919 | |||
41c132e506 | |||
09f760b10a | |||
b0619e1b31 | |||
43a4fca804 | |||
53e692f6ca | |||
dd1855002f |
@ -46,7 +46,7 @@ class BatchModel extends Base {
|
|||||||
this._EventBinding = new EventBinding()
|
this._EventBinding = new EventBinding()
|
||||||
this._elms = {};
|
this._elms = {};
|
||||||
this.pointArr = []
|
this.pointArr = []
|
||||||
this.sdk.addIncetance(this.options.id, this)
|
// this.sdk.addIncetance(this.options.id, this)
|
||||||
let tools = new Tools(sdk)
|
let tools = new Tools(sdk)
|
||||||
// BatchModel.computeDis(this)
|
// BatchModel.computeDis(this)
|
||||||
// if (this.options.positions.length > 0 || this.options.positions.lng) {
|
// if (this.options.positions.length > 0 || this.options.positions.lng) {
|
||||||
@ -58,6 +58,7 @@ class BatchModel extends Base {
|
|||||||
// BatchModel.computeDis(this)
|
// BatchModel.computeDis(this)
|
||||||
|
|
||||||
let Draw
|
let Draw
|
||||||
|
console.log('kkkkk')
|
||||||
switch (options.type) {
|
switch (options.type) {
|
||||||
case '点':
|
case '点':
|
||||||
Draw = new DrawPoint(this.sdk)
|
Draw = new DrawPoint(this.sdk)
|
||||||
@ -73,7 +74,9 @@ class BatchModel extends Base {
|
|||||||
}
|
}
|
||||||
Draw && Draw.start((a, positions) => {
|
Draw && Draw.start((a, positions) => {
|
||||||
this.options.positions = positions;
|
this.options.positions = positions;
|
||||||
|
console.log('uuuuuu')
|
||||||
//判断范围是否过大
|
//判断范围是否过大
|
||||||
|
if (positions.length != 0 || positions.lng) {
|
||||||
if (options.type == '面') {
|
if (options.type == '面') {
|
||||||
let posi = positions.map(v => {
|
let posi = positions.map(v => {
|
||||||
return Cesium.Cartesian3.fromDegrees(v.lng, v.lat)
|
return Cesium.Cartesian3.fromDegrees(v.lng, v.lat)
|
||||||
@ -101,6 +104,7 @@ class BatchModel extends Base {
|
|||||||
}
|
}
|
||||||
// this.callback(this.options);
|
// this.callback(this.options);
|
||||||
(this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this)
|
(this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -115,6 +119,7 @@ class BatchModel extends Base {
|
|||||||
let posiArr = []
|
let posiArr = []
|
||||||
let array = []
|
let array = []
|
||||||
if (that.options.type == '面') {
|
if (that.options.type == '面') {
|
||||||
|
if (that.options.positions.length != 0) {
|
||||||
that.options.positions.forEach(item => {
|
that.options.positions.forEach(item => {
|
||||||
fromDegreesArray.push(item.lng, item.lat)
|
fromDegreesArray.push(item.lng, item.lat)
|
||||||
})
|
})
|
||||||
@ -135,7 +140,9 @@ class BatchModel extends Base {
|
|||||||
alt: height
|
alt: height
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}
|
||||||
} else if (that.options.type == '线') {
|
} else if (that.options.type == '线') {
|
||||||
|
if (that.options.positions.length != 0) {
|
||||||
that.options.positions.forEach(item => {
|
that.options.positions.forEach(item => {
|
||||||
fromDegreesArray.push(item.lng, item.lat)
|
fromDegreesArray.push(item.lng, item.lat)
|
||||||
})
|
})
|
||||||
@ -155,12 +162,17 @@ class BatchModel extends Base {
|
|||||||
alt: height
|
alt: height
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
} else if (that.options.type == '点') {
|
} else if (that.options.type == '点') {
|
||||||
|
if (that.options.positions.lng) {
|
||||||
let height = await that.getClampToHeight({ lng: that.options.positions.lng, lat: that.options.positions.lat })
|
let height = await that.getClampToHeight({ lng: that.options.positions.lng, lat: that.options.positions.lat })
|
||||||
posiArr = [{ lng: that.options.positions.lng, lat: that.options.positions.lat, alt: height }]
|
posiArr = [{ lng: that.options.positions.lng, lat: that.options.positions.lat, alt: height }]
|
||||||
// posiArr = [that.options.positions]
|
// posiArr = [that.options.positions]
|
||||||
that.pointArr = posiArr
|
that.pointArr = posiArr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
let params = {
|
let params = {
|
||||||
type: that.options.type,
|
type: that.options.type,
|
||||||
positions: posiArr,
|
positions: posiArr,
|
||||||
|
@ -33,7 +33,7 @@ class TextBox extends Base {
|
|||||||
|
|
||||||
this.callback = callback
|
this.callback = callback
|
||||||
|
|
||||||
// syncData(this.sdk, this.options.id)
|
syncData(this.sdk, this.options.id)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,15 +134,17 @@ class TextBox extends Base {
|
|||||||
}
|
}
|
||||||
async getwords(words) {
|
async getwords(words) {
|
||||||
this.options.text = words
|
this.options.text = words
|
||||||
this.callback(this.options)
|
|
||||||
let { sdkP } = getSdk()
|
let { sdkP } = getSdk()
|
||||||
if (this.sdk === sdkP && sdkP) {//三维
|
if (this.sdk === sdkP && sdkP) {//三维
|
||||||
|
this.callback(this.options)
|
||||||
syncData(this.sdk, this.options.id)
|
syncData(this.sdk, this.options.id)
|
||||||
}
|
}
|
||||||
else if (sdkP) {//二维
|
else if (sdkP) {//二维
|
||||||
sdkP.entityMap.get(this.options.id).text = words
|
sdkP.entityMap.get(this.options.id).text = words
|
||||||
sdkP.entityMap.get(this.options.id).twoToThree(this.options.position)
|
sdkP.entityMap.get(this.options.id).twoToThree(this.options.position)
|
||||||
} else if (!sdkP) {
|
} else if (!sdkP) {
|
||||||
|
this.callback(this.options)
|
||||||
syncData(this.sdk, this.options.id)
|
syncData(this.sdk, this.options.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -283,6 +285,7 @@ class TextBox extends Base {
|
|||||||
this.sdk.viewer.cesiumWidget.container.removeChild(this.textDom);
|
this.sdk.viewer.cesiumWidget.container.removeChild(this.textDom);
|
||||||
}
|
}
|
||||||
await this.sdk.removeIncetance(this.options.id)
|
await this.sdk.removeIncetance(this.options.id)
|
||||||
|
syncData(this.sdk, this.options.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
flicker() { }
|
flicker() { }
|
||||||
|
@ -187,7 +187,7 @@ function html() {
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<span class="label">油耗</span>
|
<span class="label">油耗</span>
|
||||||
<div class="input-number input-number-unit-6" style="width: 170px;">
|
<div class="input-number input-number-unit-6" style="width: 170px;">
|
||||||
<input class="input" type="number" title="" min="1" max="99999999" @model="unitFuelConsumption">
|
<input class="input" type="number" title="" min="0" max="99999999" @model="unitFuelConsumption">
|
||||||
<span class="unit">L/100km</span>
|
<span class="unit">L/100km</span>
|
||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2324,7 +2324,7 @@ class TrajectoryMotion extends Base {
|
|||||||
this.model && (this.model.show = false)
|
this.model && (this.model.show = false)
|
||||||
}
|
}
|
||||||
this.labelShow = this.originalOptions.label.show
|
this.labelShow = this.originalOptions.label.show
|
||||||
this.fuelLabelShow = this.originalOptions.fuelShow
|
this.fuelShow = this.originalOptions.fuelShow
|
||||||
this.labelColor = this.originalOptions.label.color
|
this.labelColor = this.originalOptions.label.color
|
||||||
this.labelFontSize = this.originalOptions.label.fontSize
|
this.labelFontSize = this.originalOptions.label.fontSize
|
||||||
this.labelFontFamily = this.originalOptions.label.fontFamily
|
this.labelFontFamily = this.originalOptions.label.fontFamily
|
||||||
|
@ -441,10 +441,14 @@ class YJEarth {
|
|||||||
textList[i].querySelector('textarea').focus()
|
textList[i].querySelector('textarea').focus()
|
||||||
_this.isLeftClick = true
|
_this.isLeftClick = true
|
||||||
_this.entityMap.get(_this.clickTextDom.id).isClick(movement.position, _this.clickTextDom.id)
|
_this.entityMap.get(_this.clickTextDom.id).isClick(movement.position, _this.clickTextDom.id)
|
||||||
|
|
||||||
_this.blurFun = () => {
|
_this.blurFun = () => {
|
||||||
_this.entityMap.get(_this.clickTextDom.id).isClick((movement && movement.position) || null, _this.clickTextDom.id)
|
// let { sdkP } = getSdk()
|
||||||
|
// if (_this == sdkP && sdkP) {//二维
|
||||||
|
// _this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||||
|
// } else if (!sdkP) {
|
||||||
_this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
_this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||||
|
// }
|
||||||
|
_this.clickTextDom.querySelector('textarea').removeEventListener('blur', _this.blurFun)
|
||||||
}
|
}
|
||||||
_this.clickTextDom.querySelector('textarea').addEventListener('blur', _this.blurFun)
|
_this.clickTextDom.querySelector('textarea').addEventListener('blur', _this.blurFun)
|
||||||
break;
|
break;
|
||||||
@ -468,7 +472,7 @@ class YJEarth {
|
|||||||
click = true
|
click = true
|
||||||
}
|
}
|
||||||
mousemove = function (e) {
|
mousemove = function (e) {
|
||||||
if (!click) {
|
if (!click || !_this.clickTextDom) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let width = _this.clickTextDom.clientWidth * 1
|
let width = _this.clickTextDom.clientWidth * 1
|
||||||
@ -501,7 +505,7 @@ class YJEarth {
|
|||||||
_this.clickTextDom.removeEventListener('mousedown', mousedown);
|
_this.clickTextDom.removeEventListener('mousedown', mousedown);
|
||||||
_this.viewer._element.removeEventListener('mousemove', mousemove);
|
_this.viewer._element.removeEventListener('mousemove', mousemove);
|
||||||
_this.viewer._element.removeEventListener('mouseup', mouseup);
|
_this.viewer._element.removeEventListener('mouseup', mouseup);
|
||||||
_this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
// _this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||||
|
|
||||||
_this.clickTextDom.style['pointer-events'] = 'none'
|
_this.clickTextDom.style['pointer-events'] = 'none'
|
||||||
_this.clickTextDom = undefined
|
_this.clickTextDom = undefined
|
||||||
|
Reference in New Issue
Block a user