在ExtJS 4中动态加载Google Maps API v3

3
你能在页面加载后,使用ExtJS 4加载Google Maps API吗?
1个回答

7
Ext.Loader.loadScriptFile('https://www.google.com/jsapi',function(){
    google.load("maps", "3", {
        other_params:"sensor=false",
        callback : function(){
            // Google Maps are loaded. Place your code here
        }
    });
},Ext.emptyFn,null,false);

你可以使用以下方法向API传递更多参数: other_params: "sensor=false&libraries=places&key=YOUR_API_KEY" 有关Google Loader的更多信息,请参见: https://developers.google.com/loader/

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接