MarkerCluster V3 stopped working properly

前端 未结 3 1044
感情败类
感情败类 2020-12-03 17:41

I am using MarkerCluster_compiled.js from github. But while the logic works, its graphics started failing from yesterday.

The problem seems to be caused by \"https:

3条回答
  •  时光取名叫无心
    2020-12-03 18:38

    Download markerclusterer.js and the images m1.png to m5.png from Github https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images and save them locally, like this:

    index.html
    markerclusterer.js
    images/
    - m1.png
    - m2.png
    - m3.png
    - m4.png
    - m5.png
    

    Then when using markerclusterer.js, set imagePath to ìmages/m like this:

    var mc = new MarkerClusterer(map, makers, {imagePath: 'images/m'});
    

    Why you should use it like described above:

    • GitHub is not a CDN.
    • Paths could change, like they did before.
    • It will work with http and https!
    • You don't depend on external resources to keep your service alive.

提交回复
热议问题