SINTEF-9012 / PruneCluster

Fast and realtime marker clustering for Leaflet
MIT License
552 stars 131 forks source link

cluster onClick event #184

Open NiharikaSinghal opened 4 years ago

NiharikaSinghal commented 4 years ago

I want to add a different code on onClick event of the cluster. To do so i am using the explanation given in document, by overriding the BuildLeafletCluster function.

pruneCluster.BuildLeafletCluster = function(cluster, position) {
    var m = new L.Marker(position, {
         icon: pruneCluster.BuildLeafletClusterIcon(cluster)
    });
    m.on('click', function() {
        console.log("here inside this event");
    });
    return m;                         
 };

Now when i click the cluster it gets Zoom for the first time and rest other times it goes inside the event and print the message. I could not figure out this behavior?

I do not want it to Zoom in on first click

Thanks & Regards Niharika Singhal