iclient ol地图sql查询多个图层怎么处理features [已关闭]

0 投票
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);
        });
    }
12月 18, 2020 分类:  101次浏览 | 用户: 小白1 初出茅庐 (23 分)
已关闭 12月 18, 2020 用户:张亮
...