-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlegend.html
90 lines (73 loc) · 2.93 KB
/
legend.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<html>
<head>
<title>Legend</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<link rel="stylesheet" href="src/leaflet.defaultextent.css" />
<link rel="stylesheet" href="src/easyPrint.css" />
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="src/leaflet.defaultextent.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="src/leaflet.easyPrint.js"></script>
<script src="src/jQuery.print.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-locatecontrol/v0.24.0/L.Control.Locate.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-locatecontrol/v0.24.0/L.Control.Locate.css' rel='stylesheet' />
<!--[if lt IE 9]>
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-locatecontrol/v0.21.0/L.Control.Locate.ie.css' rel='stylesheet' />
<![endif]-->
<script src="src/leaflet.makimarkers.js"></script>
<link rel="stylesheet" href="src/leaflet.awesome-markers.css">
<script src="src/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="src/Control.Geocoder.css" />
<script src="src/Control.Geocoder.js"></script>
<style>
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<style>
.legend label,
.legend span {
display:block;
float:left;
height:15px;
width:20%;
text-align:center;
font-size:9px;
color:#808080;
}
</style>
<!-- Set the display of this container to none so we can
add it programmatically to `legendControl` -->
<div id='legend' style='display:none;'>
<strong>The Title or Explanation of your Map</strong>
<nav class='legend clearfix'>
<span style='background:#F1EEF6;'></span>
<span style='background:#BDC9E1;'></span>
<span style='background:#74A9CF;'></span>
<span style='background:#2B8CBE;'></span>
<span style='background:#045A8D;'></span>
<label>0 - 20%</label>
<label>40%</label>
<label>60%</label>
<label>80%</label>
<label>100%</label>
<small>Source: <a href="#link to source">Name of source</a></small>
</div>
<div id="map"></div>
<script>
window.onload = function () {
var map = L.map('map')
.setView([42.3610, -71.0587], 15);
var OpenStreetMap_BlackAndWhite = L.tileLayer('http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
map.legendControl.addLegend(document.getElementById('legend').innerHTML);
}
</script>
</div>
</body>
</html>