RT,查看官方示例http://supermap.com:8090/iserver/iClient/forJavaScript/examples/leaflet/editor.html#01_mapQueryBySQL
修改代码如下:
function query() {
var param = new SuperMap.QueryBySQLParameters({
queryParams: {
name: "Capitals@World.1",
attributeFilter: "SMID > 0",
orderBy: "CAP_POP desc",
fields: ["SmID","COUNTRY","CAPITAL"]
},
startRecord: 0,
expectCount: 20
});
L.supermap
.queryService(url)
.queryBySQL(param, function (serviceResult) {
var result = serviceResult.result;
resultLayer = L.geoJSON(result.recordsets[0].features).addTo(map);
console.log(result.recordsets[0].features);
});
}
但是返回结果的字段排序没有按照"SmID","COUNTRY","CAPITAL"这个顺序,是默认返回全部字段的顺序。
问下是否有可以控制返回字段排序的方法