-
{messages.Geocoding.EndTitle}
+
+ {messages.Geocoding.EndTitle}
+
(
{formatDate(props.createdAt, FORMAT)}
- {props.text}
+
+ {props.text}
+
)
diff --git a/src/components/map.js b/src/components/map.js
index 60a87e7..139bf86 100644
--- a/src/components/map.js
+++ b/src/components/map.js
@@ -11,6 +11,7 @@ import {
} from 'react-leaflet'
import Icon from './icon'
+import {setKeyTo} from '../utils/hash'
import leafletIcon from '../utils/leaflet-icons'
import messages from '../utils/messages'
import TransitiveLayer from './transitive-map-layer'
@@ -33,10 +34,10 @@ const endIcon = leafletIcon({
})
type Props = {
+ active: number,
centerCoordinates: Coordinate,
clearStartAndEnd(): void,
- geojson: Feature[],
- geojsonColor: string,
+ isochrones: any[],
markers: any[],
pointsOfInterest: PointsOfInterest,
setEnd(any): void,
@@ -107,11 +108,15 @@ export default class Map extends PureComponent
{
})
}
+ _setZoom = (e: MapEvent) => {
+ setKeyTo('zoom', e.target._zoom)
+ }
+
render (): React$Element {
const {
+ active,
centerCoordinates,
- geojson,
- geojsonColor,
+ isochrones,
markers,
pointsOfInterest,
transitive,
@@ -129,11 +134,15 @@ export default class Map extends PureComponent {
tileLayerProps.zoomOffset = -1
}
+ const baseIsochrone = isochrones[0]
+ const comparisonIsochrone = active !== 0 ? isochrones[active] : null
+
return (
{
onDragEnd={m.onDragEnd}
position={m.position}
>
- {m.label && {m.label}}
+ {m.label &&
+
+
+ {m.label}
+
+ }
))}
- {geojson.map(g => {
- return (
-
- )
- })}
+ {baseIsochrone &&
+ }
+
+ {comparisonIsochrone &&
+ }
{transitive &&
}
@@ -184,22 +189,22 @@ export default class Map extends PureComponent {
{showSelectStartOrEnd &&
- {lastClickedLabel &&
{lastClickedLabel}
}
+ {lastClickedLabel &&
+
+ {lastClickedLabel}
+
}
{markers.length > 0 &&
}
{markers.length > 0 &&
}
@@ -209,6 +214,21 @@ export default class Map extends PureComponent {
}
}
+function Isochrone ({isochrone, color}) {
+ return (
+
+ )
+}
+
class MapboxGeoJson extends GeoJson {
componentWillMount () {
const {mapbox} = require('mapbox.js')
diff --git a/src/components/route-card.js b/src/components/route-card.js
index 3fd0976..ad404ac 100644
--- a/src/components/route-card.js
+++ b/src/components/route-card.js
@@ -84,13 +84,15 @@ function TripDiff ({oldTravelTime, travelTime}) {
if (oldTravelTime === 255) {
return (
- {messages.NewTrip}
+ {messages.NewTrip}
+
)
} else if (actualDiff > 0) {
return (
- {diff}%
+ {diff}%
+
)
} else {
@@ -109,8 +111,12 @@ function Journeys ({journeys, oldTravelTime, travelTime, waitTime}) {
if (!travelTime || !journeys) {
return (
-
{messages.Systems.TripsTitle}
-
{messages.Systems.SelectEnd}
+
+ {messages.Systems.TripsTitle}
+
+
+ {messages.Systems.SelectEnd}
+
)
}
@@ -118,8 +124,12 @@ function Journeys ({journeys, oldTravelTime, travelTime, waitTime}) {
if (travelTime === 255 || journeys.length === 0) {
return (
-
{messages.Systems.TripsTitle}
-
{messages.Systems.TripsEmpty}
+
+ {messages.Systems.TripsTitle}
+
+
+ {messages.Systems.TripsEmpty}
+
)
}
@@ -128,19 +138,20 @@ function Journeys ({journeys, oldTravelTime, travelTime, waitTime}) {
return (
-
{messages.Systems.BestTripTitle}
+
+ {messages.Systems.BestTripTitle}
+
-
{travelTime} {messages.Units.Mins}
+
+ {travelTime} {messages.Units.Mins}
+
{oldTravelTime &&
oldTravelTime !== travelTime &&
}
- {waitTime}
- {' '}
- {messages.Units.Mins}
- {' '}
+ {waitTime} {messages.Units.Mins}{' '}
{messages.Systems.Waiting}
@@ -151,11 +162,15 @@ function Journeys ({journeys, oldTravelTime, travelTime, waitTime}) {
{journeys.length > 1 &&
-
{messages.Systems.AlternateTripsTitle}
+
+ {messages.Systems.AlternateTripsTitle}
+
{alternateJourneys.map((segments, jindex) => (
-
{jindex + 1}.
+
+ {jindex + 1}.
+
{segments.map((segment, index) => (
))}
@@ -204,16 +219,21 @@ function ShowAccess ({
}) {
return (
-
{messages.Systems.AccessTitle}
+
+ {messages.Systems.AccessTitle}
+
{base === ACCESSIBILITY_IS_EMPTY
- ?
{messages.Systems.SelectStart}
+ ?
+ {messages.Systems.SelectStart}
+
: base === ACCESSIBILITY_IS_LOADING
- ?
{messages.Systems.CalculatingAccessibility}
+ ?
+ {messages.Systems.CalculatingAccessibility}
+
: keys.map((k, i) => (
- {(base[k] | 0).toLocaleString()}
- {' '}
+ {(base[k] | 0).toLocaleString()} {' '}
{toSpaceCase(k)}
))}
@@ -248,16 +268,21 @@ function AccessDiffPercentage ({newAccess, originalAccess}) {
function ShowDiff ({keys, base, comparison}) {
return (
-
{messages.Systems.AccessTitle}
+
+ {messages.Systems.AccessTitle}
+
{base === ACCESSIBILITY_IS_EMPTY
- ?
{messages.Systems.SelectStart}
+ ?
+ {messages.Systems.SelectStart}
+
: base === ACCESSIBILITY_IS_LOADING
- ?
{messages.Systems.CalculatingAccessibility}
+ ?
+ {messages.Systems.CalculatingAccessibility}
+
: keys.map((key, i) => (
-
{(base[key] | 0).toLocaleString()}
- {' '}
+
{(base[key] | 0).toLocaleString()} {' '}
{toSpaceCase(key)}