| | |
| | | ind: '', |
| | | startup: function startup() { |
| | | topic.subscribe("openSign", lang.hitch(this, this.onOpenSign)); |
| | | topic.subscribe("closeSign", lang.hitch(this, this.onCloseSign)); |
| | | |
| | | // var fileNames = '我的标记点'; |
| | | var that = this; |
| | | var scene = that.map.scene; |
| | |
| | | // 监听鼠标移动 |
| | | handlers.setInputAction(function (moveEvent) { |
| | | // 点击完成绘制 |
| | | $('.danji').css({ 'display': 'block', 'left': moveEvent.startPosition.x + 10 + 'px', 'top': moveEvent.startPosition.y + 10 + 'px' }); |
| | | $('.danji').css({ |
| | | 'display': 'block', |
| | | 'left': moveEvent.startPosition.x + 10 + 'px', |
| | | 'top': moveEvent.startPosition.y + 10 + 'px' |
| | | }); |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | // 监听鼠标点击 |
| | | handlers.setInputAction(function (clickEvent) { |
| | |
| | | $('.sign-tian-hang-textarea').val(''); |
| | | $('.sign-tian').show(); |
| | | |
| | | $('.sign-tian').css({ 'left': clickEvent.position.x - $('.sign-tian').innerWidth() / 2 + 'px', 'top': clickEvent.position.y - 300 + 'px' }); |
| | | $('.sign-tian').css({ |
| | | 'left': clickEvent.position.x - $('.sign-tian').innerWidth() / 2 + 'px', |
| | | 'top': clickEvent.position.y - 300 + 'px' |
| | | }); |
| | | if (that.toggle && $('.sign-tian').css('display', 'block')) { |
| | | that.map.scene.postRender.addEventListener(moveDom); |
| | | that.toggle = false; |
| | |
| | | that.arrQsrbz.push(datas[i].describe); |
| | | that.Dzbx = datas[i].x; |
| | | that.Dzby = datas[i].y; |
| | | that.fileArr.push({ x: datas[i].x, y: datas[i].y, z: datas[i].z }); |
| | | that.fileArr.push({ |
| | | x: datas[i].x, |
| | | y: datas[i].y, |
| | | z: datas[i].z |
| | | }); |
| | | addPoint(that.fileArr[i], datas[i].shuzi + date); |
| | | |
| | | window.localStorage.setItem('BJD', JSON.stringify(that.fileArr)); |
| | |
| | | that.Dname.push(datas[i].name); |
| | | that.Dzbx = datas[i].x; |
| | | that.Dzby = datas[i].y; |
| | | that.fileArr.push({ x: datas[i].x, y: datas[i].y, z: datas[i].z }); |
| | | addPoint({ x: datas[i].x, y: datas[i].y, z: datas[i].z }, datas[i].shuzi + date); |
| | | that.fileArr.push({ |
| | | x: datas[i].x, |
| | | y: datas[i].y, |
| | | z: datas[i].z |
| | | }); |
| | | addPoint({ |
| | | x: datas[i].x, |
| | | y: datas[i].y, |
| | | z: datas[i].z |
| | | }, datas[i].shuzi + date); |
| | | |
| | | window.localStorage.setItem('BJD', JSON.stringify(that.fileArr)); |
| | | window.localStorage.setItem('BJDarr', JSON.stringify(that.arr)); |
| | |
| | | var a = Cesium.Cartesian3.fromDegrees(lng, lat, 200); |
| | | |
| | | var px_position = Cesium.SceneTransforms.wgs84ToWindowCoordinates(that.map.scene, a); |
| | | $('.sign-tian').css({ 'left': px_position.x - $('.sign-tian').innerWidth() / 2 + 'px', 'top': px_position.y - 310 + 'px' }); |
| | | $('.sign-tian').css({ |
| | | 'left': px_position.x - $('.sign-tian').innerWidth() / 2 + 'px', |
| | | 'top': px_position.y - 310 + 'px' |
| | | }); |
| | | } |
| | | } |
| | | |
| | |
| | | that.map.scene.postRender.addEventListener(moveDom); |
| | | $('.sign-tian-hang-textarea').val(''); |
| | | $('.sign-tian').show(); |
| | | $('.sign-tian').css({ 'left': movement.position.x - $('.sign-tian').innerWidth() / 2 + 'px', 'top': movement.position.y - 300 + 'px' }); |
| | | $('.sign-tian').css({ |
| | | 'left': movement.position.x - $('.sign-tian').innerWidth() / 2 + 'px', |
| | | 'top': movement.position.y - 300 + 'px' |
| | | }); |
| | | $('.sign_im_text').val($($('.wdbj')[i]).find('input').val()).attr('entityid', pick.id.id); |
| | | $('.sign-tian-hang-textarea').val(that.arrQsrbz[i]); |
| | | // 拖动该定位图标 |
| | |
| | | var leftDownFlag = false; |
| | | var pointDraged = null; |
| | | var viewer; |
| | | |
| | | function ConstructMoveEntity(options) { |
| | | viewer = options.viewer; |
| | | Init(); |
| | | } |
| | | |
| | | function Init() { |
| | | // Select plane when mouse down 鼠标按下事件 |
| | | that.entityAll = handler.setInputAction(function (movement) { |
| | |
| | | if (pick.id.id) { |
| | | if (pick.id.id == $($('.wdbj')[that.ind]).find('input').attr('entitydataid')) { |
| | | $('.dragEdit').stop().show(); |
| | | $('.dragEdit').css({ 'left': movement.endPosition.x + 10 + 'px', 'top': movement.endPosition.y + 10 + 'px' }); |
| | | $('.dragEdit').css({ |
| | | 'left': movement.endPosition.x + 10 + 'px', |
| | | 'top': movement.endPosition.y + 10 + 'px' |
| | | }); |
| | | } |
| | | } |
| | | } else { |
| | |
| | | if (leftDownFlag === true && pointDraged != null) { |
| | | $('.dragEdit').stop().hide(); |
| | | $('.modifyEdit').stop().show(); |
| | | $('.modifyEdit').css({ 'left': movement.endPosition.x + 10 + 'px', 'top': movement.endPosition.y + 10 + 'px' }); |
| | | $('.modifyEdit').css({ |
| | | 'left': movement.endPosition.x + 10 + 'px', |
| | | 'top': movement.endPosition.y + 10 + 'px' |
| | | }); |
| | | for (var j = 0; j < that.arr.length; j++) { |
| | | if (pointDraged.id.id == $($('.wdbj')[j]).find('input').attr('entitydataid')) { |
| | | var _ray = viewer.camera.getPickRay(movement.endPosition); |
| | |
| | | }; |
| | | return ConstructMoveEntity; |
| | | }(); |
| | | var moveTool = MoveEntity({ 'viewer': that.map }); |
| | | var moveTool = MoveEntity({ |
| | | 'viewer': that.map |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (pick && pick.id) { |
| | | if (pick.id.id) { |
| | | $('.actEdit').stop().show(); |
| | | $('.actEdit').css({ 'left': moveEvent.endPosition.x + 10 + 'px', 'top': moveEvent.endPosition.y + 10 + 'px' }); |
| | | $('.actEdit').css({ |
| | | 'left': moveEvent.endPosition.x + 10 + 'px', |
| | | 'top': moveEvent.endPosition.y + 10 + 'px' |
| | | }); |
| | | } |
| | | } else { |
| | | $('.actEdit').stop().hide(); |
| | |
| | | if (item == this.name) { |
| | | this.flag = true; |
| | | this.onOpen(); |
| | | $('.jimu-widget-Sign').show(); |
| | | |
| | | } |
| | | }, |
| | | |
| | | onCloseSign: function (item) { |
| | | var that = this; |
| | | if (item == this.name && this.flag == true) { |
| | | this.flag = false; |
| | | $('.jimu-widget-Sign').hide(); |
| | | for (var i = 0; i < that.arr.length; i++) { |
| | | // if ($(this).parent().parent().next().find('.wdbj-shanchu')[i].className == 'wdbj-shanchu') { |
| | | that.map.entities.removeById(that.arr[i]); |
| | | $(this).parents('.sign-head').next().find('.wdbj').remove(); |
| | | that.arrDingWei = []; |
| | | $($(this).parent().parent().next().find('.wdbj-shanchu').parent()[i]).remove(); |
| | | // } |
| | | } |
| | | if ($('.wdbj-shanchu').length == 0) { |
| | | $('.sign-content-my').show(); |
| | | } |
| | | that.onClose(); |
| | | } |
| | | }, |
| | | |
| | |
| | | window.localStorage.setItem('BJDarr', JSON.stringify(that.arr)); |
| | | if ($('.wdbj').length > 0) { |
| | | $('.sign-content-my').hide(); |
| | | } |
| | | ; |
| | | }; |
| | | } |
| | | }, |
| | | |
| | |
| | | } |
| | | |
| | | }); |
| | | }); |
| | | }); |