@vesium/plot 1.0.1-beta.68 → 1.0.1-beta.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -251,7 +251,7 @@ var SampledPlotProperty = class SampledPlotProperty {
251
251
  * @param value 样本数据对象,包含时间、位置和导数信息
252
252
  */
253
253
  setSample(value) {
254
- const time = value.time?.clone() ?? this._times[0].clone();
254
+ const time = value.time?.clone() ?? this._times[0]?.clone() ?? new JulianDate(0, 0);
255
255
  const positions = value.positions?.map((item) => item.clone()) ?? [];
256
256
  const derivative = value.derivative;
257
257
  const index = this._times.findIndex((t) => JulianDate.equals(time, t));
@@ -330,10 +330,11 @@ var PlotFeature = class {
330
330
  this._id = id || createGuid();
331
331
  this._scheme = PlotScheme.resolve(options.scheme);
332
332
  this._definitionChanged = new Event();
333
- this._defining = true;
334
333
  this._disabled = disabled;
335
334
  this._sampled = sampled instanceof SampledPlotProperty ? sampled : new SampledPlotProperty(sampled);
336
335
  this._sampled.definitionChanged.addEventListener((property) => this._definitionChanged.raiseEvent(this, "sampled", property, property), this);
336
+ const packable = this._sampled.getValue();
337
+ this._defining = !(packable.positions && packable.positions.length > 0);
337
338
  const init = this._scheme.initRender?.() ?? {};
338
339
  this._entities = [...init.entities ?? []];
339
340
  this._primitives = [...init.primitives ?? []];
@@ -391,7 +392,10 @@ var PlotFeature = class {
391
392
  return this._disabled;
392
393
  }
393
394
  set disabled(value) {
394
- this.disabled = value;
395
+ if (this._disabled !== value) {
396
+ this._definitionChanged.raiseEvent(this, "disabled", value, this._disabled);
397
+ this._disabled = value;
398
+ }
395
399
  }
396
400
  /**
397
401
  * @internal