修改
This commit is contained in:
@ -18,7 +18,7 @@ import { getHost } from "../on";
|
|||||||
|
|
||||||
let coordinateSystem = 'EPSG:4326'
|
let coordinateSystem = 'EPSG:4326'
|
||||||
let _cartesian
|
let _cartesian
|
||||||
let GroundCover = false
|
let GroundCover = true
|
||||||
let bimPickObject = {}
|
let bimPickObject = {}
|
||||||
let containerObject = {}
|
let containerObject = {}
|
||||||
let rotateAroundObject = {}
|
let rotateAroundObject = {}
|
||||||
|
@ -86,7 +86,7 @@ class RoutePlanning extends Base {
|
|||||||
width: 32,
|
width: 32,
|
||||||
height: 32
|
height: 32
|
||||||
}
|
}
|
||||||
// this.edit(true)
|
this.edit(true)
|
||||||
this.clear()
|
this.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ class RoutePlanning extends Base {
|
|||||||
this._element_style = document.createElement('style')
|
this._element_style = document.createElement('style')
|
||||||
this._element_style.type = 'text/css'
|
this._element_style.type = 'text/css'
|
||||||
this._element_style.setAttribute('data-name', 'YJ_style_dialog')
|
this._element_style.setAttribute('data-name', 'YJ_style_dialog')
|
||||||
this._element_style.innerHTML = css()
|
// this._element_style.innerHTML = css()
|
||||||
// this._DialogObject = await new Dialog(this.sdk.viewer._container, {
|
// this._DialogObject = await new Dialog(this.sdk.viewer._container, {
|
||||||
// title: '路径规划',
|
// title: '路径规划',
|
||||||
// closeCallBack: () => {
|
// closeCallBack: () => {
|
||||||
@ -205,19 +205,20 @@ class RoutePlanning extends Base {
|
|||||||
// })
|
// })
|
||||||
// await this._DialogObject.init()
|
// await this._DialogObject.init()
|
||||||
|
|
||||||
let div = document.createElement('div')
|
// let div = document.createElement('div')
|
||||||
div.style.position = 'absolute'
|
// div.style.position = 'absolute'
|
||||||
div.style.left = '24px'
|
// div.style.left = '24px'
|
||||||
div.style.flet = '0'
|
// div.style.flet = '0'
|
||||||
div.style.display = 'flex'
|
// div.style.display = 'flex'
|
||||||
document.getElementsByClassName('RoutePlanning')[0].getElementsByClassName('foot')[0].appendChild(div)
|
// document.getElementsByClassName('RoutePlanning')[0].getElementsByClassName('foot')[0].appendChild(div)
|
||||||
// this._DialogObject.footAppChild(div)
|
// // this._DialogObject.footAppChild(div)
|
||||||
|
|
||||||
let queryBtn = document.createElement('button')
|
// let queryBtn = document.createElement('button')
|
||||||
queryBtn.className = 'default'
|
// queryBtn.className = 'default'
|
||||||
queryBtn.innerHTML =
|
// queryBtn.innerHTML =
|
||||||
'<svg class="icon-query"><use xlink:href="#yj-icon-query"></use></svg>查询'
|
// '<svg class="icon-query"><use xlink:href="#yj-icon-query"></use></svg>查询'
|
||||||
queryBtn.style.width = 'auto'
|
// queryBtn.style.width = 'auto'
|
||||||
|
let queryBtn = document.getElementById('routeQuery')
|
||||||
queryBtn.addEventListener('click', () => {
|
queryBtn.addEventListener('click', () => {
|
||||||
if (
|
if (
|
||||||
(this.startLng || this.startLng === 0) &&
|
(this.startLng || this.startLng === 0) &&
|
||||||
@ -272,18 +273,19 @@ class RoutePlanning extends Base {
|
|||||||
this.tools.message({ type: 'warning', text: '请先设置起点和终点坐标!' })
|
this.tools.message({ type: 'warning', text: '请先设置起点和终点坐标!' })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
div.appendChild(queryBtn)
|
// div.appendChild(queryBtn)
|
||||||
|
|
||||||
let cleanBtn = document.createElement('button')
|
// let cleanBtn = document.createElement('button')
|
||||||
cleanBtn.className = 'default'
|
// cleanBtn.className = 'default'
|
||||||
cleanBtn.innerHTML =
|
// cleanBtn.innerHTML =
|
||||||
'<svg class="icon-route"><use xlink:href="#yj-icon-route"></use></svg>清除路线'
|
// '<svg class="icon-route"><use xlink:href="#yj-icon-route"></use></svg>清除路线'
|
||||||
cleanBtn.style.width = 'auto'
|
// cleanBtn.style.width = 'auto'
|
||||||
cleanBtn.style.marginLeft = '10px'
|
// cleanBtn.style.marginLeft = '10px'
|
||||||
|
let cleanBtn = document.getElementById('clearRoute')
|
||||||
cleanBtn.addEventListener('click', () => {
|
cleanBtn.addEventListener('click', () => {
|
||||||
this.clear()
|
this.clear()
|
||||||
})
|
})
|
||||||
div.appendChild(cleanBtn)
|
// div.appendChild(cleanBtn)
|
||||||
|
|
||||||
document.getElementsByTagName('head')[0].appendChild(this._element_style)
|
document.getElementsByTagName('head')[0].appendChild(this._element_style)
|
||||||
// let contentElm = document.createElement('div')
|
// let contentElm = document.createElement('div')
|
||||||
@ -507,7 +509,7 @@ class RoutePlanning extends Base {
|
|||||||
/**
|
/**
|
||||||
* 拾取起点
|
* 拾取起点
|
||||||
*/
|
*/
|
||||||
pickStartPos(e) {
|
pickStartPos(func) {
|
||||||
this.tip && this.tip.destroy()
|
this.tip && this.tip.destroy()
|
||||||
this.event && this.event.destroy()
|
this.event && this.event.destroy()
|
||||||
this.tip = new MouseTip('左键选择起点坐标,右键取消', this.sdk)
|
this.tip = new MouseTip('左键选择起点坐标,右键取消', this.sdk)
|
||||||
@ -523,6 +525,7 @@ class RoutePlanning extends Base {
|
|||||||
let pos84 = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
let pos84 = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||||
this.startLng = pos84.lng
|
this.startLng = pos84.lng
|
||||||
this.startLat = pos84.lat
|
this.startLat = pos84.lat
|
||||||
|
func(pos84)
|
||||||
!this.startEntity &&
|
!this.startEntity &&
|
||||||
(this.startEntity = this.viewer.entities.add(
|
(this.startEntity = this.viewer.entities.add(
|
||||||
new Cesium.Entity({
|
new Cesium.Entity({
|
||||||
@ -574,7 +577,7 @@ class RoutePlanning extends Base {
|
|||||||
/**
|
/**
|
||||||
* 拾取终点
|
* 拾取终点
|
||||||
*/
|
*/
|
||||||
pickEndPos(e) {
|
pickEndPos(func) {
|
||||||
this.tip && this.tip.destroy()
|
this.tip && this.tip.destroy()
|
||||||
this.event && this.event.destroy()
|
this.event && this.event.destroy()
|
||||||
this.tip = new MouseTip('左键选择终点坐标,右键取消', this.sdk)
|
this.tip = new MouseTip('左键选择终点坐标,右键取消', this.sdk)
|
||||||
@ -590,6 +593,7 @@ class RoutePlanning extends Base {
|
|||||||
let pos84 = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
let pos84 = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||||
this.endLng = pos84.lng
|
this.endLng = pos84.lng
|
||||||
this.endLat = pos84.lat
|
this.endLat = pos84.lat
|
||||||
|
func(pos84)
|
||||||
!this.endEntity &&
|
!this.endEntity &&
|
||||||
(this.endEntity = this.viewer.entities.add(
|
(this.endEntity = this.viewer.entities.add(
|
||||||
new Cesium.Entity({
|
new Cesium.Entity({
|
||||||
|
Reference in New Issue
Block a user