<!--
{
  "availability" : [
    "MapKit JS: 5.45.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/PointsOfInterestSearchDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Type",
  "symbol" : {
    "kind" : "Type",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "type/mapkit.PointsOfInterestSearchDelegate"
  },
  "title" : "PointsOfInterestSearchDelegate"
}
-->

# PointsOfInterestSearchDelegate

An object or callback function that MapKit JS calls when fetching points of interest.

```
type PointsOfInterestSearchDelegate =
    | {
          searchDidError: (error: Error) => void;
          searchDidComplete: (result: PointsOfInterestSearchResponse) => void;
      }
    | ((
          error: Error | null,
          result: PointsOfInterestSearchResponse | null,
      ) => void);
```

## Discussion

You may pass an object to the search method instead of using of a search delegate callback function. MapKit JS calls the following methods on the delegate object when they exist:

- `searchDidComplete` – Upon successful completion of a search request, this method returns a data object that is the same as the one passed to the search callback function.
- `searchDidError` – Called when the search request fails.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)