Almond.js can't handle with asynchronous plugins。 jQuery.Deferredを使用してライブラリをロードすることができます。
var googleMapsLoader = function(func, options) {
var defaults = {
"sensor" : "false",
"v" : "3",
"key" : "",
"language" : "pt",
"region" : "br",
"libraries": ""
};
$.when($.ajax({
type: "GET",
dataType: "script",
data: $.extend({}, defaults, options),
url: "https://maps.google.com/maps/api/js",
crossDomain: true
})).then(function() {
func();
});
};
/*
* Loading Google Maps API with $.Deferred.
*/
googleMapsLoader(function() {
// You may call your code here.
}, {
"libraries" : "geometry,places",
"v" : "3.7"
});
$ .DeferredとMaplaceを使用してthis exampleを参照してください。