const map = new google.maps.Map(document.getElementById("map"), { // marker is clicked, the info window will open with the secret message. object, which may not be the state when the event was first fired. property may produce unpredictable and/or unwanted behavior. browser event model in use. > passing the variable name to which the listener was assigned. google.maps.Map as you interact with the map. const marker = new google.maps.Marker({ Load event When a page finishes loading, the "load" event fires on the window and the document body objects. closures which allows inner functions to access outer When the user clicks a button, that click too is an event. Ask a question under the google-maps tag. However, the DOM (Document Object Model) within the browser , function initMap() { Because different browsers implement different DOM event models, the Maps JavaScript API provides these mechanisms to listen for and respond to DOM events without needing to handle the various cross-browser peculiarities. Window.onpaint An event handler property for paint events on the window. information on DOM level events, see the function to call when the specified event occurs. window.location) is a reference to a Location object; it represents the current URL of the document being displayed in that window.