Using google map on my site (https secure) shows an error

My site uses secure https pages, but when I use the Google Maps API to display a map on my website, it shows an error (for example, the web page contains insecure elements). But if I delete this gmap api, the error will disappear.

Is there any way how I can use google map in secure https pages without any errors.

+7
source share
4 answers

Yes,

Thus, we are pleased to offer free access to the Maps API v3, Static Maps APIs and HTTPS Maps API Web Services for all developers from today. To download the Maps API v3 via HTTPS, the API must be loaded from the hostname maps-api-ssl.google.com. For the static maps API and web services, use maps.googleapis.com.

Check out the official announcement from Google:

http://googlegeodevelopers.blogspot.com/2011/03/maps-apis-over-ssl-now-available-to-all.html

+8
source

The bad news is that you use the Google Maps - SSL API , you still sometimes get a Secure and Unsecured warning. That's why:

The Google url above displays everything under https: // to display the secure environment correctly. However , this is a huge problem . Google now displays an image of the building or location on the left in without https , which gives us a "strong" unsecured error that we hate to get in a secure environment.

Here is a good example ... take a look at the following:

https://maps-api-ssl.google.com/maps?q=1000+Ballpark+Way,+Arlington,+TX&hl= en & SLL = 37.0625, -95.677068 & sspn = 49.310476,101.425781 & vpsrc = 0 & hnear = 1000 + Ballpark + Way + Arlington + Texas + 76011 & t = m & g = 17

Now, using Firefox or the browser of your choice, right-click on the image of the building Info or Image Properties ... and WOW! You will see that this image causes your unsecured error when everything that matches Google needs to be protected for https: //

Images of the building and location are not listed in https: // .... you will still receive an error message!

Check it out for yourself and you will see what I see ... so viewing Google maps for SSL is still a problem if someone does not know about the work round, to delete this location or images of buildings or to display for https : //, but not http: //, for example, in the case of the image itself.

Bottom line ... it's still a problem due to non -SSL photo images ...
Check it out and you'll see what I'm talking about.

If anyone knows about this, I would definitely like to know. Google, if you have an explanation, please let us know.

+1
source

You need to use protocol related paths like this:

<link rel="stylesheet" href="//example.com/style.css"> <script src="//example.com/script.js"></script> 

check this answer:

How to include CSS and JS files via HTTPS if necessary?

0
source

To do this, you need to use corporate Google maps, and it's not free. Learn more at http://www.google.com/enterprise/earthmaps/maps.html

You can try downloading Maps API v3 via HTTPS, the API should be loaded from the maps-aplash.google.com node name. For the static maps API and web services, use maps.googleapis.com.

-one
source

All Articles