Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

google-maps-api-loader

laurencedorman49.9kMITdeprecated1.1.1

This package is deprecated, use @googlemaps/js-api-loader instead

Conditionally load the Google Maps API in an ES6 promise

google-maps, google-maps-api, es6, promise

readme

Google Maps API Loader

npm travis Dependency Status devDependency Status

Provides a convenient wrapper for the Google Maps API, allowing it to be called in the promise syntax.

Installation

$ npm install --save google-maps-api-loader

Usage


var GoogleMapsApiLoader = require('google-maps-api-loader');

GoogleMapsApiLoader({
        libraries: ['places'],
        apiKey: 'your-api-key' // optional
    })
    .then(function(googleApi) {
        var autocomplete = new googleApi.maps.places.AutocompleteService();
    }, function(err) {
        console.error(err);
    });

License

MIT