Is there an easy way to add a link for a specific popup in leaflet or any other javascript object?
I have a website with a lot of popups, this popup fetches a html file from a folder with a lot of text.
fetch('../assets/txts/4.html', {mode: 'no-cors'})
.then(res => res.text())
.then(data => text4 = data)
.then(() => L.marker([331, 370], {
icon: makerRot
}).addTo(map).bindPopup(text4, {
maxWidth: 800,
keepInView: true,
maxHeight: 500
}))
when I type in example.com/text/text1.html I can see the text obviously, but when I click on the popup I stay on example.com
Is there a way to add a link (example.com/text4) so when I click the link it will open the right popup? And even better if I click the popup the url will be updated to the according link?
I know about section and #-anchors but could transfer this to my problem.