highlight selected feature #2173
-
Hello dear community.
to get the clicked on feature i use these code
The click event also works without problems. However, I would like to update and highlight the feature. Unfortunately I didn't find the function "setFeatureState" in this lib. Do you have any suggestions how I could realize this? Thanks and best regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Aloha @hamburger1993, this can easily be achieved by adding another
and define the If you wish to "highlight" multiple selected features, adapt the filter to using Enjoy and happy mapping :) |
Beta Was this translation helpful? Give feedback.
-
if we do this way, i need to save to a state and it re-render all features again it make a sec delay. which is not good for user experience. Need a way for adding or modifying feature without rendering. |
Beta Was this translation helpful? Give feedback.
Aloha @hamburger1993,
this can easily be achieved by adding another
CircleLayer
with a filter for the selected cluster id.Store the
selectedCluster
in a state and addand define the
clusteredPointsActive
style as desired.If you wish to "highlight" multiple selected features, adapt the filter to using
in
and an array of corresponding values.Enjoy and happy mapping :)