Instance Method

cancel

Cancels a previous request for route directions.

Declaration

Boolean cancel(Number id);

Parameters

id

The ID returned by a call to route. Passing an invalid ID or the ID of a request that has completed has no effect.

Return Value

true if the server canceled the pending route request.

Discussion

Sometimes a request needs to be canceled, either because the user initiated the cancellation or has moved on to another activity. You can cancel a directions request by providing its ID.