Skip to content

Commit

Permalink
Merge pull request #126 from Jovillios/add_google_directions_str
Browse files Browse the repository at this point in the history
Add Support for Address String Input in Google Router's Directions Method
  • Loading branch information
chrstnbwnkl committed Apr 30, 2024
2 parents 3432ce4 + c19216e commit fd474a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions routingpy/routers/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,15 @@ def directions( # noqa: C901
origin, destination = locations[0], locations[-1]
if isinstance(origin, (list, tuple)):
params["origin"] = convert.delimit_list(list(reversed(origin)))
elif isinstance(origin, str):
params["origin"] = origin
elif isinstance(origin, self.WayPoint):
raise TypeError("The first and last locations must be list/tuple of [lon, lat]")

if isinstance(destination, (list, tuple)):
params["destination"] = convert.delimit_list(list(reversed(destination)))
elif isinstance(destination, str):
params["destination"] = destination
elif isinstance(origin, self.WayPoint):
raise TypeError("The first and last locations must be list/tuple of [lon, lat]")

Expand Down

0 comments on commit fd474a0

Please sign in to comment.