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-01-02 16:42:03
  4. * @Last Modified by: Caven
  5. * @Last Modified time: 2020-05-11 22:06:23
  6. */
  7. import State from '../state/State'
  8. import Layer from './Layer'
  9. /**
  10. * The vector layer is used to add various enitity, which is essentially a CustomDataSource
  11. * that is used to place entities of the same class or business attribute into the same layer
  12. */
  13. class VectorLayer extends Layer {
  14. constructor(id) {
  15. super(id)
  16. this._delegate = new Cesium.CustomDataSource(id)
  17. this.type = Layer.getLayerType('vector')
  18. this._state = State.INITIALIZED
  19. }
  20. clear() {
  21. this._delegate.entities && this._delegate.entities.removeAll()
  22. this._cache = {}
  23. this._state = State.CLEARED
  24. return this
  25. }
  26. }
  27. Layer.registerType('vector')
  28. export default VectorLayer