Warm tip: This article is reproduced from stackoverflow.com, please click
geo leaflet

Leaflet GEOpoly with Links

发布于 2020-04-19 09:31:30

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

Questioner
jdadwilson
Viewed
50
Falke Design 2020-02-06 15:42

Update your click function:

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

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