1.0.1 • Published 4 years ago
js-google-maps-api v1.0.1
Google Maps API for JavaScript
This repository contains a JavaScript package that allows you to access the Google Maps JavaScript API from your JavaScript project.
Installation
This package can be installed with NPM. Run this command:
npm install js-google-maps-api
Usage
Simple example of using the Google Maps JavaScript API.
import googleMapsApi from './google-maps-api'
// Load the Google Maps API.
googleMapsApi({
key: '{google-maps-api-key}', // required
libraries: ['places'], // optional
// other optional parameters
}).then((api) => {
// Use the api, eg:
let autocomplete = new api.places.Autocomplete(/** params */);
})
// Use the Google Maps API.
googleMapsApi().then((api) => {
// Use the api, eg:
let autocomplete = new api.places.Autocomplete(/** params */);
})