-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Create a hover effect for labels #5299
Comments
That's probably the best way for now. See #200 for a request for a built-in feature for this. |
@jfirebaugh Thank you! The pseudo-class is already a built-in feature but not released to the public now? Where can I send a request for that built-in feature? |
Using a debounce function with layer filters can help a bit for your hover use case in the meantime @roti https://bl.ocks.org/ryanbaumann/0d72890cea4f97e0dbd10ea3cf7189b2 |
@anandthakker Thank you! Got it. |
@ryanbaumann That's amazing. The debounce function helps improve the performance a lot. Thank you! |
Hi, I am trying to create a hover effect for labels. My idea is that we can create two layers using the same label data and add them to the map. One layer will be the labels displayed on the map and the other one will be the hover effect layer. When hovering over a label, we can get the properties of that label and use properties like "id" or "name" to filter the hover effect layer.
Here is what I have got so far: hover effect test
There are three problems:
I wonder if there is a better way to create a hover effect for labels. Also, is there any way to create polygons like the collision boxes for the text labels.
Any help will be appreciated.
The text was updated successfully, but these errors were encountered: