Google Maps API


#1

Hi,

Thanks for the terrific tutorials library - they’re really great! I’m stuck on the Google Maps JavaScript API project and need assistance. These errors are logged to the console:

  1. [blocked] Access to geolocation was blocked over insecure connection to…
    I’m using an http server to host my app and did NOT set a restriction for http in the API console.

  2. Google Maps API error: InvalidKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key-map-error
    I’m using copy/paste to put the key into the html file provided with the tutorial, and I’ve created a new key several times, but I keep getting the same errors.

Thanks in advance for any assistance - very much appreciated!


"Mozilla splash page" assessment
"Mozilla splash page" assessment
(Chris Mills) #2

Hi bheckmann,

I’ve looked into this, and it seems that Google have changed the way that their Maps API works. Grrr!

So I am going to need to find some time to sit down and learn how the new API works, and rewrite all my examples ;-|

Sorry about the delay on this. I will try to find time to do this soon.


#3

Hi chrismills,

Thanks for replying. I’m continuing to work the problem and it has changed a bit since my initial post.

  1. I’m no longer getting the “[blocked]…” error - just “InvalidKeyMapError”.

  2. When I load my page the map appears for a second but is quickly replaced by the error.


#4

Hi chrismills,

Correction / update to my previous post…

I incorrectly reported that I’m no longer getting the “[blocked]…” error. I’m hosting the html file on an http server (not https) and when I open the file by right-clicking it while FTP’d into the server everything works fine. However, when I access the file by typing the URL in the browser I get the error.

I understand now that this is a network security issue, not a problem with the tutorial (I’ll continue digging around to resolve the security problem).

As for the API key, I unfortunately don’t know why it’s working now when it previously didn’t. I spent a lot of time in the API console and Google Cloud Platform UI so I must have made an adjustment that cleared up the problem.

Thanks for your attention.


(Chris Mills) #5

Ah, OK. I am glad you are at least getting it working now. Yes, it probably was some kind of Google Cloud platform issue - I’ve spent a lot of time tinkering around in there myself. I still reckon the security thing might be to do with non-HTTPS. Maybe try putting it on GitHub? GitHub pages will give you HTTPS by default.