Tile Loading Event

660 views
Skip to first unread message

burnin...@gmail.com

unread,
Jul 7, 2017, 9:37:21 AM7/7/17
to cesium-dev
Is there any sort of event that I could hack together to detect when a tile has successfully loaded?

Rachel Hwang

unread,
Jul 7, 2017, 9:51:32 AM7/7/17
to cesium-dev, burnin...@gmail.com
Hi there,


Hope that helps,
- Rachel

burnin...@gmail.com

unread,
Jul 7, 2017, 9:55:30 AM7/7/17
to cesium-dev, burnin...@gmail.com
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

Rachel Hwang

unread,
Jul 7, 2017, 10:03:04 AM7/7/17
to cesium-dev, burnin...@gmail.com
By slippy tiles, do you mean imagery tiles?


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!)


Hope that helps,
- Rachel

burnin...@gmail.com

unread,
Jul 7, 2017, 5:54:06 PM7/7/17
to cesium-dev, burnin...@gmail.com
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?

Cody

unread,
Jul 8, 2017, 2:09:39 PM7/8/17
to cesium-dev
Also, I can't figure out how to access the TileLoadQueue, as I can't find the object that it is a property of.

Rachel Hwang

unread,
Jul 14, 2017, 11:37:21 AM7/14/17
to cesium-dev
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%7Csort:relevance/cesium-dev/D_ma3ioftI8/rqND6i1hEwAJ

Hope that helps,
- Rachel

Cody

unread,
Jul 19, 2017, 11:23:55 AM7/19/17
to cesium-dev
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.

Rachel Hwang

unread,
Jul 28, 2017, 10:11:21 AM7/28/17
to cesium-dev
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


Kevin Ring

unread,
Jul 28, 2017, 6:39:00 PM7/28/17
to cesiu...@googlegroups.com
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.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages