Home Listening infowindow with Gmaps4rails gem
Reply: 0

Listening infowindow with Gmaps4rails gem

user1029
1#
user1029 Published in April 26, 2018, 5:29 pm

I want to put an event after the user click on the marker and this is traditionally made by this way:

var infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow, 'domready', function() {
      // whatever you want to do once the DOM is ready
});

Where we can see in this answer: Listening for the domready event for google.maps.InfoWindow class

The problem is that I'm using gmaps4rails and the variable that I called manually above "infoWindow" is already generated in darkness.

We have the variable "handler" that do all the stuff

handler = Gmaps.build('Google');

I instinctivilly thought that it should be something like:

var infoWindow = handler.infoWindow
google.maps.event.addListener(infoWindow, 'domready', function() {
     // whatever you want to do once the DOM is ready
});

but doens't work. How can I do to get this job done with this gem? Thank you.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.314147 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO