search(callback, options)
Fetches points of interest.
Declaration
search(
callback: PointsOfInterestSearchDelegate,
options?: PointsOfInterestSearchOptions,
): number | undefined;Parameters
- callback:
A callback function or delegate object with the following parameters:
error(Error)An error code and descriptive message.
data(Pointsofinterestsearchresponse)An object parsed from server-returned JSON.
- options:
A Pointsofinterestsearchoptions object.
Return Value
This method returns a request ID (integer) that you can use with cancel(id) to cancel a pending request.
Discussion
The search(callback, options) method returns a set of points of interest within the region defined and matching the PointOfInterestFilter.
MapKit JS invokes the callback function on failure and success with two arguments, error and data that represent failure and success information, respectively. You may optionally provide a delegate object instead of a callback. If you call cancel(id) before MapKit JS responds, the system doesn’t call the callback or delegate.