Thư viện ứng dụng của API Tối ưu hoá tuyến đường
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trang này cho biết cách bắt đầu sử dụng các thư viện ứng dụng cho Route Optimization API.
Đọc thêm về các thư viện ứng dụng trong bài viết Giải thích về thư viện ứng dụng.
Cài đặt thư viện ứng dụng
Thiết lập phương thức xác thực
Khi sử dụng thư viện ứng dụng, bạn sẽ dùng Thông tin xác thực mặc định của ứng dụng (ADC) để xác thực. Để biết thông tin về cách thiết lập ADC, hãy xem bài viết Cung cấp thông tin xác thực cho Thông tin xác thực mặc định của ứng dụng. Để biết thông tin về cách sử dụng ADC với thư viện ứng dụng, hãy xem phần Xác thực bằng thư viện ứng dụng.
Tài nguyên khác
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eThis page provides instructions for getting started with the Route Optimization API client libraries, covering installation and authentication setup for various programming languages like Java, Go, Node.js, Python, .Net, and PHP.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries simplify interaction with the Route Optimization API by providing language-specific implementations and handling authentication using Application Default Credentials (ADC).\u003c/p\u003e\n"],["\u003cp\u003eInstallation instructions and setup guides for each supported language are linked for developers to quickly integrate the API into their projects.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage provided resources like source code, package documentation, and issue trackers for further assistance and community support.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication with the API is streamlined through Application Default Credentials (ADC), ensuring secure access to Google Cloud services.\u003c/p\u003e\n"]]],["Client libraries for the Route Optimization API can be installed using specific commands for each language: `go get cloud.google.com/go/maps` (Go), `npm install @googlemaps/routeoptimization` (Node.js), `pip install google-maps-routeoptimization` (Python), and `composer require google/maps-routeoptimization` (PHP). Java and .Net instructions are found on their respective documentation pages. Authentication is handled through Application Default Credentials (ADC). Each language also provides links to source code and issue trackers.\n"],null,["# Route Optimization API client libraries\n\nThis page shows how to get started with the client libraries for\nRoute Optimization API.\n\nRead more about the client libraries in [Client Libraries Explained](https://cloud.google.com/apis/docs/client-libraries-explained).\n\nInstall client libraries\n------------------------\n\n### Java\n\nFor more information, see [Setting Up a Java Development Environment](https://cloud.google.com/java/docs/setup).\n\nSee [Google Route Optimization API Client for Java](https://github.com/googleapis/google-cloud-java/tree/main/java-maps-routeoptimization) for the installation\ninstructions.\n\n### Go\n\n```\ngo get cloud.google.com/go/maps\n```\n\nFor more information, see [Setting Up a Go Development Environment](https://cloud.google.com/go/docs/setup).\n\nSee [Google Route Optimization API Client for Go](https://pkg.go.dev/cloud.google.com/go/maps/routeoptimization/apiv1) for the installation\ninstructions.\n\n### Node.js\n\n```\nnpm install @googlemaps/routeoptimization\n```\n\nFor more information, see [Setting Up a Node.js Development Environment](https://cloud.google.com/nodejs/docs/setup).\n\nFor the complete installation instructions, see\n[Google Routes API Client for Node.js](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization)\n\n### Python\n\n```\npip install google-maps-routeoptimization\n```\n\nFor more information, see [Setting Up a Python Development Environment](https://cloud.google.com/python/docs/setup).\n\nFor the complete installation instructions, see\n[Google Route Optimization API Client for Python](https://github.com/googleapis/google-cloud-python/tree/main/packages/google-maps-routeoptimization)\n\n### .Net\n\nFor more information, see [Setting Up a .Net Development Environment](https://cloud.google.com/dotnet/docs/setup).\n\nFor the complete installation instructions, see\n[Google Route Optimization API Client for .Net](https://googleapis.dev/dotnet/Google.Maps.RouteOptimization.V1/latest/).\n\n### PHP\n\n```\ncomposer require google/maps-routeoptimization\n```\n\nFor more information, see [Getting Started with PHP](https://cloud.google.com/php/getting-started).\n\nFor the complete installation instructions, see\n[Google Maps Route Optimization Client for PHP](https://packagist.org/packages/google/maps-routeoptimization).\n\nSet up authentication\n---------------------\n\nWhen you use client libraries, you use\n[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials) to authenticate. For information\nabout setting up ADC, see [Provide credentials for Application Default\nCredentials](https://cloud.google.com/docs/authentication/provide-credentials-adc). For information about using ADC with client libraries, see\n[Authenticate using client libraries](https://cloud.google.com/docs/authentication/client-libraries).\n\nAdditional resources\n--------------------\n\n### Java\n\n- [Source Code](https://github.com/googleapis/google-cloud-java/tree/main/java-maps-routeoptimization)\n\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-java/issues)\n\n\n### Go\n\n- [Source Code](https://github.com/googleapis/google-cloud-go/tree/main/maps/routeoptimization/apiv1)\n- [Package Documentation](https://pkg.go.dev/cloud.google.com/go/maps/routeoptimization/apiv1)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-go/issues)\n\n### Node.js\n\n- [Source Code](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-node/issues)\n\n### Python\n\n- [Source Code](https://github.com/googleapis/google-cloud-python/tree/main/packages/google-maps-routeoptimization)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-python/issues)\n\n### .Net\n\n- [Source Code](https://github.com/googleapis/google-cloud-dotnet/tree/main/apis/Google.Maps.RouteOptimization.V1)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-dotnet/issues)\n\n### PHP\n\n- [Source Code](https://github.com/googleapis/google-cloud-php/tree/main/MapsRouteOptimization)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-php/issues)\n\n\u003cbr /\u003e"]]