Openlayers 3中的鼠标滚轮事件

The mouse scroll wheel event in Openlayers 3

我开发的网站有两个部分:列表显示和地图显示。 我的地图上有很多标记。现在我需要在鼠标滚轮放大或缩小时获取地图标记的坐标。 moveend 是可能的。尽管我进行了搜索,但我无法做到这一点。任何人都可以帮助我。

提前致谢。

不清楚您要做什么以及这些标记是什么;他们是ol.geom.Point吗? 如果是,您可以这样做:

map.getView().on('change:resolution', function(evt){
    //layerFeatures is a reference of a ol.layer.Vector
    layerFeatures.getSource().forEachFeature(function(feature){
        var geom = feature.getGeometry();
        var coord = geom.getCoordinates(); //this is valid for a ol.geom.Point
        console.info(coord);
    });
});