-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Map div does not support 100% height CSS property #1266
Comments
JSFiddle doesn't open for me for some reason, but Leaflet does support 100% height without problems — you're probably doing something wrong. See http://leafletjs.com/examples/mobile.html |
I was wrong. I did not set height property to body tags. Thanks |
Use this code to make it responsive height of the window |
Omgan's comment above worked great for me with leaflet 1.0.2 |
this works perfectly, but the setting worked with (- 40) |
I followed what Omgan, dstrickler, and josejaner did. Also since I had my map initialized in a separate function initMap() I had to trigger resize in there as well like below....
|
@stripathix if you think this is an issue, I suggest you open a new one with a clear example illustrating the issue. Given the information you provided, it sounds highly unlikely this is a Leaflet problem, but rather an issue with how your application uses it. For example, if your map container ever changes size after the map is initialized, make sure to call |
You use a wrapper container set to position fixed or absolute to get height 100% working.
See https://jsfiddle.net/robertpribpolestar/xg41w12v/3/ It, of course, means you have to use fixed and absolute positing which can be annoying, but better than having to include in JS watching the browser resize. |
in my case, this css solve the problem: #map{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
} and give its container |
@dhanyn10 |
its perfectly fine working hack for it, i searched for this kind of solution for last couple of hours but at last i did found it and i am really happy. I test its responsiveness also, which is correct. |
Oh FFS just use |
I tried to spread a map on to the full document. Unfortunately, when I set height css property as 100%, the map does not render. But, the map renders for static height pixels. I have created the following jsfiddle for reference: http://jsfiddle.net/QbP2U/5/
The text was updated successfully, but these errors were encountered: