Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

PolylineFlowMaterialProperty.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * @Author: Caven
  3. * @Date: 2020-02-24 13:53:52
  4. */
  5. import MaterialProperty from '../../MaterialProperty'
  6. const { Cesium } = DC.Namespace
  7. class PolylineFlowMaterialProperty extends MaterialProperty {
  8. constructor(options = {}) {
  9. super(options)
  10. this._percent = undefined
  11. this._percentSubscription = undefined
  12. this._gradient = undefined
  13. this._gradientSubscription = undefined
  14. this.percent = options.percent || 0.03
  15. this.gradient = options.gradient || 0.1
  16. }
  17. getType(time) {
  18. return Cesium.Material.PolylineFlowType
  19. }
  20. getValue(time, result) {
  21. if (!result) {
  22. result = {}
  23. }
  24. result.color = Cesium.Property.getValueOrUndefined(this._color, time)
  25. result.speed = this._speed
  26. result.percent = this._percent
  27. result.gradient = this._gradient
  28. return result
  29. }
  30. equals(other) {
  31. return (
  32. this === other ||
  33. (other instanceof PolylineFlowMaterialProperty &&
  34. Cesium.Property.equals(this._color, other._color) &&
  35. Cesium.Property.equals(this._speed, other._speed) &&
  36. Cesium.Property.equals(this._percent, other._percent) &&
  37. Cesium.Property.equals(this._gradient, other._gradient))
  38. )
  39. }
  40. }
  41. Object.defineProperties(PolylineFlowMaterialProperty.prototype, {
  42. color: Cesium.createPropertyDescriptor('color'),
  43. speed: Cesium.createPropertyDescriptor('speed'),
  44. percent: Cesium.createPropertyDescriptor('percent'),
  45. gradient: Cesium.createPropertyDescriptor('gradient')
  46. })
  47. export default PolylineFlowMaterialProperty