2amigos / yii2-leaflet-extension

Yii 2 Extension library to display interactive maps with Leaflet .
http://yiiwheels.com
Other
30 stars 26 forks source link

Add extend height variable support #14

Closed gfargo closed 8 years ago

gfargo commented 9 years ago

Currently the height variable only can accept static pixel values; This is less than optimal for anyone who wants to add 'inherit' or a percentage height value.

Curious if you had specific reasoning behind adding the 'px' postfix in the init() within the /yii2-leaflet-extension/src/widgets/Map.php widget?

tonydspaniard commented 8 years ago

Have you tried differently (ie percent?). We had issues with it.

gfargo commented 8 years ago

Ah, :+1: you are correct. There are issues if you are expecting this to work with a map container that has the following CSS rules;

I found that when using the map as a background element with a position: fixed the height variable at 100% preforms exactly how one would expect.

:bulb: Maybe document that the issue exists given these CSS properties & therefore you should almost always use px as your height? That way If you wanted to make a full height background element behind all your content you wouldn't have to override the style="height: 400px" with an !important in my CSS.

:beers: Cheers!

tonydspaniard commented 8 years ago

:+1: