iclient ol地图sql查询多个图层怎么处理features能够显示到一个layer里面?目前代码如下:此代码显示不出来要素,但是单独引用features1是能显示出来的
function query() {
var param = new SuperMap.QueryBySQLParameters({
queryParams: [{name: "SS"},{name: "SS2"}]
});
new ol.supermap.QueryService(url).queryBySQL(param, function (serviceResult) {
var features1=(new ol.format.GeoJSON()).readFeatures(serviceResult.result.recordsets[0].features);
var features2=(new ol.format.GeoJSON()).readFeatures(serviceResult.result.recordsets[1].features);
var fea=[features1,features2]
var vectorSource = new ol.source.Vector({
features: fea,
wrapX: false
});
resultLayer = new ol.layer.Vector({
source: vectorSource
});
map.addLayer(resultLayer);
});
}