Skip to content

Instantly share code, notes, and snippets.

@Chris-Murphy
Created April 15, 2012 16:13
Show Gist options
  • Save Chris-Murphy/2393622 to your computer and use it in GitHub Desktop.
Save Chris-Murphy/2393622 to your computer and use it in GitHub Desktop.
Google maps async in Meteor
function loadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '/js/bootstrap.js';
document.body.appendChild(script);
script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&' +
'libraries=geometry,places&callback=themap.initialize';
document.body.appendChild(script);
}
if (Meteor.is_client) {
var clientID = new Date().getTime(); //this could probably be more random
window.onload = loadScript;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment