@vesium/plot 1.0.1-beta.38 → 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/dist/index.cjs +18 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.iife.js +18 -19
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.mjs +1 -1
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +18 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -342,15 +342,12 @@ const EVENT_TYPE_RECORD = {
|
|
|
342
342
|
};
|
|
343
343
|
function usePositioned(type, listener) {
|
|
344
344
|
const screenEvent = EVENT_TYPE_RECORD[type];
|
|
345
|
-
const
|
|
346
|
-
const pick = useScenePick(position);
|
|
345
|
+
const viewer = useViewer();
|
|
347
346
|
useScreenSpaceEventHandler(screenEvent, (event) => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}, {
|
|
353
|
-
flush: "post"
|
|
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 =
|
|
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
|
-
}
|
|
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(
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
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);
|