Method: Mapbox::Matrix.matrix

Defined in:
lib/mapbox/matrix.rb

.matrix(waypoints, profile, options = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/mapbox/matrix.rb', line 23

def self.matrix(waypoints, profile, options={})
  formatted_waypoints = waypoints.map {|p| xy_from_hash(p).join ','}.join ';'
  params = self.assemble_params(options)
  return request(
      :get,
      "/directions-matrix/v1/mapbox/#{profile}/#{formatted_waypoints}.json#{params}",
      nil)
end