[GIS] Optimal page layout with Leaflet

leaflet

This is somewhat of a broad question. I'm basically looking for the best or easiest way to control the layout of a page with a Leaflet map. Say I want the map to be located on the right side of the screen, mobile friendly and resize responsively. I've been playing around with Leaflet for a little while and haven't found a convenient way to control the maps location and size on the page. Am I better off with traditional CSS or maybe something like Bootstrap? Could there be a plug-in I've overlooked?

Like I said, it's a broad question. Not looking for specifics. Just a sense of direction, so I don't run down unnecessary rabbit holes.

Best Answer

The Leaflet framework can only be used to control the map itself and its controls (like zoom, search, etc.), not the rest of the webpage.

Therefore the map itself has to be inside a normal div element. To change the size or position of this div element you can use plain CSS/HTML or any frontend framework (e.g. bootstrap) you like.

Related Question