-
Notifications
You must be signed in to change notification settings - Fork 359
Description
Description
Opening a dedicated issue following early discussion in #1264.
Currently, trying to register the same plugin to multiple tile sets throws an error, but this could be beneficial to support sharing the same plugin between multiple tile sets. Imagine the following use case:
I have a quantized mesh terrain I overlay with aerial imagery using the ImageOverlayPlugin. I also overlay the same aerial imagery over another tileset of 3d buildings (to have realistic roof textures). Currently we have to use two ImageOverlayPlugins doing exactly the same thing and thus loading the same aerial imagery twice.
I tried to just remove the error thrown here and using the same ImageOverlayPlugin as described above mostly works out of the box! The only issue I noticed is in case one of the two tile sets is disposed, then the textures are of course disposed in the other tile set (full black material).
Is there also something to consider in case of sharing the same plugin between tile sets with heterogeneous errorTarget?
Probably there are other issues I didn't encountered
Solution
- remove the thrown error saying that "A plugin can only be registered to a single tile set"
- maintain in the plugin a list of tile sets it is registered for and only dispose tiles when all the tile sets are disposed
- address other issues I didn't think of :) (easier said than done, of course)
Alternatives
status quo (inefficient duplicated usage of ressources)
Additional context
No response