You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * @Author: Caven
  3. * @Date: 2020-08-30 23:46:07
  4. */
  5. import { Cesium } from '../../../namespace'
  6. import Edit from './Edit'
  7. import AttackArrowGraphics from '../graphics/AttackArrowGraphics'
  8. class EditAttackArrow extends Edit {
  9. constructor(overlay) {
  10. super(overlay)
  11. this._graphics = new AttackArrowGraphics()
  12. }
  13. /**
  14. *
  15. * @private
  16. */
  17. _mountedHook() {
  18. this._delegate.polygon.hierarchy = new Cesium.CallbackProperty(() => {
  19. if (this._positions.length > 2) {
  20. this._graphics.positions = this._positions
  21. return this._graphics.hierarchy
  22. } else {
  23. return null
  24. }
  25. }, false)
  26. this._layer.entities.add(this._delegate)
  27. }
  28. }
  29. export default EditAttackArrow