| | |
| | | this.circleLevel3OutlineEntity = null |
| | | this.isDrawing = false |
| | | this.drawStep = 0 |
| | | this.isCompleted = false |
| | | } |
| | | |
| | | start() { |
| | |
| | | this.handler.setInputAction(click => this.handleLeftClick(click), Cesium.ScreenSpaceEventType.LEFT_CLICK) |
| | | this.handler.setInputAction(movement => this.handleMouseMove(movement), Cesium.ScreenSpaceEventType.MOUSE_MOVE) |
| | | this.drawStep = 0 |
| | | this.isCompleted = false |
| | | this.tooltip.show('单击设置中心点', { x: 0, y: 0 }) |
| | | } |
| | | |
| | | handleLeftClick(click) { |
| | | if (this.isCompleted) return |
| | | const position = this.getPositionFromScreen(click.position) |
| | | if (!position) return |
| | | |
| | |
| | | this.radiusLevel3 = Math.max(radius, this.radiusLevel2) |
| | | this.isDrawing = false |
| | | this.drawStep = 0 |
| | | this.isCompleted = true |
| | | const positions = buildEllipsePositions(this.centerCartesian, this.radiusLevel3, this.radiusLevel3) |
| | | this.notify('getPolygonPositions', { |
| | | positions, |
| | |
| | | } |
| | | |
| | | handleMouseMove(movement) { |
| | | if (this.isCompleted) return |
| | | this.tooltip.move(movement.endPosition) |
| | | if (!this.isDrawing) return |
| | | const position = this.getPositionFromScreen(movement.endPosition) |
| | |
| | | this.radiusLevel3 = 0 |
| | | this.isDrawing = false |
| | | this.drawStep = 0 |
| | | this.isCompleted = false |
| | | } |
| | | } |
| | |
| | | this.semiMinor = 0 |
| | | this.isDrawing = false |
| | | this.drawStep = 0 |
| | | this.isCompleted = false |
| | | this.style = resolveStyle(options?.style) |
| | | } |
| | | |
| | |
| | | this.handler.setInputAction(click => this.handleLeftClick(click), Cesium.ScreenSpaceEventType.LEFT_CLICK) |
| | | this.handler.setInputAction(movement => this.handleMouseMove(movement), Cesium.ScreenSpaceEventType.MOUSE_MOVE) |
| | | this.drawStep = 0 |
| | | this.isCompleted = false |
| | | this.tooltip.show('单击设置中心点', { x: 0, y: 0 }) |
| | | } |
| | | |
| | | handleLeftClick(click) { |
| | | if (this.isCompleted) return |
| | | const position = this.getPositionFromScreen(click.position) |
| | | if (!position) return |
| | | if (this.drawStep === 0) { |
| | |
| | | this.semiMinor = Math.min(minorRadius, this.semiMajor) |
| | | this.isDrawing = false |
| | | this.drawStep = 0 |
| | | this.isCompleted = true |
| | | const positions = buildEllipsePositions(this.centerCartesian, this.semiMajor, this.semiMinor) |
| | | this.notify('getPolygonPositions', positions) |
| | | this.tooltip.hide() |
| | |
| | | } |
| | | |
| | | handleMouseMove(movement) { |
| | | if (this.isCompleted) return |
| | | this.tooltip.move(movement.endPosition) |
| | | if (!this.isDrawing) return |
| | | const position = this.getPositionFromScreen(movement.endPosition) |
| | |
| | | this.minorPoint = null |
| | | this.isDrawing = false |
| | | this.drawStep = 0 |
| | | this.isCompleted = false |
| | | } |
| | | } |