jekyll-leaflet icon indicating copy to clipboard operation
jekyll-leaflet copied to clipboard

changing map height and css

Open moozer opened this issue 4 years ago • 1 comments

Very nice plugin. Very easy to use. Thank you for making it available.

I have been looking into not having it 300px high, and looking through the code I figures out that it was possible to use a custom id for the leaflet using the "divId" keyword. This allows me to set the css as I want and not be bound by the default 300px.

This is not in the docs, so I suggest adding something like the below text to https://github.com/DavidJVitale/jekyll-leaflet/blob/master/docs/getting-started.md

I can make a pull request, if you prefer, but i figure that you may want a consistency in writing style :-)

again, thanks for a nice plugin.


It is possible to customize the leaflet style, ie. height, margins, and such. This is done using the divId keyword which sets the id of the leaflet map div.

It is done like so

{% raw %} {% leaflet_map { "divId": "myleaflet" } %} {} {% endleaflet_map %} {% endraw %}

moozer avatar Jul 07 '20 19:07 moozer

Thanks for the suggestion @moozer , I agree completely that there should be some documentation on how to better apply custom styling. The divId property should definitely be documented, and I will look into making the CSS cascading a bit smarter so you can specify class-level styling to apply to your whole document (it doesn't work at the moment).

Will update you when I get these changes it, much thanks again for the suggestion!

DavidJVitale avatar Jul 21 '20 05:07 DavidJVitale