| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | |
| | | const POINT_ENTITY_NAME = 'edit-polygon-point' |
| | |
| | | } |
| | | |
| | | handleMouseMove(movement) { |
| | | this.tooltip.show('拖动顶点编辑,右键删除点', movement.endPosition) |
| | | if (!this.tooltip?.isVisible) { |
| | | this.tooltip.show('????????????', movement.endPosition) |
| | | } else { |
| | | this.tooltip.show('????????????') |
| | | this.tooltip.move(movement.endPosition) |
| | | } |
| | | if (!this.isDragging || this.draggedIndex < 0) return |
| | | const position = this.getPositionFromScreen(movement.endPosition) |
| | | if (!position) return |
| | |
| | | createEntities() { |
| | | this.polygonEntity = this.dataSource.entities.add({ |
| | | polygon: { |
| | | hierarchy: new Cesium.CallbackProperty( |
| | | () => new Cesium.PolygonHierarchy(this.positions), |
| | | false |
| | | ), |
| | | hierarchy: new Cesium.CallbackProperty(() => new Cesium.PolygonHierarchy(this.positions), false), |
| | | material: this.style.fill, |
| | | outline: false, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |