@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 +1 -1
- 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 +4 -4
package/dist/index.mjs
CHANGED
|
@@ -181,8 +181,6 @@ function useScenePick(windowPosition, options = {}) {
|
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
}, {
|
|
185
|
-
flush: "post"
|
|
186
184
|
});
|
|
187
185
|
return pick;
|
|
188
186
|
}
|
|
@@ -342,13 +340,12 @@ const EVENT_TYPE_RECORD = {
|
|
|
342
340
|
};
|
|
343
341
|
function usePositioned(type, listener) {
|
|
344
342
|
const screenEvent = EVENT_TYPE_RECORD[type];
|
|
345
|
-
const
|
|
346
|
-
const pick = useScenePick(position);
|
|
343
|
+
const viewer = useViewer();
|
|
347
344
|
useScreenSpaceEventHandler(screenEvent, (event) => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
345
|
+
var _a;
|
|
346
|
+
const position = event.position;
|
|
347
|
+
const pick = (_a = viewer.value) == null ? void 0 : _a.scene.pick(position);
|
|
348
|
+
pick && position && listener({ event: { position }, pick });
|
|
352
349
|
});
|
|
353
350
|
}
|
|
354
351
|
const GLOBAL_GRAPHIC_SYMBOL = Symbol("GLOBAL_GRAPHIC_SYMBOL");
|
|
@@ -1231,7 +1228,7 @@ function useSkeleton(plots, current, getCurrentTime) {
|
|
|
1231
1228
|
}
|
|
1232
1229
|
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;
|
|
1233
1230
|
};
|
|
1234
|
-
const update =
|
|
1231
|
+
const update = (plot, destroyed) => {
|
|
1235
1232
|
const oldEntities = plot.skeletons;
|
|
1236
1233
|
const entities = [];
|
|
1237
1234
|
if (destroyed || plot.disabled) {
|
|
@@ -1278,7 +1275,7 @@ function useSkeleton(plots, current, getCurrentTime) {
|
|
|
1278
1275
|
});
|
|
1279
1276
|
}
|
|
1280
1277
|
plot.skeletons = entities;
|
|
1281
|
-
}
|
|
1278
|
+
};
|
|
1282
1279
|
const { addGraphicEvent } = useGraphicEvent();
|
|
1283
1280
|
watchEffect((onCleanup) => {
|
|
1284
1281
|
const remove = addGraphicEvent("global", "DRAG", ({ event, pick, dragging, lockCamera }) => {
|
|
@@ -1381,16 +1378,18 @@ function useSkeleton(plots, current, getCurrentTime) {
|
|
|
1381
1378
|
added.forEach((plot) => update(plot));
|
|
1382
1379
|
removed.forEach((plot) => update(plot, true));
|
|
1383
1380
|
});
|
|
1384
|
-
useCesiumEventListener(
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1381
|
+
useCesiumEventListener(
|
|
1382
|
+
() => plots.value.map((plot) => plot.definitionChanged),
|
|
1383
|
+
(plot, key, newValue, oldValue) => {
|
|
1384
|
+
if (["disabled", "defining", "scheme", "sampled", "time"].includes(key)) {
|
|
1385
|
+
nextTick(() => update(plot));
|
|
1386
|
+
} else if (key === "skeletons") {
|
|
1387
|
+
const { added, removed } = arrayDiff(newValue, oldValue);
|
|
1388
|
+
added.forEach((item) => entityScope.add(item));
|
|
1389
|
+
removed.forEach((item) => entityScope.remove(item));
|
|
1390
|
+
}
|
|
1392
1391
|
}
|
|
1393
|
-
|
|
1392
|
+
);
|
|
1394
1393
|
watch(current, (plot, previous) => {
|
|
1395
1394
|
plot && update(plot);
|
|
1396
1395
|
previous && update(previous);
|