Contents

eta(request, callback)

Retrieves estimated arrival times to up to 10 destinations from a single starting point.

Declaration

eta(
        request: EtaRequestOptions,
        callback: (error: Error | null, result?: EtaResponse) => void,
    ): number | undefined;

Parameters

  • request:

    An Etarequestoptions object that specifies details for the server to provide estimated arrival times at one or more destinations.

  • callback:

    A callback function that receives the estimated time response object, returned asynchronously.

Return Value

A request ID, which you can pass to cancel(id) to cancel a pending request.

Discussion

To get a set of estimated arrival times, provide an EtaRequestOptions object when you call the eta(request, callback) method. You may provide up to 10 destinations. The server returns an error if you request more than 10 destinations in a single request.

Estimated times are returned asynchronously via a callback function. MapKit JS invokes the callback function with two arguments, error on failure and data on success.

error contains an error code and a text description of the error. data is an EtaResponse object.

See Also

Getting estimated arrival times