Skip to content

Allow sharing the same plugin among multiple tile sets #1331

@xawill

Description

@xawill

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions