Skip to content

Size only by visible div #177

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

Open
stefanwerfling opened this issue Feb 19, 2025 · 1 comment
Open

Size only by visible div #177

stefanwerfling opened this issue Feb 19, 2025 · 1 comment

Comments

@stefanwerfling
Copy link

Why is the height and width of the SVG only determined via the div? It's a bad implementation. You should also be able to set the height and width using the options. My current workaround is now as follows:

this._element = jQuery('<div style="width: 100%; height: 400px"></div>').appendTo(telement);

        this._map = new JsVectorMap({
            selector: jQuery(this._element)[0],
            map: 'world',
            regionsSelectable: true
        });

        this._element.on('resize', () => {
            this._map.updateSize();
        });
@stefanwerfling stefanwerfling changed the title Size only by visable div Size only by visible div Feb 20, 2025
@themustafaomar
Copy link
Owner

Hi @stefanwerfling sorry for the late response.

I'll see what I can do about this, and let you know.

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