Skip to content

Instantly share code, notes, and snippets.

@zpratt
Last active August 29, 2015 14:17
Show Gist options
  • Save zpratt/856f523fd72e6dfc76f2 to your computer and use it in GitHub Desktop.
Save zpratt/856f523fd72e6dfc76f2 to your computer and use it in GitHub Desktop.
Google Maps facade
'use strict';
var google = global.google;
module.exports = {
create: function (mapContainer, options) {
return new Promise(function (resolve) {
var mapInstance = new google.maps.Map(mapContainer, options);
google.maps.event.addListenerOnce(mapInstance, 'idle', function () {
resolve(mapInstance);
});
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment