diff --git a/googlemaps/distance_matrix.py b/googlemaps/distance_matrix.py index a30cbe0..ceeddac 100755 --- a/googlemaps/distance_matrix.py +++ b/googlemaps/distance_matrix.py @@ -51,7 +51,8 @@ def distance_matrix(client, origins, destinations, :type language: string :param avoid: Indicates that the calculated route(s) should avoid the - indicated features. Valid values are "tolls", "highways" or "ferries". + indicated features. Valid values are "tolls", "highways", "indoor" or "ferries" + as well as any combination of them separated by "|". :type avoid: string :param units: Specifies the unit system to use when displaying results. @@ -107,8 +108,12 @@ def distance_matrix(client, origins, destinations, params["language"] = language if avoid: - if avoid not in ["tolls", "highways", "ferries"]: - raise ValueError("Invalid route restriction.") + valid_avoids = ["tolls", "highways", "indoor", "ferries"] + avoid_tokens = avoid.split("|") + for token in avoid_tokens: + if token not in valid_avoids: + raise ValueError("Invalid route restriction.") + valid_avoids.remove(token) params["avoid"] = avoid if units: