概要
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Maps JavaScript API のルート ライブラリには、以前の DirectionsService
オブジェクトと DistanceMatrixService
オブジェクトに代わる Route
クラスと RouteMatrix
クラスが含まれています。
Route
クラス
Route
クラスは、2 つの地点間の最適なルートを返す computeRoutes()
メソッドを提供します。複数の地点間の移動について、交通機関や自転車、車、原動機付自転車、徒歩でのルートをリアルタイムの交通情報とともに示します。
RouteMatrix
クラス
RouteMatrix
クラスは、さまざまな出発地と目的地間のルートの行列の距離と移動時間を返します。複数の目的地について、最大 625 個のルート要素を踏まえて移動時間と距離を算出します。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-27 UTC。
[null,null,["最終更新日 2025-08-27 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\nThe Routes Library, Maps JavaScript API includes the `Route` and `RouteMatrix`\nclasses, which replace the legacy `DirectionsService` and `DistanceMatrixService`\nobjects.\n\n`Route` class\n\nThe `Route` class provides the `computeRoutes()` method, which returns\nthe ideal route between two locations. Provide directions with real-time traffic for transit,\nbiking, driving, 2-wheel motorized vehicles, or walking between multiple locations.\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- [Try the Routes library demo](/maps/documentation/javascript/routes/demo)\n\n`RouteMatrix` class\n\nThe `RouteMatrix` class returns distances and travel times for a matrix of routes\nbetween different origin and destination locations. Calculate travel times and distances for\nmultiple destinations for up to 625 route elements.\n\n- [Route matrix class overview](/maps/documentation/javascript/routes/route-matrix-class-overview)\n- [Migrate to the new `RouteMatrix` class](/maps/documentation/javascript/routes/route-matrix-js-migration)\n\nNext steps\n\n- [Get started](/maps/documentation/javascript/routes/start)"]]