-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
62 lines (55 loc) · 2.13 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
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<title>L.Control.ZoomBar</title>
<!-- Leaflet -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<!-- the control code, just these two files -->
<script type="text/javascript" src="leaflet-control-zoombar.js"></script>
<link rel="stylesheet" href="leaflet-control-zoombar.css" />
<!-- the remaining HTML and JS is for the demo -->
<style type="text/css" >
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
}
</style>
<style type="text/css">
/* hack for Leaflet 1.7.1 which only flashes ARIA outlines (though keeps focus) which misses the point of ARIA outlines */
.leaflet-container :focus {
outline-color: -webkit-focus-ring-color !important;
outline-style: auto !important;
outline-width: thin !important;
outline: revert !important;
}
</style>
<script type="text/javascript">
var map, zoombar;
function init() {
map = L.map('map');
L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="https://carto.com/attributions">CARTO</a>',
}).addTo(map);
map.setView([37.7833,-122.4167], 12);
zoombar = new L.Control.ZoomBar({
// for the home button, give a L.LatLngBounds or a bounds-like literal...
// homeBounds: [[37.64, -122.64], [37.92, -122.19]],
// ... or a L.LatLng or literal, combined with a zoom level
homeLatLng: [37.7833,-122.4167],
homeZoom: 12,
// you can also customize tooltips, which are also the ARIA labels, to your own language or phrasing
zoomInTitle: 'Zoom the map in a step',
zoomOutTitle: 'Zoom the map out a step',
zoomHomeTitle: 'Reset to original view',
}).addTo(map);
}
</script>
</head>
<body onLoad="init()">
<div id="map" tabindex="0"></div>
</body>
</html>