Erste Schritte mit Routen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
So richten Sie die Routes Library, Maps JavaScript API ein:
API-Schlüssel anfordern und Maps JavaScript API aktivieren
Bevor Sie die Routes Library in der Maps JavaScript API verwenden können, benötigen Sie ein Cloud-Projekt mit einem Rechnungskonto. Außerdem müssen die Maps JavaScript API und die Routes API aktiviert sein. Weitere Informationen finden Sie unter Google Cloud-Projekt einrichten.
API-Schlüssel anfordern
Maps JavaScript API aktivieren
Routes API aktivieren
Initialisierungscode der Karte aktualisieren
- Laden Sie die Maps JavaScript API.
- Laden Sie die Routes-Bibliothek bei Bedarf aus einer
async
-Funktion heraus:
const { Route, RouteMatrix } = await google.maps.importLibrary('routes');
Nächste Schritte
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-09-05 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-09-05 (UTC)."],[],[],null,["**European Economic Area (EEA) developers** 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](/maps/comms/eea/faq).\n\nFollow these steps to get set up with Routes Library, Maps JavaScript API\n\nGet an API key and enable the Maps JavaScript API \nBefore using the Routes Library, Maps JavaScript API,\nyou need a Cloud project with a billing account, and both the\nMaps JavaScript API and Routes API enabled. To\nlearn more, see [Set up your Google Cloud project](/maps/documentation/javascript/cloud-setup).\n[Get an API key](/maps/documentation/javascript/get-api-key)\n\n\n[Enable the Maps JavaScript API](https://console.cloud.google.com/apis/library/maps-backend.googleapis.com)\n\n\n[Enable the Routes API](https://console.cloud.google.com/apis/library/routes.googleapis.com)\n\nUpdate your map initialization code\n\n1. [Load the\n Maps JavaScript API](/maps/documentation/javascript/load-maps-js-api).\n2. Load the Routes library from within an `async` function when needed:\n\n```javascript\n const { Route, RouteMatrix } = await google.maps.importLibrary('routes');\n \n```\n\nNext steps\n\n- [Route class overview](/maps/documentation/javascript/routes/route-class-overview)\n- [Migrate to the new Route class](/maps/documentation/javascript/routes/routes-js-migration)\n- [Route Matrix class overview](/maps/documentation/javascript/routes/route-matrix-class-overview)\n- [Migrate to the new Route Matrix class](/maps/documentation/javascript/routes/route-matrix-js-migration)"]]