Error GET Google Places API - google-maps

Today, Google places API stopped working on my site. Yesterday, it was working just fine. When I call it, I get following error in developer's console:
GET https://maps.googleapis.com/maps/api/place/js/AutocompletionService.GetPredictions?1slux&4scs-CZ&9sgeocode&15e3&key=AIzaSyCe8-UQIQuXtaQ5xVOqtwnCtZOjDtXj4Co&callback=_xdc_._8rz5bv&token=109805 net::ERR_ABORTED
The problem isn't in Google maps API itself, because that works just fine (without the Places). If I take fresh code snipper from Google website, it is still not working, as you can see here. So the problem isn't in my code, but in the API itself. I checked my project on Google site and the API is enabled, so it should work. Maybe it's connected to my API key? I haven't tried creating a new one, I don't want to have too many of them.

SOLUTION: After approximately one hour (from posting this), it started working again. Apparently a problem on Google side. So if you have the same problem:
Go to your Google account and check in API manager if the Google Places API service is enabled.
If it is enabled, wait and be patient. Hopefully it will fix by itself.

Related

Google Maps API for both localhost & production server, as of April 2019

TLDR
My code works fine on my laptop when accessed as file://<path>/index.html, but neither on my laptop with an Apache server running when accessed as http://<path>/index.html, nor on my real (production) server. I see no errors on the console, but the map is just a grey rectangle.
[Update] I moved to LeafletJS shortly after asking this question, and recommend others to do so too.
It has been a few years since I coded any Google Maps applications.
It seems that, as of last year, it is now necessary to have an API key, by providing it with credit card details, and to provide it with each API call.
Unfortunately, there is a lot of of information about this, much/most of it out of date and/or contradictory.
Can anyone point to the canonical guide, preferably with screenshots, of how to configure this?
I wish to draw a map, and add some makers, which will require reverse geocoding, such that I provide a street address and convert it to lat/long in order to place the markers.
Sounds simple enough, but which of the many thousands of "helpful" site has gotten it right?
For instance, what seems to be the current Google help page speaks of
From the Navigation menu, select APIs & Services > Credentials.
On the Credentials page, click Create credentials > API key
But I can't even see that menu option :-(
[Update] If it helps any, the error message in the developer console said :
Geocoding Service: 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 For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key
[Update] I am trying to access the API like this
<script src="maps.google.com/maps/api/…>
and
var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + comapnyLocation +'&key=XXXX';
$http.get(url)
[Update++] in the developer console, I see a bunch of errors along the lines of:
aliextension.com/wp-content/uploads/2017/08/JAR.png:1 GET https://aliextension.com/wp-content/uploads/2017/08/JAR.png net::ERR_CONNECTION_TIMED_OUT
I have no idea what aliextension is, nor does it appear in my code (maybe in some minified JS?)
Ok, it is something to do with AliExpress (Ali Baba). I removed it & the timeout messages go away, but I still have problems.
If I load the index.html into Chrome as a file://, then it works just fine. But, if I load it `as http://, where I have a Xampp Apache server running, the map box remains grey, although I see no error messages. The same thing happens on my real server :-(
This page should be your starting point:
https://developers.google.com/maps/documentation/javascript/tutorial
it helps you working with Google map javascript API.
To embedded a google map to your website read the overview page in the above link.
To add markers to your google map read this page:
https://developers.google.com/maps/documentation/javascript/adding-a-google-map
To do reverse geocoding read this page:
https://developers.google.com/maps/documentation/javascript/geocoding
That all i need to work with google map. I think you can do the same too.
The cause for this is quite likely an API key restriction.
In order to permit these host-names or IP addresses, you have to:
a) go to the credentials panel and select the according project, then click on "Api key".
b) there you can loosen the restrictions, for HTTP referrers (for web-sites)
... or for IP addresses (in case these are server-side requests).

ExpiredKeyMapError on newly generated API key

