Would you mind setting a quick example of what you ment by "The other
thing you could do is keep the listeners static and check a global
state variable in your listener function that will determine what to
do when." ?




On 29 dez, 23:02, Papa Bear <[email protected]> wrote:
> Not a map question per se, but a javascript question.
>
> You can set the onmouseover and other listeners in javascript:
>
> document.getElementById('foobar').onmouseover = 'myfunction()'; etc
>
> In other words, "onmouseover" is a property of the element, much as
> style, href, classname, etc. are properties and is settable
> dynamically.
>
> If you Google "javascript set onmouseover" you should get plenty of
> examples.
>
> The other thing you could do is keep the listeners static and check a
> global state variable in your listener function that will determine
> what to do when.
>
> On Dec 29, 5:50 pm, Mauricio Bolognese <[email protected]> wrote:
>
>
>
> > I need to turn on and off the listeners multiple times.
> > I´ll try to explain with an exemple.
>
> > I have 4 listeners.
>
> > 1 - MouseOver (on marker)
> > 2 - MouseOut (on marker)
> > 3 - Click (on marker)
> > 4 - ExtInfoWindowClose (on extinfowindow)
>
> > When I "mouseover" a marker I want to show an ExtInfoWindow, and when
> > I "mouseout" I want to hide it.
>
> > When I "click" a marker, I want to show an ExtInfoWindow, and turn of
> > the "mouseover" and "mouseout" listeners.
>
> > When I close the ExtInfoWindow, I want to activate the "mouseover" and
> > "mouseout" listeners.
>
> > How can I do this?
>
> > The "mouseover" and "mouseout" part is coded bellow, but I could not
> > make the on and off part. If anyone can help me with this, I would
> > greatly appreciate.
>
> > Thanks,
> > Mauricio Bolognese.
>
> > var windowMouseOver = GEvent.addListener(marker, "mouseover", function
> > (){
> >         marker.openExtInfoWindow(map, "custom_info_window");
>
> > });
>
> > var windowMouseOut = GEvent.addListener(marker, "mouseout", function()
> > {
> >         map.closeExtInfoWindow();
>
> > });
>
> > GEvent.addListener(marker, 'click', function(){
> >          marker.openExtInfoWindow(map, "custom_info_window");
> >         //code to turn off listeners
>
> > });
>
> > GEvent.addListener(map, 'extinfowindowclose', function(){
> >         //code to turn on listeners
>
> > });

--

You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-api?hl=en.


Reply via email to