Wrapper for asynchronously used Google Maps API

npm install google-maps
2 downloads in the last day
23 downloads in the last week
104 downloads in the last month

NPM version Dependency Status Build Status


Google Maps

Wrapper for asynchronously used Google Maps API in browser.

This module does not change original google maps api in any way. It just provide easy way to load and use this API asynchronously.


Environment with common js:

$ npm install google-maps

Download and import one of these files into your .html file:


var GoogleMapsLoader = require('google-maps');        // only for common js environments

GoogleMapsLoader.load(function(google) {
    new google.maps.Map(el, options);

If you are not using environment with common js support, you can use GoogleMapsLoader variable directly. It is already in window object.


Own API key

GoogleMapsLoader.KEY = 'qwertyuiopasdfghjklzxcvbnm';

Business API client

GoogleMapsLoader.CLIENT = 'yourclientkey';
GoogleMapsLoader.VERSION = '3.14';


GoogleMapsLoader.SENSOR = true

Unload google api

For testing purposes is good to remove all google objects and restore loader to its original state.

GoogleMapsLoader.release(function() {
    console.log('No google maps api around');



GoogleMapsLoader.onLoad(function(google) {
    console.log('I just loaded google maps api');


$ npm test

Changelog list

  • 2.0.0

    • Added Maps API for Business support
    • Added standalone version for non common js environments
    • Removed dependency on q package
    • Using callback instead of promise
    • Added tests + travis
    • Added status badges
  • 1.0.0

    • Initial version
npm loves you