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

213
Visualizações
How to import html text in a leaflet popup

I have a pretty map with a cool event that trigger a map.onclick event like that :

function onMapClick(e) {
    L.popup()
        .setLatLng(e.latlng)
        .setContent('<link rel="import" href="./pages/myPopup.html">')
        .openOn(mymap);
    }
mymap.on('click', onMapClick);

And i'm trying to import html text in my leaflet popup. I'm using bootstrap+JQuery and I already saw bootstrap3-dialog but I think there is something to try with HTML5 or with jquery, but I don't know how !

I also found some explanations for having a click link inside leaflet popup that help for the start ! (JSFiddle here)

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You sound to be looking for a simple <iframe> (instead of your strange <link> tag which is for the page <head>) embedded in a Leaflet popup.

<iframe src="./myPopup.html"></iframe>

This is extremely simple and does not present any particular issue. Do not forget to set height and width on your iframe.

Demo: https://plnkr.co/edit/m94za7fHpGakqouMmwO2?p=preview

about 4 years ago · Santiago Trujillo Relatório
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