@@ -32,6 +32,7 @@ function ItineraryPageMap(
32
32
showDurationBubble,
33
33
itinerary,
34
34
showBackButton,
35
+ isLocationPopupEnabled,
35
36
...rest
36
37
} ,
37
38
{ match, router, executeAction, config } ,
@@ -99,13 +100,18 @@ function ItineraryPageMap(
99
100
leafletObjs . push ( < LocationMarker key = { `via_${ i } ` } position = { via } /> ) ;
100
101
} ) ;
101
102
102
- // max 5 viapoints
103
- const locationPopup =
104
- config . viaPointsEnabled && viaPoints . length < 5
105
- ? 'all'
106
- : 'origindestination' ;
107
- const onSelectLocation = ( item , id ) =>
108
- onLocationPopup ( item , id , router , match , executeAction ) ;
103
+ let locationPopup = 'none' ;
104
+ let onSelectLocation ;
105
+
106
+ if ( isLocationPopupEnabled ) {
107
+ // max 5 viapoints
108
+ locationPopup =
109
+ config . viaPointsEnabled && viaPoints . length < 5
110
+ ? 'all'
111
+ : 'origindestination' ;
112
+ onSelectLocation = ( item , id ) =>
113
+ onLocationPopup ( item , id , router , match , executeAction ) ;
114
+ }
109
115
110
116
return (
111
117
< MapWithTracking
@@ -149,6 +155,7 @@ ItineraryPageMap.propTypes = {
149
155
showDurationBubble : PropTypes . bool ,
150
156
itinerary : itineraryShape ,
151
157
showBackButton : PropTypes . bool ,
158
+ isLocationPopupEnabled : PropTypes . bool ,
152
159
} ;
153
160
154
161
ItineraryPageMap . defaultProps = {
@@ -158,6 +165,7 @@ ItineraryPageMap.defaultProps = {
158
165
showDurationBubble : false ,
159
166
itinerary : undefined ,
160
167
showBackButton : true ,
168
+ isLocationPopupEnabled : false ,
161
169
} ;
162
170
163
171
ItineraryPageMap . contextTypes = {
0 commit comments