-
Notifications
You must be signed in to change notification settings - Fork 1
/
bridges.html
126 lines (113 loc) · 4.2 KB
/
bridges.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.15.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.15.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://fonts.googleapis.com/css?family=Ropa+Sans' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<style>
#title {
position: absolute;
top: 72%;
left: 1%;
bottom: 0;
width: 450px;
height: 160px;
box-sizing: border-box;
border-color: rgba(65, 73, 80, 0.9);
border-width: medium;
border-style: solid;
padding: 8px 24px;
font-family: 'Ropa Sans', sans-serif;
font-size: 9pt;
color: rgba(229, 229, 216, 0.9);
text-align: center;
background: rgba(42, 54, 60, 0.9);
-webkit-border-radius: 4px;
border-radius: 4px;
z-index: 9999;
overflow: auto;
}
a {
color: rgba(229, 229, 216, 0.9);
}
</style>
<div id='map'></div>
<div id='title'>
<font size='6'>Bridges
<font size='3'>of </font size> America</font size>
<br>
<font size='3'>Mapping the <a target="blank" href="http://catalog.data.gov/dataset/national-bridge-inventory-national-geospatial-data-asset-ngda-bridges"> National Bridge Inventory</a>
<br>Made by <a target="blank" href="https://twitter.com/jonahadkins">Jonah Adkins</a>
<br>
<input id='mapbox://styles/jonahadkins/cim3kbhey0091cwm21d1dvsgo' type='button' name='rtoggle' value='Traffic Count' checked='checked'>
<!--<label for='traffic'>traffic</label>-->
<input id='mapbox://styles/jonahadkins/cim12p4xx004s9jm0sye25k9v' type='button' name='rtoggle' value='Bridge Status'>
<!--<label for='status'>status</label>-->
<font size='2'>
<br> Traffic Count | <font color='#9ab899'> 0 </font color>| <font color='#ffa98f'>10k</font color> | <font color='#ff8880'>25k</font color> | <font color='#f56b70'>75k </font color>| <font color='#e84a5f'>150k </font color>| per day
<br> Bridge Status | <font color='#9ab899'> Ok </font color>| <font color='#ff8880'>Structurally Deficient </font color>| <font color='#e84a5f'>Functionally Obsolete </font color>|
<br> <a target="blank" href="http://jonahadkins.com/mapbox/cartography/qgis/2016/03/22/bridges-of-america.html">Read More About This Map</a>
</font size>
</div>
<script>
mapboxgl.accessToken = 'pk.eyJ1Ijoiam9uYWhhZGtpbnMiLCJhIjoiRlVVVkx3VSJ9.9sdVEK_B_VkEXPjssU5MqA';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/jonahadkins/cim3kbhey0091cwm21d1dvsgo',
center: [-95.69, 39.92],
pitch: 0, // pitch in degrees
bearing: 0, // bearing in degrees
zoom: 4, // starting zoom
//attributionControl: true,
minZoom: 4,
maxZoom: 12
});
// Add Button Control
var layerList = document.getElementById('title');
var inputs = layerList.getElementsByTagName('input');
function switchLayer(layer) {
var layerId = layer.target.id;
map.setStyle(layerId);
}
for (var i = 0; i < inputs.length; i++) {
inputs[i].onclick = switchLayer;
}
// Add zoom and rotation controls to the map.
map.addControl(new mapboxgl.Navigation());
</script>
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=7998460;
var sc_invisible=1;
var sc_security="768fe709";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="shopify traffic
stats" href="http://statcounter.com/shopify/"
target="_blank"><img class="statcounter"
src="//c.statcounter.com/7998460/0/768fe709/1/" alt="shopify
traffic stats"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
</body>
</html>