create map in javascript

This commit is contained in:
Nils Schneider 2015-03-23 13:25:52 +01:00
parent f54d430df3
commit 7a404926b2
2 changed files with 7 additions and 5 deletions

View File

@ -161,7 +161,7 @@
box-sizing: border-box;
}
#sidebardata, #map {
#sidebardata, .map {
height: 100vh;
}
@ -258,7 +258,7 @@
display: none;
}
#map {
.map {
height: 60vh;
}
@ -290,8 +290,6 @@
<script src="history.js"></script>
</head>
<body>
<div id="map">
</div>
<div id="sidebar">
<button id="sidebarhandle">
</button>

View File

@ -34,7 +34,11 @@ function main() {
zoomControl: false
}
var map = L.map(document.getElementById("map"), options)
var mapDiv = document.createElement("div")
mapDiv.classList.add("map")
document.body.insertBefore(mapDiv, document.body.firstChild)
var map = L.map(mapDiv, options)
var sh = document.getElementById("sidebarhandle")
sh.onclick = function () {