I have just generated an API Key to enable us to display a Google map on our website but I'm getting the ExpiredKeyMapError. This is the exact same issue as this stackoverflow query from 8 months ago, but that has never received a solution: Google Maps ExpiredKeyMapError with recently created API Key
When the page first loads, the map shows for a split second and then it disappears, to be replaced with a grey box that says:
"Sorry! Something went wrong. This page didn't load Google Maps
correctly. See the JavaScript console for technical details"
And when I pull up the console, this is the error message I get:
Google Maps API error: ExpiredKeyMapError
https://developers.google.com/maps/documentation/javascript/error-messages#expired-key-map-error
SCRIPT12008: WebSocket Error: Incorrect HTTP response. Status code
403, Forbidden
and that last line just keeps repeating.
Any help much appreciated because I have no idea how to solve this myself.
I had the same error after generating a new API key, but I had JavaScript API already enabled and everything correctly setup.
While searching for an answer and checking what else I can do, the key started to work. So every single time you create a new key, be patient and expect it to work within 1-8 minutes.
I discovered that it was not working because I hadn't separately enabled the Google maps javascript API. Once I'd done that, the map started working a few minutes later.
I discovered that it was not working because I hadn't separately enabled the Places API. Once I'd done that, the map started working a few minutes later.

Implementing A Website like Google Waypoints

Actually I am new in web development and doing work by search and reading tutorials. I am confused by google API and need some help.
I am using nodejs and need to show the google map in my view and show path of a vehicle on map. I have read https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints#try-it-yourself and found the waypoints in direction is my solution.
According to the steps at https://developers.google.com/maps/documentation/directions/get-api-key#key
I have created a project, added libraries and also get api key from google.then to test my api key I made a html page just like a page which is defined here
And I got an error after loading map.It
Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript
console for technical details.
And consol log said the url is not authorised so I added url to Domain Verification section at Credential of this link
but the error still appears.
I am sure there is a lot of info which I did not understand them but I need to know What's wrong on my work? Do I skip any step?
I found the solution to fix my problem! I did not enable javascript API and that caused error.
To enable JavaScript Api do this
Go to API Manager
Click on Dashboard
Click on Enable API with Plus button
Search for Google Maps JavaScript API and Click on that
You will find Enable button there. Click to enable API.

Alert "This page was unable to display google maps element." javascript error "RefererDeniedMapError"

I'm getting this alert message in one of my sites that uses Google Maps JavaScript API v3:
"This page was unable to display google maps element. See the terms of service"
And in the javascript console this error:
"RefererDeniedMapError"
I searched in internet and its seems to be a new bug, I only found reports in this month (June 2015).
It seems to be a domain specific problem, because the same code works in others domains.
In my case the web page were working without an API key. After this error I generated and added an API key to my code, but it doesn't solve the problem.
In the https://console.developers.google.com/ doesn't appear any useful information. The quota of map loads is OK, but when I load the web page the map loads are not counted (probably because the error).
Does anyone has a clue about how to solve the problem?
I was getting the same error message, and realized I replaced with below one
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
I was getting the same error message, and realized I needed to remove "signin=true" from the google maps call.

Google maps api v2 stopped working

Long ago I've setup a Google Maps project using the old API version(v2). I know Google Maps API v2 is being deprecated and I'm working on rewriting it for the new version, but I need this working until then.
Suddenly, the map stopped working throwing this error in an alert box:
Google has disabled use of the Maps API for this application. This
site is not authorized to use the Google Maps client ID provided. If
you are the owner of this application, you can learn more about
registering URLs here:
http://code.google.com/apis/maps/documentation/premier/guide.html#URLs
I haven't changed anything in the current app and the requests per day are less than 1000(way far from the daily quota). The first thing I've noticed is that there was no allowed referrers specified. But even after they was set to(replacing sitename.com with my domain):
sitename.com
sitename.com/*
www.sitename.com
www.sitename.com/*
*.sitename.com
*.sitename.com/*
There was no result whatsoever even after couple of hours. The reason why this application suddenly stopped working is still a mystery to me (once again - nothing has been changed in my code or the google account), but most importantly I need really fast solution.
Any ideas?
Sounds like you might be using v2.x. There was a release of v2 very recently. If you aren't using v2.s; you might try that (or v=2) to see if it resolves your problem (for now, they have gone to a 2 week upgrade cycle on v2: "We have updated v=2.x to 2.441. v=2 will be updated in 2 weeks and v=2.s will be updated in 4 weeks.")