/** * Defines a path on the earth for which to return elevation data. * This parameter defines a set of two or more ordered * {latitude,longitude} pairs defining a path along the surface * of the earth. This parameter must be used in conjunction * with the samples parameter described below. * * @param $path * @return $this */ public function setPath(Gps\PolyLine $path) { $data = array(); foreach ($path->toArray() as $coordinate) { $data[] = implode(',', $coordinate->toArray()); } $this->paths = implode('|', $data); return $this; }
/** * One or more addresses and/or textual latitude/longitude values, * separated with the pipe (|) character, from which to calculate * distance and time. If you pass an address as a string, * the service will geocode the string and convert it to a * latitude/longitude coordinate to calculate directions. * If you pass coordinates, ensure that no space exists between * the latitude and longitude values. * * @param $origins * @return $this */ public function setOrigins(Gps\PolyLine $origins) { $data = array(); foreach ($origins->toArray() as $coordinate) { $data[] = implode(',', $coordinate->toArray()); } $this->origins = implode('|', $data); return $this; }