<!--
{
  "availability" : [
    "MapKit JS: 5.75.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/mapkit/load",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "instm/mapkit/load"
  },
  "title" : "load(libraryNames)"
}
-->

# load(libraryNames)

Tells MapKit JS which libraries to load.

```
load?(libraryNames: string | string[]): Promise<MapKit>;
```

## Parameters

`libraryNames`

The libraries to load.

## Return Value

A promise that resolves when the libraries finish loading. The promise resolves to the [`mapkit`](/documentation/MapKitJS/mapkit) namespace object.

## Discussion

> Note:
> The full bundle of MapKit JS doesn’t implement this method.

This method returns a `Promise` that resolves when the requested libraries finish loading. The promise resolves to the [`mapkit`](/documentation/MapKitJS/mapkit) namespace object, allowing you to destructure the interfaces you need directly from the result:

```javascript
const { Map } = await mapkit.load(["map"]);
```

MapKit JS also dispatches either a `load` event or a `load-error` event when the libraries finish loading. The event ([`MapKitLibraryLoadEvent`](/documentation/MapKitJS/MapKitLibraryLoadEvent)) contains the array of library names that you pass to this method. If the libraries fail to load, the returned promise rejects.

Calling `load()` with libraries that are already loaded is a no-op; the promise resolves immediately.

---

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)