best way to highlight onHover object on map? #5634
Unanswered
tamir-jether
asked this question in
Q&A
Replies: 1 comment 6 replies
-
You can use the following props to speed it up: pickable: true,
autoHighlight: true,
highlightColor: [0, 255, 0] |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to make objects on the map highlighted when the user hovers on them. I was wondering what's the best way to do so when using react + deck.gl.
Right now I'm using react + redux, and in the state object, I'm saving the data of the onHover object (which have a unique ID). Every time I render my Layer, on the getFillColor function for example, I check if my current object ID is the same ID of the currently onHover object I have in my global state. If it is I give it a different color.
Sometimes it's slow since I re-color everything every time I hover on an object.
My question is this - is that the "best way" to handle highlighting, or is there a different better way to do so?
Beta Was this translation helpful? Give feedback.
All reactions