Skip to content

Commit 4319ece

Browse files
committed
Add a legend. Magically fix click location.
1 parent 7aa1fea commit 4319ece

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

web/index.html

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
<script async src="https://www.googletagmanager.com/gtag/js?id=G-K0V9G9G1VX"></script>
3333
<script>
3434
window.dataLayer = window.dataLayer || [];
35-
function gtag() { dataLayer.push(arguments); }
35+
36+
function gtag() {
37+
dataLayer.push(arguments);
38+
}
39+
3640
gtag('js', new Date());
3741
gtag('config', 'G-K0V9G9G1VX');
3842
</script>
@@ -54,7 +58,27 @@ <h1 class="title" x-data="{detail: metadata}" x-on:metadata-load.window="detail
5458

5559
<div id="main">
5660
<div class="columns card">
57-
<div id="map" class="column is-three-quarters"></div>
61+
<div id="map-container" class="column is-three-quarters">
62+
<div id="map"></div>
63+
<div class='map-overlay mapboxgl-ctrl-bottom-right' id='legend'>
64+
<div>
65+
<span class="legend-key" style="background-color: #e55e5e"></span>
66+
<span>Pedestrian</span>
67+
</div>
68+
<div>
69+
<span class="legend-key" style="background-color: #fbb03b"></span>
70+
<span>Cyclist</span>
71+
</div>
72+
<div>
73+
<span class="legend-key" style="background-color: #223b53"></span>
74+
<span>Person in motor vehicle</span>
75+
</div>
76+
<div>
77+
<span class="legend-key" style="background-color: #3bb2d0"></span>
78+
<span>Other</span>
79+
</div>
80+
</div>
81+
</div>
5882

5983
<div class="column">
6084
<div id="tabs-with-content">

web/styles.css

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,25 @@ html, body {
2929

3030
.is-selected .check {
3131
visibility: visible;
32-
}
32+
}
33+
34+
.map-overlay {
35+
background: rgba(255, 255, 255, 0.8);
36+
margin-right: 20px;
37+
font-family: Arial, sans-serif;
38+
}
39+
40+
#legend {
41+
padding: 10px;
42+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
43+
line-height: 18px;
44+
margin-bottom: 20px;
45+
}
46+
47+
.legend-key {
48+
display: inline-block;
49+
border-radius: 20%;
50+
width: 10px;
51+
height: 10px;
52+
margin-right: 5px;
53+
}

0 commit comments

Comments
 (0)