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

Event spiderfied not fire #1067

Open
josuelmm opened this issue Aug 2, 2022 · 0 comments
Open

Event spiderfied not fire #1067

josuelmm opened this issue Aug 2, 2022 · 0 comments

Comments

@josuelmm
Copy link

josuelmm commented Aug 2, 2022

  • Leaflet version I'm using: 1.8.0
  • Leaflet.MarkerCluster version I'm using: 1.5.3
  • Browser (with version) I'm using: Chrome
  • OS/Platform (with version) I'm using: Windows

I am importing this:

import * as L from 'leaflet';
import 'leaflet.markercluster';
import 'leaflet.markercluster.freezable';

this.markersGroup = L.markerClusterGroup({
      chunkedLoading: true,
      disableClusteringAtZoom: 15,
      spiderfyOnMaxZoom: !1,
      showCoverageOnHover: !1,
      removeOutsideVisibleBounds: !0,
      iconCreateFunction: (t) => {
        var e = t.getChildCount(),
            i = "cluster-";
        return (i += e < 5 ? "small" : e < 10 ? "medium" : "large"), L.divIcon({ html: '<div class="cluster-inner"><b>' + e + "</b></div>", className: "cluster " + i, iconSize: [58, 58], iconAnchor: [25, 25] });
      },
    });

this.markersGroup.addTo(this.map);
        this.markersGroup.on('spiderfied', (cluster, cMarkers) => {
          console.log(cluster);
          console.log(cMarkers);
        });
        this.markersGroup.on('clusterclick', (a) => {
          this.markersGroup.refreshClusters();
          // a.layer is actually a cluster
          console.log('cluster ' + a.layer.getAllChildMarkers().length);
        });

The events spiderfied and unspiderfied not fire
The event cluster click yes fire

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