**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).

The Routes Library, Maps JavaScript API includes the `Route` and `RouteMatrix`
classes, which replace the legacy `DirectionsService` and `DistanceMatrixService`
objects.

## `Route` class

![Directions on a map.](https://developers.google.com/static/maps/documentation/javascript/routes/images/routes_api_hero.png)

The `Route` class provides the `computeRoutes()` method, which returns
the ideal route between two locations. Provide directions with real-time traffic for transit,
biking, driving, 2-wheel motorized vehicles, or walking between multiple locations.

- [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)
- [Try the Routes library demo](https://developers.google.com/maps/documentation/javascript/routes/demo.md.txt)

## `RouteMatrix` class

![Distance matrix on a map.](https://developers.google.com/static/maps/documentation/javascript/routes/images/distanceMatrix_hero_image.png)

The `RouteMatrix` class returns distances and travel times for a matrix of routes
between different origin and destination locations. Calculate travel times and distances for
multiple destinations for up to 625 route elements.

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

## Next steps

- [Get started](https://developers.google.com/maps/documentation/javascript/routes/start.md.txt)