tomchentw / react-google-maps

React.js Google Maps integration component
https://tomchentw.github.io/react-google-maps/
MIT License
4.62k stars 939 forks source link

Trigger the click event of a marker programmatically #969

Open yaroslav-perec opened 5 years ago

yaroslav-perec commented 5 years ago

I want to start dragging my marker immediately when I add it to my map, the marker becomes draggable when you click on it. How do I programmatically trigger a click event? Or can I achieve this behavior in a different way? I think it's related to #337

I'm tried to use gmaps.event.trigger(this.myMarkerNode.context['__SECRET_MARKER_CLUSTERER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED'], 'click');, but it's doesn't works.