Skip to content

Commit

Permalink
fix(i3dm): use instanceId to get info
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyGlt committed Nov 27, 2024
1 parent cf41e8d commit 683e55d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Layer/OGC3DTilesLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,14 @@ class OGC3DTilesLayer extends GeometryLayer {
getC3DTileFeatureFromIntersectsArray(intersects) {
if (!intersects.length) { return null; }

const { face, index, object } = intersects[0];
const { face, index, object, instanceId } = intersects[0];

/** @type{number|null} */
let batchId;
if (object.isPoints && index) {
batchId = object.geometry.getAttribute('_BATCHID')?.getX(index) ?? index;
} else if (object.isMesh && face) {
batchId = object.geometry.getAttribute('_BATCHID')?.getX(face.a);
batchId = object.geometry.getAttribute('_BATCHID')?.getX(face.a) ?? instanceId;
}

if (batchId === undefined) {
Expand Down

0 comments on commit 683e55d

Please sign in to comment.