方案1:
var map=new ol.Map({
layers:[new ol.layer.Tile({
source:new ol.source.OSM()
})],
target:"map",
view:new ol.View({
center:[0,0],
zoom:0
}),
interactions:new ol.interaction.defaults({
doubleClickZoom:false, //屏蔽双击放大事件
})
})
方案2:
const dblClickInteraction = map
.getInteractions()
.getArray()
.find(interaction => {
return interaction instanceof ol.interaction.DoubleClickZoom;
});
map.removeInteraction(dblClickInteraction);