การจัดการข้อผิดพลาด
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
นักพัฒนาแอปในเขตเศรษฐกิจยุโรป (EEA)
หลังจากส่งคำขอแล้ว คุณอาจได้รับการตอบกลับที่มีรายละเอียดข้อผิดพลาด
ชิ้นส่วน 2 มิติและภาพ Street View
รายการต่อไปนี้แสดงรายละเอียดข้อผิดพลาดที่คุณอาจพบเมื่อใช้ไทล์ 2 มิติ
และภาพ Street View
เกิดข้อผิดพลาดในการแสดง
รายการต่อไปนี้แสดงรายละเอียดข้อผิดพลาดที่คุณอาจพบเมื่อใช้
Map Tiles API
required
- คำขอของคุณไม่มีพารามิเตอร์ของ URL โปรดทราบว่าข้อความแสดงข้อผิดพลาดจะระบุ
พารามิเตอร์ที่ขาดหายไป
notFound
, invalid
ค่า x
, y
หรือ
z
อยู่นอกช่วง
สำหรับไทล์แผนที่ปกติ ระดับการซูมสูงสุดจะขึ้นอยู่กับ
ไทล์แผนที่นั้นๆ และตัวเลือกแผนที่ที่คุณขอ
สำหรับไทล์แผนที่ปกติ พิกัด x ต้องอยู่ในช่วง
[0, (2^zoom)-1]
สำหรับไทล์แผนที่ปกติ พิกัด y ต้องอยู่ในช่วง [0, (2^(zoom-1))-1]
สำหรับไทล์ Street View ระดับการซูมต้องอยู่ระหว่าง 0 ถึง 5 เท่านั้น
สำหรับไทล์ Street View ช่วงพิกัด x และ y จะเหมือนกับ
ไทล์แผนที่ปกติจนถึงการซูมระดับ 5 ณ จุดนั้น ค่าสูงสุดคือ imageHeight
หรือ imagewidth
หารด้วย tileHeight
หรือ tileWidth
forbidden
:
สาเหตุที่เป็นไปได้:
คำขอไม่มีคีย์ API ที่ถูกต้อง
ข้อความ: Your request cannot be served. Please ensure the parameters and
request type are valid for your account and region.
ไทล์ดาวเทียม 2 มิติไม่พร้อมใช้งานในโปรเจ็กต์ที่ลิงก์กับ
บัญชีสำหรับการเรียกเก็บเงินที่มีที่อยู่ในเขตเศรษฐกิจยุโรป (EEA) ดูข้อมูลเพิ่มเติมได้ที่การปรับ Map Tiles API สำหรับลูกค้าใน EEA
expired
- โทเค็น
session
ของคุณหมดอายุแล้ว โทเค็นเซสชันจะมีอายุ
2 สัปดาห์นับจากเวลาที่สร้าง โปรดทราบว่าข้อมูลนี้อาจเปลี่ยนแปลงได้โดยไม่ต้องแจ้งให้ทราบ หากได้รับข้อผิดพลาดนี้ คุณต้องขอโทเค็นเซสชันใหม่ตามที่อธิบายไว้ในใช้โทเค็นเซสชัน
badRequest
คำขอของคุณมีรูปแบบไม่ถูกต้อง สาเหตุที่พบบ่อยมีดังนี้
คุณระบุประเภทแผนที่ terrain
โดยไม่รวมเลเยอร์ roadmap
คุณใส่styles
อาร์เรย์สำหรับประเภทแผนที่ที่ไม่ใช่แผนที่เส้นทาง
คุณส่งค่าละติจูด/ลองจิจูด รวมถึงรหัสพาโนรามาในคำขอข้อมูลเมตาของ Street View
quotaExceeded
, rateLimitExceeded
แอปพลิเคชันของคุณมีโควต้าเกินที่อนุญาต หรือมีจำนวนการค้นหาต่อวินาทีเกินที่อนุญาต
ตัวอย่างข้อผิดพลาด
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"errors": [
{
"message": "The request is missing a valid API key.",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED"
}
}
ลองส่งคำขออีกครั้ง
เมื่อคำขอไม่สำเร็จโดยมีข้อผิดพลาด quotaExceeded
และ rateLimitExceeded
คุณควรลองส่งคำขออีกครั้งในลักษณะที่คำขอที่เสียหรือความล้มเหลวในวงกว้างไม่ทำให้เซิร์ฟเวอร์ของ Google ทำงานหนักเกินไป เนื่องจากไคลเอ็นต์จำนวนมากพยายามส่งคำขออีกครั้งอย่างรวดเร็ว ซึ่งหมายถึงการใช้Exponential Backoff
เมื่อลองส่งคำขออีกครั้ง Exponential Backoff บังคับให้คุณกระจายคำขอตามเวลาเพื่อให้เซิร์ฟเวอร์มีเวลาฟื้นตัว
เช่น หากคำขอไม่สำเร็จ ให้ลองอีกครั้งหลังจากผ่านไป 1 วินาที แต่หากความพยายามดังกล่าวไม่สำเร็จ ให้ลองส่งคำขออีกครั้งหลังจากผ่านไป 2 วินาที หากคำขอดังกล่าวไม่สำเร็จ ให้ลองอีกครั้งหลังจากผ่านไป 4 วินาที ดังนั้นคุณจึงกระจาย
คำขอแต่ละรายการที่ตามมาได้อย่างมีประสิทธิภาพเพียงแค่เพิ่มระยะเวลาระหว่างคำขอเป็น 2 เท่า
ชิ้นส่วนแผนที่ 3 มิติ
ข้อผิดพลาดจากเซิร์ฟเวอร์ของ Google อาจไม่ชัดเจนสำหรับคุณเนื่องจากคุณเข้าถึงไทล์สมจริงผ่านโปรแกรมแสดงผล ซึ่งมีหน้าที่จัดการข้อผิดพลาดของเซิร์ฟเวอร์
ข้อผิดพลาดของโปรแกรมแสดงผลไทล์
ตัวอย่างเช่น โดยปกติแล้วโปรแกรมแสดงผล CesiumJS จะล้มเหลวอย่างเงียบๆ เมื่อเกิดข้อผิดพลาดของเซิร์ฟเวอร์
ซึ่งอาจส่งผลให้เกิดปัญหาต่างๆ ตั้งแต่แอปขัดข้อง หน้าจอว่าง ไปจนถึงไทล์บางรายการไม่โหลด
เทคนิคที่คุณใช้ในการแก้ไขข้อบกพร่องของข้อผิดพลาดของเซิร์ฟเวอร์จะขึ้นอยู่กับโปรแกรมแสดงผลที่คุณใช้ สำหรับโปรแกรมแสดงผลที่อิงตามเบราว์เซอร์ เช่น CesiumJS คุณสามารถตรวจสอบ
การรับส่งข้อมูลเครือข่ายด้วยเครื่องมือที่มาพร้อมกับเบราว์เซอร์ส่วนใหญ่ เช่น คุณใช้เครื่องมือสำหรับนักพัฒนาเว็บใน Chrome ได้
ข้อผิดพลาดที่พบบ่อย
รายการต่อไปนี้มีรายละเอียดเกี่ยวกับข้อผิดพลาดที่พบบ่อยที่สุดซึ่งคุณอาจพบ
- 400: อาร์กิวเมนต์ไม่ถูกต้อง
- คีย์ API, พารามิเตอร์การค้นหา, รหัสไทล์/ชุดไทล์ หรือโทเค็นเซสชันที่หมดอายุไม่ถูกต้อง
- 400: ค่าไม่ถูกต้อง
- ตรวจสอบว่า mapType ที่ใช้ในการส่ง
createSessionToken
คำขอ
ตรงกับ mapType
ที่ใช้ในปลายทางไทล์ที่ตามมา เช่น ใช้โทเค็นเซสชัน streetview
เพื่อขอไทล์ roadmap
ไม่ได้
403: ไม่อนุญาต
สาเหตุที่เป็นไปได้:
ไม่มีคีย์ API, ไม่มีการเชื่อมต่อ SSL หรือไม่ได้เพิ่มคีย์ API
ลงในรายการที่อนุญาตสำหรับ 3D Tiles ติดต่อทีมสนับสนุนของ Google พร้อมรหัสโปรเจ็กต์เพื่อขอ
เพิ่มลงในรายการที่อนุญาตสำหรับฟังก์ชันการทำงานของ 3D Tiles ใน
Map Tiles API
ข้อความ: Your request cannot be served. Please ensure the parameters and
request type are valid for your account and region.
ชิ้นส่วนแผนที่ 3 มิติแบบสมจริงไม่พร้อมใช้งานในโปรเจ็กต์ที่ลิงก์กับ
บัญชีสำหรับการเรียกเก็บเงินที่มีที่อยู่ในเขตเศรษฐกิจยุโรป (EEA) ดูข้อมูลเพิ่มเติมได้ที่การปรับ Map Tiles API สำหรับลูกค้าใน EEA
- 429: มีคำขอมากเกินไป
- โควต้าของคุณหมดแล้ว ติดต่อทีมสนับสนุนของ Google เพื่อเพิ่มโควต้า
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-29 UTC
[null,null,["อัปเดตล่าสุด 2025-08-29 UTC"],[[["\u003cp\u003eRequests for 2D Tiles and Street View imagery may result in errors such as \u003ccode\u003erequired\u003c/code\u003e, \u003ccode\u003enotFound\u003c/code\u003e, \u003ccode\u003einvalid\u003c/code\u003e, \u003ccode\u003eforbidden\u003c/code\u003e, \u003ccode\u003eexpired\u003c/code\u003e, \u003ccode\u003ebadRequest\u003c/code\u003e, \u003ccode\u003equotaExceeded\u003c/code\u003e, or \u003ccode\u003erateLimitExceeded\u003c/code\u003e indicating issues with parameters, API keys, or quota limits.\u003c/p\u003e\n"],["\u003cp\u003eWhen retrying requests that failed due to \u003ccode\u003equotaExceeded\u003c/code\u003e or \u003ccode\u003erateLimitExceeded\u003c/code\u003e, it's crucial to implement exponential backoff to avoid overwhelming Google servers.\u003c/p\u003e\n"],["\u003cp\u003e3D Tiles errors are often handled by the renderer, requiring debugging techniques like inspecting network traffic using browser developer tools.\u003c/p\u003e\n"],["\u003cp\u003eCommon 3D Tiles errors include 400 (Invalid argument), 403 (Permission denied), and 429 (Too many requests), which can be addressed by verifying API keys, SSL connections, allowlisting, or adjusting quotas.\u003c/p\u003e\n"]]],["Upon encountering errors when using Map Tiles API, common issues include missing URL parameters (`required`), out-of-range coordinates (`notFound`, `invalid`), an invalid API key (`forbidden`), or an expired session token (`expired`). Other errors involve malformed requests (`badRequest`) or exceeding usage limits (`quotaExceeded`, `rateLimitExceeded`). When rate limiting occurs, implement exponential backoff when retrying requests. 3D Tiles errors may be handled by the renderer and include issues like invalid keys, missing API key, or exceeded quota.\n"],null,["# Handling errors\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google\n| Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. [Learn more](/maps/comms/eea/faq). In addition, certain content from the Map Tiles API will no longer be returned. [Learn more](/maps/comms/eea/map-tiles).\n\nAfter you make a request, you might receive a response that contains error\ndetails.\n\n2D Tiles and Street View imagery\n--------------------------------\n\nThe following list details the errors that you might encounter when using 2D\nTiles and Street View imagery.\n\n### Error listing\n\nThe following list details the errors you might encounter when using the\nMap Tiles API.\n\n`required`\n: Your request is missing a URL parameter. Note that the error message indicates\n which parameter is missing.\n\n`notFound`, `invalid`\n\n: Your \u003cvar class=\"apiparam\" translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003ex\u003c/code\u003e\u003c/var\u003e, \u003cvar class=\"apiparam\" translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003ey\u003c/code\u003e\u003c/var\u003e, or\n \u003cvar class=\"apiparam\" translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003ez\u003c/code\u003e\u003c/var\u003e values are out of range.\n\n - For regular map tiles, the maximum zoom level depends on the particular\n map tile, and on the map options that you requested.\n\n - For regular map tiles, the x coordinate must be in the range\n \\[0, (2\\^zoom)-1\\].\n\n - For regular map tiles, the y coordinate must be in the range\n \\[0, (2\\^(zoom-1))-1\\].\n\n - For Street View Tiles, zoom must be between zero and five, inclusive.\n\n - For Street View Tiles, the x and y coordinate ranges are the same as\n for regular map tiles, until level five zoom. At that point, the maximum\n values are `imageHeight` or `imagewidth` divided by `tileHeight` or\n `tileWidth`.\n\n`forbidden`:\n\nPossible causes:\n\n- The request is missing a valid API key.\n\n- Message: `Your request cannot be served. Please ensure the parameters and\n request type are valid for your account and region.`\n\n 2D satellite tiles are not available in projects that are linked to a\n billing account with a European Economic Area (EEA) address. For more\n information, see [Map Tiles API adjustments for EEA\n customers](/maps/comms/eea/map-tiles#adjustments).\n\n`expired`\n: Your `session` token has expired. A session token is valid for\n two weeks from its creation time. Note that this might change\n without notice. If you receive this error, then you must get a new session\n token, as described in\n [Use session tokens](/maps/documentation/tile/session_tokens).\n\n`badRequest`\n\n: Your request was malformed. Common reason for this include:\n\n - You specified a `terrain` map type without including a `roadmap` layer.\n\n - You included a `styles` array for a non-roadmap map type.\n\n - You sent a lat/lng value, as well as a panorama ID in a Street View metadata\n request.\n\n`quotaExceeded`, `rateLimitExceeded`\n\n: Your application has exceeded its allowed quota, or it exceeded it allowed\n number of queries per second.\n\n### Example error\n\n {\n \"error\": {\n \"code\": 403,\n \"message\": \"The request is missing a valid API key.\",\n \"errors\": [\n {\n \"message\": \"The request is missing a valid API key.\",\n \"domain\": \"global\",\n \"reason\": \"forbidden\"\n }\n ],\n \"status\": \"PERMISSION_DENIED\"\n }\n }\n\n### Retrying requests\n\nWhen requests fail with `quotaExceeded` and `rateLimitExceeded`, you should\nretry your request in such as way that broken requests or wide-scale failures\ndon't flood Goodle servers---as many clients attempt to retry requests in quick\nsuccession. This means using\n[exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff)\nwhen you retry your requests. Exponential backoff forces you to spread your\nrequests out in time, to give the server time to recover.\n\nFor example, if a request fails, then retry again after one second. But if that\nattempt fails as well, then retry your request again after two seconds. If that\nrequest also fails, then try again after four seconds. So you effectively spread\neach successive request out by simply doubling the length of time between them.\n\n3D Tiles\n--------\n\nErrors from Google's server might not be obvious to you because you access\nphotorealistic tiles through a renderer, which is responsible for handling\nserver errors.\n\n### Tile renderer errors\n\nFor example, the CesiumJS renderer usually fails silently when server errors\noccur, which can result in anything from crashes, blank screens, to specific\ntiles not loading.\n\nThe technique that you use to debug server errors will depend on the particular\nrenderer you use. For browser-based renderers like CesiumJS, you can inspect\nthe network traffic with tools built into most browsers. For example, you can\nuse\n[Chrome DevTools](https://developer.chrome.com/docs/devtools/).\n\n### Common errors\n\nThe following list contains details about the most common errors that you might\nencounter.\n\n400: Invalid argument\n: Invalid API keys, query parameters, tile/tileset IDs, or an expired session\n token.\n\n400: Invalid Value\n: Make sure that the mapType with which the `createSessionToken` request was\n made matches the `mapType` used in the subsequent tile endpoint. For example, a\n `streetview` session token cannot be used to request a `roadmap` tile.\n\n**403: Permission denied**\n\nPossible causes:\n\n- Missing API key, missing SSL connection, or your API key has not been added\n to the allowlist for 3D Tiles. Contact [Google\n Support](/maps/support#contact-maps-support) with your project ID to get\n added to the allowlist for the 3D Tiles functionality of the\n Map Tiles API.\n\n- Message: `Your request cannot be served. Please ensure the parameters and\n request type are valid for your account and region.`\n\n Photorealistic 3D tiles are not available in projects that are linked to a\n billing account with a European Economic Area (EEA) address. For more\n information, see [Map Tiles API adjustments for EEA\n customers](/maps/comms/eea/map-tiles#adjustments).\n\n429: Too many requests\n: Your quota is exhausted. Contact\n [Google Support](/maps/support#contact-maps-support) to increase your quota."]]