File tree Expand file tree Collapse file tree
main/java/com/google/maps
test/java/com/google/maps Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,7 +111,10 @@ public enum RouteRestriction implements UrlValue {
111111 HIGHWAYS ("highways" ),
112112
113113 /** Indicates that the calculated route should avoid ferries. */
114- FERRIES ("ferries" );
114+ FERRIES ("ferries" ),
115+
116+ /** Indicates that the calculated route should avoid indoor areas. */
117+ INDOOR ("indoor" );
115118
116119 private final String restriction ;
117120
Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ public DirectionsApiRequest mode(TravelMode mode) {
137137 /**
138138 * Indicates that the calculated route(s) should avoid the indicated features.
139139 *
140- * @param restrictions one or more of {@link DirectionsApi.RouteRestriction#TOLLS}, {@link
141- * DirectionsApi.RouteRestriction#HIGHWAYS}, {@link DirectionsApi.RouteRestriction#FERRIES}
140+ * @param restrictions one or more of {@link DirectionsApi.RouteRestriction} objects.
142141 * @return Returns this {@code DirectionsApiRequest} for call chaining.
143142 */
144143 public DirectionsApiRequest avoid (DirectionsApi .RouteRestriction ... restrictions ) {
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public DistanceMatrixApiRequest destinations(LatLng... points) {
9696 * Specifies the mode of transport to use when calculating directions.
9797 *
9898 * <p>Note that Distance Matrix requests only support {@link TravelMode#DRIVING}, {@link
99- * TravelMode#WALKING} and {@link TravelMode#BICYCLING }.
99+ * TravelMode#WALKING}, {@link TravelMode#BICYCLING} and {@link TravelMode#TRANSIT }.
100100 *
101101 * @param mode One of the travel modes supported by the Distance Matrix API.
102102 * @return Returns this {@code DistanceMatrixApiRequest} for call chaining.
@@ -115,8 +115,7 @@ public DistanceMatrixApiRequest mode(TravelMode mode) {
115115 /**
116116 * Introduces restrictions to the route. Only one restriction can be specified.
117117 *
118- * @param restriction One of {@link RouteRestriction#TOLLS}, {@link RouteRestriction#FERRIES} or
119- * {@link RouteRestriction#HIGHWAYS}.
118+ * @param restriction A {@link RouteRestriction} object.
120119 * @return Returns this {@code DistanceMatrixApiRequest} for call chaining.
121120 */
122121 public DistanceMatrixApiRequest avoid (RouteRestriction restriction ) {
Original file line number Diff line number Diff line change @@ -180,6 +180,24 @@ public void testTorontoToMontrealByBicycleAvoidingHighways() throws Exception {
180180 }
181181 }
182182
183+ @ Test
184+ public void testSanFranciscoToSeattleByBicycleAvoidingIndoor () throws Exception {
185+ try (LocalTestServerContext sc =
186+ new LocalTestServerContext ("{\" routes\" : [{}],\" status\" : \" OK\" }" )) {
187+ DirectionsApi .newRequest (sc .context )
188+ .origin ("San Francisco" )
189+ .destination ("Seattle" )
190+ .avoid (RouteRestriction .INDOOR )
191+ .mode (TravelMode .BICYCLING )
192+ .await ();
193+
194+ sc .assertParamValue ("San Francisco" , "origin" );
195+ sc .assertParamValue ("Seattle" , "destination" );
196+ sc .assertParamValue (RouteRestriction .INDOOR .toUrlValue (), "avoid" );
197+ sc .assertParamValue (TravelMode .BICYCLING .toUrlValue (), "mode" );
198+ }
199+ }
200+
183201 /**
184202 * Brooklyn to Queens by public transport.
185203 *
You can’t perform that action at this time.
0 commit comments