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

markercluster events #648

Closed
azatoth opened this issue Mar 10, 2015 · 3 comments
Closed

markercluster events #648

azatoth opened this issue Mar 10, 2015 · 3 comments

Comments

@azatoth
Copy link

azatoth commented Mar 10, 2015

markercluster adds "cluster" + eventName events to markers; afaik, possible events are hardcoded in leafletEvents.js.

Would it be possible to remedy this to some extent?

@joeljeske
Copy link

I got around this for now by doing this by get the layer directly. Note this code is in a directive, so layersCtrl is the injected controller into the link function when using the require options in the directive definition.

layersCtrl.getLayers()
    .then(function(layers) {
        var layer = layers.overlays[layerId];
        layer.on('clusterclick', function(e) {
            var map      = e.target._map,
                children = e.layer.getAllChildMarkers(),
                latlng   = e.latlng;

            if (map._zoom >= map._layersMaxZoom) {
                showPopup(map, children, latlng);
            }
        });
    });

@nmccready
Copy link
Contributor

This issue was moved to angular-ui/ui-leaflet#146

@nmccready nmccready reopened this Nov 2, 2015
@tombatossals
Copy link
Owner

I'm going to rework&redesign angular-leaflet-directive to be compatible with Leaflet v1.0. It will mantain almost all its functionality, and will be compatible with the current features of the directive, but I must start from a fresh point, so I'm going to close this issue. If you think it must be worked with the new version, please reopen it.

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

4 participants