Skip to content

Commit ca439ee

Browse files
committed
Merge branch 'master' of ssh://github.com/googlemaps/google-maps-services-python
Change-Id: Iee6e59d34cf2528ea2f3e06e53ac29f9b1c44835
2 parents 881bfdf + b1ec30b commit ca439ee

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎googlemaps/distance_matrix.py‎

100644100755
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
def distance_matrix(client, origins, destinations,
2525
mode=None, language=None, avoid=None, units=None,
2626
departure_time=None, arrival_time=None, transit_mode=None,
27-
transit_routing_preference=None, traffic_model=None):
27+
transit_routing_preference=None, traffic_model=None, region=None):
2828
""" Gets travel distance and time for a matrix of origins and destinations.
2929
3030
:param origins: One or more locations and/or latitude/longitude values,
@@ -81,6 +81,11 @@ def distance_matrix(client, origins, destinations,
8181
the travel mode is driving, and where the request includes a
8282
departure_time.
8383
84+
:param region: Specifies the prefered region the geocoder should search
85+
first, but it will not restrict the results to only this region. Valid
86+
values are a ccTLD code.
87+
:type region: string
88+
8489
:rtype: matrix of distances. Results are returned in rows, each row
8590
containing one origin paired with each destination.
8691
"""
@@ -127,4 +132,7 @@ def distance_matrix(client, origins, destinations,
127132
if traffic_model:
128133
params["traffic_model"] = traffic_model
129134

135+
if region:
136+
params["region"] = region
137+
130138
return client._request("/maps/api/distancematrix/json", params)

0 commit comments

Comments
 (0)