-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track the number of tiles loading since loading had finished previously #920
Conversation
cc @sguimmara This should be what you're looking for regarding #906. Test it out and let me know what you think. Calculating the load percent since the last load completed should work like so: const active = tiles.stats.downloading + tiles.stats.parsing;
const total = tiles.stats.inCacheSinceLoad;
console.log( ( 100 * ( 1.0 - active / total ) ).toFixed( 2 ) ); Thought I'm open to any suggestions for exposing both load percents as public members, as well. |
That seems to do the job ! Thanks. Just one slight change: if total is zero, the value is |
I also updated + export type Statistics = {
+ inCacheSinceLoad: number,
+ inCache: number,
+ parsing: number,
+ downloading: number,
+ failed: number,
+ inFrustum: number,
+ used: number,
+ active: number,
+ visible: number,
+ };
export class TilesRendererBase {
readonly rootTileSet : object | null;
readonly root : object | null;
+ stats: Statistics; But that might not be a good idea to expose the stats if we use a method to query the progress instead |
I'd like to expose this as a member but I'm struggling with naming. Perhaps both percentages don't need to be exposed and "loadPercent" is enough. |
I wouldn't expose a percentage (as in the [0, 100] range), but a normalized value in the [0, 1] range though. What about a |
I plan to expose it as [0, 1]
Is this preferred to a |
Will |
Yes it returns 1 if the total in cache value is 0. |
Fix #906
TODO
RenameinCacheBeforeReset
-inCacheSinceLoad
?loadProgress
/loadProgressSinceCompletion
,getLoadProgress( sinceLoad = true )