Add Listener to infowindow

Home Forums MapPress Support Add Listener to infowindow

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9403
    dhechler
    Participant

      I know with Google Maps you can add an event listener inside the infowindow. Would that still be possible with this plugin? I want to have a link inside the infowindow (already accomplished) that will open a div outside the map (using jQuery .slideDown). My script works for links outside the map, but not for ones in the infowindows. Any idea?

      #9432
      Chris
      Keymaster

        Hi, it’s not possible because the infowindow handle isn’t exposed in the current version. If you like, drop me a line and I’ll add the function to the latest development version – if you don’t mind a beta you’ll be able to get that handle.

        #9444
        Chris
        Keymaster

          The beta is now available if you login to your account on this site (2.38.1 beta). You need to know your map’s name (see the FAQ for how to assign a name). Assuming the name is ‘mymap’ you can use javascript to get the infoWindow handle:

          mymap.getInfoWindow();

          With the handle you can use google’s “domready” event to detect when the window is open.

          By the way, you could probably also just embed an ‘onclick’ event in the link. It’s a little uglier but it would let you avoid getting the handle, etc.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.