您好 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);
var iner=new ol.interaction.Select({
condition: ol.events.condition.pointerMove, // 唯一的不同之处,设置鼠标移到feature上就选取
layers: [resultLayer]
})
// 添加一个用于选择Feature的交互方式
map.addInteraction(iner);
iner.on('select',(e)=>{
console.log(e,'e')
})