Check if L.marker is visible

I am new at leafletjs and in js, so i'am trying to code some function which will show is marker's modal is visible, like if marker 1 is pressed then function will return "near 1" if marker 2 is pressed then it will return "near 2"

// Get map region name 
function GetRegionName()
    if (L.marker([-36.26531, 133.5825]))
        return "near 1";
} document.getElementById("regionname").innerHTML = GetRegionName();


comments powered by Disqus