schlock
schlock

Reputation: 549

Using Google maps API via SSL

So, I know just recently that google maps API is now available in SSL (here).

My question is, how do I retro-fit my http google maps api script to use this?

So my http Google maps API script call looks like this:

http://maps.google.com/maps?file=api&v=3&sensor=false&key=########

They suggest via this link that to use SSL it should be this:

https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false

I've tried retro-fitting this into my old URL format like so:

https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=########

but that no longer displays the map.

Does anyone have any suggestions on what the URL should be?

Thanks

Upvotes: 2

Views: 13372

Answers (2)

Skadlig
Skadlig

Reputation: 1579

Try this line:
https://maps.google.com/maps/api/js?v=3.5&sensor=true
Google btw suggests that you explicitly enter what version of the api you are going to use. Just entering v=3 will always return the latest version, at the moment 3.5. I believe that the current stable version is 3.3.
As Trott wrote in his answer, api key is no longer needed.

Upvotes: 4

Trott
Trott

Reputation: 70055

You don't need an API key to use v3, but I suppose it probably doesn't hurt. General things to try:

  1. Open your browser's JavaScript console and see if it is reporting any problems when you load the page.
  2. Remove the API key
  3. Change & to just &
  4. Copy and paste the exact link text you put above into your code, because that link text is working for me. I'm referring to this:

https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=########

Of course, change ######## to your API key (or just remove it altogether).

Upvotes: 0

Related Questions