Skip to content

Commit

Permalink
Merge pull request #127 from traveltime-dev/fix_readme
Browse files Browse the repository at this point in the history
Fixed time-filter/fast examples in README.md.
  • Loading branch information
mikism authored Sep 5, 2024
2 parents f79ea17 + f75079f commit d302d9c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ ManyToOne manyToOne = new ManyToOne(
new PublicTransport(),
1900,
"weekday_morning",
Arrays.asList(Property.TRAVEL_TIME, Property.FARES)
Arrays.asList(Property.TRAVEL_TIME, Property.FARES),
null
);

OneToMany oneToMany = new OneToMany(
Expand All @@ -220,7 +221,8 @@ OneToMany oneToMany = new OneToMany(
new PublicTransport(),
1900,
"weekday_morning",
Arrays.asList(Property.TRAVEL_TIME, Property.FARES)
Arrays.asList(Property.TRAVEL_TIME, Property.FARES),
null
);

ArrivalSearches arrivalSearches = new ArrivalSearches(
Expand Down Expand Up @@ -258,6 +260,7 @@ Body attributes:
* country: Return the results that are within the specified country;
* requestType: MANY_TO_ONE(single arrival location and multiple departure locations) or ONE_TO_MANY (single departure location and multiple arrival locations).
* withDistance: Specifies if distance also should be returned.
* snapping: Specifies snapping parameters. (optional)

```java
TimeFilterFastProtoRequest request = TimeFilterFastProtoRequest
Expand All @@ -268,7 +271,13 @@ TimeFilterFastProtoRequest request = TimeFilterFastProtoRequest
.travelTime(7200)
.country(Countries.NETHERLANDS)
.requestType(RequestType.ONE_TO_MANY)
.withDistance(false)
.withDistance(false)
.snapping(Snapping
.builder()
.penalty(Snapping.SnapPenalty.ENABLED)
.acceptRoads(Snapping.AcceptRoads.ANY_DRIVABLE)
.build()
)
.build();

Either<TravelTimeError, TimeFilterFastProtoResponse> response = sdk.sendProto(request);
Expand Down

0 comments on commit d302d9c

Please sign in to comment.