-
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
setFeatureState and the need for removeFeatureState #6889
Comments
@cammanderson this should be possible by getting the current state with |
does this mean the states will be alive after features is removed by tile is unload? It would be nice to have the possibilty to automatically remove states if the feature is removed. Or to say in other word. The lifesycle may be the same to reduce memory space. |
@cammanderson @asheemmamoowala from a design perspective, should the |
Making some progress for a key-level |
Closed by #7761 |
Hi Guys,
Working with the new setFeatureState, and I noticed that there isn't a way to remove the state supplied. You must always provide a value to merge it, and can't reset to the original values.
Use cases are varied, and not sure of the overall impact, but I am updating a react project to offer the function, but I can't 'reset' the state back to 'pre' application of the setFeatureState. Ideally, I would be able to remove the feature state completely, and then assumingly it would source from the original value of the underlying source data. If not, you'd have to track the original property value of the object to work around it. Not sure if we need to add a removeFeatureState() ?
Cheers
Cam
mapbox-gl-js version:
0.46.0
browser:
N/A
Steps to Trigger Behavior
Expected Behavior
Remove feature state entirely
Actual Behavior
Because underlying it is using an extend, the null || {} values have no effect.
featureState: { value: true }
The text was updated successfully, but these errors were encountered: