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

[Bug] Cesium Ion metadata url changed to options.url #3127

Closed
techtruth opened this issue Oct 9, 2024 · 3 comments
Closed

[Bug] Cesium Ion metadata url changed to options.url #3127

techtruth opened this issue Oct 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@techtruth
Copy link
Contributor

Loader

CesiumIonLoader (preload) then Tiles3DLoader

Description

It appears the metadata structure returned from CesiumIon has changed... When calling CesiumIonLoader.preload, it seems that the ionAssetMetadata object now has its 'url' value under 'options' such that 'options.url' is the intended value...

I am unsure when this changed, but I believe this is a change from the cesium api.

The code below is in loaders.gl and in this case url is always undefined.

    const ionAssetMetadata = await getIonAssetMetadata(accessToken, assetId);
    const { type, url } = ionAssetMetadata; ```

### Expected Behavior

       const metadata = await CesiumIonLoader.preload(
         "https://assets.ion.cesium.com/2275207/tileset.json",
         {                            
           "cesium-ion": {            
             accessToken:             
               "eyJhbG...Xyjt"
             assetId: "2275207",      
           },                         
         },                           
       ); 

I would expect this call to work, and not fail the loader assertion.

### Steps to Reproduce

       const metadata = await CesiumIonLoader.preload(
         "https://assets.ion.cesium.com/2275207/tileset.json",
         {                            
           "cesium-ion": {            
             accessToken:             
               "eyJhbG..YOUR_ACCESS_TOKEN....Xyjt"
             assetId: "2275207",      
           },                         
         },                           
       ); 

### Environment

- Framework version: 4.2.5
- Browser: Chromium 126.0.6478.182
- Node: 20.17.0
- OS: Debian


### Logs

arssert.js:11 Uncaught (in promise) Error: loader assertion failed.
    at assert (assert.js:11:15)
    at getIonTilesetMetadata (ion.js:30:69)
    at async SurfaceScreen.loadTiles (surface.ts:131:24)
@techtruth techtruth added the bug Something isn't working label Oct 9, 2024
@ibgreen
Copy link
Collaborator

ibgreen commented Oct 9, 2024

@techtruth Thanks for reporting. Seems like an small fix. Do need to keep the old way of getting url working as well?

Not sure if we have any maintainer who is working on 3D Tiles right now and is ready to jump on this, so... would you be interested in making a PR?

@dsavinov-actionengine @belom88

@ibgreen
Copy link
Collaborator

ibgreen commented Oct 9, 2024

You can probably try to just modify the CesiumIONLoader object in your own app, or copy it and create your own CesiumIONLoader and verify that the fix works before making a PR.

@techtruth
Copy link
Contributor Author

#3128 << Created this PR, let me know if you find it helpful. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants