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

# GeoJSONImporterCallback

A callback function that MapKit JS invokes when importing a GeoJSON object.

```
type GeoJSONImporterCallback = (
    ...args:
        | [GeoJSONImportError, GeoJSONTypes.GeoJSON | undefined]
        | [null, ItemCollection]
) => void;
```

## Discussion

MapKit JS invokes this callback with two arguments, `error` on failure and `result` on success, as follows:

- `error`: A [`GeoJSONImportError`](/documentation/MapKitJS/GeoJSONImportError) that contains an error code and a descriptive message.
- `result`: An [`ItemCollection`](/documentation/MapKitJS/ItemCollection) in which MapKit JS stores the raw GeoJSON to use for generating the object in the object’s `data` property.

---

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)