| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /**
- * @Author: Caven
- * @Date: 2020-08-30 22:04:36
- */
-
- import { Cesium } from '@dc-modules/namespace'
- import { Transform } from '@dc-modules/transform'
- import Edit from './Edit'
-
- class EditBillboard extends Edit {
- constructor(overlay) {
- super(overlay)
- this._position = undefined
- }
-
- /**
- *
- * @private
- */
- _mountedHook() {
- this.editTool.tooltipMess = '右击结束编辑'
- this._position = this._delegate.position.getValue(Cesium.JulianDate.now())
- this._delegate.position = new Cesium.CallbackProperty(() => {
- return this._position
- })
- this._layer.entities.add(this._delegate)
- }
-
- /**
- *
- * @private
- */
- _stopedHook() {
- this._overlay.position = Transform.transformCartesianToWGS84(this._position)
- this._overlay.show = true
- this._options.onEditStop && this._options.onEditStop(this._overlay)
- }
-
- /**
- *
- * @param pickedAnchor
- * @param position
- * @private
- */
- _onAnchorMoving({ pickedAnchor, position }) {
- this._position = position
- }
- }
-
- export default EditBillboard
|