ERROR: Google Maps API error: MissingKeyMapError - google-maps

The following JavaScript error suddenly appeared:
Google Maps API error: Google Maps API error: MissingKeyMapError

Yes. Now Google wants an API key to authenticate users to access their APIs`.
You can get the API key from the following link. Go through the link and you need to enter a project and so on. But it is easy. Hassle free.
https://developers.google.com/maps/documentation/javascript/get-api-key
Once you get the API key change the previous
<script src="https://maps.googleapis.com/maps/api/js"></script>
to
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=your_api_key_here"></script>
Now your google map is in action. In case if you are wondering to get the longitude and latitude to input to Maps. Just pin the location you want and check the URL of the browser. You can see longitude and latitude values there. Just copy those values and paste it as follows.
new google.maps.LatLng(longitude ,latitude )

As per Google recent announcement, usage of the Google Maps APIs now requires a key. If you are using the Google Maps API on localhost or your domain was not active prior to June 22nd, 2016, it will require a key going forward. Please see the Google Maps APIs documentation to get a key and add it to your application.

All Google Maps JavaScript API applications require authentication( API KEY )
Go to https://developers.google.com/maps/documentation/javascript/get-api-key.
Login with Google Account
Click on Get a key button
3 Select or create a project
Click on Enable API ( Google Maps API)
Copy YOUR API KEY in your Project: <script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=(Paste YOUR API KEY)"></script>

Update django-geoposition at least to version 0.2.3 and add this to settings.py:
GEOPOSITION_GOOGLE_MAPS_API_KEY = 'YOUR_API_KEY'

The same issue i was facing couple of months back and that is because end of free google map usage effective from i think June 11, 2018. Google does not provide free google maps now. You need to have a valid API key and valid billing used, which may give you 200$ of free usage.
Refer link for more details: Google map pricing
Follow the process here to get your api key.
If you are upto using only maps with specific user, you can try other map tools.

The script element that loads the API is missing the required authentication parameter. If you are using the standard Maps JavaScript API, you must use a key parameter with a valid API key. If you are a Premium Plan customer, you must use either a client parameter with your client ID or a key parameter with a valid API key.
See the guide to API keys and client IDs.

you must create a project and collect the key in this way:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=en&key=()"></script>

Related

How can I reactivate the Google API key?

We've been sending addresses to Google for a while and then getting the coordinates from Google back and storing them.
This won´t work anymore.
From Google, we get the following error message:
You must use an API key to authenticate each request to
Google Maps Platform APIs. For additional information, please refer to
http://g.co/dev/maps-no-account
What must I change in the API settings, so it works again?
Welcome to the community!
You need to add a Billing Account, Maps API is not for free anymore.
https://cloud.google.com/maps-platform/

Can single google API key be used for streetview, geocoding and google maps services?

I want to use streetview, geocoding and googlemaps services.
Can i use single API key for these?
Is it right thing to use single API keys for all google services?
I think you can use 1 API key but you will have to enable API for every google service you want to use in your app.
https://console.developers.google.com/
Go to Google Developers console and create a Project and get a KEY.
After then, click on Library and enable the API for every service you want to use.

Deprecation of V2

I have an application calling the v2 api without key using:
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key="></script>
This has stopped working over the past couple of days. Console is showing only one error:
Control is no longer supported in the Google Maps Javascript API v2...
However, whichever way I try and call the v3 API, I get an error :
"Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site"
I have checked, and re-connected a valid bank card to the account (although the outstanding balance was $0.00) This payment appears not to have been registered.
Any leaders on where to go next?
Don't use the Google Maps Javascript API v2, it is deprecated and has been turned off, replaced with a simple wrapper for the Google Maps Javascript API v3
From the error you report in the console, the functionality you are attempting to use is not available in the wrapper.
Port your code to v3 ASAP.
See https://developers.google.com/maps/documentation/javascript/v2/v2tov3#overview
You need to register a new API key.
Loading the Google Maps API page states to use this code with a new API key placed into the code at API_KEY and you will probably need to set your sensor to FALSE, also you may need to place the new API key into your application settings page.
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=FALSE">
</script>

Google maps: how to generate a key for Google Maps v2?

I have an old website that uses Google maps v2. Previously the website was running under http://domain1.edu. Now it is runs under http://domain2.edu. It appears that I need to update the map key.
On the internet, I was looking for how to do this. I find incomplete info at Google's own website. Here is the link for v2 map key: https://developers.google.com/maps/documentation/javascript/v2/introduction?csw=1#Obtaining_Key
It says:
To create your API key, visit the APIs Console at https://code.google.com/apis/console and log in with your Google Account.
Click the Services link from the left-hand menu, then activate the Google Maps API v2 service.
Once the service has been activated, your API key is available from the API Access page, in the Simple API Access section. Maps API applications use the Key for browser apps
First, I am unable to find "Google Maps API v2" service mentioned above. I am able to find Google Maps API v3, and so I enabled it. I used the key mentioned at https://developers.google.com/maps/documentation/javascript/tutorial#api_key
However, the website key is still not working.
Here is the page with Google map: http://nmai.si.edu/nafvf/attend.aspx
Anyone knows how to fix this?
Thanks and regards!
You are using the deprecated Google Maps Javascript API v2, those keys are no longer available (as the documentation you point to indicates). You need to use a v3 key, and make sure you have the referrers set correctly for that key (you really should update your map to use the v3 API...)
working example (copied from Mike Williams' v2 tutorial, just changed the key)
This link says how to generate the key for android. You need to get the SHA1 of your signing key and then gotto google console to generate the key.

google map api key not working, need a defferent key

sorry, I know this question might be too common, but I really couldn't figure out why the google map on my site is not working, I did following what the documentation told me to do, I sign up a google map api key, and I implement the follwoing code:
<script type="text/javascript"
src="http://maps.google.com/maps? file=api&v=2&sensor=false&key=mykey">
</script>
I did replace mykey with the google map key for the url I entered during sign up, but when I go to my website, there still show me a alert saying that the site need a different google map api key, I wonder this could be other reasons but I can't think any, anyone could help me with that, any help will be greatly appreciated!
use google maps v3, you only need a key for maps v2:
How does the Google Maps APIs key system work?
Note: Google Maps API keys are only required when using the JavaScript Maps API V2 and the Maps API for Flash.
http://code.google.com/apis/maps/faq.html#keysystem
Where did you sign up for your key? The Maps API now uses keys that are generated through the API console: https://code.google.com/apis/console so you can go there and generate a new key.