lendo
lendo

Reputation:

Google maps over https

We are using Google Maps over https using a free maps API key. The Google Maps API FAQ says:

The Google Maps JavaScript API and Google Static Maps API can be accessed over a secure (https) connection by Google Maps API Premier customers. If the Google Maps APIs are used with a free Maps API key on a secure site, the browser may warn the user about non-secure objects on the screen.

My understanding of the above is that the API will work anyway, but users might get a security warning. For us, however, the map will not display at all, rendering the page completely unusable.

Does anybody know if Google is blocking use of the maps API over https with free maps API keys?

Upvotes: 17

Views: 22984

Answers (6)

Panayiotis Hiripis
Panayiotis Hiripis

Reputation: 700

After installing SSL certificate, I just had to do a simple change for everything to work.

From this:

<script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>

To this:

<script src="//maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>

Upvotes: 3

Skyborg
Skyborg

Reputation: 874

You should probably use a protocol relative URL.

<script type="text/javascript" src="//maps.google.com/maps/api/js?sensor=false"></script>

Upvotes: 3

Aashish
Aashish

Reputation: 9

no, google will let you display the map even if you are using free google API's over https login.

It definitely gives you a pop up box asking for a yes/no but your map will be displayed for sure.

Upvotes: 0

Harry Wood
Harry Wood

Reputation: 2351

You might be able to work around the problem by using OpenStreetMap instead. It doesn't present a super easy solution, because OpenStreetMap's main tile server does not support HTTPS connections, however there are various things you're allowed to do with OpenStreetMap which google would never allow.

Some more discussion of this on the OpenStreetMap forum: http://forum.openstreetmap.org/viewtopic.php?id=5546

Upvotes: 0

Alex.Bullard
Alex.Bullard

Reputation: 5563

From a quick look at the google maps premier site it seems like they probably are blocking it. One of the listed features is the "ability to provide secure maps over https"

http://code.google.com/apis/maps/documentation/premier/

Okay, here is some more specific info:

http://code.google.com/apis/maps/faq.html#ssl

It seems like you are probably getting a blank map because you are attempting to access with https a service that is only available to premiere members

Upvotes: 6

Related Questions