https://github.com/zpratt/async-google-maps
Asynchronous loading and creation of google maps
https://github.com/zpratt/async-google-maps
Last synced: about 1 year ago
JSON representation
Asynchronous loading and creation of google maps
- Host: GitHub
- URL: https://github.com/zpratt/async-google-maps
- Owner: zpratt
- License: mit
- Created: 2015-03-11T22:46:41.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-26T13:45:45.000Z (about 9 years ago)
- Last Synced: 2025-04-20T18:38:53.097Z (about 1 year ago)
- Language: JavaScript
- Size: 409 KB
- Stars: 16
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Asynchronous loading and creation of google maps
[](https://travis-ci.org/zpratt/async-google-maps)
[](https://www.npmjs.com/package/async-google-maps)
## Why use this module?
I wrote this module to have the simplest possible public API and to handle the common case of waiting to add things to the map until it is `idle`. It is also targeted at making the creation of multiple map instances easier to manage, since each call to `create` will return a promise. There is [another library](https://github.com/sakren/node-google-maps) you can use if you don't like mine.
Additionally, I have focused on code readability, test quality, and attempted to make this an easy module to TDD with as a dependency. You can easily stub the API, instead of having to verify properties of the module itself. TDD is a passion of mine.
### Not fully baked yet
I have yet to include the options for the business version, but I expect to include that in the next release.
## Running tests
This module is 100% test-driven. Please feel free to run the tests and critique them.
1. Install io.js (needed for jsdom)
2. `git clone` ...
3. `npm i`
4. `npm test`
## Usage
This is a pure commonjs module with no production dependencies. I recommend using either [webpack](http://webpack.github.io/docs/) or [browserify](https://github.com/substack/node-browserify) to build.
See the [wiki](https://github.com/zpratt/async-google-maps/wiki) for usage examples.
## Documentation
API documentation can be found [here](http://zpratt.github.io/async-google-maps/docs/async-google-maps/0.2.2/index.html).
### Promises
This library leverages the ES6 promise implementation, which is currently [available in most modern browsers](http://caniuse.com/#feat=promises). If you wish to use it with browsers that do not support the ES6 promise implementation, then I recommend using [a polyfill](https://github.com/jakearchibald/es6-promise).
### Why?
I have intentionally limited the production dependencies of this module, so you are not forced to use a particular library.