UNPKG

vue-cesium

Version:
48 lines (43 loc) 1.99 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var util = require('../../../utils/util.js'); var VcBaseMaterialProperty = require('./VcBaseMaterialProperty.js'); "use strict"; class VcLineTrailMaterialProperty extends VcBaseMaterialProperty["default"] { constructor(options = {}) { var _a, _b, _c, _d, _e, _f, _g; super(options); const { Color, Cartesian2, defined } = Cesium; this.image = (_a = options.image) != null ? _a : options.url; this.color = (_b = options.color) != null ? _b : new Color(1, 0, 0, 1); this.axisY = (_c = options.axisY) != null ? _c : false; this.time = (_d = options.time) != null ? _d : 0; this.repeat = (_e = options.repeat) != null ? _e : new Cartesian2(1, 1); this.loop = (_f = options.loop) != null ? _f : true; this.duration = (_g = options.duration) != null ? _g : 3; this._time = (/* @__PURE__ */ new Date()).getTime(); } getType(value) { return "VcLineTrail"; } getValue(time, result) { const { Color, Cartesian2, defined } = Cesium; !defined(result) && (result = {}); if (this.lastTime >= 0.99 && !this.loop) { return result; } result.image = this.image; result.color = util.getCesiumColor(this.color, new Color(1, 1, 1, 0), time); result.repeat = util.getCesiumValue(this.repeat, Cartesian2, time); result.axisY = this.axisY; result.time = ((/* @__PURE__ */ new Date()).getTime() - this._time) % this.duration / this.duration; this.lastTime = result.time; return result; } equals(other) { const reData = this === other || other instanceof VcLineTrailMaterialProperty && Cesium.Property["equals"](this.color, other.color) && Cesium.Property["equals"](this.repeat, other.repeat) && this.image === other.image && this.axisY === other.axisY && this.duration === other.duration; return reData; } } exports["default"] = VcLineTrailMaterialProperty; //# sourceMappingURL=VcLineTrailMaterialProperty.js.map