You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a 2 years old discussion about this issue which tracks back to your repository, i propose a little fix that makes a lot of lifes easier.
The base of the fix lies in the CircleMarker.js file, which until now, made it impossible to render Circlemarkers inside of react-leaflet-markercluster without throwing:
TypeError: Cannot read property 'lat' of undefined.
This fix changes the equality check for the updateLeafletElement center property.
- if (toProps.center !== fromProps.center) + if (!latLng(toProps.center).equals(fromProps.center))
Hi, thanks for your PR but this should be part of your app or plugin logic.
As you can see in the CircleMarker documentation the center prop is required, if you set it to undefined as raised in the error message you quoted, it's not expected to work.
Hi Paul,
Since im providing CircleMarker center props its rather the third party plugin. I checked the react-markercluster library, and i don't confirm any bug or mistake in there, but if you do have a idea about this issue, here is the stacktrace:
I am running the exact same issue with the same stack trace.
For now I'm using a patched forked version of this package, hopefully the author will reconsider this PR.
Sorry I don't have time to investigate issues in third-party plugins.
As I wrote in the previous comment, the error seems to indicate the provided center prop is undefined, so I'd suggest you start by trying to figure out why your app or plugin is providing an undefined position and fix the problem there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a 2 years old discussion about this issue which tracks back to your repository, i propose a little fix that makes a lot of lifes easier.
The base of the fix lies in the CircleMarker.js file, which until now, made it impossible to render Circlemarkers inside of react-leaflet-markercluster without throwing:
This fix changes the equality check for the updateLeafletElement center property.
- if (toProps.center !== fromProps.center)+ if (!latLng(toProps.center).equals(fromProps.center))