Skip to content

Commit 0f4af4c

Browse files
author
David Emory
committed
fix(example): Fix bundled example
1 parent 3909593 commit 0f4af4c

File tree

5 files changed

+45
-37
lines changed

5 files changed

+45
-37
lines changed

example-config.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,12 @@ geocoder:
2323
maxLat: 45.7445
2424
MAPZEN_KEY: MAPZEN_KEY
2525

26-
modes:
27-
- TRANSIT,WALK
26+
modeGroups:
27+
- name: Transit
28+
modes:
29+
- TRAM
30+
- BUS
31+
- name: Walk/Bike
32+
modes:
33+
- WALK
34+
- BICYCLE

example.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.row {
1+
.main-row {
22
position: fixed;
33
top: 52px;
44
bottom: 0px;
@@ -18,3 +18,7 @@
1818
margin: 0px;
1919
padding: 0px;
2020
}
21+
22+
.date-time-selector {
23+
margin-top: 20px;
24+
}

example.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@ import { Navbar, Grid, Row, Col } from 'react-bootstrap'
1111

1212
// import OTP-RR components
1313
import {
14+
BaseLayers,
15+
BaseMap,
16+
DateTimeSelector,
1417
EndpointsOverlay,
15-
ItineraryCarousel,
18+
ErrorMessage,
1619
ItineraryOverlay,
1720
LocationField,
18-
ModeSelector,
19-
DateTimeSelector,
20-
// NarrativeItineraries,
21-
BaseMap,
22-
BaseLayers,
23-
// OsmBaseLayer,
21+
NarrativeItineraries,
2422
PlanTripButton,
25-
createOtpReducer,
26-
ErrorMessage,
27-
SwitchButton
23+
SettingsSelectorPanel,
24+
SwitchButton,
25+
26+
createOtpReducer
2827
} from './lib'
2928

3029
// load the OTP configuration
@@ -61,17 +60,16 @@ class OtpRRExample extends Component {
6160
<Navbar.Brand>OpenTripPlanner</Navbar.Brand>
6261
</Navbar>
6362
<Grid fluid>
64-
<Row>
63+
<Row className='main-row'>
6564
<Col xs={12} md={4} className='sidebar'>
6665
<LocationField type='from' label='Enter start location or click on map...' />
6766
<LocationField type='to' label='Enter destination or click on map...' />
6867
<SwitchButton />
69-
<ModeSelector />
7068
<DateTimeSelector />
69+
<SettingsSelectorPanel />
7170
<ErrorMessage />
7271
<PlanTripButton />
73-
{/* <NarrativeItineraries /> */}
74-
<ItineraryCarousel />
72+
<NarrativeItineraries />
7573
</Col>
7674

7775
<Col xsHidden md={8} className='map-container'>

lib/components/narrative/default/default-itinerary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class DefaultItinerary extends NarrativeItinerary {
1818
setActiveStep
1919
} = this.props
2020
return (
21-
<div className={`option itinerary${active ? ' active' : ''}`}>
21+
<div className={`option default-itin${active ? ' active' : ''}`}>
2222
<button
2323
className='header'
2424
onClick={this._onHeaderClick}

lib/components/narrative/narrative.css

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222

2323
/* ITINERARY OPTION */
2424

25-
.otp .option .default-itin {
25+
.otp .option.default-itin {
2626
margin-bottom: 16px;
2727
padding: 10px;
28-
background-color: green;
2928
border: 1px solid #e3e3e3;
3029
border-radius: 4px
3130
}
@@ -38,51 +37,51 @@
3837
background-color: #EAF3F2;
3938
}
4039

41-
.otp .option .default-itin > .header {
40+
.otp .option.default-itin > .header {
4241
font-size: 16px;
4342
/*padding-bottom: 4px;*/
4443
/*border-bottom: 1px solid black;*/
4544
/*margin-bottom: 6px;*/
4645
cursor: pointer;
4746
}
4847

49-
.otp .option .default-itin > .header > .title {
48+
.otp .option.default-itin > .header > .title {
5049
font-weight: bold;
5150
}
5251

53-
.otp .option .default-itin > .header > .summary {
52+
.otp .option.default-itin > .header > .summary {
5453
text-align: center;
5554
margin: 8px 0px;
5655
}
5756

5857
/* ITINERARY LEG */
5958

60-
.otp .option .default-itin .leg {
59+
.otp .option.default-itin .leg {
6160
background-color: #d0d0d0;
6261
padding: 6px;
6362
margin-bottom: 8px;
6463
}
6564

66-
.otp .option .default-itin .leg:hover {
65+
.otp .option.default-itin .leg:hover {
6766
background-color: var(--hover-color);
6867
}
6968

70-
.otp .option .default-itin .leg.active {
69+
.otp .option.default-itin .leg.active {
7170
background-color: #ddd;
7271
}
7372

74-
.otp .option .default-itin .leg > .header {
73+
.otp .option.default-itin .leg > .header {
7574
cursor: pointer;
7675
}
7776

78-
.otp .option .default-itin .leg .stop-count {
77+
.otp .option.default-itin .leg .stop-count {
7978
cursor: pointer;
8079
/*margin-bottom: 4px;*/
8180
padding: 4px;
8281
margin-left: 8px;
8382
}
8483

85-
.otp .option .default-itin .leg .stop-list {
84+
.otp .option.default-itin .leg .stop-list {
8685
cursor: pointer;
8786
margin-bottom: 4px;
8887
padding: 4px;
@@ -91,42 +90,42 @@
9190
list-style: none;
9291
}
9392

94-
.otp .Itin .option .default-itin .leg .item {
93+
.otp .Itin .option.default-itin .leg .item {
9594
padding: 2px;
9695
font-size: small;
9796
}
9897

99-
.otp .option .default-itin .leg .alert-item {
98+
.otp .option.default-itin .leg .alert-item {
10099
padding-left: 22px;
101100
}
102101

103-
.otp .option .default-itin .leg .stop-list .stop-item {
102+
.otp .option.default-itin .leg .stop-list .stop-item {
104103
padding-left: 0px;
105104
}
106105

107-
.otp .option .default-itin .leg .stop-list .info-item {
106+
.otp .option.default-itin .leg .stop-list .info-item {
108107
padding-left: 12px;
109108
}
110109

111110
/* ITINERARY STEP */
112111

113-
.otp .option .default-itin .step {
112+
.otp .option.default-itin .step {
114113
cursor: pointer;
115114
background-color: #eee;
116115
margin-bottom: 4px;
117116
padding: 4px;
118117
font-size: x-small;
119118
}
120119

121-
.otp .option .default-itin .step:hover {
120+
.otp .option.default-itin .step:hover {
122121
background-color: var(--hover-color);
123122
}
124123

125-
.otp .option .default-itin .step.active {
124+
.otp .option.default-itin .step.active {
126125
background-color: #ccc;
127126
/*border: 1px dotted;*/
128127
}
129128

130-
.otp .option .default-itin .step .step-distance {
129+
.otp .option.default-itin .step .step-distance {
131130
float: right;
132131
}

0 commit comments

Comments
 (0)