You need to use addDomListener. addListener is only for map events. Chad Killingsworth
On May 27, 11:42 am, "Miguel.camba" <[email protected]> wrote: > I have the same problem. Neither my InfoBoxes nor his internal > elements seems to capture click events. > I tried adding a listener to the infobox itself: > var ib = new InfoBox(opts); > google.maps.event.addListener(ib,'click',function() > {alert('click!')}) > And with JQuery on the content > $('#infobox_content').click(function(){ alert('click') } ) > > On the options i have "enableEventPropagation" : true, so i have no > idea what's the problem. > It seems like i cant click the infobox and i pass through, clicking > the map. > > Any idea? > > On 14 abr, 21:19, Daniel Lee <[email protected]> wrote: > > > > > If you want to listen to *click* events within the InfoBox, you can probably > > add the listener to the HTML Node passed in as the content. Have you tried > > this? > > > To open InfoBox, it's probably best to maintain a single global variable for > > which you can call anywhere. This will also ensure only a single InfoBox is > > open at any moment. > > > Regarding Markers, it's never a bad idea to maintain a global collection of > > any Overlay objects added onto the map. This includes Markers, Polygons, > > Polylines, Rectangle, Circle, etc. In terms of what to use as the key in a > > Dictionary collection, I think it depends on what meta data is present in > > your app, as long as it's unique. > > > Hope this helps, > > > Dann > > > On Sun, Apr 4, 2010 at 7:27 AM, starenka <[email protected]> wrote: > > > Hi all! > > > > I've just fell down the rabbit hole into this map Wonderland. Don't > > > bash me for asking a trivial question. I'm trying to bind a click > > > event on infoBox (http://code.google.com/p/google-maps-utility-library- > > > v3/source/browse/trunk/infobox/src/infobox.js?spec=svn50&r=49<http://code.google.com/p/google-maps-utility-library-%0Av3/source/bro...>). > > > The > > > event just don't seem to work at all (see the alert thing). What's my > > > problem? I can't provide an URL but, the functions which spawn > > > markers and windows is +- like thishttp://openpaste.org/en/20310/ > > > > PS. I need to open the infoboxes later - on demand (not only after > > > marker click). How should i do that? Is storing references to markers/ > > > info boxes a good idea (f.e a dict with marker/boxes, where key is > > > hashed latlon)? How do you solve such things? > > > > Thanks for your time & help > > > > starenka > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Google Maps JavaScript API v3" group. > > > To post to this group, send email to > > > [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<google-maps-js-api-v3%2B > > > [email protected]> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > > -- > > Daniel Lee > > Developer Programs Engineer > > Google, Inc. > > 345 Spear Street > > San Francisco, CA 94105 > > 650 253 0967 -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
