Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster onClick event #184

Open
NiharikaSinghal opened this issue Feb 26, 2020 · 0 comments
Open

cluster onClick event #184

NiharikaSinghal opened this issue Feb 26, 2020 · 0 comments

Comments

@NiharikaSinghal
Copy link

NiharikaSinghal commented Feb 26, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant