Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Zero height map #431

Open
wintersylf opened this issue Jul 9, 2015 · 3 comments
Open

Zero height map #431

wintersylf opened this issue Jul 9, 2015 · 3 comments

Comments

@wintersylf
Copy link

My map won't display and I've traced the problem to lines 228-229 (v0.4.17, in the main function):

    this.el.style.width = options.width || this.el.scrollWidth || this.el.offsetWidth;
    this.el.style.height = options.height || this.el.scrollHeight || this.el.offsetHeight;

where the this.el.scrollHeight is set to 0. generally it's poor policy to set inline values on an element as it overrides whatever CSS the developer means to control layout with. if I comment out these two lines my map appears. what would anyone recommend be done?

@hpneo
Copy link
Owner

hpneo commented Jul 10, 2015

Honestly I can't remember why I put that code, but I've never heard complains about it. When you create a map, you need to set a width and height to that map container (located in this.el). You can do it using CSS (as you can see in the "examples" folder), or you can set it in the GMapsconstructor.

Can you post more info about your issue, like how you create a map or the container's CSS?

@wintersylf
Copy link
Author

I don't have a working repro just now because I fixed the problem by amending the code. I think the problem may be browser related. I'm running on IE11, but like I said, overriding sizes inline is poor practice as it leaves the CSS, which is where all such things should be done, powerless

@hpneo
Copy link
Owner

hpneo commented Jul 22, 2015

I will run tests in some browsers and check if those lines are unnecessary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants