-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvancouver-building-age.html
261 lines (221 loc) · 10.9 KB
/
vancouver-building-age.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
---
layout: gis
title: Vancouver Building Age Map
description: Map showing Vancouver buildings' age
permalink: /projects/vancouver-building-age-map/
image_preview: http://i.imgur.com/eCpWlIG.png
---
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v0.0.3/leaflet.fullscreen.css' rel='stylesheet' />
<link rel="stylesheet" href="/css/leaflet.awesome-markers.css">
<style>
#map {
height: 600px;
width: 100%;
margin-bottom: 20px;
}
form h4 {
font-size: 13pt;
}
.subscribe_form {
position: relative;
top: 18px;
}
.leaflet-container {
background-color: #E6E6E6;
}
.my-legend {
/*background-color: #f9f9f9;*/
padding: 10px;
opacity: 0.8;
}
.my-legend .legend-title {
text-align: left;
margin-bottom: 8px;
font-weight: bold;
font-size: 90%;
}
.my-legend .legend-scale ul {
margin: 0;
padding: 0;
float: left;
list-style: none;
}
.my-legend .legend-scale ul li {
display: block;
float: left;
width: 40px;
margin-bottom: 6px;
text-align: center;
font-size: 80%;
list-style: none;
}
.my-legend ul.legend-labels li span {
display: block;
float: left;
height: 15px;
width: 40px;
}
.my-legend .legend-source {
font-size: 70%;
color: #999;
clear: both;
}
.my-legend a {
color: #777;
}
li#PARK span {
height: 13px;
width: 38px;
margin-left: 2px;
border: 1px solid #a4a4a4;
}
</style>
<div class="container">
<div class="row">
<div class="row">
<div class="col-lg-7">
<header class="post-header col-lg-12">
<h1>Vancouver Building Age Map</h1>
</header>
<article class="post-content col-lg-12">
<div class="my-legend">
<div class='legend-scale'>
<ul class='legend-labels'>
<li><span style='background:#f6f477;'></span>1800s</li>
<li><span style='background:#ffe00c;'></span>1900s</li>
<li><span style='background:#fdbf34;'></span>1910s</li>
<li><span style='background:#fd900c;'></span>1920s</li>
<li><span style='background:#f16f2d;'></span>1930s</li>
<li><span style='background:#d24b2d;'></span>1940s</li>
<li><span style='background:#b54545;'></span>1950s</li>
<li><span style='background:#835771;'></span>1960s</li>
<li><span style='background:#576aaf;'></span>1970s</li>
<li><span style='background:#3b8bf3;'></span>1980s</li>
<li><span style='background:#4fabe5;'></span>1990s</li>
<li><span style='background:#53cde0;'></span>2000s</li>
<li><span style='background:#82ecd0;'></span>2010s</li>
<li id='PARK'><span style='background:#fff;'></span>Parks</li>
</ul>
</div>
<div class='legend-source'>Data source: <a href="http://data.vancouver.ca/datacatalogue/">Open Data City of Vancouver</a></div>
</div>
</article>
</div>
<div class="col-lg-5 hidden-xs hidden-sm hidden-md subscribe_form">
<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="//loveyourmap.us8.list-manage.com/subscribe/post?u=1df8e5e5207516b23fbc2c506&id=2cb89c7cb0" method="post" id="mc-embedded-subscribe-form-upper" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<h4>Subscribe to receive more great content like this</h4>
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;"><input type="text" name="b_1df8e5e5207516b23fbc2c506_2cb89c7cb0" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</form>
</div>
<!--End mc_embed_signup-->
</div>
</div>
</div>
<div class="col-lg-12">
<p>
<strong>Note:</strong>
If the map doesn't show up, <a href='http://i.imgur.com/uqOsIXI.jpg'>click to see a screenshot</a>.
<button id="show_location" class="btn btn-default" style="float: right; position: relative; top: -5px"><span class="glyphicon glyphicon-home"></span> Show my location on the map</button>
</p>
<div id="map"></div>
<p>Inspired by building age maps popping up for different cities (Portland, New York, etc.) I created the Vancouver Building Age map using publicly available data on the City of Vancouver website.</p>
<p>In particular I used the parcel polygon shapefile (containing land lot outlines) and a property tax report table. Unfortunately, I could not use building footprints because the latest file containing such information dates back to 1999. I am currently in the process of adding the hover effect to display addresses and will soon post a more detailed description of the map creation process. Some lots do not actually have any information on when the buildings were constructed so I left them gray.</p>
<p>Hope you have fun exploring the map! My personal favourite is the octopus-looking Shaughnessy lots between Oak st and Granville st.</p>
</div>
<div class="col-lg-12">
<div class="">
<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="//loveyourmap.us8.list-manage.com/subscribe/post?u=1df8e5e5207516b23fbc2c506&id=2cb89c7cb0" method="post" id="mc-embedded-subscribe-form-lower" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<h4>Subscribe to receive more great content like this</h4>
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;"><input type="text" name="b_1df8e5e5207516b23fbc2c506_2cb89c7cb0" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</form>
</div>
<!--End mc_embed_signup-->
</div>
</div>
</div>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v0.0.3/Leaflet.fullscreen.min.js'></script>
<script src="/js/geoPosition.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/leaflet.awesome-markers.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
var map = L.map('map').setView([49.254837, -123.1382151], 12);
L.tileLayer('http://tiles.loveyourmap.com/vancouver/{z}/{x}/{y}.png', {
minZoom: 12,
maxZoom: 18
}).addTo(map);
map.attributionControl.setPrefix('');
map.attributionControl.addAttribution("Hosted by <a href='http://loveyourmap.com'>Love your map</a>");
L.control.fullscreen().addTo(map);
map.on('zoomend', function(e) {
ga('send', 'event', 'map_interaction', 'zoom');
});
map.on('dragend', function(e) {
ga('send', 'event', 'map_interaction', 'drag');
});
$(function () {
$("#mc-embedded-subscribe-form-lower").submit(function () {
ga('send', 'event', 'subscribe', 'submit', 'lower');
});
$("#mc-embedded-subscribe-form-upper").submit(function () {
ga('send', 'event', 'subscribe', 'submit', 'upper');
});
$("#show_location").click(function() {
ga('send', 'event', 'geolocation', 'locate me');
if (!geoPosition.init()) {
ga('send', 'event', 'geolocation', 'no support');
alert("Geolocation service not supported by your browser.");
return;
}
geoPosition.getCurrentPosition(
// success
function (p) {
var icon, marker;
icon = L.AwesomeMarkers.icon({
icon: 'home',
markerColor: 'red'
});
marker = L.marker(
[p.coords.latitude, p.coords.longitude],
{icon: icon}
).addTo(map);
marker.bindPopup("<b>Hey!</b><br>You are here.").openPopup();
ga('send', 'event', 'geolocation', 'success', 'js', p.coords.accuracy);
},
// error
function (e) {
ga('send', 'event', 'geolocation', 'failure');
},
// options
{
enableHighAccuracy: true
}
);
});
});
</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=grigory"></script>