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

Minimum map size #3

Closed
ramblerswebs opened this issue Aug 31, 2022 · 3 comments
Closed

Minimum map size #3

ramblerswebs opened this issue Aug 31, 2022 · 3 comments

Comments

@ramblerswebs
Copy link

Not sure if you are still supporting this project but in case you are it would be good to be able to supply a minimum size for the map so the user cannot resizer to a smaller size than this.

@jjimenezshaw
Copy link
Owner

Hi @ramblerswebs . it is stable, but not dead ;)
Is it enough setting css styles like min-width and min-height? it seems to work for me.

@ramblerswebs
Copy link
Author

Thanks
I ended up with this code
this.controls.resizer.addEventListener('drag', function () {
var newHeight = self._mapDiv.clientHeight;
if (newHeight < self.minHeight) {
self._mapDiv.style.height = self.minHeight + "px";
// only allow map to be larger
}

});

@jjimenezshaw
Copy link
Owner

I tried css styles min-width and min-height in both Chrome and Firefox, and both work (for future readers).

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

2 participants