TroubleshootingStay organized with collectionsSave and categorize content based on your preferences.
AI-generated Key Takeaways
To use the Google Maps JavaScript API, you must include an API key and enable billing for your project.
If you see a darkened map or a negative Street View image watermarked with "for development purposes only", you might have an issue with your API key or billing.
Troubleshooting steps involve verifying your API key implementation, checking billing account attachment, ensuring billing method validity, and reviewing daily usage limits and IP restrictions.
This page offers solutions to common billing and API errors, and links to resources for further assistance.
API Key and Billing Errors
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. The following flow will help troubleshoot this:
Are you using an API key?
I'm not sure. How can I check if I am using an API key?
An API key is passed as thekeyparameter in the URL that is used to load the
Maps JavaScript API. Here are a few options to check if you are using an API key:
Use theGoogle Maps Platform API CheckerChrome extension. This allows you to determine if your
website is properly implementing Google’s licensed Maps APIs.
If you are using a library or plugin to load the Maps JavaScript API,
check the settings for that library and look for an API key option.
Checkerrors in your browser.
If you see the following messages, you are not using your API key correctly:
If you have access to the source code of your application, look for the<script>tag which is used to load the Maps JavaScript API.
When loading the Maps JavaScript API, substituteYOUR_API_KEYin the code below with your API key.
Check the network traffic generated by your website in the browser.
In Chrome, this can be viewed using theDevToolsNetworktab.
Here you will see the network requests made by your website. Requests made using the
Maps JavaScript API will be under the pathmaps/api/js.
Here you can confirm if the requests are using thekeyparameter.
It may be helpful tofilter your network trafficbymaps/api/jswhen viewing theNetworktab.
Great! Let’s move on and check if a billing account is attached to your project.
Is a billing account attached to your project?
I'm not sure. How can I check if billing account is attached to my project?
Go to theBilling pagein the Google Cloud console and select the project under which your API key was created.
To confirm the key is associated with the project:
Go to theCredentialssection, which can be accessed from the left side bar underGoogle Maps Platform > Credentials.
Check that the API key you currently use on your website is listed.
If that's not the case, switch to a different project, and check the credentials there.
If you cannot locate the project for your API key, you may have lost access to this project.
Ask others in your organization for help. If the original project cannot be located, you should:
Create a new project. This can be done by selectingNew Projectfrom the projects list, or by selectingCreate Projectvia theResource Manager page.
Create a new API key. This can be done on theCredentialspage.
Once there clickCreate credentialsand then selectAPI key.
Once you have located your project in the Cloud console,
check if a billing account is attached by navigating to theBillingsection in the left side menu.
No, a billing account is not attached to my project.
Is there an exceeded self-imposed daily limit on the API?
If you have set a daily limit on any of your APIs, which is common to prevent unexpected increases,
you can resolve this byincreasing your daily limit.
You can check your daily limits by going to theAPIs & Services Dashboardin the
Cloud console. Once there:
Select a project if prompted.
Select an API from the list, then click theQuotastab.
Does your API key have an IP addresses restriction?
API keys with anIP addressesrestriction can only be used with web services that are
intended for use from the server side (such as theGeocoding APIand otherWeb Service APIs).
Most of these web services have equivalent services within the Maps JavaScript API (for example, see theGeocoding Service).
To use the Maps JavaScript API client side services, you will need to create a separate API key which
can be secured with anHTTP referrersrestriction (seeGet, add, and restrict an API key).
If your code 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 thezoomandcenterproperties 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.
Use a JavaScript debugger to help identify problems, like the one available
in theChrome
Developer Tools. Start by looking in the JavaScript console for errors.
Post questions toStack
Overflow. Guidelines on how to post great questions are available on
theSupportpage.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-11-10 UTC."],[],["Using the Maps JavaScript API requires a valid API key and enabled billing. Issues like a darkened map typically stem from these. Verify API key usage via browser checks, source code, or network traffic. Ensure the project linked to your API key has an active billing account. Check for invalid payment methods or exceeded API daily limits. If restricted by IP address, create a key with HTTP referrers. Troubleshoot by checking for typos, verifying map element properties, or using a JavaScript debugger.\n"]]