修改tip提示语
This commit is contained in:
@ -38,19 +38,14 @@ class CircleViewShed extends Tools {
|
||||
this.tools = new Tools(sdk)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
// CircleViewShed.edit(this)
|
||||
let terrainAvailability = this.viewer.terrainProvider.availability;
|
||||
if (!terrainAvailability) {
|
||||
this.tools.message({ type: 'warning', text: '未加载地形数据!' })
|
||||
// window.ELEMENT && window.ELEMENT.Message({
|
||||
// message: '未加载地形数据!',
|
||||
// type: 'warning',
|
||||
// duration: 1500
|
||||
// });
|
||||
return
|
||||
}
|
||||
|
||||
// CircleViewShed.create(this)
|
||||
}
|
||||
draw() {
|
||||
let terrainAvailability = this.viewer.terrainProvider.availability;
|
||||
if (!terrainAvailability) {
|
||||
return '未加载地形数据!'
|
||||
}
|
||||
CircleViewShed.create(this)
|
||||
}
|
||||
|
||||
@ -115,13 +110,7 @@ class CircleViewShed extends Tools {
|
||||
static create(that) {
|
||||
let terrainAvailability = that.viewer.terrainProvider.availability;
|
||||
if (!terrainAvailability) {
|
||||
that.tools.message({ type: 'warning', text: '未加载地形数据!' })
|
||||
// window.ELEMENT && window.ELEMENT.Message({
|
||||
// message: '未加载地形数据!',
|
||||
// type: 'warning',
|
||||
// duration: 1500
|
||||
// });
|
||||
return
|
||||
return '未加载地形数据!'
|
||||
}
|
||||
let count = 0
|
||||
if (!YJ.Measure.GetMeasureStatus()) {
|
||||
@ -129,10 +118,20 @@ class CircleViewShed extends Tools {
|
||||
that._DialogObject.close()
|
||||
that._DialogObject = null
|
||||
}
|
||||
let Draw = new YJ.Draw.DrawCircle(that.sdk)
|
||||
let Draw = new YJ.Draw.DrawCircle(that.sdk, {
|
||||
tipText: '左键单击确定中心点位置,右键单击取消区域绘制!CTRL+右键单击撤销'
|
||||
})
|
||||
Draw.start(async (a, options) => {
|
||||
// that.center = options.center
|
||||
if (!options) {
|
||||
switch (a) {
|
||||
case 0:
|
||||
Draw.tipText = '左键单击确定中心点位置,右键单击取消区域绘制!CTRL+右键单击撤销'
|
||||
break;
|
||||
case 1:
|
||||
Draw.tipText = '左键单击确定圆形视域半径,完成圆形视域分析!'
|
||||
break;
|
||||
}
|
||||
return
|
||||
}
|
||||
that.radius = options.radius
|
||||
@ -152,47 +151,47 @@ class CircleViewShed extends Tools {
|
||||
}
|
||||
}
|
||||
|
||||
static async edit(that) {
|
||||
if (that._DialogObject && that._DialogObject.close) {
|
||||
that._DialogObject.close()
|
||||
that._DialogObject = null
|
||||
}
|
||||
that._DialogObject = await new Dialog(that.sdk.viewer._container, {
|
||||
title: '圆形视域分析',
|
||||
left: '180px',
|
||||
top: '100px',
|
||||
closeCallBack: () => {
|
||||
that.Dialog.closeCallBack && that.Dialog.closeCallBack()
|
||||
YJ.Measure.SetMeasureStatus(false)
|
||||
}
|
||||
})
|
||||
await that._DialogObject.init()
|
||||
that._DialogObject._element.body.className =
|
||||
that._DialogObject._element.body.className + ' circle-view-shed'
|
||||
let contentElm = document.createElement('div')
|
||||
contentElm.innerHTML = html()
|
||||
that._DialogObject.contentAppChild(contentElm)
|
||||
// static async edit(that) {
|
||||
// if (that._DialogObject && that._DialogObject.close) {
|
||||
// that._DialogObject.close()
|
||||
// that._DialogObject = null
|
||||
// }
|
||||
// that._DialogObject = await new Dialog(that.sdk.viewer._container, {
|
||||
// title: '圆形视域分析',
|
||||
// left: '180px',
|
||||
// top: '100px',
|
||||
// closeCallBack: () => {
|
||||
// that.Dialog.closeCallBack && that.Dialog.closeCallBack()
|
||||
// YJ.Measure.SetMeasureStatus(false)
|
||||
// }
|
||||
// })
|
||||
// await that._DialogObject.init()
|
||||
// that._DialogObject._element.body.className =
|
||||
// that._DialogObject._element.body.className + ' circle-view-shed'
|
||||
// let contentElm = document.createElement('div')
|
||||
// contentElm.innerHTML = html()
|
||||
// that._DialogObject.contentAppChild(contentElm)
|
||||
|
||||
let drawElm = document.createElement('button')
|
||||
drawElm.innerHTML = '绘制'
|
||||
drawElm.addEventListener('click', () => {
|
||||
let terrainAvailability = that.viewer.terrainProvider.availability;
|
||||
if (!terrainAvailability) {
|
||||
window.ELEMENT && window.ELEMENT.Message({
|
||||
message: '未加载地形数据!',
|
||||
type: 'warning',
|
||||
duration: 1500
|
||||
});
|
||||
return
|
||||
}
|
||||
CircleViewShed.create(that)
|
||||
})
|
||||
that._DialogObject.footAppChild(drawElm)
|
||||
// let drawElm = document.createElement('button')
|
||||
// drawElm.innerHTML = '绘制'
|
||||
// drawElm.addEventListener('click', () => {
|
||||
// let terrainAvailability = that.viewer.terrainProvider.availability;
|
||||
// if (!terrainAvailability) {
|
||||
// window.ELEMENT && window.ELEMENT.Message({
|
||||
// message: '未加载地形数据!',
|
||||
// type: 'warning',
|
||||
// duration: 1500
|
||||
// });
|
||||
// return
|
||||
// }
|
||||
// CircleViewShed.create(that)
|
||||
// })
|
||||
// that._DialogObject.footAppChild(drawElm)
|
||||
|
||||
let all_elm = contentElm.getElementsByTagName('*')
|
||||
that._EventBinding.on(that, all_elm)
|
||||
that._elms = that._EventBinding.element
|
||||
}
|
||||
// let all_elm = contentElm.getElementsByTagName('*')
|
||||
// that._EventBinding.on(that, all_elm)
|
||||
// that._elms = that._EventBinding.element
|
||||
// }
|
||||
|
||||
analyse() {
|
||||
// this.destroy()
|
||||
|
||||
Reference in New Issue
Block a user