Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 801931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:31:10+00:00 2026-05-14T23:31:10+00:00

I have a Google Map API v3 map object on a page that uses

  • 0

I have a Google Map API v3 map object on a page that uses MarkerClusterer. I have a function that need to run when we click on the map to it is registered as:

google.maps.event.addListener(map, 'click', function (event) {
    CallMe(event.latLng);
});

So my problem is as follows: When I click on a cluster of MarkerClusterer instead of behaving like a marker and not raise the click event on the map but only the one from the marker it calls the click from the map.

To test this I have generated an alert from the markerclusterer click:

google.maps.event.addListener(markerClusterer, "clusterclick", function (cluster) {
    alert('MarkerClusterer click event');
}); 

So the clusterclick rises after the click event of map object. I then can’t remove the listener of map object as a solution. Is there any way to test if there was a clusterer click in the click event of the map? Or a way to replicate the marker behaviour and do not raise the click event of map when clustererclick is called? Google and documentation didn’t help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:31:11+00:00Added an answer on May 14, 2026 at 11:31 pm

    Here is something that works but I’m still open to other better answers.

    I use a setTimeout to relay the map click event to be the last thing javascript should execute and check with a boolean if clustererclick was raised before with something like this :

    google.maps.event.addListener(map, 'click', function (event) {
        setTimeout(function () {
            if (!clusterClicked) {
                CallMe(event.latLng);
                alert('Map click executed');
            }
            else {
                clusterClicked = false;
                alert('ClusterClicked map click not executed');
            }
        }, 0);
    });
    
    google.maps.event.addListener(markerClusterer, "clusterclick", function (cluster) {
        clusterClicked = true;
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing sample application that uses Google Map API. I have generated Google
I'm working on an application that uses the Google Maps API. I have no
I have a Map object created through the google maps api and I want
I have a web page with a google map (api v3) that has dozens
I am using Google Maps API v3 , and have several map markers that
I have a dynamic map in Google Maps (API v2) I want to overlay
I have a Google Map (API 2) that used to work fine as a
I have noticed that, from Google Maps page, you can get an embed link
I have a google map in a page (Using the Javascript API v3) the
I have a google maps api v3, which uses The Di Lab's plugin for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.