ผลิตภัณฑ์หรือฟีเจอร์นี้อยู่ในสถานะเดิม ดูข้อมูลเพิ่มเติมเกี่ยวกับระยะเดิมและวิธีย้ายข้อมูลจากบริการเดิมไปยังบริการที่ใหม่กว่าได้ที่
ผลิตภัณฑ์และฟีเจอร์เดิม
ตั้งค่าโปรเจ็กต์ Google Cloud
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คู่มือนี้แสดงวิธีตั้งค่าโปรเจ็กต์ Google Cloud ก่อนใช้
API ของแพลตฟอร์ม Google Maps แม้ว่าคุณอาจทำตามขั้นตอนเหล่านี้บางส่วนในหน้าเริ่มต้นใช้งาน Google Maps Platform แล้ว
เอกสารนี้จะให้วิธีการเพิ่มเติมที่เป็นประโยชน์สำหรับการจัดการโปรเจ็กต์
สร้างโปรเจ็กต์
หากต้องการใช้ Google Maps Platform คุณต้องมีโปรเจ็กต์เพื่อจัดการบริการ
ข้อมูลเข้าสู่ระบบ การเรียกเก็บเงิน API และ SDK
คุณต้องตั้งค่าการเรียกเก็บเงินสำหรับแต่ละโปรเจ็กต์ แต่ระบบจะเรียกเก็บเงินจากคุณก็ต่อเมื่อโปรเจ็กต์ใช้บริการที่ไม่มีค่าใช้จ่ายเกินโควต้า
วิธีสร้างโปรเจ็กต์ Cloud ที่เปิดใช้การเรียกเก็บเงิน
คอนโซล
-
สร้างโปรเจ็กต์ Google Cloud ใหม่ใน Cloud Console โดยทำดังนี้
สร้างโปรเจ็กต์ใหม่
-
ในหน้าโปรเจ็กต์ใหม่ ให้กรอกข้อมูลที่จำเป็นดังนี้
-
ชื่อโปรเจ็กต์: ยอมรับค่าเริ่มต้นหรือป้อนชื่อที่กำหนดเอง
คุณเปลี่ยนชื่อโปรเจ็กต์ได้ทุกเมื่อ ดูข้อมูลเพิ่มเติมได้ที่
การระบุโปรเจ็กต์
-
รหัสโปรเจ็กต์: ยอมรับค่าเริ่มต้นหรือคลิกแก้ไขเพื่อป้อนรหัสที่กำหนดเอง
ซึ่ง Google APIs จะใช้เป็นตัวระบุที่ไม่ซ้ำกันสำหรับโปรเจ็กต์ของคุณ
หลังจากสร้างโปรเจ็กต์แล้ว คุณจะเปลี่ยนรหัสโปรเจ็กต์ไม่ได้ ดังนั้น
โปรดเลือกรหัสที่คุณจะใช้ได้อย่างสะดวกตลอดอายุการใช้งานของ
โปรเจ็กต์ อย่าใส่ข้อมูลที่ละเอียดอ่อนในรหัสโปรเจ็กต์
-
บัญชีสำหรับการเรียกเก็บเงิน: เลือกบัญชีสำหรับการเรียกเก็บเงินสำหรับโปรเจ็กต์ หากคุณ
ยังไม่ได้ตั้งค่าบัญชีสำหรับการเรียกเก็บเงินหรือมีบัญชีสำหรับการเรียกเก็บเงินเพียงบัญชีเดียว คุณ
จะไม่เห็นตัวเลือกนี้
คุณต้องเป็นผู้ดูแลระบบบัญชีสำหรับการเรียกเก็บเงินหรือผู้จัดการการเรียกเก็บเงินของโปรเจ็กต์
จึงจะเชื่อมโยงโปรเจ็กต์กับบัญชีสำหรับการเรียกเก็บเงินได้ ดูข้อมูลเพิ่มเติมได้ที่
เอกสารประกอบเกี่ยวกับการควบคุมการเข้าถึงการเรียกเก็บเงิน
-
สถานที่: หากมีองค์กรที่ต้องการลิงก์โปรเจ็กต์
ให้คลิกเรียกดูแล้วเลือกองค์กรนั้น หรือเลือก "ไม่มีองค์กร"
ดูข้อมูลเพิ่มเติมได้ที่หัวข้อการสร้างและการจัดการโฟลเดอร์
และความสัมพันธ์ระหว่างองค์กร โปรเจ็กต์ และบัญชีสำหรับการเรียกเก็บเงิน
เลือกสร้าง
เปิดใช้การเรียกเก็บเงิน
คุณต้องเปิดใช้การเรียกเก็บเงินจึงจะทำให้แอปใช้งานได้ จะไม่มีการเรียกเก็บเงินจากบัญชีของคุณ
หากคุณใช้ภายในโควต้ารายเดือน
หากแอปพลิเคชันของคุณต้องการทรัพยากรที่เกินโควต้าต่อเดือน ระบบจะ
เรียกเก็บเงินสำหรับการใช้งานเพิ่มเติม
หากคุณมีบัญชีสำหรับการเรียกเก็บเงินเมื่อสร้างโปรเจ็กต์ Cloud ระบบจะเปิดใช้การเรียกเก็บเงินในโปรเจ็กต์นั้นโดยอัตโนมัติ
วิธีเปิดใช้การเรียกเก็บเงินในโปรเจ็กต์ Cloud
- ใน Cloud Console ให้ไปที่หน้าการเรียกเก็บเงิน
ไปที่หน้าการเรียกเก็บเงิน
- เลือกหรือสร้างโปรเจ็กต์ระบบคลาวด์
- หน้าการเรียกเก็บเงินจะแสดงข้อมูลต่อไปนี้อย่างใดอย่างหนึ่ง โดยขึ้นอยู่กับว่ามีบัญชีสำหรับการเรียกเก็บเงินอยู่หรือไม่ หรือโปรเจ็กต์ Cloud ที่เลือกเชื่อมโยงกับบัญชีหรือไม่
- หากเปิดใช้การเรียกเก็บเงินสำหรับโปรเจ็กต์ Cloud ที่เลือกแล้ว
ระบบจะแสดงรายละเอียดเกี่ยวกับ
บัญชีสำหรับการเรียกเก็บเงิน
- หากไม่มีบัญชีสำหรับการเรียกเก็บเงิน ระบบจะแจ้งให้คุณสร้างบัญชีสำหรับการเรียกเก็บเงิน
และเชื่อมโยงกับโปรเจ็กต์ Cloud ที่เลือก
- หากมีบัญชีสำหรับการเรียกเก็บเงิน ระบบจะแจ้งให้คุณเปิดใช้การเรียกเก็บเงินหากโปรเจ็กต์ Cloud ที่เลือกยังไม่ได้เชื่อมโยงกับบัญชีสำหรับการเรียกเก็บเงิน นอกจากนี้ คุณยังเลือกยกเลิก
แล้วเลือกสร้างบัญชีเพื่อสร้างและเชื่อมโยง
บัญชีสำหรับการเรียกเก็บเงินใหม่ได้ด้วย
หลังจากเปิดใช้การเรียกเก็บเงินแล้ว ระบบจะไม่จำกัดจำนวนเงินที่อาจเรียกเก็บจากคุณ
หากต้องการควบคุมค่าใช้จ่ายได้มากขึ้น คุณสามารถสร้าง
งบประมาณและตั้งค่าการแจ้งเตือน โปรดดูข้อมูลเพิ่มเติมที่การเรียกเก็บเงิน
เปิดใช้ API
หากต้องการใช้ Google Maps Platform คุณต้องเปิดใช้ API หรือ SDK ที่วางแผนจะใช้กับโปรเจ็กต์
ดู API ที่เปิดใช้
คอนโซล
หากต้องการดู API หรือ SDK ที่คุณเปิดใช้ ให้ไปที่หน้า Google Maps Platform
ในคอนโซล Cloud
ไปที่หน้า Google Maps Platform
- API เพิ่มเติม: ไม่ได้เปิดใช้ API หรือ SDK เหล่านี้
- หากเห็นการ์ดสำหรับ Maps API และบริการแต่ละรายการ แสดงว่ายังไม่ได้เปิดใช้ API หรือ SDK ใดๆ
ปิดโปรเจ็กต์
คุณปิดใช้การเรียกเก็บเงินและปล่อยทรัพยากร Cloud ทั้งหมดที่ใช้ในโปรเจ็กต์ Cloud ได้โดยการปิดโปรเจ็กต์นั้น
ขั้นตอนถัดไป
หลังจากตั้งค่าโปรเจ็กต์ Google Cloud แล้ว คุณต้องสร้างและรักษาความปลอดภัย
คีย์ API เพื่อใช้ Distance Matrix API โดยทำดังนี้
ใช้คีย์ API
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eThis guide explains how to set up a Google Cloud project for using Google Maps Platform APIs, including creating a project, enabling billing, and enabling APIs.\u003c/p\u003e\n"],["\u003cp\u003eYou must create a Google Cloud project to manage services, credentials, billing, and APIs; billing is required but you are only charged for usage exceeding the free quota.\u003c/p\u003e\n"],["\u003cp\u003eBefore using Google Maps Platform, you need to enable the specific APIs or SDKs you intend to use within your project.\u003c/p\u003e\n"],["\u003cp\u003eYou can shut down a project to disable billing and release Cloud resources when no longer needed.\u003c/p\u003e\n"],["\u003cp\u003eAfter setting up your project, create and secure an API key to use the Google Maps Platform APIs.\u003c/p\u003e\n"]]],["To use Google Maps Platform APIs, you must first create a Google Cloud project, including setting the project name, ID, and linking a billing account. Billing must be enabled, though charges only occur beyond the free monthly quota. Next, enable the specific APIs or SDKs needed for your project. You can use the console or `gcloud` to manage these steps and view enabled APIs. If a project is no longer needed, it can be shut down to disable billing and release its resources.\n"],null,["# Set up your Google Cloud project\n\nThis guide shows how to set up your Google Cloud project before using\nthe Google Maps Platform APIs. While you may have completed some of these\nsteps in the\n\n[Getting started with Google Maps Platform](/maps/get-started) page,\nthis document provides additional, useful instructions for managing your projects.\n\nCreate a project\n----------------\n\nTo use Google Maps Platform, you must have a project to manage services,\ncredentials, billing, APIs, and SDKs.\n\n[Billing setup](#billing) is required for each project, but you will only be charged if a\nproject exceeds its [quota](/maps/billing-and-pricing/billing#monthly-credit) of no-charge services.\n\nTo create a Cloud project with billing enabled: \n\n### Console\n\n1. Create a new Google Cloud project in the Cloud console:\n\n [Create new project](https://console.cloud.google.com/projectcreate?utm_source=Docs_NewProject&utm_content=Docs_distance-matrix-backend)\n2. On the **New Project** page, fill in the required information:\n\n - **Project name:** Accept the default or enter a customized name.\n\n You can change the project name at any time. For more information, see\n [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects).\n - **Project ID:** Accept the default or click **EDIT** to enter a\n customized ID that Google APIs use as a unique identifier for your project.\n\n After you create the project, you *cannot* change the project ID, so\n choose an ID that you'll be comfortable using for the lifetime of the\n project. Don't include any sensitive information in your project ID.\n - **Billing account:** Select a billing account for the project. If you\n haven't set up a billing account or only have one billing account, you\n won't see this option.\n\n You must be a Billing Account Administrator or Project Billing Manager\n to associate a project with a billing account. For more information, see\n [the billing access control documentation](https://cloud.google.com/billing/docs/how-to/billing-access#overview_of_billing_roles_in).\n - **Location:** If you have an organization you want to link your project\n to, click **Browse** and select it; otherwise, choose \"No organization\".\n\n For more information, see [Creating and Managing Folders](https://cloud.google.com/resource-manager/docs/creating-managing-folders)\n and [Relationships between organizations, projects, and billing accounts](https://cloud.google.com/billing/docs/how-to/billing-access#relationships-between-resources).\n3. Select **Create**.\n\n### gcloud\n\n```bash\ngcloud projects create \"\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\"\n```\n\nRead more about the\n[Google Cloud SDK](https://cloud.google.com/sdk)\n,\n[Cloud SDK installation](https://cloud.google.com/sdk/docs/install)\n, and the following commands:\n\n- [`gcloud projects create`](https://cloud.google.com/sdk/gcloud/reference/projects/create)\n\nEnable billing\n--------------\n\nTo deploy your apps, you must enable billing. Your account won't be charged\nif you stay within your [monthly quota](/maps/billing-and-pricing/billing#monthly-credit).\nIf your application needs resources that exceed the monthly quota, you will be\ncharged for the additional usage.\n\nIf you have a billing account when you create a Cloud\nproject, then billing is automatically enabled on that project.\n\nTo enable billing on a Cloud project:\n\n1. In the Cloud console, go to the Billing page: \n [Go to the Billing page](https://console.cloud.google.com/projectselector/billing?utm_source=Docs_Billing&utm_content=Docs_distance-matrix-backend)\n2. Select or create a Cloud project.\n3. Depending on if a billing account exists or if the selected Cloud project is associated with an account, the Billing page displays one of the following:\n - If billing is already enabled for the selected Cloud project, then the details about the billing account are listed.\n - If no billing account exists, you are prompted to create a billing account and associate it with the selected Cloud project.\n - If a billing account exists, you are prompted to enable billing if the selected Cloud project is not already associated with a billing account. You can also select **Cancel** and then select **Create account** to create and associate a new billing account.\n\nAfter you enable billing, there is no limit to the amount that you might\nbe charged. To gain more control over your costs, you can\n[create\na budget and set alerts](/maps/billing-and-pricing/billing#creating-budgets-and-set-alerts). For more information, see [Billing](/maps/billing-and-pricing/billing).\n\nEnable APIs\n-----------\n\nTo use Google Maps Platform, you must enable the APIs or SDKs you plan to use with your project.\n\n### Console\n\n\n[Enable the Distance Matrix API](https://console.cloud.google.com/apis/library/distance-matrix-backend.googleapis.com?utm_source=Docs_EnableAPIs&utm_content=Docs_distance-matrix-backend)\n\n### Cloud SDK\n\n```bash\ngcloud services enable \\\n --project \"\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\" \\\n \"distance-matrix-backend.googleapis.com\"\n```\n\nRead more about the\n[Google Cloud SDK](https://cloud.google.com/sdk)\n,\n[Cloud SDK installation](https://cloud.google.com/sdk/docs/install)\n, and the following commands:\n\n- [`gcloud services enable`](https://cloud.google.com/sdk/gcloud/reference/services/enable)\n- [`gcloud services disable`](https://cloud.google.com/sdk/gcloud/reference/services/disable)\n\nView enabled APIs\n-----------------\n\n### Console\n\nTo view the APIs or SDKs you have enabled, go to the Google Maps Platform page\nin the Cloud console:\n[Go to Google Maps Platform page](https://console.cloud.google.com/project/_/google/maps-apis/api-list?utm_source=Docs_ProjectViewAPI&utm_content=Docs_distance-matrix-backend)\n\n- Additional APIs: These API or SDKs are not enabled.\n- If you see cards for each Map APIs and services, no APIs or SDKs have been enabled.\n\n### gcloud\n\n```bash\ngcloud services list --project \"\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\"\n```\n\nRead more about the\n[Google Cloud SDK](https://cloud.google.com/sdk)\n,\n[Cloud SDK installation](https://cloud.google.com/sdk/docs/install)\n, and the following commands:\n\n- [`gcloud services list`](https://cloud.google.com/sdk/gcloud/reference/services/list)\n\nShut down a project\n-------------------\n\nYou can disable billing and release all the Cloud resources that\nare being used in your Cloud project by shutting down\nthat project: \n\n### Console\n\n1. Go to the Projects page:\n\n [Go to the Projects page](https://console.cloud.google.com/iam-admin/projects?utm_source=Docs_ProjectShutdown&utm_content=Docs_distance-matrix-backend)\n2. Select the Cloud project that you want to shut down,\n then click **Delete**.\n\nFor more information about managing your Cloud\nprojects, see [Cloud Resource Manager: creating, shutting down, and restoring projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\n### gcloud\n\n```bash\ngcloud projects delete \"\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\"\n```\n\nRead more about the\n[Google Cloud SDK](https://cloud.google.com/sdk)\n,\n[Cloud SDK installation](https://cloud.google.com/sdk/docs/install)\n, and the following commands:\n\n- [`gcloud projects delete`](https://cloud.google.com/sdk/gcloud/reference/projects/delete)\n\nWhat's next\n-----------\n\nAfter setting up your Google Cloud project, you must create and secure\nyour API Key to use the Distance Matrix API:\n\n[Use API Keys](/maps/documentation/distance-matrix/get-api-key)"]]