Skip to content
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

Checking if popup is open in onRender #464

Merged
merged 1 commit into from
Mar 22, 2018
Merged

Checking if popup is open in onRender #464

merged 1 commit into from
Mar 22, 2018

Conversation

olabalboa
Copy link
Contributor

I am using react-leaflet together with my own react-implementation of leaflet markercluster. The following error can occurr (see stack trace below).

  1. I have a popup open for a marker
  2. The content of the popup is changed at the same time as the position of the marker is changed.
  3. The position change results in that the marker gets clustered with another marker and the popup gets closed by leaflet-markercluster.
  4. Since the content of the popup is changed, the callback function supplied to the render call in DivOverlay's renderContent and then Popup's onRender is executed.
  5. this.leafletElement._adjustPan() is called but since the popup no longer exists on the map an error is thrown in the leaflet marker code.

I have added a check if the popup is open on the map in the onRender function

@PaulLeCam PaulLeCam merged commit 9104809 into PaulLeCam:master Mar 22, 2018
@PaulLeCam
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants