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

  • SEARCH
  • Home
  • 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 8953583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:07:46+00:00 2026-06-15T14:07:46+00:00

I need to know when the Map Data link is clicked (see image 1,

  • 0

I need to know when the Map Data link is clicked (see image 1, bottom right corner).
When the Map Data window is opened, it is hidden by the overlaying elements (image 2). So I have to hide them when I receive the trigger of opening the window, and to redisplay them when it is closed.

I’ve tried to catch all click events under the map canvas as below, but I’m not triggered when I click on “Map Data”

$("googleMapCanvas a").click(function() {
        alert("link under map clicked");
        });

Any ideas?

Image 1

Image 1

Image 2

Image 2

Update

Here is my functionnal code after Christian’s answer

<div id="googleMapCanvas">
</div>

<div id="currentLocationBubbleContainer">
    ... 
</div>

<script>
$("#googleMapCanvas").on('click', 'a', function(event) {

     var host = event.target.host;      
     var isGoogleExternalLink = false;

     if (host != null && host.search(".google.") != -1 ){
             isGoogleExternalLink = true;
     }

     //It's not enough to check the innerHTML because it's content varies 
     //depending on the device langage, so in stead I check if it is not 
     //a click on the google logo, or on the terms of use which are external links
     if (event.target.innerHTML == "Map Data" || ! isGoogleExternalLink ){
             hideCurrentLocationBubble();
     }
     });

     //Close button of Map Data window
     $("#googleMapCanvas").on('click', 'img', function(event) {

         if (event.target.src == "https://maps.gstatic.com/mapfiles/transparent.png"){
             showCurrentLocationBubble();
         }
     });
</script>
  • 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-06-15T14:07:49+00:00Added an answer on June 15, 2026 at 2:07 pm

    Where are you binding that .click() event? By default that won’t be delegated, so if the map doesn’t exist at the time of calling the code, that event won’t be bound. Try using .on() instead:

    $("googleMapCanvas").on('click', 'a', function() {
        alert("link under map clicked");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image (map) without geo data in TIFF format. I need to
I need to know how to add an a href link to a div?
I need to know how Boost::Serialize works with STL containers - such as map,
I need to plot discrete X,Y data as a MAP in a PNG or
are STL maps ordered? Specifically I need to know if std::map is ordered. So
I usually use C++ stdlib map whenever I need to store some data associated
Need to know this so that i could send DTMF and that is going
Need to know which event triggered after text selection done in Apple iPad. It
I need to know how to change background of expanded list item when it
I need to know how to exclude files/folders from php generated zip. Here is

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.