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.

PolylineTrailMaterialProperty.js 976B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @Author : Caven Chen
  3. */
  4. import { Cesium } from '../../../../libs'
  5. import MaterialProperty from '../../MaterialProperty'
  6. class PolylineTrailMaterialProperty extends MaterialProperty {
  7. constructor(options = {}) {
  8. super(options)
  9. }
  10. getType(time) {
  11. return Cesium.Material.PolylineTrailType
  12. }
  13. getValue(time, result) {
  14. if (!result) {
  15. result = {}
  16. }
  17. result.color = Cesium.Property.getValueOrUndefined(this._color, time)
  18. result.speed = this._speed
  19. return result
  20. }
  21. equals(other) {
  22. return (
  23. this === other ||
  24. (other instanceof PolylineTrailMaterialProperty &&
  25. Cesium.Property.equals(this._color, other._color) &&
  26. Cesium.Property.equals(this._speed, other._speed))
  27. )
  28. }
  29. }
  30. Object.defineProperties(PolylineTrailMaterialProperty.prototype, {
  31. color: Cesium.createPropertyDescriptor('color'),
  32. speed: Cesium.createPropertyDescriptor('speed'),
  33. })
  34. export default PolylineTrailMaterialProperty