How does Cesium read the local file for zoom in/out?

HI, I am new to Cesiumjs. I want study the code of cesium. Let say we have our own local image file. How does cesium know which file to load when zoom in/out? I look the sample of cesium image data, they don't have geo reference information. When I create the view, I do like:
imageryProvider : new Cesium.BingMapsImageryProvider({ url : "earth/texture/"})
where earth/texture is the image file located.



The imagery is represented as QuadTrees. For each level of detail, there are 4 child tiles that occupy the space of the parent’s tile. For a visual representation of what this looks like in Cesium, toggle on ‘Tile Coordinates’ in this example:

Also, we have a SingleTileImageryProvider if you did have an image and wanted to display it on the globe. That is used to add the Cesium image in the above demo.



Hi, Hannah,
Thank you for your response, I am still not sure how does cesium engine know which file to load. In the example, we are seeing level 2, L2X3Y1 and I zoom in to level3, there are several L3 file contained, like L3X5Y3, L3X6Y3, L3X7Y3. My questions is how does the engine know my file structure? Is it through a JSON file? What if my file name is like: 2001,jpg, 2002, 2003, 2004 for level 2, and 30001,jpg, 30002 … for level 3? which follows the QuadTree rule. There got to be someway that engine know the file structure.

Thank you.

That particular detail varies depending on the ImageryProvider.
We have the UrlTemplateImageryProvider that lets you create a URL template where X and Y are the tile coordinates and Z is the level. You can use that to define your own URL that matches with your files.