Tile Loading Event

Is there any sort of event that I could hack together to detect when a tile has successfully loaded?

Hi there,

Check out Cesium3DTileset.allTilesLoaded here: http://cesiumjs.org/Cesium/Build/Documentation/Cesium3DTileset.html#allTilesLoaded

Hope that helps,

  • Rachel

I should have been more specific, I mean an event for when each individual tile has successfully loaded, and I was referring to slippy tiles, not the 3D tiles

By slippy tiles, do you mean imagery tiles?

Globe has an event for tile loading http://cesiumjs.org/Cesium/Build/Documentation/Globe.html?classFilter=globe#tileLoadProgressEvent

We don’t have a way of checking whether an individual tile has been loaded, but you can manually look through the TileLoadQueue if you really need to check (not part of the public API!)

See this thread for more: https://groups.google.com/forum/?hl=en#!searchin/cesium-dev/tile$20loaded$20event|sort:relevance/cesium-dev/76zzkzIOBrs/IQoSRmQIbMAJ

Hope that helps,

  • Rachel

Yes I mean imagery tiles. Would it be possible to make something for the public API? The only reason I'm interested is because we are using a weather service (open weather maps), and they don't provide any way to see how many API calls you've made, so I'm really only interested in the number of successful tile loads. Is there any way at all this could be accomplished?

Also, I can’t figure out how to access the TileLoadQueue, as I can’t find the object that it is a property of.

Hi Cody,

I’m not sure we have the bandwidth to change our tile loading API at the moment, but we hear you.

In the meanwhile, if all you need is to count the number of successful tile loads, perhaps you could use some code similar to this: https://groups.google.com/forum/?hl=en#!searchin/cesium-dev/tile$20event|sort:relevance/cesium-dev/D_ma3ioftI8/rqND6i1hEwAJ

Hope that helps,

  • Rachel

This would almost work, but unfortunately I don’t think there is a way to differentiate between the layers, because I obviously don’t want to include the base layer.

Hi Cody,

All imagery providers implement a function called requestImage, so if you want to know how many images are requested for a specific provider, you can just wrap the existing requestImage function in that provider with a function that also counts how many times it’s called. Depending on what they are trying to track, this technique isn’t perfect. For example, just because requestImage is called doesn’t mean the browser actually requested anything from the server (the tile could have been cached). But it’s probably the best you can do purely from client code.

Hope that helps,

  • Rachel

If you’re overriding requestImage, be aware that requestImage may return undefined if there are two many requests in flight already. So you may want to only count calls to requestImage where the underlying imagery provider’s return value !== undefined.