Search code examples
leafletgeo

Leaflet GEOpoly with Links


My site uses Leaflet to build a map with multiple county outlines. Embedded within each GEOPoly file is a feature to indicate the website for the county. This all works great. BUT, what I would like to do is have the link include a target"_blank". How can this be done?

TIA for any assistance jdadwilson


Solution

  • Update your click function:

    layer.on('click', function () { 
        window.open(CO_URL_LINK['Attala'], '_blank');
    })
    

    https://stackoverflow.com/a/13158856/8283938