45 lines
1.6 KiB
HTML
45 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>ui</title>
|
|
<script src='../mapbox.js'></script>
|
|
<link href='../mapbox.min.css' type='text/css' rel='stylesheet' />
|
|
<style>
|
|
#map {
|
|
position:absolute;
|
|
top:0;
|
|
left:150px;
|
|
right:0;
|
|
bottom:0;
|
|
}
|
|
#boxes {
|
|
position:absolute;
|
|
top:0;
|
|
width:130px;
|
|
padding:10px;
|
|
bottom:0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id='boxes'>
|
|
<div><input type='checkbox' id='zoomer' /> <label for='zoomer'>zoom</label></div>
|
|
<div><input type='checkbox' id='zoombox' /> <label for='zoombox'>zoombox</label></div>
|
|
<div><input type='checkbox' id='fullscreen' /> <label for='fullscreen'>fullscreen</label></div>
|
|
<div><input type='checkbox' id='attribution' /> <label for='attribution'>attribution</label></div>
|
|
<div><input type='checkbox' id='pointselector' /> <label for='pointselector'>pointselector</label></div>
|
|
</div>
|
|
<div id='map'></div>
|
|
<script>
|
|
var map = mapbox.map('map', mapbox.layer().id('tmcw.map-rep59d6x')).zoom(3);
|
|
|
|
var checkboxes = document.getElementsByTagName('input');
|
|
for (var i = 0; i < checkboxes.length; i++) {
|
|
checkboxes[i].onchange = function() {
|
|
this.checked ? map.ui[this.id].add() : map.ui[this.id].remove();
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|