Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/symbol/placement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ export class Placement {
bucket.deserializeCollisionBoxes(collisionBoxArray);
}

const tileID = this.retainedQueryData[bucket.bucketInstanceId].tileID;
const getElevation = this.terrain ? (x: number, y: number) => this.terrain.getElevation(tileID, x, y) : null;
Comment thread
zhangyiatmicrosoft marked this conversation as resolved.

const placeSymbol = (symbolInstance: SymbolInstance, collisionArrays: CollisionArrays) => {
if (seenCrossTileIDs[symbolInstance.crossTileID]) return;
if (holdingForFade) {
Expand Down Expand Up @@ -493,14 +496,6 @@ export class Placement {
verticalTextFeatureIndex = collisionArrays.verticalTextFeatureIndex;
}

// update elevation of collisionArrays
const tileID = this.retainedQueryData[bucket.bucketInstanceId].tileID;
const getElevation = this.terrain ? (x: number, y: number) => this.terrain.getElevation(tileID, x, y) : null;
for (const boxType of ['textBox', 'verticalTextBox', 'iconBox', 'verticalIconBox']) {
const box = collisionArrays[boxType];
if (box) box.elevation = getElevation ? getElevation(box.anchorPointX, box.anchorPointY) : 0;
}

const textBox = collisionArrays.textBox;
if (textBox) {

Expand Down