Commit 5695fd04 authored by Sharp Hall's avatar Sharp Hall

Add location sharing notice

parent f3199145
......@@ -19,7 +19,7 @@ var nearbyStops = [];
var selectedRoutes = [];
var flatDistanceSorted = [];
var currentLocation = {latitude: 39.952583, longitude: -75.165222};
var currentLocation = null;
function milesFromObj(ref, septaObj) {
return haversine(ref, {latitude: parseFloat(septaObj.lat),
......@@ -38,6 +38,11 @@ function markRoutes(routes) {
var refreshDisplay = _.debounce(function () {
if (currentLocation === null) {
ReactDOM.render(<LocationSharingNotice />,
document.getElementById('routelist'));
return;
}
var here = point([currentLocation.longitude, currentLocation.latitude]);
// find close stops
nearbyStops = _.filter(
......@@ -163,3 +168,15 @@ class VehicleList extends React.Component {
);
}
}
class LocationSharingNotice extends React.Component {
render() {
return (
<div className="locationSharingNotice">
To see results, you must allow your device to share location
information with this page. No location information will
be transmitted over the internet.
</div>
);
}
}
......@@ -5,7 +5,7 @@ body {
font-family: 'Montserrat', sans-serif;
}
.vehicle {
.vehicle, .locationSharingNotice {
margin: 4px;
padding: 4px;
background: #cccccc;
......@@ -13,6 +13,9 @@ body {
overflow:auto;
}
.locationSharingNotice {
margin-top:400px;
}
.coming {
font-weight:bold;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment