admin管理员组

文章数量:1589823

说明:

在使用ol.interaction.Select时,我定义的变量作用域作用不到其回调函数里,但我在select结果中,需要用到这些变量

解决方案:

虽想了个办法解决了,但不知道是不是合理;是否有其他解决方法

        let selecthover = new ol.interaction.Select({
            condition: ol.events.condition.click,
            layers: [animationLineLayer]
        });
        selecthover.set("arrPoints", that._pointArray);
        selecthover.on("select", function (evt) {
            var tmpPointsArray = this.getProperties()["arrPoints"];
        });

 

本文标签: olOpenLayersselectInteraction