-
Notifications
You must be signed in to change notification settings - Fork 303
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
fix(OGC3DTilesLayer): handle multiple views #2435
fix(OGC3DTilesLayer): handle multiple views #2435
Conversation
src/Layer/OGC3DTilesLayer.js
Outdated
@@ -22,19 +22,14 @@ import PointsMaterial, { | |||
} from 'Renderer/PointsMaterial'; | |||
|
|||
const _raycaster = new THREE.Raycaster(); | |||
|
|||
const viewers = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment saying that it stores ids of viewers where tilesets have been added and explaining why and how it is related to the cache please ? You can also link the issue I think
@AnthonyGlt when a view is disposed, all layers added to this view are removed and their object3Ds are removed from the scene so it should be handled automatically; but it's worth checking that everything works fine :) |
I meant that in the viewers of OGC3DTilesLayer here We will store cache & queues for each view. Once a view is disposed, the corresponding cache & queue will still be stored in the |
If you want to remove it from viewers I think you should do it here (called when a view holding this layer is disposed) |
@jailln it should be disposed when the view is disposed, not the layer, because we share it between all layers of a same view. Lines 283 to 292 in d73f0a1
|
Yes you're right it should be disposed when the view is disposed. Normally, when a layer is disposed, the tiles of this layer (only) should be removed from the cache (this should be handled by What you may want to do in addition is to remove the view and its associated |
That was what I was talking about :) I've pushed some edits, maybe a bit overkill to pass the view as parameter but it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks :)
Ok for me, thanks for the changes :) @Desplandis @mgermerie do you want to take a look at it or should we merge? |
Okay for me, but we'll need to have a better way to handle shared ressources between layers of a given view! |
fix(OGC3DTilesLayer): handle multiple views cache
fix(OGC3DTilesLayer): handle multiple views cache
Description
Handle the 3dtiles cache in each view when multiple views are created
Motivation and Context
#2426
Modifications
Adding an id to the view. Incremented at each new view.
Adding a list of cache and queues in OGC3DTilesLayer.js, to share them if in in the same view
Improvements
@jailln @Desplandis
How to handle a View disposing ?
Also, a "viewers" constant already exist in View.js, maybe this one could be used ?
itowns/src/Core/View.js
Line 118 in a4f0d22