diff --git a/routingpy/routers/google.py b/routingpy/routers/google.py index 07e2c2f..c70572c 100644 --- a/routingpy/routers/google.py +++ b/routingpy/routers/google.py @@ -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]")