Add custom image to Marker Cluster without overwriting markers

后端 未结 1 674
暗喜
暗喜 2021-01-28 14:07

I have the following jQuery code which adds map marker clusters:

markerCluster = new MarkerClusterer(map);

I\'m using markerCluster.addMa

相关标签:
1条回答
  • 2021-01-28 14:39

    By default, MarkerClusterer looks for markers in the ../images folder (relative to the position of markerclusterer.js).

    The easiest thing for you would be to get the image folder from the github, so the structure of your files is following:

    -images
      -m1.png
      -m2.png
      -..etc other files from the directory
    -SOME_FOLDER //can be lib, libraries, what have you
      -markerclusterer.js
    

    Alternatively you can play with imagePath attribute of the options object, so you would have something like this:

    var options = { imagePath: "PATH_TO_IMAGES_FOLDER/m" };
    markerCluster = new MarkerClusterer(map, markers, options);
    
    0 讨论(0)
提交回复
热议问题