Places UI Kit: A ready-to-use library that provides room for customization and low-code development. Try it out, and share yourinput on your UI Kit experience.
Get started with Routes Stay organized with collections Save and categorize content based on your preferences.
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, seeSet up your Google Cloud project.
Enable the Maps JavaScript API
Update your map initialization code
- Load the Maps JavaScript API.
- Load the Routes library from within an
async
function when needed:
const{Route,RouteMatrix}=awaitgoogle.maps.importLibrary('routes');
Next steps
- Route class overview
- Migrate to the new Route class
- Route Matrix class overview
- Migrate to the new Route Matrix class
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-02 UTC.