Styling MarkerClusterer Icons?

前端 未结 2 701
灰色年华
灰色年华 2021-01-31 07:47

I am using the MarkerCluster.js to create clustering in my google maps api. The clusters work how I want them however I want to style differently than yellow, blue and red circl

2条回答
  •  醉梦人生
    2021-01-31 08:23

    What you need to do is use the url to specify which images to use instead of the blue/yellow/red images currently being used. And probably a good idea to include the height and width options too.

    var clusterStyles = [
      {
        textColor: 'white',
        url: 'path/to/smallclusterimage.png',
        height: 50,
        width: 50
      },
     {
        textColor: 'white',
        url: 'path/to/mediumclusterimage.png',
        height: 50,
        width: 50
      },
     {
        textColor: 'white',
        url: 'path/to/largeclusterimage.png',
        height: 50,
        width: 50
      }
    ];
    

提交回复
热议问题