-1

Is there a way of adding a click eventlistener for an info window or an InfoBox (I'm using that plugin)?

Really the problem I'm having is that the window/box is sometimes getting in the way of a click eventlistener that should be triggered when the user clicks anywhere on the map.

twekken
  • 13
  • 5

1 Answers1

0

from the documentation:

http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/examples.html

Using InfoBox to Create a Map Label This example shows how to use an InfoBox as a map label. One important step is to set the pane property to "mapPane" so that the InfoBox appears below everything else on the map. It's also necessary to set closeBoxURL to "" so that the label will not have a close box, to set disableAutoPane to true so that the map does not pan when the label is added, and to set enableEventPropagation to true so that events will be passed on to the map for handling.

from the example referenced above:

    var myOptions = {
             content: boxText
            ,disableAutoPan: false
            ,maxWidth: 0
            ,pixelOffset: new google.maps.Size(-140, 0)
            ,zIndex: null
            ,boxStyle: { 
              background: "url('tipbox.gif') no-repeat"
              ,opacity: 0.75
              ,width: "280px"
             }
            ,closeBoxMargin: "10px 2px 2px 2px"
            ,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif"
            ,infoBoxClearance: new google.maps.Size(1, 1)
            ,isHidden: false
            ,pane: "floatPane"
            ,enableEventPropagation: false
    };

    var ib = new InfoBox(myOptions);
    ib.open(theMap, marker);
geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • Thanks! The code you pasted is incorrect for this problem - 'pane:"floatPane"' needs to be 'pane:"mapPane"', so I initally didn't think your solution was correct. But the text and link you posted was perfect! – twekken Dec 11 '13 at 19:30
  • Actually, I should note this has issues as it places the infobox beneath any polyline or markers. – twekken Dec 11 '13 at 19:41
  • It doesn't say anything about polylines or markers in your question. – geocodezip Dec 11 '13 at 19:44
  • Nope, I wasn't aware it would be relevant to the solution. – twekken Dec 11 '13 at 20:24
  • But I found out that if I add the InfoBox to the 'overlayLayer' pane and set the zIndex high enough it is at least in front of the polyline :) – twekken Dec 11 '13 at 20:24