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

Redraw on Resize #24

Open
marcruef opened this issue Aug 28, 2020 · 3 comments
Open

Redraw on Resize #24

marcruef opened this issue Aug 28, 2020 · 3 comments

Comments

@marcruef
Copy link

It would be great if the map gets redrawn if the canvas is resized.

@benstigsen
Copy link

Seconded

@bramkragten
Copy link

bramkragten commented Apr 15, 2021

This can be done:

const map = new svgMap({...});
const resizeHandler = () => {
  map.mapPanZoom.resize();
  map.mapPanZoom.fit();
  map.mapPanZoom.center();
}

Use the resizeHandler as callback from an resizeObserver or window.addEventListener("resize", resizeHander)

@jjxtra
Copy link

jjxtra commented Apr 15, 2022

resizeHandler

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

No branches or pull requests

4 participants