question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

markerCluster.on(GoogleMapsEvent.MARKER_CLICK) doesnt trigger

See original GitHub issue
 this.map.addMarkerCluster({
                markers: data,
                icons: [
                    { min: 2, max: 100, url: "assets/clusters/m1.png", anchor: { x: 16, y: 16 } },
                    { min: 100, max: 1000, url: "assets/clusters/m2.png", anchor: { x: 16, y: 16 } },
                    { min: 1000, max: 2000, url: "assets/clusters/m3.png", anchor: { x: 24, y: 24 } },
                    { min: 2000, url: "assets/clusters/m4.png", anchor: { x: 32, y: 32 } },
                ]
            }).then((markerCluster: MarkerCluster) => {
                
                markerCluster.on(GoogleMapsEvent.MARKER_CLICK).subscribe((params) => {
                  console.log(1)
                 })
            })

The problem is that doesnt do the console.log(1) instead shows this console.log: -----> This is remained cluster icon : 209105

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wf9a5m75commented, Mar 14, 2018

I see. I will change the plugin’s code later to prevent conflict. Anyway, congrats.

1reaction
francorocommented, Mar 14, 2018

I solved it. The problem was that i has an id property in the data that i pass to the clusters and i check that you put an id when you create them so that was interferring

Read more comments on GitHub >

github_iconTop Results From Across the Web

Marker detached from cluster does not fire click event in ...
You created marker event listener google.maps.event.addListener(marker, "click", function (cluster) { console.log("Marker click"); });.
Read more >
Problem with listener map, marker and markerClusterer,
my map is a interactive map for users with exotics palm. Normaly there put a new single marker in place where the plant...
Read more >
Marker clustering doesn't work - ACF Support
I am using markerCluster.js, which is added and loaded. (function($) { /* * new_map ...
Read more >
Google markers at same address not showing all markers
getPosition(); if (latlng.equals(pos)) { text = text + " & " + content[i]; } } } google.maps.event.addListener(marker, 'click', function() ...
Read more >
Ionic Native/Google Maps: Marker click does not work in ...
Ionic Native/Google Maps: Marker click does not work in Marker Cluster · Ionic Framework ionic-v3 · biney12 March 18, 2019, 3:38pm #1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found