-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Crash when removing <RFeature> from <RLayerVector> #1
Comments
Can you post a reproduction or a backtrace? |
I added an example for adding & deleting features at https://mmomtchev.github.io/rlayers/#/add_delete |
Thank you very much for the quick response. I have tested your example (it works for me as well) and discovered that the issue only occurs when using an ROverlay inside the RFeature. Regardless of the ROverlay's children the application crashes in this case. I created a minimal example in a repository here: https://github.com/jonas-peeters/rlayer-test Here are the two error messages from the development build:
|
Yes, indeed, this is a real problem. React doesn't detect that |
@jonas-peeters I released 1.0.2, thanks for reporting the problem |
I have tested the new version and it works great. Thank you very much. |
I've been struggling with a variation of this. I've adjusted the above reproduction with this case (and RLayers 1.5.2): https://github.com/stefgootzen/rlayers-reproduction I get the same error when only removing the {
features.map(f => <RFeature key={f.id} geometry={new Point(fromLonLat([f.longitude, f.latitude]))}>
{/*
Adding an ROverlay to a feature will cause a crash when the overlay is removed
*/}
{
(f.id === activeFeatureId) && (
<ROverlay key={f.id}>
<div>{f.id}</div>
</ROverlay>
)
}
</RFeature>)
} (Relevant file here) Any thoughts on how to fix this? Thanks in advance! |
Change your overlay to: {f.id === activeFeatureId && (
<div>
<ROverlay>
<div>{f.id}</div>
</ROverlay>
</div>
)} OpenLayers is removing the containing |
Awesome, many thanks. Works like a charm. |
Hello,
I have a data array that is mapped to
<RFeature>
components inside anRLayerVector
component.Everything is working perfectly until I remove objects from my data array. At this point the application crashes and I get the following error message:
Uncaught DOMException: Node.removeChild: The node to be removed is not a child of this node
From what I can tell, this has to do with DOM manipulation from either rlayers or ol. Any advice on how to solve the problem?
Edit: GitHub removes HTML-tag like strings when they are not in a code block
The text was updated successfully, but these errors were encountered: