-
Notifications
You must be signed in to change notification settings - Fork 101
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
Canvas element doesn't seem to update after window resize #31
Comments
Same here ! Quoting from the documentation of that method :
The same initial size ! Then, it won't resize with it, and this is the issue. |
Hey! Thanks for pointing the issue. I don't have time to maintain this library anymore, I'll be more than happy to see if someone is interested in maintaining the library in a thoughtful and constructive way! |
hello i solved in this way: this is my p5.js sketch: function setup() {
canvas = createCanvas(windowWidth, windowHeight);
myMap = mappa.tileMap(options);
myMap.overlay(canvas,function () {
myMap.map.invalidateSize();
});
}
function draw() {
}
function windowResized(){
resizeCanvas(windowWidth, windowHeight);
myMap.resize(canvas);
} and in the mappa.js, i have added this method to the class ( just under the method overlay ): {
key: 'resize',
value: function resize(canvas) {
this.mappaDiv.style.width = canvas.width + 'px';
this.mappaDiv.style.height = canvas.height + 'px';
}
} this works for me |
@gberrante Working perfectly, Thanks. |
I have a leaflet map which has the width and height of the window. If I resize the window the map size get updated. Somehow the new values are not translated from the map to canvas elements. How can this be achieved?
The text was updated successfully, but these errors were encountered: