رسیدگی به خطاها
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
توسعه دهندگان منطقه اقتصادی اروپا (EEA). پس از درخواست، ممکن است پاسخی دریافت کنید که حاوی جزئیات خطا باشد.
کاشی های دوبعدی و تصاویر نمای خیابان
فهرست زیر جزئیات خطاهایی را که ممکن است هنگام استفاده از کاشیهای دوبعدی و تصاویر نمای خیابان با آنها مواجه شوید، نشان میدهد.
خطا در فهرست کردن
فهرست زیر به جزئیات خطاهایی که ممکن است هنگام استفاده از Map Tiles API با آنها مواجه شوید، میپردازد.
-
required
- درخواست شما فاقد پارامتر URL است. توجه داشته باشید که پیام خطا نشان می دهد که کدام پارامتر وجود ندارد.
-
notFound
، invalid
مقادیر x
، y
، یا z
شما خارج از محدوده هستند.
برای کاشی های نقشه معمولی، حداکثر سطح بزرگنمایی به کاشی نقشه خاص و به گزینه های نقشه ای که درخواست کرده اید بستگی دارد.
برای کاشی های نقشه معمولی، مختصات x باید در محدوده [0، (2^zoom)-1] باشد.
برای کاشی های نقشه معمولی، مختصات y باید در محدوده [0, (2^(zoom-1))-1] باشد.
برای کاشیهای نمای خیابان، زوم باید بین صفر تا پنج باشد.
برای کاشیهای نمای خیابان، محدوده مختصات x و y مانند کاشیهای نقشه معمولی تا زوم سطح پنج است. در آن نقطه، حداکثر مقادیر 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.
کاشیهای ماهوارهای دوبعدی در پروژههایی که به حساب صورتحساب با آدرس منطقه اقتصادی اروپا (EEA) مرتبط هستند، در دسترس نیستند. برای اطلاعات بیشتر، به تنظیمات Map Tiles API برای مشتریان EEA مراجعه کنید.
-
expired
- رمز
session
شما منقضی شده است. یک نشانه جلسه به مدت دو هفته از زمان ایجاد آن معتبر است. توجه داشته باشید که این ممکن است بدون اطلاع قبلی تغییر کند. اگر این خطا را دریافت کردید، باید یک نشانه جلسه جدید دریافت کنید، همانطور که در Use session tokens توضیح داده شده است. -
badRequest
درخواست شما بد شکل بود دلایل رایج این امر عبارتند از:
شما یک نوع نقشه terrain
را بدون درج لایه roadmap
مشخص کردید.
شما یک آرایه styles
برای یک نوع نقشه غیرنقشه راه اضافه کرده اید.
شما یک مقدار lat/lng و همچنین یک شناسه پانوراما در یک درخواست فراداده نمای خیابان ارسال کردید.
-
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
با شکست مواجه میشوند، باید درخواست خود را مجدداً امتحان کنید، بهگونهای که درخواستهای شکسته یا شکستهای در مقیاس وسیع، سرورهای Goodle را سرازیر نکنند - زیرا بسیاری از مشتریان تلاش میکنند درخواستها را پشت سر هم دوباره امتحان کنند. این به این معنی است که وقتی درخواستهای خود را دوباره امتحان میکنید، از عقبنشینی نمایی استفاده کنید. عقب نشینی تصاعدی شما را مجبور می کند تا درخواست های خود را به موقع پخش کنید تا به سرور زمان بازیابی بدهید.
به عنوان مثال، اگر درخواستی با شکست مواجه شد، پس از یک ثانیه دوباره سعی کنید. اما اگر این تلاش نیز با شکست مواجه شد، پس از دو ثانیه درخواست خود را دوباره امتحان کنید. اگر آن درخواست نیز ناموفق بود، پس از چهار ثانیه دوباره امتحان کنید. بنابراین شما به طور موثری هر درخواست متوالی را با دو برابر کردن مدت زمان بین آنها پخش می کنید.
کاشی های سه بعدی
ممکن است خطاهای سرور Google برای شما واضح نباشد زیرا از طریق یک رندر به کاشیهای واقعگرایانه دسترسی پیدا میکنید که مسئول رسیدگی به خطاهای سرور است.
خطاهای رندر کاشی
به عنوان مثال، رندر CesiumJS معمولاً هنگامی که خطاهای سرور رخ میدهد، بیصدا از کار میافتد، که میتواند منجر به هر چیزی از خرابی، صفحههای خالی، تا لود نشدن کاشیهای خاص شود.
تکنیکی که برای اشکال زدایی خطاهای سرور استفاده می کنید به رندر خاصی که استفاده می کنید بستگی دارد. برای رندرهای مبتنی بر مرورگر مانند CesiumJS، می توانید ترافیک شبکه را با ابزارهای تعبیه شده در اکثر مرورگرها بررسی کنید. برای مثال، میتوانید از Chrome DevTools استفاده کنید.
خطاهای رایج
لیست زیر حاوی جزئیاتی در مورد رایج ترین خطاهایی است که ممکن است با آنها مواجه شوید.
- 400: استدلال نامعتبر است
- کلیدهای API نامعتبر، پارامترهای پرس و جو، شناسه های کاشی/مجموعه کاشی، یا نشانه جلسه منقضی شده است.
- 400: مقدار نامعتبر
- مطمئن شوید که mapType که درخواست
createSessionToken
با آن ارسال شده است با mapType
مورد استفاده در نقطه پایانی کاشی بعدی مطابقت دارد. به عنوان مثال، یک نشانه جلسه streetview
نمی تواند برای درخواست کاشی roadmap
استفاده شود.
403: اجازه رد شد
علل احتمالی:
کلید API موجود نیست، اتصال SSL موجود نیست، یا کلید API شما به لیست مجاز کاشی های سه بعدی اضافه نشده است. با شناسه پروژه خود با پشتیبانی Google تماس بگیرید تا به لیست مجاز برای عملکرد کاشی های سه بعدی Map Tiles API اضافه شوید.
پیام: Your request cannot be served. Please ensure the parameters and request type are valid for your account and region.
کاشیهای سه بعدی واقعی در پروژههایی که به حساب صورتحساب با آدرس منطقه اقتصادی اروپا (EEA) مرتبط هستند، در دسترس نیستند. برای اطلاعات بیشتر، به تنظیمات Map Tiles API برای مشتریان EEA مراجعه کنید.
- 429: درخواست های خیلی زیاد
- سهمیه شما تمام شده است. برای افزایش سهمیه خود با پشتیبانی Google تماس بگیرید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]