forked from gregallensworth/L.Control.BoxZoom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·49 lines (41 loc) · 1.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<title>L.Control.BoxZoom Demo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- Leaflet as usual -->
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<!-- the L.Control.BoxZoom code -->
<script src="dist/leaflet-control-boxzoom.js"></script>
<link rel="stylesheet" href="dist/leaflet-control-boxzoom.css" />
<!-- enough styling to make a full-page map -->
<style type="text/css">
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
}
</style>
<!-- and our local code: make a map, and add the BoxZoom control -->
<script type="text/javascript">
function initMap() {
var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'examples.map-i875mjb7'
}).addTo(map);
L.Control.boxzoom({ position:'topleft' }).addTo(map);
}
</script>
</head>
<body onLoad="initMap();">
<div id="map"></div>
</body>
</html>