vesium 1.0.1-beta.47 → 1.0.1-beta.49

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
@@ -50,6 +50,37 @@ function createViewer(...args) {
50
50
  return ((_a = viewer.value) == null ? void 0 : _a.isDestroyed()) ? void 0 : viewer.value;
51
51
  });
52
52
  }
53
+ function arrayDiff(list, oldList) {
54
+ const oldListSet = new Set(oldList);
55
+ const added = list.filter((obj) => !oldListSet.has(obj));
56
+ const newListSet = new Set(list);
57
+ const removed = (oldList == null ? void 0 : oldList.filter((obj) => !newListSet.has(obj))) ?? [];
58
+ return { added, removed };
59
+ }
60
+ function canvasCoordToCartesian(canvasCoord, scene, mode = "auto") {
61
+ if (mode === "pickPosition") {
62
+ return scene.pickPosition(canvasCoord);
63
+ } else if (mode === "globePick") {
64
+ const ray = scene.camera.getPickRay(canvasCoord);
65
+ return ray && scene.globe.pick(ray, scene);
66
+ } else {
67
+ if (scene.globe.depthTestAgainstTerrain) {
68
+ return scene.pickPosition(canvasCoord);
69
+ }
70
+ const position1 = scene.pickPosition(canvasCoord);
71
+ const ray = scene.camera.getPickRay(canvasCoord);
72
+ const position2 = ray && scene.globe.pick(ray, scene);
73
+ if (!position1) {
74
+ return position2;
75
+ }
76
+ const height1 = (position1 && cesium.Ellipsoid.WGS84.cartesianToCartographic(position1).height) ?? 0;
77
+ const height2 = (position2 && cesium.Ellipsoid.WGS84.cartesianToCartographic(position2).height) ?? 0;
78
+ return height1 < height2 ? position1 : position2;
79
+ }
80
+ }
81
+ function cartesianToCanvasCoord(position, scene) {
82
+ return scene.cartesianToCanvasCoordinates(position);
83
+ }
53
84
  const toString = Object.prototype.toString;
54
85
  function isDef(val) {
55
86
  return typeof val !== "undefined";
@@ -91,33 +122,6 @@ function assertError(condition, error) {
91
122
  function cesiumEquals(left, right) {
92
123
  return left === right || isFunction(left == null ? void 0 : left.equals) && left.equals(right) || isFunction(right == null ? void 0 : right.equals) && right.equals(left);
93
124
  }
94
- function isCesiumConstant(value) {
95
- return !cesium.defined(value) || !!value.isConstant;
96
- }
97
- function canvasCoordToCartesian(canvasCoord, scene, mode = "auto") {
98
- if (mode === "pickPosition") {
99
- return scene.pickPosition(canvasCoord);
100
- } else if (mode === "globePick") {
101
- const ray = scene.camera.getPickRay(canvasCoord);
102
- return ray && scene.globe.pick(ray, scene);
103
- } else {
104
- if (scene.globe.depthTestAgainstTerrain) {
105
- return scene.pickPosition(canvasCoord);
106
- }
107
- const position1 = scene.pickPosition(canvasCoord);
108
- const ray = scene.camera.getPickRay(canvasCoord);
109
- const position2 = ray && scene.globe.pick(ray, scene);
110
- if (!position1) {
111
- return position2;
112
- }
113
- const height1 = (position1 && cesium.Ellipsoid.WGS84.cartesianToCartographic(position1).height) ?? 0;
114
- const height2 = (position2 && cesium.Ellipsoid.WGS84.cartesianToCartographic(position2).height) ?? 0;
115
- return height1 < height2 ? position1 : position2;
116
- }
117
- }
118
- function cartesianToCanvasCoord(position, scene) {
119
- return scene.cartesianToCanvasCoordinates(position);
120
- }
121
125
  function toCoord(position, options = {}) {
122
126
  if (!position) {
123
127
  return void 0;
@@ -204,6 +208,9 @@ function dmsToDegrees(dms) {
204
208
  const latitude = dmsDecode(y);
205
209
  return [longitude, latitude, Number(height) || 0];
206
210
  }
211
+ function isCesiumConstant(value) {
212
+ return !cesium.defined(value) || !!value.isConstant;
213
+ }
207
214
  class CesiumMaterial extends cesium.Material {
208
215
  constructor(options) {
209
216
  super(options);
@@ -407,13 +414,6 @@ function tryRun(fn) {
407
414
  }
408
415
  };
409
416
  }
410
- function arrayDiff(list, oldList) {
411
- const oldListSet = new Set(oldList);
412
- const added = list.filter((obj) => !oldListSet.has(obj));
413
- const newListSet = new Set(list);
414
- const removed = (oldList == null ? void 0 : oldList.filter((obj) => !newListSet.has(obj))) ?? [];
415
- return { added, removed };
416
- }
417
417
  async function toPromiseValue(source, options = {}) {
418
418
  try {
419
419
  const { raw = true } = options;