0.2.4 • Published 8 years ago

gmaps-loader v0.2.4

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

gmaps-loader Build Status

Promise based Google Maps API loader

Install

npm install gmaps-loader

Example usage

var Loader = require('gmaps-loader');

var init = function() {
  var loader = new Loader({
    apiKey: '<YOUR_API_KEY>' //Should of course be a real key, this will throw an error.
  });

  loader.load()
    .then(function(api) {
      new api.Map(document.querySelector('#canvas'), {
        center: {
          lat: -34.397,
          lng: 150.644
        },
        zoom: 8
      });
    });
};

document.addEventListener('DOMContentLoaded', init);

API

callback

Type: string

The callback that will be called when the API has been initialized, that is window.YOUR_CALLBACK. Default is __INIT_GMAP.

apiKey

Type: string

Your API key, provided by Google.

To-do

  • Make it possible to pass in a custom API endpoint.
0.2.4

8 years ago

0.2.3

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.6

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago