| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | |
| | | const POINT_ENTITY_NAME = 'draw-polygon-point' |
| | |
| | | this.handler.setInputAction(click => this.handleRightClick(click), Cesium.ScreenSpaceEventType.RIGHT_CLICK) |
| | | this.handler.setInputAction(movement => this.handleMouseMove(movement), Cesium.ScreenSpaceEventType.MOUSE_MOVE) |
| | | this.isDrawing = true |
| | | this.tooltip.show(this.getTipText(), { x: 0, y: 0 }) |
| | | this.tooltip.hide() |
| | | } |
| | | |
| | | handleLeftClick(click) { |
| | |
| | | |
| | | this.polygonEntity = this.dataSource.entities.add({ |
| | | polygon: { |
| | | hierarchy: new Cesium.CallbackProperty( |
| | | () => new Cesium.PolygonHierarchy(getPreviewPositions()), |
| | | false |
| | | ), |
| | | hierarchy: new Cesium.CallbackProperty(() => new Cesium.PolygonHierarchy(getPreviewPositions()), false), |
| | | material: this.style.fill, |
| | | outline: false, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |