Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the function of google.maps.event.addDomListener(window, 'load', initialize);?

I was trying Google maps. I found this statement.

google.maps.event.addDomListener(window, 'load', initialize);

what is the function of that statement ?

like image 375
Daniel Listyo Emanuel Avatar asked Jul 19 '13 09:07

Daniel Listyo Emanuel


People also ask

How do you fix Google Maps event addDomListener () is deprecated?

maps. event. addDomListener() is deprecated, use the standard addEventListener() method instead. The feature will continue to work and there is no plan to decommission it.

How do I add an event to Google Maps?

To add an event, head to Google Maps on Android, tap on Contribute >Events > Add a public event. You can add an event name, tag the location, and add the time and date of the event as well. There's an option to add an image, write more event details, and add description as well.

Which event is triggered when the map is continuously moved and tracked?

Then you will have a dragend event available.


2 Answers

It adds a listener to the window object, which as soon as the load event is triggered (i.e. "the page has finished loading") executes the function initialize.

I.e. it delays the Google Map related script until the page has finished loading.

like image 144
deceze Avatar answered Oct 05 '22 05:10

deceze


@Dust function is initialize and it is called only after the <div> element is loaded. in maps.event..., I think event is element because essentially it contains the map-canvas information.

like image 23
Jagpat Singh Avatar answered Oct 05 '22 04:10

Jagpat Singh