jawj / OverlappingMarkerSpiderfier

Deals with overlapping markers in Google Maps JS API v3, Google Earth-style
http://blog.mackerron.com
837 stars 238 forks source link

Hover instead of click ? #120

Open data-b opened 7 years ago

data-b commented 7 years ago

Hi ! nice job with this script ! I wonder if there is any solution to use hover instead of click the marker ? Thks Vince

trungvose commented 7 years ago

If you are not using marker click event for any purpose, the following code will work for you.

google.maps.event.addListener(marker, 'mouseover', () => {
    if (marker._omsData === undefined) { google.maps.event.trigger(marker, 'click'); }        
});