RouteMatrix class
google.maps.routes.RouteMatrix
class
A matrix of routes computed for a set of origin/destination pairs by RouteMatrix.computeRouteMatrix
Access by calling const {RouteMatrix} = await google.maps.importLibrary("routes").
See Libraries in the Maps JavaScript API.
Static Methods | |
|---|---|
computeRouteMatrix |
computeRouteMatrix(request)Parameters:
Return Value:
Promise<{matrix:RouteMatrix}>Takes in a list of origins and destinations and returns a matrix containing route information for each combination of origin and destination. Note: This method requires that you specify a response field mask in the request by setting the ComputeRouteMatrixRequest.fields property. The value is a list of field paths. For example:
Use of the wildcard response field mask fields: ['*'] is discouraged because:
|
Properties | |
|---|---|
rows |
Type:
Array<RouteMatrixRow>The rows of the matrix. Each row corresponds to an origin and contains an array of |