Skip to content

Commit cc2502e

Browse files
committed
removing ‘as the crow flies’ distance
- Apparently we don’t want people commuting on crows, or knowing how far crows commute.
1 parent 87afdde commit cc2502e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ <h1>Results</h1>
233233
<ul class="school-details col-md-6">
234234

235235
{{#if distance}}
236-
<li class="school-distance"><span class="field-label">Distance: </span><p><span class="field-data">About {{distance}} km as the crow flies</span><span class="route-distance"></span></p></li>
236+
<li class="school-distance"><span class="field-label">Distance: </span><p><span class="field-data route-distance"></span></p></li>
237237

238238
{{/if}}
239239

js/google_geocoder.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,14 @@ function callBacker(selector) {
7070
// outputDiv.innerHTML = '';
7171
// origins[i] + ' to ' + destinations[j]
7272
var results = response.rows[0].elements;
73-
outputDiv.html(', or via roads: '
74-
+ results[0].distance.text.split(' ').join('&nbsp;') + ' in '
75-
+ results[0].duration.text.split(' ').join('&nbsp;') + ' cycling');
73+
if (results[0].status === "ZERO_RESULTS"){
74+
// zip
75+
}
76+
else{
77+
outputDiv.html('Via roads: '
78+
+ results[0].distance.text.split(' ').join('&nbsp;') + ' in '
79+
+ results[0].duration.text.split(' ').join('&nbsp;') + ' cycling');
80+
}
7681
}
7782
};
7883

0 commit comments

Comments
 (0)