PinClusterer icon indicating copy to clipboard operation
PinClusterer copied to clipboard

How to change icon for single pin

Open mirko77 opened this issue 9 years ago • 1 comments

Changing zoom level, when I have only single pushpins and not a cluster, how do I change the icon to represent a single point? From the circle to a custom image basically

Can you add an example about how to modify/set the pushpin settings?

Cheers

mirko77 avatar Jun 19 '15 12:06 mirko77

You could do that when initialising PinClusterer, using the onClusterToMap callback (and checking that the cluster contains 1 pin).

E.g.

var pinClusterer = new PinClusterer(map, {
  onClusterToMap: function (center, cluster) {
    if (cluster.length === 1) {
      center.setOptions({
        icon: '/path/to/icon'
      });
    }
  }
});

rtsinani avatar Jun 19 '15 17:06 rtsinani