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.

PolylineLightingTrailMaterialProperty.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * @Author: Caven
  3. * @Date: 2021-01-13 20:52:47
  4. */
  5. import { Cesium } from '@dc-modules/namespace'
  6. import MaterialProperty from '../../MaterialProperty'
  7. const IMG = require('@dc-modules/images/lighting.png')
  8. class PolylineLightingTrailMaterialProperty extends MaterialProperty {
  9. constructor(options = {}) {
  10. super(options)
  11. this._image = undefined
  12. this._imageSubscription = undefined
  13. this.image = IMG
  14. }
  15. getType(time) {
  16. return Cesium.Material.PolylineLightingTrailType
  17. }
  18. getValue(time, result) {
  19. if (!result) {
  20. result = {}
  21. }
  22. result.color = Cesium.Property.getValueOrUndefined(this._color, time)
  23. result.image = Cesium.Property.getValueOrUndefined(this._image, time)
  24. result.speed = this._speed
  25. return result
  26. }
  27. equals(other) {
  28. return (
  29. this === other ||
  30. (other instanceof PolylineLightingTrailMaterialProperty &&
  31. Cesium.Property.equals(this._color, other._color) &&
  32. Cesium.Property.equals(this._speed, other._speed))
  33. )
  34. }
  35. }
  36. Object.defineProperties(PolylineLightingTrailMaterialProperty.prototype, {
  37. color: Cesium.createPropertyDescriptor('color'),
  38. speed: Cesium.createPropertyDescriptor('speed'),
  39. image: Cesium.createPropertyDescriptor('image')
  40. })
  41. export default PolylineLightingTrailMaterialProperty