超图FAQ: 可以使用匿名方法传参,比如:
var args={};
var queryService = new SuperMap.REST.QueryByGeometryService(url, {
eventListeners: {
"processCompleted": function(e){processCompleted(e,args);},
"processFailed": function(e){processFailed(e,args);}
}
});
-------
function processCompleted(result,args){}
若是在循环里执行,需要使用闭包传参,比如:
var args={};
var queryService = new SuperMap.REST.QueryByGeometryService(url, {
eventListeners: {
"processCompleted": (function(x){returun function(e){processCompleted(e,x);}})(args),
"processFailed": function(e){processFailed(e);}
}
});