Skip to content

Commit 5218299

Browse files
remove waypoint limit check (there is no such a limitation for offline routes) (#928)
1 parent 57f429f commit 5218299

2 files changed

Lines changed: 0 additions & 15 deletions

File tree

services-directions/src/main/java/com/mapbox/api/directions/v5/MapboxDirections.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,6 @@ public Builder destination(@NonNull Point destination) {
421421
* @since 3.0.0
422422
*/
423423
public Builder addWaypoint(@NonNull Point waypoint) {
424-
if (coordinates.size() > 23) {
425-
throw new ServicesException("A max of 25 coordinates including the origin and destination"
426-
+ "values can be used inside your request.");
427-
}
428424
coordinates.add(waypoint);
429425
return this;
430426
}

services-directions/src/test/java/com/mapbox/api/directions/v5/MapboxDirectionsTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,6 @@ public void sanity() throws Exception {
118118
Assert.assertNotNull(mapboxDirections);
119119
}
120120

121-
@Test
122-
public void addWaypoint_maxWaypointsAdded() throws Exception {
123-
thrown.expect(ServicesException.class);
124-
thrown.expectMessage("A max of 25 coordinates including the origin and destination");
125-
MapboxDirections.Builder mapboxDirectionsBuilder = MapboxDirections.builder();
126-
for (int i = 0; i < 25; i++) {
127-
mapboxDirectionsBuilder.addWaypoint(Point.fromLngLat(i, i + 1));
128-
}
129-
mapboxDirectionsBuilder.accessToken(ACCESS_TOKEN).build().executeCall();
130-
}
131-
132121
@Test
133122
public void build_noAccessTokenExceptionThrown() throws Exception {
134123
thrown.expect(IllegalStateException.class);

0 commit comments

Comments
 (0)