MCPcopy Index your code
hub / github.com/googlemaps/google-maps-services-python / location_list

Function location_list

googlemaps/convert.py:111–129  ·  view source on GitHub ↗

Joins a list of locations into a pipe separated string, handling the various formats supported for lat/lng values. For example: p = [{"lat" : -33.867486, "lng" : 151.206990}, "Sydney"] convert.waypoint(p) # '-33.867486,151.206990|Sydney' :param arg: The lat/lng list. :t

(arg)

Source from the content-addressed store, hash-verified

109
110
111def location_list(arg):
112 """Joins a list of locations into a pipe separated string, handling
113 the various formats supported for lat/lng values.
114
115 For example:
116 p = [{"lat" : -33.867486, "lng" : 151.206990}, "Sydney"]
117 convert.waypoint(p)
118 # '-33.867486,151.206990|Sydney'
119
120 :param arg: The lat/lng list.
121 :type arg: list
122
123 :rtype: string
124 """
125 if isinstance(arg, tuple):
126 # Handle the single-tuple lat/lng case.
127 return latlng(arg)
128 else:
129 return "|".join([latlng(location) for location in as_list(arg)])
130
131
132def join_list(sep, arg):

Callers 1

shortest_pathFunction · 0.85

Calls 2

latlngFunction · 0.85
as_listFunction · 0.85

Tested by

no test coverage detected