@vesium/plot 1.0.1-beta.37 → 1.0.1-beta.39

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/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  </p>
17
17
 
18
18
  <p align="center">
19
- <a href="https://github.com/GeoVueJS/vesium/blob/main/README.zh-CN.md" target="__blank">中文</a>
19
+ <a href="https://github.com/GeoVueJS/vesium/blob/main/README.zh.md" target="__blank">中文</a>
20
20
  |
21
21
  <a href="https://github.com/GeoVueJS/vesium/blob/main/README.md" target="__blank">English</a>
22
22
  </p>
package/dist/index.cjs CHANGED
@@ -183,8 +183,6 @@ function useScenePick(windowPosition, options = {}) {
183
183
  );
184
184
  }
185
185
  }
186
- }, {
187
- flush: "post"
188
186
  });
189
187
  return pick;
190
188
  }
@@ -344,13 +342,12 @@ const EVENT_TYPE_RECORD = {
344
342
  };
345
343
  function usePositioned(type, listener) {
346
344
  const screenEvent = EVENT_TYPE_RECORD[type];
347
- const position = vue.shallowRef();
348
- const pick = useScenePick(position);
345
+ const viewer = useViewer();
349
346
  useScreenSpaceEventHandler(screenEvent, (event) => {
350
- position.value = event.position.clone();
351
- });
352
- vue.watch([position, pick], ([position2, pick2]) => {
353
- pick2 && position2 && listener({ event: { position: position2 }, pick: pick2 });
347
+ var _a;
348
+ const position = event.position;
349
+ const pick = (_a = viewer.value) == null ? void 0 : _a.scene.pick(position);
350
+ pick && position && listener({ event: { position }, pick });
354
351
  });
355
352
  }
356
353
  const GLOBAL_GRAPHIC_SYMBOL = Symbol("GLOBAL_GRAPHIC_SYMBOL");
@@ -1233,7 +1230,7 @@ function useSkeleton(plots, current, getCurrentTime) {
1233
1230
  }
1234
1231
  return ((_a = activeEntity.value) == null ? void 0 : _a.id) === entity.id ? PlotAction.ACTIVE : ((_b = hoverEntity.value) == null ? void 0 : _b.id) === entity.id ? PlotAction.HOVER : PlotAction.IDLE;
1235
1232
  };
1236
- const update = shared.throttle((plot, destroyed) => {
1233
+ const update = (plot, destroyed) => {
1237
1234
  const oldEntities = plot.skeletons;
1238
1235
  const entities = [];
1239
1236
  if (destroyed || plot.disabled) {
@@ -1280,7 +1277,7 @@ function useSkeleton(plots, current, getCurrentTime) {
1280
1277
  });
1281
1278
  }
1282
1279
  plot.skeletons = entities;
1283
- }, 1);
1280
+ };
1284
1281
  const { addGraphicEvent } = useGraphicEvent();
1285
1282
  vue.watchEffect((onCleanup) => {
1286
1283
  const remove = addGraphicEvent("global", "DRAG", ({ event, pick, dragging, lockCamera }) => {
@@ -1383,16 +1380,18 @@ function useSkeleton(plots, current, getCurrentTime) {
1383
1380
  added.forEach((plot) => update(plot));
1384
1381
  removed.forEach((plot) => update(plot, true));
1385
1382
  });
1386
- useCesiumEventListener(() => plots.value.map((plot) => plot.definitionChanged), (plot, key, newValue, oldValue) => {
1387
- if (["disabled", "defining", "scheme", "sampled", "time"].includes(key)) {
1388
- update(plot);
1389
- }
1390
- if (key === "skeletons") {
1391
- const { added, removed } = shared.arrayDiff(newValue, oldValue);
1392
- added.forEach((item) => entityScope.add(item));
1393
- removed.forEach((item) => entityScope.remove(item));
1383
+ useCesiumEventListener(
1384
+ () => plots.value.map((plot) => plot.definitionChanged),
1385
+ (plot, key, newValue, oldValue) => {
1386
+ if (["disabled", "defining", "scheme", "sampled", "time"].includes(key)) {
1387
+ vue.nextTick(() => update(plot));
1388
+ } else if (key === "skeletons") {
1389
+ const { added, removed } = shared.arrayDiff(newValue, oldValue);
1390
+ added.forEach((item) => entityScope.add(item));
1391
+ removed.forEach((item) => entityScope.remove(item));
1392
+ }
1394
1393
  }
1395
- });
1394
+ );
1396
1395
  vue.watch(current, (plot, previous) => {
1397
1396
  plot && update(plot);
1398
1397
  previous && update(previous);