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 6086859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:48:16+00:00 2026-05-23T11:48:16+00:00

I have a Google Map (v3) with 20 markers. I have a single InfoBox

  • 0

I have a Google Map (v3) with 20 markers. I have a single InfoBox instance that gets populated with a div that includes the text to fill the box as innerHTML.

I want to be able to click on the infobox and navigate away to a different page, but I can’t get the infobox, or the div inside it to respond to a click event.

I’ve tried adding an event listener, and I’ve tried adding a domListener, but I can’t get either to work.

Here are some snippets from my code

//setting up the infobox

    var infobox = new InfoBox({
           disableAutoPan: true
          ,isHidden:false
          ,pixelOffset: new google.maps.Size(-10, -10)
          ,closeBoxURL: ""
          ,pane: "mapPane"
          ,enableEventPropagation: true
        });

    //setting up the div

    var boxText1 = document.createElement("div");
        boxText1.id = "boxText1";
        boxText1.className = "labelText";
        boxText1.innerHTML = title1;//this is created earlier

    //the marker event listener - the marker and coordinates are also set up earlier
       google.maps.event.addListener(_marker1, 'click', function() { 
       infobox.content_ = boxText1;
       infobox.position_ = mkLatLng1;
       infobox.open(map);
    });

      //so far everything ok. When the user clicks the marker the infobox pops up - but.....

    google.maps.event.addDomListener(boxText1,'click',function(){ alert('clicked!') });//doesn't work

I’ve tried a variety of other options, but they’re all shots in the dark. What’s the best way to listen for a click event on an infobox?

Thanks

  • 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-23T11:48:16+00:00Added an answer on May 23, 2026 at 11:48 am

    Problem solved. In the infobox options you have to ensure that you have

    pane: "floatPane" 
    

    and NOT

    pane: "mapPane"
    

    as I had it. Works fine now.

    Interestingly the Google Docs say

    Set the pane to "mapPane" if the InfoBox is being used as a map label.
    

    What they don’t say is that you can’t use this option if you want the map label to be clickable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Google Map on our site that has a list of markers
I currently have a Google map that geocodes multiple markers on the fly but
I have a Google Map that loads a layer of markers from a KML
Right now I have google map code that will set a single marker on
I have some google map markers that sit on a map. They are controlled
I have a Google map that is showing a number of markers. When the
I have an app that saves google map markers, I basically save the lat
I have a Google Map that suddenly stopped working for no apparent reason (I
I'm working on an application that generates a large number of Google Map markers
I have a Google map with markers which link through to other pages. If

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.