<!DOCTYPE html>
<html>
<head>
<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 id="container">
<div id="infobox">
<div id="features">
<h3>Sidebar header</h3>
</div>
</div>
<div class="map-wrapper">
<div id="map"></div>
</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);
var marker = L.marker(L.latLng(49.5, 16)).bindPopup('my custom popup').bindLabel('my custom label');
map.addLayer(marker);
}
html, body, #container {
height: 100%;
overflow: hidden;
width: 100%;
margin: 0;
padding: 0;
}
#infobox {
position: absolute;
right: 10;
top: 10;
height: 400px;
width: 150px;
z-index: 4;
background: white;
}
#container {
position: relative;
}
.map-wrapper {
position: static;
z-index: 5;
}
.map-wrapper,
#map {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
height: 100%;
width: auto;
}
Leaflet map with navbar and sidebar based on https://github.com/bmcbride/bootleaf