jamesatha jamesatha - 5 months ago 60
Javascript Question

Listening for the domready event for google.maps.InfoWindow class

So, I am trying to make add a google map to my webpage. I want to add a form into the pop-up bubble when you click on a marker on the map.

The API documentation says that the domready

"event is fired when the containing the InfoWindow's content is attached to the DOM. You may wish to monitor this event if you are building out your info window content dynamically."

How do I listen to this event?

This is the documentation.


I just solved a similar problem myself. To listen for the domready event, use the following syntax:

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