visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.04k stars 2.07k forks source link

Type Error when loading 3D Tiles #4582

Closed 91raan1mpg closed 3 years ago

91raan1mpg commented 4 years ago

Hi, I am trying to display a 3D Tileset with the Tile3DLayer and the Tiles3DLoader in Deck.gl, but in the web console I get the message:

Error: 3DTileLoader: unknown type {"as

The tileset can be rendered in a CesiumJS viewer.

What type is the error message referring to and should the type be specified in the loadOptions ?

ibgreen commented 4 years ago

It should not be too hard to narrow this down, it looks like a tileset json file is not being correctly detected. Or it is a json file but not a tileset json file.

Is your tileset available to enable maintainers to reproduce this issue?

91raan1mpg commented 4 years ago

The tileset is available under:

http://steinbeis-3dps.eu:8080/3DContainerTile/collections/NewYork/3DTiles/

The content is a tileset json file, does the URL has to end on tileset.json to be detected?

JoeThunyathep commented 4 years ago

Hi @ibgreen ,

I am Joe, (@91raan1mpg colleague), In case you wanna test with the local tileset you may download our NYC-Manhattan 3D Tileset from this link
(We converted it from NYC 3D Buildings - DoITT.)

ibgreen commented 4 years ago

You are correct. At the moment it looks like we don't detect tileset files based on sniffing the content, so you either need to add a .json extension or provide a loader option to force the loader to interpret it as a JSON file, see:

https://github.com/visgl/loaders.gl/blob/master/modules/3d-tiles/src/tiles-3d-loader.js#L43

Effectively, the 3d tiles loader handles a mix of JSON and binary file formats.

xintongxia commented 4 years ago

I'll update the document with more details about how to use the loader.

91raan1mpg commented 4 years ago

Thank you for your help with the loader option, the tileset can be displayed now. But for it to work, the option has to be added twice.

   new Tile3DLayer({
            id: 'tile-3d-layer',
            data: data_url,
            loader: Tiles3DLoader,
            loadOptions: {
                '3d-tiles':{isTileset:true},
                isTileset:true
            }
   })

https://github.com/visgl/loaders.gl/blob/594b49d52e9e423e372b9add5b2e740f5f9be331/modules/3d-tiles/src/tiles-3d-loader.js#L43-L44

xintongxia commented 4 years ago

@91raan1mpg thanks for reporting the issue. I'll look into it today.

Pessimistress commented 4 years ago

@91raan1mpg the double option issue is fixed in 8.1.7