I am using google maps on http, it is working perfectly fine. But when i installed ssl certificates over the same, it stopped working. It is giving me errors
Mixed Content: The page at 'https://url' was loaded over HTTPS, but requested an insecure script 'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js?_=1***************'. This request has been blocked; the content must be served over HTTPS.
Check the script inclusion url for google maps and remove the http protocol from the url:
will become
in this manner the script will be served using the correct protocol (http or, in your case, https)
If you access your website through https, all content that it serves must come from https as well. That includes images, stylesheets and JS scripts. Just change http to https in the URL.
Just change the Google http:// to https://
http://maps.google.com/ to https://maps.google.com/
I faced this problem today for Marker cluster library, so I had to update the images directory manually from the js source file, open markercluster.js
and replace:
https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer
With the directory in github:
https://googlemaps.github.io/js-marker-clusterer
And you should be fine..
UPDATE: On May the 12th 2016 Google decommissioned the google-maps-utility-library-v3.googlecode.com source for this library. However, since Google moved the source over to GitHub a while back, please consider the GitHub details covered at the end of this post and, in particular, the final note regarding including the script and resources directly in your project
In addition to changing your script inclusion url from:
to:
you'll also need to specify the imagePath option when instantiating your MarkerClusterer along the following lines:
This will avoid the following warning which covers the same ground as the script error you've highlighted:
The reason this occurs is that, by default, the MarkerClusterer library uses the following non https setting as the root for its cluster images (m1.png, m2.png etc.):
Whilst we encountered this issue a while back, it does appear to have been addressed in response to the following pull request on the library's GitHub repository:
Changed HTTP to HTTPS in image link
This GitHub version can be accessed from RawGit by using the following script url:
and the following imagePath can be used to access the GitHub images:
Whilst the above urls (with the cdn prefixes) have no traffic limits or throttling and the files are served via a super fast global CDN, please bear in mind that RawGit is a free hosting service and offers no uptime or support guarantees.
This is covered in more detail in the following SO answer:
Link and execute external JavaScript file hosted on GitHub
This post also covers that, if you're linking to files on GitHub, in production you should consider targeting a specific release tag to ensure you're getting the desired release version of the script.
However, as the custodians of the js-marker-clusterer repository have yet to create any releases, this isn't currently possible.
As a result, you should seriously consider downloading and including the library and its resources directly in your project for production purposes.