Skip to content
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

Inverted zIndex #321

Closed
devnesi opened this issue Oct 22, 2024 · 2 comments
Closed

Inverted zIndex #321

devnesi opened this issue Oct 22, 2024 · 2 comments

Comments

@devnesi
Copy link

devnesi commented Oct 22, 2024

I am using RLayerVectorTile, passing the zIndex in the properties, but the rendering seems inverted, I believe. For example, if I have two layers, the first with index 1 and the second with index 2, and with two overlapping geometries, the one with index 2 should be on top of the one with index 1, but that's not happening. However, the click events are working as expected, respecting the higher index. Can you help me?

@devnesi devnesi closed this as completed Oct 22, 2024
@devnesi devnesi reopened this Oct 22, 2024
@nodgear
Copy link

nodgear commented Oct 22, 2024

Let me exemplify:

  • Render 6 VectorLayerTile's, with unique zIndexes for each one (from 1 to 6)
    • Click on an area where 2 tiles overlaps
      • The click event will be fired on the layer with highest zIndex (correct behavior)
  • The layers with higher zIndex are rendered bellow the ones with smaller zIndex (inverse of what one might expect)
    • The order in which the VectorLayerTile is in the DOM does not change this fact if zIndex is set
      • If zIndex is not set, the order in DOM affects the render order but not the priority when interacting with the overlapping layers (the one being rendered behind will be the one receiving the event)

Edit: i have looked on issues for a possible solution and couldn't fine none. I should also note that i do not work for big techs, heck, i'm a brazilian hobbyist.
I can submit a PR if needed, but, for now i don't know where to start debugging this.

@devnesi
Copy link
Author

devnesi commented Oct 23, 2024

I was able to understand the behavior: actually, when I click on overlapping geometries, an event will be triggered for each geometry, and I was only handling the last one.

Thanks to #265, I was able to notice.

@devnesi devnesi closed this as completed Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants