4
votes

I've set up a Google Maps Static API and added my API key to my code. It still comes up with an error. 403 forbidden, g.co/staticmaperror/signature

I have set the http referrer to be MYDOMAIN.COM/* and also *.MYDOMAIN.COM/*

I can't get it to stop showing a 403 error. I've only just set up the static map so it can't be a quota issue. The same code works on another client site (different domain, http referrer and API key).

I've recreated the API key and double checked it has copied and pasted correctly. I've spell checked my http referrer.

Is there any other reason I could be blocked from using the Static map API?

2
Your API key is a Google Static Maps API key and not a Google Maps API key ? Some other user right here mixed up the two API - S. Miranda
Definitely a static maps API key. I have read every static maps post on Stackoverflow. And checked all of these things 7 times before even coming here. I'm totally baffled but it must be something stupid. Been staring at it too long methinks. - Eoin

2 Answers

0
votes

It turns out that Google Maps Static has a limit on the size of the map you can use. And this was what was causing my issue.

You can see more information here: https://blog.dotnetframework.org/2013/09/03/exceeding-the-maximum-size-for-google-static-maps/

It states that (you'll have to work with the below tabular data, sorry):

**API,      scale=1,                   scale=2,             scale=4**

Free,   640x640 640x640, (returns 1280×1280 pixels),    Not available.

Google Maps API for Business,   2048x2048,  1024x1024 (returns 2048×2048 pixels),   512x512 (returns 2048×2048 pixels)

So anything above that causes problems, which was what happened in my case.

0
votes

The Easiest way to debug Google static maps - is to try to open the URL in a new browser tab.