Open EricBoix opened 2 years ago
Today that's not really possible because a 3DTilesLayer needs a view as param constructor and a view needs an extent as param constructor. So in order to create a 3DTiles layer we have to fix before the extent, the problem belongs to itowns.
@valentinMachado Couldn't we automatically extract the bounding of the considered Tileset, consider it's 2d extension to make it an extent PRIOR to constructing the view and only then the 3DTilesLayer ?
Yes we could but that's not very elegant to request the tileset.json since C3DTilesLayer
is going to do it. The problem here is that a C3DTilesLayer
should be able to be instanciated without a View
. It's also quite weird to write something like:
const layer = new Layer(..., view);
view.add(layer)
Iam not sure why this has been implemented this way but I've discussed of it with @jailln and it should be refacto in itowns at some point.
Related issue: #146
The need
When realizing 3DTiles based demos, the territory extent (the portion of the territory whose map is displayed) is usually specified manually (e.g. this py3dTilers demo). Such an extent depends on the considered set of 3DTiles tilesets and is usually manually extracted (through a lengthy trial and error process). Because (3DTiles) tilesets encode their own extent, the demo extent could be automatically extracted and computed out of the considered tileset set.