Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
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)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

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

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!