调用此函数时,我希望该函数在返回对象之前等待回调完成r
function getWmsLayers(oneServerState){
reader = new GeoExt.data.WMSCapabilitiesReader();;
var serverLayers = new Array();
var store = new GeoExt.data.WMSCapabilitiesStore({
url: OpenLayers.ProxyHost + oneServerState.serverUrl,
reader: reader
});
var isCallBackCompleted = false;
store.load({
callback: function (r) {
return r;
}
});
//Do something ??
return r;
};
layers = getWMSLayers(oneServerState);