<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<link rel="stylesheet" href="http://leaflet.github.io/Leaflet.label/leaflet.label.css" />
<link rel="stylesheet" href="style.css" />
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a>Menu item 1</a>
</li>
<li>
<a>Menu item 2</a>
</li>
</ul>
</div>
</div>
</div>
<div id="container">
<div id="sidebar">
<div class="sidebar-wrapper">
<div id="features" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Sidebar header</h3>
</div>
</div>
</div>
</div>
<div id="map"></div>
</div>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet-src.js"></script>
<script src="http://leaflet.github.io/Leaflet.label/leaflet.label.js"></script>
<script src="script.js"></script>
</body>
</html>
jQuery(document).ready(main)
function main() {
var map = L.map('map', {}).setView([49.5, 16], 14);
L.tileLayer('http://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 16,
atribution: 'Map data © OSM.org'
}).addTo(map);
}
html, body, #container {
height: 100%;
overflow: hidden;
width: 100%;
}
body {
/* height of .navbar, customize with @navbar-height variable */
padding-top: 50px;
}
.navbar {
min-height: 50px;
}
#sidebar {
float: left;
height: 100%;
max-width: 100%;
width: 150px;
}
#map {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
height: 100%;
width: auto;
}
.sidebar-wrapper {
height: 100%;
position: relative;
width: 100%;
}
@media (max-width: 767px) {
#sidebar {
display: none;
}
}
Leaflet map with navbar and sidebar based on https://github.com/bmcbride/bootleaf