| | |
| | | name: '通视分析', |
| | | classs: 'throughSee-tool', |
| | | img: './images/addL/pdpx.png' |
| | | }, |
| | | {//平面裁剪 |
| | | name: '平面裁剪', |
| | | classs: 'clippingPlanes-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | ]; |
| | | |
| | |
| | | name: '通视分析', |
| | | classs: 'throughSee-tool', |
| | | img: './images/addL/pdpx.png' |
| | | }, |
| | | {//平面裁剪 |
| | | name: '平面裁剪', |
| | | classs: 'clippingPlanes-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | , |
| | | {//建造模型 |
| | |
| | | }) |
| | | |
| | | }, |
| | | promise: 'NODATA', |
| | | beginSpatialAnalysis: function (domHtmls) { |
| | | var that = this; |
| | | var domHtmls = domHtmls; |
| | |
| | | topic.publish('beginthroughSee', 'beginthroughSee'); |
| | | }) |
| | | |
| | | //平面裁剪 |
| | | $('.clippingPlanes-tool').click(function () { |
| | | that.closeOnceUse(); |
| | | // console.log(that.promise, 22222222222) |
| | | if (that.promise == 'NODATA') { |
| | | layer.tips('请选择三维倾斜数据中的图层支持!', '.SelectLayerTool', { |
| | | tips: [3, 'red'] |
| | | }); |
| | | } else { |
| | | $(".jimu-widget-clippingPlanes").show(); |
| | | topic.publish('beginclippingPlanes', that.promise); |
| | | } |
| | | }) |
| | | |
| | | $('.SelectLayerTool').click(() => { |
| | | $('#SelectLayerToolItem').toggle(); |
| | |
| | | this.liClick('默认:天地图影像', '默认:天地图影像'); |
| | | |
| | | }, |
| | | liClick: function (itemid, name) {//点击事件 |
| | | morenliClick: (itemid, name) => { |
| | | var dom = $('.SelectLayerTool'); |
| | | dom.empty(); |
| | | var str = `${name} <i class="layui-icon layui-icon-down layui-font-12"></i>` |
| | | dom.append(str); |
| | | // console.log('数据错误默认') |
| | | this.promise = 'NODATA'; |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | }, |
| | | liClick: function (itemid, name, ourdata = 1) {//点击事件 |
| | | var that = this; |
| | | var liList = $(`[itemid='${itemid}s']`); |
| | | // console.log(liList); |
| | | liList.click(() => { |
| | |
| | | dom.append(str); |
| | | dom.attr("title", name); |
| | | $('#SelectLayerToolItem').hide(); |
| | | // console.log(ourdata); |
| | | // 定位 |
| | | // console.log(name) |
| | | 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)) |
| | | }); |
| | | } |
| | | if (ourdata.src.indexOf('.openrealspace') != -1) { |
| | | // console.log('数据正确'); |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | that.promise = { |
| | | src: ourdata.src, |
| | | name: ourdata.serviceName |
| | | }; |
| | | |
| | | } else { |
| | | // console.log('数据错误'); |
| | | that.promise = 'NODATA'; |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | } |
| | | } else { |
| | | // console.log('数据错误没有data'); |
| | | that.promise = 'NODATA'; |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | appendItemS: function (item, obj, layer) { |
| | |
| | | |
| | | $("#SelectLayerToolItemTitle").append(liItem); |
| | | } |
| | | that.liClick(obj.id, obj.title); |
| | | that.liClick(obj.id, obj.title, obj); |
| | | } |
| | | }, |
| | | removeItemS: function (item, obj) { |
| | | console.log(obj, 'r1') |
| | | // console.log(obj, 'r1') |
| | | var that = this; |
| | | if (item == this.name) { |
| | | var liList = $("#SelectLayerToolItemTitle li"); |
| | | for (var i = 0; i < liList.length; i++) { |
| | | if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id + 's') { |
| | | $(liList[i]).remove(); |
| | | var dom = $('.SelectLayerTool').attr("title"); |
| | | console.log(dom == obj.title, this.liClick) |
| | | // console.log(dom == obj.title, this.liClick) |
| | | if (dom == obj.title) { |
| | | this.liClick('默认:天地图影像', '默认:天地图影像'); |
| | | that.morenliClick('默认:天地图影像', '默认:天地图影像'); |
| | | that.promise = 'NODATA'; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | $("#SelectLayerToolItemTitle").append(liItem); |
| | | } |
| | | that.liClick(obj.id, obj.title); |
| | | that.liClick(obj.id, obj.title, obj); |
| | | } |
| | | }, |
| | | removeTiltS: function (item, obj) { |
| | | console.log(obj, 'r2') |
| | | // console.log(obj, 'r2') |
| | | // console.log('r2') |
| | | var that = this; |
| | | if (item == this.name) { |
| | | var liList = $("#SelectLayerToolItemTitle li"); |
| | | for (var i = 0; i < liList.length; i++) { |
| | |
| | | $(liList[i]).remove(); |
| | | var dom = $('.SelectLayerTool').attr("title"); |
| | | if (dom == obj.title) { |
| | | this.liClick('默认:天地图影像', '默认:天地图影像'); |
| | | that.morenliClick('默认:天地图影像', '默认:天地图影像'); |
| | | that.promise = 'NODATA'; |
| | | } |
| | | } |
| | | } |
| | |
| | | //关闭通视分析 |
| | | if ($(".jimu-widget-throughSee").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-throughSee").hide(); |
| | | // topic.publish('closesthroughSee'); |
| | | topic.publish('closesthroughSee'); |
| | | } |
| | | //关闭平面裁剪 |
| | | if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-clippingPlanes").hide(); |
| | | topic.publish('closesclippingPlanes'); |
| | | } |
| | | |
| | | }, |