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