Skip to content

Commit

Permalink
Allow rendering Popups and Tooltips for ImageOverlay components. (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjdestigter authored and PaulLeCam committed Jan 10, 2017
1 parent dfd9c6e commit 3cc676e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ImageOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ export default class ImageOverlay extends MapLayer {
url: PropTypes.string.isRequired,
};

static childContextTypes = {
popupContainer: PropTypes.object,
};

getChildContext (): { popupContainer: Object } {
return {
popupContainer: this.leafletElement,
}
}

componentWillMount () {
super.componentWillMount()
const { bounds, url, ...props } = this.props
Expand All @@ -30,8 +40,4 @@ export default class ImageOverlay extends MapLayer {
this.leafletElement.setOpacity(this.props.opacity)
}
}

render (): null {
return null
}
}

0 comments on commit 3cc676e

Please sign in to comment.