📜  悬停时如何提升功能 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:04.407000             🧑  作者: Mango

代码示例1
function addPopup(feature, layer) {
    var popupContent = feature.properties.name;
    layer.bindPopup(popupContent);

    layer.on('mouseover', function (e) {
        this.openPopup(e.latlng);
    });
    layer.on('mouseout', function (e) {
        this.closePopup();
    });
}