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
Synchronize map resize with overlay resize #19
Comments
@wwwtyro want to try digging into this one first? Seems like a good ticket to get familiar with the library. |
Sounds good; I'm on it!
|
@vicapow Seems like the debounce (if necessary) should be relegated to the user of react-map-gl? e.g., var UserApp = React.createClass({
...
componentDidMount: function componentDidMount() {
window.addEventListener('resize', debounce(function onResize() { // <-- debounce
this.setState({
viewport: assign({}, this.state.viewport, {
width: window.innerWidth,
height: window.innerHeight
})
});
}.bind(this)), 100);
},
...
} Everything stays in sync, this way. If so, the solution would be to simply remove the debounce from MapGL._resizeMap. Is that anywhere close to what you guys had in mind as a solution to this? |
@wwwtyro that sounds good to me. |
#33 🎉 |
This component currently debounces resize events. This makes it hard to synchronize resizing of overlays leading to the overlays temporarily having incorrect offsets during window resizing.
The resizes can be caused by browser window resize, but can also result from the opening/closing of variable width UI components like side bars etc that modify the size of the map component to ensure that the map stays centered.
The text was updated successfully, but these errors were encountered: