**European Economic Area (EEA) developers**

> [!NOTE]
> If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq.md.txt).

Follow these steps to get set up with Routes Library, Maps JavaScript API

## Get an API key and enable the Maps JavaScript API

Before using the Routes Library, Maps JavaScript API,
you need a Cloud project with a billing account, and both the
Maps JavaScript API and Routes API enabled. To
learn more, see [Set up your Google Cloud project](https://developers.google.com/maps/documentation/javascript/cloud-setup).
[Get an API key](https://developers.google.com/maps/documentation/javascript/get-api-key.md.txt)


[Enable the Maps JavaScript API](https://console.cloud.google.com/apis/library/maps-backend.googleapis.com)


[Enable the Routes API](https://console.cloud.google.com/apis/library/routes.googleapis.com)

## Update your map initialization code

1. [Load the
   Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/load-maps-js-api).
2. Load the Routes library from within an `async` function when needed:

```javascript
    const { Route, RouteMatrix } = await google.maps.importLibrary('routes');
        
```

## Next steps

- [Route class overview](https://developers.google.com/maps/documentation/javascript/routes/route-class-overview.md.txt)
- [Migrate to the new Route class](https://developers.google.com/maps/documentation/javascript/routes/routes-js-migration.md.txt)
- [Route Matrix class overview](https://developers.google.com/maps/documentation/javascript/routes/route-matrix-class-overview.md.txt)
- [Migrate to the new Route Matrix class](https://developers.google.com/maps/documentation/javascript/routes/route-matrix-js-migration.md.txt)