Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getIonAssetMetadata struct changed (options.url) #3128

Merged
merged 3 commits into from
Oct 11, 2024
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
7 changes: 5 additions & 2 deletions modules/3d-tiles/src/lib/ion/ion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ export async function getIonTilesetMetadata(accessToken, assetId) {

// Step 2: Query metdatadata for this asset.
const ionAssetMetadata = await getIonAssetMetadata(accessToken, assetId);
const {type, url} = ionAssetMetadata;
const type = ionAssetMetadata.type;
// As of Oct 2024 ion service now returns the resource URL in an options object
const url = ionAssetMetadata.options?.url || ionAssetMetadata.url;
assert(type === '3DTILES' && url);

// Prepare a headers object for fetch
ionAssetMetadata.headers = {
Authorization: `Bearer ${ionAssetMetadata.accessToken}`
// Use provided accessToken if a new token is not provided in the ion response
Authorization: `Bearer ${ionAssetMetadata.accessToken || accessToken}`
};
return ionAssetMetadata;
}
Expand Down
Loading