Skip to content

mxn.Marker.setHover() close on mouseOut #133

Open

Description

@ashagi

After setting setHover(true) on a markers, hovering a marker creates an InfoBubble. However, it does that each time the marker is hovered, even if it already has a shown InfoBubble. I assume it closes/destroys previous one and creates new InfoBubble, as you can see 'blink' on the InfoBubble.

Also, it would be nice to have an option to close InfoBubble when mouse leaves the marker area.

Activity

  1. ashagi commented on Apr 10, 2012

    @ashagi
    Author

    I think I fixed the issue (mxn 2.0.18). Setting setHover(true) on mxn.Marker now will behave in a following way: show bubble when hovering and close it when mouse goes out of the marker.

    Here is "patch":

    mxn.googlev3.core.js

    @@ -504,13 +504,19 @@ Marker: {
            var marker = new google.maps.Marker(options);
    
            if (this.infoBubble) {
    -           var event_action = "click";
    +            google.maps.event.addListener(marker, "click", function() {
    +                marker.mapstraction_marker.openBubble();
    +            });
                if (this.hover) {
    -               event_action = "mouseover";
    +                google.maps.event.addListener(marker, "mouseover", function() {
    +                    marker.mapstraction_marker.openBubble();
    +                });
    +                google.maps.event.addListener(marker, "mouseout", function() {
    +                    marker.mapstraction_marker.closeBubble();
    +                });
    +
                }
    -           google.maps.event.addListener(marker, event_action, function() {
    -               marker.mapstraction_marker.openBubble();
    -           });
    +
            }
    
            if (this.hoverIconUrl) {

    Sorry, if I am not following conventions or submitting the issue and patch in a wrong way. Overwhelmed with work, so submitting what I have :\

  2. reopened this on Apr 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions