Answers for "how to pup up feature when hover"

0

how to pup up feature when hover

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();
    });
}
Posted by: Guest on July-26-2020

Browse Popular Code Answers by Language