googlemaps / google-maps-services-java

Java client library for Google Maps API Web Services
Apache License 2.0
1.71k stars 945 forks source link

Route restrictions misses new (?) "indoor" parameter #688

Closed jom-jom closed 4 years ago

jom-jom commented 4 years ago

Hello, first, I would like to thank you for this library - I use it in my first own software project for my master's thesis in the social sciences. It helps a lot, especially since I am fairly new to Java and programming.

Is your feature request related to a problem? Please describe. The class com.google.maps.DirectionsApi contains the enum RouteRestriction which as of now has three elements: TOLL, HIGHWAYS, and FERRIES. But the developer guide for the Distance Matrix API defines a fourth ("indoor") at https://developers.google.com/maps/documentation/distance-matrix/intro#Restrictions

Since com.google.maps.DistanceMatrixApiRequest.avoid(DirectionsApi.RouteRestriction restriction) uses the mentioned enum, the "indoor"-parameter is unavailable.

Describe the solution you'd like It would be very useful if the DistanceMatrixApi classes could get their own restrictions enum. Adding the "indoor" parameter to the DirectionsApi RouteRestriction enum is probably not a perfect solution: if I remember correctly, the "indoor" parameter is not available for the DirectionsApi restriction/avoid parameter.

Describe alternatives you've considered Using generic DistanceMatrixApiRequest.custom(java.lang.String parameter, java.lang.String value) as a workaround.

Thanks! Johannes

jom-jom commented 4 years ago

I also stumbled upon a minor flaw in the javadoc of com.google.maps.DistanceMatrixApiRequest.mode(TravelModel mode) : Currently, it reads "Note that Distance Matrix requests only support TravelMode.DRIVING, TravelMode.WALKING and TravelMode.BICYCLING". But the method actually supports these three and TravelMode.TRANSIT

googlemaps-bot commented 4 years ago

:tada: This issue has been resolved in version 0.15.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: