Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
open leaflet.js popup with a link

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.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda