| | |
| | | name: '平面裁剪', |
| | | classs: 'clippingPlanes-tool', |
| | | img: './images/addL/pingmian.png' |
| | | }, |
| | | {//BOX裁剪 |
| | | name: 'BOX裁剪', |
| | | classs: 'BOXTailoring-tool', |
| | | img: './images/addL/pingmian.png' |
| | | } |
| | | ]; |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | //BOX裁剪 |
| | | $('.BOXTailoring-tool').click(function () { |
| | | that.closeOnceUse(); |
| | | |
| | | if (that.promise == 'NODATA') { |
| | | layer.tips('请选择三维倾斜数据中的图层支持!', '.SelectLayerTool', { |
| | | tips: [3, 'red'] |
| | | }); |
| | | } else { |
| | | $(".jimu-widget-BOXTailoring").show(); |
| | | topic.publish('beginBOXTailoring', that.promise); |
| | | } |
| | | }) |
| | | |
| | | $('.SelectLayerTool').click(() => { |
| | | $('#SelectLayerToolItem').toggle(); |
| | | }) |
| | |
| | | dom.append(str); |
| | | // console.log('数据错误默认') |
| | | this.promise = 'NODATA'; |
| | | this.SelectClose();//关闭需要三维数据的窗口 |
| | | }, |
| | | SelectClose: function () { |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | |
| | | //关闭BOX裁剪 |
| | | if ($(".jimu-widget-BOXTailoring").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-BOXTailoring").hide(); |
| | | topic.publish('closesBOXTailoring'); |
| | | } |
| | | }, |
| | | liClick: function (itemid, name, ourdata = 1) {//点击事件 |
| | |
| | | if (ourdata != 1) { |
| | | // console.log('data') |
| | | if (ourdata.lon) { |
| | | that.map.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(ourdata.lon), Number(ourdata.lat), Number(ourdata.height * 50)) |
| | | //设置相机位置、视角,便于观察场景 |
| | | that.map.scene.camera.setView({ |
| | | destination: new Cesium.Cartesian3.fromDegrees(Number(ourdata.lon), Number(ourdata.lat), Number(ourdata.height)), |
| | | orientation: { |
| | | heading: Cesium.Math.toRadians(Number(ourdata.yawAngle)), |
| | | pitch: Cesium.Math.toRadians(Number(ourdata.pitchAngle)), |
| | | roll: Cesium.Math.toRadians(Number(ourdata.rollAngle)) |
| | | } |
| | | }); |
| | | } |
| | | if (ourdata.src.indexOf('.openrealspace') != -1) { |
| | | // console.log('数据正确'); |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | this.SelectClose();//关闭需要三维数据的窗口 |
| | | that.promise = { |
| | | src: ourdata.src, |
| | | name: ourdata.serviceName |
| | | ZName: ourdata.title, |
| | | name: ourdata.serviceName, |
| | | id: ourdata.id |
| | | }; |
| | | |
| | | } else { |
| | | // console.log('数据错误'); |
| | | that.promise = 'NODATA'; |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | this.SelectClose();//关闭需要三维数据的窗口 |
| | | } |
| | | } else { |
| | | // console.log('数据错误没有data'); |
| | | that.promise = 'NODATA'; |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | this.SelectClose();//关闭需要三维数据的窗口 |
| | | } |
| | | |
| | | }) |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // beginRool: function (data) { |
| | | // //选择图层Layui |
| | | // layui.use(['dropdown', 'util', 'layer', 'table'], function () { |
| | | // var dropdown = layui.dropdown |
| | | // , layer = layui.layer; |
| | | // dropdown.render({ |
| | | // elem: '.SelectLayerTool' |
| | | // , data: data |
| | | // , click: function (obj) { |
| | | // layer.tips('选择了:' + obj.title, this.elem, { tips: [1, '#5FB878'] }); |
| | | // var dom = $('.SelectLayerTool'); |
| | | // dom.empty(); |
| | | // var str = `${obj.title} <i class="layui-icon layui-icon-down layui-font-12"></i>` |
| | | // dom.append(str); |
| | | // } |
| | | // }); |
| | | // }); |
| | | // }, |
| | | closeToolBox: function (item) { |
| | | if (item != this.name) { |
| | | $('.tool-y-box').hide(); |
| | |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | |
| | | //关闭BOX裁剪 |
| | | if ($(".jimu-widget-BOXTailoring").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-BOXTailoring").hide(); |
| | | topic.publish('closesBOXTailoring'); |
| | | } |
| | | |
| | | }, |
| | | onOpen: function () { |
| | | }, |