This page describes the error messages that can be returned by the Maps JavaScript API. The Maps JavaScript API writes error and warning messages to the JavaScript console. Certain error conditions may also occur, which result in the display of a darkened watermarked map.
API Key and Billing Errors
Troubleshooting
Under certain circumstances, a darkened map, or 'negative' Street View image, watermarked with the text "for development purposes only", may be displayed. This behavior typically indicates issues with either an API key or billing. In order to use Google Maps Platform products, billing must be enabled on your account, and all requests must include a valid API key. For help on finding error messages, see the section on checking errors in your browser.
The following flow will help you troubleshoot the issue.
Maps JavaScript API Error Codes for Developers and Site Owners
The following tables list the possible error codes returned by the Maps JavaScript API, with a description of the cause and how you can fix the problem. For help on finding the error messages, see the section on checking errors in your browser.
Map Loading Errors
If you encounter an error while loading the Maps JavaScript API, please see the table below to find explanations for the error codes.
Error Code | Message | Description |
---|---|---|
NotLoadingAPIFromGoogleMapsError
|
The Maps JavaScript API must be downloaded directly from Google's servers. |
The script element that loads the Maps JavaScript API is not being included correctly on your page. In order for the API to work correctly, it must be loaded directly from https://maps.googleapis.com. |
TOSViolationMapError
|
This website appears to violate the Google Maps API Terms of Service. The Google Maps API has been disabled for this website. |
Your application was blocked for non-compliance with the Google Maps Platform Terms of Service, following several email notifications. To appeal the block and have your implementation reviewed, please complete this form. You will receive a response via email within a few business days. If you have a Google Maps Platform Premium Plan license, please use your Google Maps Platform Premium Plan credentials to resolve this error. See the guide to Premium Plan authentication. |
UnauthorizedURLForClientIdMapError
|
This URL is not authorized to use the Google Maps Client ID provided. |
The Premium Plan or Maps APIs for Work client ID included in the script load is invalid, expired, or the current address loading the Maps JavaScript API has not been added to the list of authorized URLs. |
Maps JavaScript API Error Codes
If you find an error on Chrome JavaScript Console, Firefox Web Console or any other equivalent tools on your browsers, please see the table below to find explanations for the error codes.
The Maps JavaScript API returns both errors and warnings. An error indicates a severe issue which occurred while loading the Maps JavaScript API. Your page cannot load the API correctly, and the API will not work on that page. A warning is a supplemental message about the loading of the Maps JavaScript API. The warning describes the possible reasons for an error, or suggests potential issues in your code that loads the Maps JavaScript API. If you receive only warnings without any errors, the API will work correctly on that page. However, we recommend that you fix these potential issues as well.
Developer Error Code | Type | Description |
---|---|---|
ApiNotActivatedMapError
|
Error |
The Maps JavaScript API is not activated on your API project. You may need to enable the Maps JavaScript API under APIs in the Google Cloud Console. To activate the Maps JavaScript API for your project, click the button below.
|
ApiTargetBlockedMapError
|
Error |
This API key is not authorized to use this service or API. Please check the API restrictions settings of your API key in the Google Cloud Console to ensure that all of the APIs and services you need to use are correctly specified in the list of enabled APIs. See API keys in the Cloud Console. For more information, see API security best practices. |
DeletedApiProjectMapError
|
Error |
Your API project may have been deleted from the Cloud Console. Please check the project for which you generated the API key that's included in JavaScript API loader. You can create a new API project and get a new key in the Cloud Console. To create a new project and get an API key for the project, click the button below.
|
ClientBillingNotEnabledMapError
|
Error |
You have not enabled billing on your project. You must enable Billing on the Google Cloud Project associated to this client ID, here. |
BillingNotEnabledMapError
|
Error |
You have not enabled billing on your project which is causing this error. You must enable Billing on the Google Cloud Project here. |
ExpiredKeyMapError
|
Error |
The API key included in the script element that loads the API has expired or is not recognized by the system. You may receive this error after creating a new API key if you try to use the key before it is recognized by the system. Wait a few minutes and try again, or you may need to generate a new API key in the Cloud Console. To get an API key, click the button below.
|
InvalidClientIdMapError
|
Error |
The client ID included in the script element that loads the API is invalid, or expired. Please make sure you are using your client ID correctly. The client ID should start with "gme-" prefix. If you see this error even when using your client ID correctly, the client ID may have expired. Please contact your Google Account Manager.
If you do not have a Premium Plan or
Maps APIs for Work license, you need to use a
See the guide to Premium Plan authentication. |
InvalidKeyMapError
|
Error |
The API key included in the script element that loads the API is not found. Please make sure you are using a correct API key. You can generate a new API key in the Cloud Console. To get an API key, click the button below.
|
MalformedCredentialsMapError
|
Error |
Your application uses an unsupported URI scheme. Verify that the application uses a valid URI format as defined in RFC 3986. |
MissingKeyMapError
|
Error |
The script element that loads the API is missing the required authentication parameter. If you are using the standard Maps JavaScript API, then you must use
a If you are a Premium Plan customer, then you must
use either a If you are NOT the website owner, then there are no steps that you can take to fix this error. However, you might want to notify the site owner if possible. |
ProjectDeniedMapError
|
Error |
Your request has not been completed. You may be able to find the more details about the error in the Cloud Console. See Cloud Console. |
RefererDeniedMapError
|
Error |
Your application was blocked for non-compliance with the Google Maps Platform Terms of Service, following several email notifications. To appeal the block and have your implementation reviewed, please complete this form. You will receive a response via email within a few business days. |
RefererNotAllowedMapError
|
Error |
The current URL loading the Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key in the Cloud Console. See the Maps JavaScript API and Get an API Key. |
OverQuotaMapError
|
Error |
The number of requests has exceeded the usage limits for the Maps JavaScript API. Your app's requests will work again at the next daily quota reset. If you are NOT the website owner, there are no steps you can take to fix this error. However, you may want to notify the site owner if possible. For more details, see the guide to usage limits. The page also explains how you can get higher usage limits. |
ApiProjectMapError
|
Error |
Either the provided API key or the API project with which it is associated, could not be resolved. This error may be temporary. If this error message persists you may need to get a new API key or create a new API project. For more information, see Get Started with Google Maps Platform. |
ClientIdLooksLikeCryptoKey
|
Warning |
You may have supplied a cryptographic key in the See the guide to client IDs for Premium Plan and Maps APIs for Work customers. |
ClientIdLooksLikeKey
|
Warning |
You may have supplied an API key in the See the guide to Premium Plan authentication. |
InvalidChannel
|
Warning |
You may have supplied an invalid |
InvalidClientId
|
Warning |
The See the guide to Premium Plan authentication. |
InvalidKey
|
Warning |
The API key included in the script element that loads the API does not look correct. Please make sure you are using a correct API key. You can generate a new API key in the Cloud Console. To get an API key, click the button below.
|
InvalidVersion
|
Warning |
You may have supplied an incorrect version number in your script element. Please make sure you are using a correct version number. |
KeyLooksLikeClientId
|
Warning |
You may have supplied a client ID as a key parameter. If you
have a Premium Plan or
Maps APIs for Work license, please specify your client ID as a
client parameter instead of the key parameter. If you have a
Google Maps Platform Premium Plan, you can use a client parameter
or a key parameter. If you don't have any licenses,
you must use a key parameter, instead of a client
parameter.
See the guide to Premium Plan authentication. |
KeyLooksLikeCryptoKey
|
Warning |
You may have supplied a cryptographic key or signing secret as a See the guide to Specifying a client ID when loading the API. |
KeyLooksLikeProjectNumber
|
Warning |
You may have supplied a project number as a Learn how to get an API key. |
NoApiKeys
|
Warning |
The script element that loads the API has no API key. Please make sure
you include a valid API key as a
To get an API key, click the button below to get started.
If you are loading Maps JavaScript API from the deprecated v2
path, you will get the |
RetiredVersion
|
Warning |
You may have supplied a retired version in your script element. Please update your application to use one of the available versions. |
SensorNotRequired
|
Warning |
The |
SignatureNotRequired
|
Warning |
The |
SignedInNotSupported
|
Warning |
The |
UrlAuthenticationCommonError
|
Error |
An error has occurred that doesn't fit into the other categories on this page. This could be caused by a temporary problem. Please retry the request after a short delay. If that doesn't solve the problem, please review the developer's guide to make sure the request has the proper format. |
Checking Errors in Your Browser
The Maps JavaScript API writes error messages to
window.console
. This section explains how you can check the
window.console
output in Google Chrome. If you are using any other
browsers, please check the developer documentation for your browser. For your
reference, this is a list of tools to check window.console
output
in some other browsers.
- Web Console for Firefox.
- Remote debugging for Android.
- Web Inspector for iOS.
In Chrome, you can use the
JavaScript Console
to check window.console
output as follows.
- To open the Developer Tools, select the menu icon > More Tools > Developer Tools.
- To open the JavaScript Console, press the ESC key on your keyboard. The ESC key will toggle the JavaScript Console. If you close the console, press the ESC key again to open it.
If any errors or warnings occurred when loading the Maps JavaScript API, they appear as one or more lines in the console. An error or warning message has the following format:
Google Maps API error: [ERROR CODE] [Link to API document]
or
Google Maps API warning: [ERROR CODE] [Link to API document]
You can check the error codes table above to find the error code in the error message. You can also find the details about the error message in the API document linked from the message.
Note: You can listen for authentication errors programmatically.
Handling unsupported browsers
Ensure that the version of the browser you are using is currently supported by the Maps JavaScript API.
If you're developing a native Windows application that runs in a WebView, ensure that you are using WebView2 based on Edge. Previous versions of WebView, based on Internet Explorer, are no longer supported.
If your code still isn't working
To help you get your maps code up and running, Brendan Kenny and Mano Marks point out some common mistakes and how to fix them in this video.
- Look for typos. Remember that JavaScript is a case-sensitive language.
- Check the basics - some of the most common problems occur with the
initial map creation. Such as:
- Confirm that you've specified the
zoom
andcenter
properties in your map options. - Ensure that you have declared a div element in which the map will appear on the screen.
- Ensure that the div element for the map has a height. By default, div elements are created with a height of 0, and are therefore invisible.
- Confirm that you've specified the
- Use a JavaScript debugger to help identify problems, like the one available in the Chrome Developer Tools. Start by looking in the JavaScript console for errors.
- Post questions to Stack Overflow. Guidelines on how to post great questions are available on the Support page.