Asynchronously Loading
It is also possible to load the Google Maps API on demand.
The example below uses window.onload to load the Google Maps API after the page has fully loaded.
The loadScript() function creates the Google Maps API tag. In addition, the callback=initialize parameter is added to the end of the URL to execute the initialize() function after the API is fully loaded: