OverlappingMarkerSpiderfier icon indicating copy to clipboard operation
OverlappingMarkerSpiderfier copied to clipboard

click trigger event

Open bartmoons opened this issue 9 years ago • 1 comments

I tried multiple things to trigger a click on a marker, but it doesn't seem to work. What I want to achieve is to auto click the first marker on initialisation, so the first infowindow is open. I don't get an error message, so I think the syntax is correct.

oms.trigger(oms.a[0], 'click');

bartmoons avatar May 12 '15 20:05 bartmoons

I looked at the coffeescript file and it's using the google event listeners. So right now I'm doing something like this on my google map drag event. Though I need to work out the kinks to have my crosshairs which is centered on my map to move slowly instead of jerky.

 map.addListener('drag',function(){
that.currentPositionMarker().setPosition({lat: that.map().center.lat(), lng: that.map().center.lng()});
      var nearbyMarker = oms.markersNearMarker(that.currentPositionMarker(),true);
      //console.log('nearbyMarker');
      //console.log(nearbyMarker);
      if ((nearbyMarker || []).length){
        google.maps.event.trigger(nearbyMarker[0],'click');
      }
}

joezen777 avatar Sep 19 '16 16:09 joezen777