Skip to content

Commit

Permalink
fix(web): selection without groundPrimitives (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyshx authored Mar 25, 2024
1 parent 459c94f commit 2f42938
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const HeatmapMesh = memo(
ref,
) => {
const { scene } = useCesium();
const groundPrimitives = scene?.primitives;
const groundPrimitives = scene?.groundPrimitives;
const primitiveRef = useRef<GroundPrimitive>();

const material = useConstant(() =>
Expand Down
4 changes: 4 additions & 0 deletions web/src/beta/lib/core/engines/Cesium/pickMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ function pickManyFromViewport(
windowWidth: number,
windowHeight: number,
): object[] {
const showGroundPrimitives = scene.groundPrimitives.show;
scene.groundPrimitives.show = false;
invariant(windowWidth > 0 && windowHeight > 0);
assertType<PrivateScene>(scene);
const context = scene.context;
Expand Down Expand Up @@ -272,6 +274,8 @@ function pickManyFromViewport(
const objects = pickFramebufferEnd.apply(view.pickFramebuffer, [rectangleScratch]);
context.endFrame();

scene.groundPrimitives.show = showGroundPrimitives;

return objects;
}

Expand Down

0 comments on commit 2f42938

Please sign in to comment.