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). 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 this http://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 google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
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 <daniel...@google.com> 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 <staren...@gmail.com> 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
> > google-map...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B unsub...@googlegroups.com>
Chad Killingsworth
GM.event.addDomListener(openedInfoBox,'clikc',function()
{ alert('click!') }); // Dont works
//$("div.infoBoxContent").click(function()
{ alert('click!') }) // Dont works
});
}
Is this the way you suggested?
On 27 mayo, 19:09, Chad Killingsworth
<chadkillingswo...@missouristate.edu> wrote:
> You need to use addDomListener. addListener is only for map events.
>
> Chad Killingsworth
>
> On May 27, 11:42 am, "Miguel.camba" <miguel.ca...@gmail.com> wrote:
>
>
>
> > I have the same problem. Neither my InfoBoxes nor his internal
> > elements seems to captureclickevents.
> > I tried adding a listener to theinfoboxitself:
> > var ib = newInfoBox(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 cantclicktheinfoboxand i pass through, clicking
> > the map.
>
> > Any idea?
>
> > On 14 abr, 21:19, Daniel Lee <daniel...@google.com> wrote:
>
> > > If you want to listen to *click* events within theInfoBox, you can probably
> > > add the listener to the HTML Node passed in as the content. Have you tried
> > > this?
>
> > > To openInfoBox, it's probably best to maintain a single global variable for
> > > which you can call anywhere. This will also ensure only a singleInfoBoxis
> > > 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 <staren...@gmail.com> 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 aclick
> > > > event oninfoBox(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
> > > > markerclick). How should i do that? Is storing references to markers/
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.