Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda