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.d.ts CHANGED
@@ -269,7 +269,7 @@ export declare function createPropertyField<T>(scope: any, field: string, maybeP
269
269
  *
270
270
  * When the Viewer instance referenced by this overloaded function becomes invalid, it will not trigger destruction.
271
271
  */
272
- export declare function createViewer(viewer: MaybeRefOrGetter<Viewer | undefined>): Readonly<ShallowRef<Viewer | undefined>>;
272
+ export declare function createViewer(viewer: MaybeRef<Viewer | undefined>): Readonly<ShallowRef<Viewer | undefined>>;
273
273
 
274
274
  /**
275
275
  * Initialize a Viewer instance, which can be accessed by the
@@ -47,6 +47,37 @@ var Vesium = function(exports, core, cesium, vue) {
47
47
  return ((_a = viewer.value) == null ? void 0 : _a.isDestroyed()) ? void 0 : viewer.value;
48
48
  });
49
49
  }
50
+ function arrayDiff(list, oldList) {
51
+ const oldListSet = new Set(oldList);
52
+ const added = list.filter((obj) => !oldListSet.has(obj));
53
+ const newListSet = new Set(list);
54
+ const removed = (oldList == null ? void 0 : oldList.filter((obj) => !newListSet.has(obj))) ?? [];
55
+ return { added, removed };
56
+ }
57
+ function canvasCoordToCartesian(canvasCoord, scene, mode = "auto") {
58
+ if (mode === "pickPosition") {
59
+ return scene.pickPosition(canvasCoord);
60
+ } else if (mode === "globePick") {
61
+ const ray = scene.camera.getPickRay(canvasCoord);
62
+ return ray && scene.globe.pick(ray, scene);
63
+ } else {
64
+ if (scene.globe.depthTestAgainstTerrain) {
65
+ return scene.pickPosition(canvasCoord);
66
+ }
67
+ const position1 = scene.pickPosition(canvasCoord);
68
+ const ray = scene.camera.getPickRay(canvasCoord);
69
+ const position2 = ray && scene.globe.pick(ray, scene);
70
+ if (!position1) {
71
+ return position2;
72
+ }
73
+ const height1 = (position1 && cesium.Ellipsoid.WGS84.cartesianToCartographic(position1).height) ?? 0;
74
+ const height2 = (position2 && cesium.Ellipsoid.WGS84.cartesianToCartographic(position2).height) ?? 0;
75
+ return height1 < height2 ? position1 : position2;
76
+ }
77
+ }
78
+ function cartesianToCanvasCoord(position, scene) {
79
+ return scene.cartesianToCanvasCoordinates(position);
80
+ }
50
81
  const toString = Object.prototype.toString;
51
82
  function isDef(val) {
52
83
  return typeof val !== "undefined";
@@ -88,33 +119,6 @@ var Vesium = function(exports, core, cesium, vue) {
88
119
  function cesiumEquals(left, right) {
89
120
  return left === right || isFunction(left == null ? void 0 : left.equals) && left.equals(right) || isFunction(right == null ? void 0 : right.equals) && right.equals(left);
90
121
  }
91
- function isCesiumConstant(value) {
92
- return !cesium.defined(value) || !!value.isConstant;
93
- }
94
- function canvasCoordToCartesian(canvasCoord, scene, mode = "auto") {
95
- if (mode === "pickPosition") {
96
- return scene.pickPosition(canvasCoord);
97
- } else if (mode === "globePick") {
98
- const ray = scene.camera.getPickRay(canvasCoord);
99
- return ray && scene.globe.pick(ray, scene);
100
- } else {
101
- if (scene.globe.depthTestAgainstTerrain) {
102
- return scene.pickPosition(canvasCoord);
103
- }
104
- const position1 = scene.pickPosition(canvasCoord);
105
- const ray = scene.camera.getPickRay(canvasCoord);
106
- const position2 = ray && scene.globe.pick(ray, scene);
107
- if (!position1) {
108
- return position2;
109
- }
110
- const height1 = (position1 && cesium.Ellipsoid.WGS84.cartesianToCartographic(position1).height) ?? 0;
111
- const height2 = (position2 && cesium.Ellipsoid.WGS84.cartesianToCartographic(position2).height) ?? 0;
112
- return height1 < height2 ? position1 : position2;
113
- }
114
- }
115
- function cartesianToCanvasCoord(position, scene) {
116
- return scene.cartesianToCanvasCoordinates(position);
117
- }
118
122
  function toCoord(position, options = {}) {
119
123
  if (!position) {
120
124
  return void 0;
@@ -201,6 +205,9 @@ var Vesium = function(exports, core, cesium, vue) {
201
205
  const latitude = dmsDecode(y);
202
206
  return [longitude, latitude, Number(height) || 0];
203
207
  }
208
+ function isCesiumConstant(value) {
209
+ return !cesium.defined(value) || !!value.isConstant;
210
+ }
204
211
  class CesiumMaterial extends cesium.Material {
205
212
  constructor(options) {
206
213
  super(options);
@@ -404,13 +411,6 @@ var Vesium = function(exports, core, cesium, vue) {
404
411
  }
405
412
  };
406
413
  }
407
- function arrayDiff(list, oldList) {
408
- const oldListSet = new Set(oldList);
409
- const added = list.filter((obj) => !oldListSet.has(obj));
410
- const newListSet = new Set(list);
411
- const removed = (oldList == null ? void 0 : oldList.filter((obj) => !newListSet.has(obj))) ?? [];
412
- return { added, removed };
413
- }
414
414
  async function toPromiseValue(source, options = {}) {
415
415
  try {
416
416
  const { raw = true } = options;