npm install @googlemaps/js-api-loader
Alternatively, the following script can be added to the HTML document.
The full sample code is below.
Create a starter application from sample
Node.js is required to run this sample locally. Follow these instructions to install Node.js and NPM.
npx @googlemaps/js-samples init programmatic-load-button DESTINATION_FOLDER
Run in Google Cloud Shell
Google Cloud Shell is an interactive shell environment for Google Cloud Platform that makes it easy for you to learn and experiment with GCP and manage your projects and resources from your web browser.Run in Cloud Shell