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

Programmatic click doesn't work with clusterer incorporated #170

Open
btbowden opened this issue Aug 26, 2020 · 1 comment
Open

Programmatic click doesn't work with clusterer incorporated #170

btbowden opened this issue Aug 26, 2020 · 1 comment

Comments

@btbowden
Copy link

I'm using the spidifier with the marker clusterer plugin and it works great, however there is one problem. I'm activating the marker click programmatically, which does fire the marker event, but doesn't open the info window or spidering as expected.

click event that gets fired:
google.maps.event.trigger(localsLocation.Markers[index], 'spider_click');

event code:
google.maps.event.addListener(marker, 'spider_click', function (e) { // 'spider_click', not plain 'click'
marker.setZIndex(google.maps.Marker.MAX_ZINDEX);
localsLocation.infoWindow.setContent("

" + data.Information + "
");
localsLocation.infoWindow.open(localsLocation.Map, marker);
});

If I manually click the marker it works as expected though.

@btbowden
Copy link
Author

I implemented a time delay on the clusterer constructor and it now works.

        setTimeout(function () {
            // Add a marker clusterer to manage the markers.
            const clusterOptions = {
                imagePath: "/Assets/Images/MarkerClusterer/",
                gridSize: 50,
                maxZoom: 15
            };
            localsLocation.MarkerCluster = new MarkerClusterer(localsLocation.Map, localsLocation.Markers, clusterOptions);
        }, timeout);

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