1

When your website is loaded through HTTPS, the Google Maps Marker Clusterer Plus default icons are still loaded via plain HTTP

And that triggers the "mixed content" warning from most browsers

some resources were loaded with plain http

Anthony Dahanne
  • 4,823
  • 2
  • 40
  • 39

2 Answers2

1

Simply add this line :

MarkerClusterer.IMAGE_PATH = "https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m";

before calling your Google Maps Marker Clusterer Plus :

var markerCluster = new MarkerClusterer(map, allMarkersArray, mcOptions);
Anthony Dahanne
  • 4,823
  • 2
  • 40
  • 39
  • Just in case it's useful, I've updated my answer to include details of Google's decommissioning of the Google Code copies of the MarkerClustererPlus scripts – Chris Cook May 12 '16 at 22:03
1

You can also address this, in a similar fashion to Anthony's answer, by specifying the imagePath option when instantiating your MarkerClusterer (as follows):

var mc = new MarkerClusterer(map, markers, { 
    imagePath: 'https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m' 
});

UPDATE: As Google moved the MarkerClustererPlus source over to GitHub a while back, and the Google Code versions have now been discontinued, you should use the new GitHub hosted versions by using one of the following script urls (standard and packed versions):

https://cdn.rawgit.com/googlemaps/v3-utility-library/master/markerclustererplus/src/markerclusterer.js
https://cdn.rawgit.com/googlemaps/v3-utility-library/master/markerclustererplus/src/markerclusterer_packed.js

You'll also need to direct the imagePath option to the new hosting location when instantiating your MarkerClusterer as follows:

var mc = new MarkerClusterer(map, markers, { 
    imagePath: 'https://cdn.rawgit.com/googlemaps/v3-utility-library/master/markerclustererplus/images/m' 
});

In production, the above urls (with the cdn prefix) should be used as they have no traffic limits or throttling and the files are served via a super fast global CDN. However please bear in mind that, as a free service, it offers no uptime or support guarantees.

Accessing files hosted from Git is covered in more detail in the following SO answer:

Link and execute external JavaScript file hosted on GitHub

Community
  • 1
  • 1
Chris Cook
  • 2,821
  • 1
  • 20
  • 32
  • thank you for your answer and update - code should not rely on google code anymore, since it was sunset a while ago – Anthony Dahanne May 12 '16 at 22:20
  • I wholeheartedly agree, though it seems that quite a few developers have been caught out on this issue - mainly as the examples supplied with the Google Maps Utility Library only referenced (and still reference) the Google Code versions – Chris Cook May 12 '16 at 22:24