Google Maps data layer, soft click on geometry

I have a google map where I am loading geometry data to a data layer using geoJSON. I am binding to the next event in the data layer.

map.data.addListener('click', function (event) { console.log(event);});

      

How can I trigger this event manually? I know I can fire the click event on the marker manually, but it gets triggered via google.maps.event

.

+3


source to share


1 answer


This must be done with google.maps.event.trigger.

Try (not sure):



// invoke a click
google.maps.event.trigger(map.data, 'click');

      

+2


source







All Articles