您好,可以使用ID查询功能进行过滤显示指定ID的面,示例代码如下:
query();
function query() {
var idsParam = new ol.supermap.GetFeaturesByIDsParameters({
IDs: [233, 234],
datasetNames: ["World:Countries"]
});
new ol.supermap.FeatureService(url).getFeaturesByIDs(idsParam).then(function (serviceResult) {
var vectorSource = new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures(serviceResult.result.features),
wrapX: false
});
resultLayer = new ol.layer.Vector({
source: vectorSource
});
map.addLayer(resultLayer);
});
}
示例代码中显示的就是ID为233和234的几何面
希望能够帮助到您!