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

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.cjs CHANGED
@@ -113,11 +113,11 @@ var PlotScheme = class PlotScheme {
113
113
 
114
114
  //#endregion
115
115
  //#region usePlot/SampledPlotProperty.ts
116
- let SampledPlotStrategy = /* @__PURE__ */ function(SampledPlotStrategy$1) {
117
- SampledPlotStrategy$1[SampledPlotStrategy$1["NEAR"] = 0] = "NEAR";
118
- SampledPlotStrategy$1[SampledPlotStrategy$1["CYCLE"] = 1] = "CYCLE";
119
- SampledPlotStrategy$1[SampledPlotStrategy$1["STRICT"] = 2] = "STRICT";
120
- return SampledPlotStrategy$1;
116
+ let SampledPlotStrategy = /* @__PURE__ */ function(SampledPlotStrategy) {
117
+ SampledPlotStrategy[SampledPlotStrategy["NEAR"] = 0] = "NEAR";
118
+ SampledPlotStrategy[SampledPlotStrategy["CYCLE"] = 1] = "CYCLE";
119
+ SampledPlotStrategy[SampledPlotStrategy["STRICT"] = 2] = "STRICT";
120
+ return SampledPlotStrategy;
121
121
  }({});
122
122
  /**
123
123
  * 默认插值算法
@@ -333,10 +333,10 @@ var SampledPlotProperty = class SampledPlotProperty {
333
333
  *
334
334
  * @param interval 要移除样本的时间间隔
335
335
  */
336
- removeSamples(interval$1) {
336
+ removeSamples(interval) {
337
337
  for (let i = 0; i < this._times.length; i++) {
338
338
  const time = this._times[i];
339
- cesium.TimeInterval.contains(interval$1, time) && this.removeSample(time);
339
+ cesium.TimeInterval.contains(interval, time) && this.removeSample(time);
340
340
  }
341
341
  }
342
342
  /**
@@ -491,11 +491,11 @@ var PlotFeature = class {
491
491
  * - HOVER 悬停状态
492
492
  * - ACTIVE 激活状态
493
493
  */
494
- let PlotAction = /* @__PURE__ */ function(PlotAction$1) {
495
- PlotAction$1[PlotAction$1["IDLE"] = 0] = "IDLE";
496
- PlotAction$1[PlotAction$1["HOVER"] = 1] = "HOVER";
497
- PlotAction$1[PlotAction$1["ACTIVE"] = 2] = "ACTIVE";
498
- return PlotAction$1;
494
+ let PlotAction = /* @__PURE__ */ function(PlotAction) {
495
+ PlotAction[PlotAction["IDLE"] = 0] = "IDLE";
496
+ PlotAction[PlotAction["HOVER"] = 1] = "HOVER";
497
+ PlotAction[PlotAction["ACTIVE"] = 2] = "ACTIVE";
498
+ return PlotAction;
499
499
  }({});
500
500
  /**
501
501
  * 标绘框架点 Entity
@@ -847,8 +847,8 @@ function usePlot(options) {
847
847
  (0, vue.watch)(current, (plot, previous) => {
848
848
  if (previous) {
849
849
  if (previous.defining) {
850
- const packable$1 = previous.sampled.getValue(getCurrentTime());
851
- if (previous.scheme.allowManualComplete?.(packable$1)) {
850
+ const packable = previous.sampled.getValue(getCurrentTime());
851
+ if (previous.scheme.allowManualComplete?.(packable)) {
852
852
  PlotFeature.setDefining(previous, false);
853
853
  operateResolve?.(previous);
854
854
  } else collection.delete(previous);
@@ -932,9 +932,9 @@ function control() {
932
932
  const newHeading = (viewer.camera.heading + headingAdjust) % (2 * Math.PI);
933
933
  const positions = [...packable.positions ?? []];
934
934
  const cartographic = (0, vesium.toCartographic)(positions[index]);
935
- const distance$1 = height / 1e5 * Math.PI / 180 / 1e3;
936
- cartographic.latitude += distance$1 * Math.cos(newHeading);
937
- cartographic.longitude += distance$1 * Math.sin(newHeading);
935
+ const distance = height / 1e5 * Math.PI / 180 / 1e3;
936
+ cartographic.latitude += distance * Math.cos(newHeading);
937
+ cartographic.longitude += distance * Math.sin(newHeading);
938
938
  positions[index] = (0, vesium.toCartesian3)(cartographic);
939
939
  sampled.setSample({
940
940
  time: packable.time,
@@ -1345,9 +1345,9 @@ async function distance(positions, options) {
1345
1345
  positions.forEach((position, index) => {
1346
1346
  if (index !== positions.length - 1) {
1347
1347
  const next = positions[index + 1];
1348
- const distance$1 = cesium.Cartesian3.distance(position, next);
1349
- stages.push(distance$1);
1350
- count += distance$1;
1348
+ const distance = cesium.Cartesian3.distance(position, next);
1349
+ stages.push(distance);
1350
+ count += distance;
1351
1351
  }
1352
1352
  });
1353
1353
  if (!_options.clampToGround) return {
@@ -1359,27 +1359,27 @@ async function distance(positions, options) {
1359
1359
  const densities = stages.map((stage) => {
1360
1360
  return Math.floor(stage / count * density);
1361
1361
  });
1362
- const diff = density - densities.reduce((count$1, current) => count$1 += current, 0);
1362
+ const diff = density - densities.reduce((count, current) => count += current, 0);
1363
1363
  if (diff) densities[densities.length - 1] += diff;
1364
- const positionListPromises = densities.map((density$1, i) => {
1364
+ const positionListPromises = densities.map((density, i) => {
1365
1365
  return lerpArray({
1366
1366
  scene: _options.scene,
1367
1367
  start: positions[i],
1368
1368
  end: positions[i + 1],
1369
- count: density$1,
1369
+ count: density,
1370
1370
  clampToGround: true,
1371
1371
  classificationType: _options.classificationType,
1372
1372
  terrainProvider: _options.terrainProvider
1373
1373
  });
1374
1374
  });
1375
- const stagePromises = (await Promise.all(positionListPromises)).map(async (positions$1) => {
1376
- const { count: count$1 } = await distance(positions$1);
1377
- return count$1;
1375
+ const stagePromises = (await Promise.all(positionListPromises)).map(async (positions) => {
1376
+ const { count } = await distance(positions);
1377
+ return count;
1378
1378
  });
1379
1379
  const groundStages = await Promise.all(stagePromises);
1380
1380
  return {
1381
1381
  stages: groundStages,
1382
- count: groundStages.reduce((count$1, current) => count$1 += current, 0)
1382
+ count: groundStages.reduce((count, current) => count += current, 0)
1383
1383
  };
1384
1384
  }
1385
1385