| | |
| | | ind: pointIndex, // 索引记录 |
| | | }, |
| | | }) |
| | | |
| | | |
| | | } |
| | | // 清除不在范围内的点 |
| | | removeLastInvalidPoint() { |
| | |
| | | this.removeMenuPopup() |
| | | |
| | | const pickedAllEntity = this.viewer.scene.drillPick(click.position).filter(i => i.id) |
| | | const isStartPoint = pickedAllEntity.find(i => i.id.name === '起飞点') |
| | | |
| | | const isPolygonPoint = pickedAllEntity.find(i => i.id.name === DrawPolygon.ENTITY_NAMES.POINT) |
| | | const isPolygon = pickedAllEntity.find(i => i.id.name === DrawPolygon.ENTITY_NAMES.POLYGON) |
| | | |
| | | if (isStartPoint) return |
| | | |
| | | |
| | | // 如果不是绘制模式 |
| | | if (!this.drawingMode) { |
| | |
| | | } |
| | | |
| | | // 鼠标右键点击(弹出菜单) |
| | | handleRightClick(click) { |
| | | handleRightClick(click) { |
| | | console.log('click',click); |
| | | |
| | | const that = this |
| | | if (that.drawingMode) return |
| | | |
| | | that.removeMenuPopup() |
| | | |
| | | const pickedAllEntity = that.viewer.scene.drillPick(click.position).filter(i => i.id) |
| | |
| | | pickedEntity = isPolygon |
| | | tooltipEvent = that.delPolygon |
| | | menuType = 'polygon' |
| | | |
| | | } else if (isEditPoint) { |
| | | pickedEntity = isEditPoint |
| | | tooltipEvent = that.delPoint |
| | | menuType = 'edit-point' |
| | | |
| | | } |
| | | |
| | | if (pickedEntity && this.isDeleteTheArea) { |
| | |
| | | menuPopup.id = 'planarPolygonEditMenu' |
| | | menuPopup.className = 'planar-polygon-edit-menu' |
| | | |
| | | |
| | | const menuItems = |
| | | type === 'polygon' |
| | | ? [{ title: '删除测区', class: 'del-planar-polygon' }] |
| | |
| | | titleDiv.className = item.class |
| | | menuPopup.appendChild(titleDiv) |
| | | }) |
| | | |
| | | this.isPreviewMode = true |
| | | menuPopupVBox.appendChild(menuPopup) |
| | | return menuPopupVBox |
| | |
| | | initPolygon(viewer, positions, isPurePreview = false) { |
| | | this.initHandler(viewer) |
| | | this.isPureSpotPreview = isPurePreview |
| | | this.startDrawing() |
| | | // this.startDrawing() |
| | | let newPosition = positions.map(item => { |
| | | return Cesium.Cartesian3.fromDegrees(Number(item.lng), Number(item.lat), Number(item.height)) |
| | | }) |
| | |
| | | // 初始化事件处理器 |
| | | initHandler(viewer) { |
| | | this.viewer = viewer |
| | | this.startDrawing() |
| | | // this.startDrawing() |
| | | |
| | | if (!this.handler) { |
| | | this.handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas) |