Skip to content

Icons are always below text-fields #12626

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

Closed
entioentio opened this issue Mar 27, 2023 · 5 comments
Closed

Icons are always below text-fields #12626

entioentio opened this issue Mar 27, 2023 · 5 comments
Labels

Comments

@entioentio
Copy link

Pardon if this is documented somewhere in the docs. Couldn't find it.

mapbox-gl-js version: 2.13.0

browser: Latest brave, latest firefox. Don't think that it has anything to do with the browser

Steps to Trigger Behavior

  1. Place overlapping symbol with both text and icon
  2. Set symbol-sort-key of one of them to higher
  3. Observe its icon not covering other symbol text-field

Link to Demonstration

https://codepen.io/soentio/pen/gOdEYvx
image

Expected Behavior

The text-field of another symbol should be covered by the icon of the symbol with higher symbol-sort-key.

Actual Behavior

It seems that there exist two separate stacks of ordering - one for text-fields, other one for the icons. So bringing an icon to the top brings it only above other icons.

Context

I'm have a dense grid of symbols that have to be able to expand sideways (a.o) on hover. I wanted to cover the neighboring symbol with an icon. When marker is hovered, the dataset gets updated so the hovered symbol goes to the top ('symbol-sort-key': [ 'case', ['boolean', ['get', 'hovered', ['properties']], false], 1000, 0 ]). That doesn't work due to aforementioned limitation.

@stepankuzmin
Copy link
Contributor

Hi @entioentio,

Thanks for creating an issue. I can confirm that the icon in the feature above does not overlap the text on the features below.

Screenshot 2023-03-28 at 18 33 33

@enersis-pst
Copy link
Contributor

i think its the same behavior which was described on many other places.
#10123

@stepankuzmin
Copy link
Contributor

stepankuzmin commented Mar 30, 2023

@enersis-pst yes, you are right, I missed that. Closing this issue as a duplicate of #4064, so we track it in one place.

@stepankuzmin stepankuzmin closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2023
@entioentio
Copy link
Author

entioentio commented Mar 30, 2023

The mentioned issue misses a good description and minimal reproduction. Furthermore, it seems to be a general notice / call for ideas or help and not really a bug report.
I've actually commented on the mentioned issue, not realizing that it is about the same problem. Lol. The original author's case could be solved with a bit of supercluster magic.

To be clear, I don't think that reopening this issue is a good idea, Isn't #4064 a better suit for "base" issue?

@stepankuzmin
Copy link
Contributor

Yes, that makes sense. Thanks, @entioentio!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants