Skip to content

Commit

Permalink
fix(OverlayView): fixed bug in OverlayView when nested in MarkerClust…
Browse files Browse the repository at this point in the history
…erer (#302)

* Original author: @camiel 
* Original commit: ac80483
* Closes #301
  • Loading branch information
camiel authored and tomchentw committed Oct 4, 2016
1 parent 2c3294c commit 1c5e933
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/OverlayView.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ export default class OverlayView extends Component {
this.setState({ overlayView });
}

componentWillUnmount() {
if (!canUseDOM) {
return;
}

const { anchorHolderRef } = this.props;
const { overlayView } = this.state;

if (anchorHolderRef) {
if (`MarkerClusterer` === anchorHolderRef.getAnchorType()) {
anchorHolderRef.getAnchor().removeMarker(overlayView);
}
}
}

render() {
const { mapHolderRef } = this.context;
if (this.state.overlayView) {
Expand Down

0 comments on commit 1c5e933

Please sign in to comment.