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

349
Views
In Laflet map, When click outside of the map, how to close opend popup

I am developing cms widgets using lit-element and it contains leaflet maps. we open popups inside the map when we click on the marker. and close them inside the map. But the problem is how to close those opened leaflet marker popups when click outside of the leaflet map ?

. I was looking for the answer for long time. But i couldn't find any. Please help me .. Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

documentation stated may use closePopup function to closes the popup previously opened with openPopup. Based on my understanding to the documentation, you may try to store openPopup as a variable, trigger function to close the popup once clicking outside the map.

var boo = L.marker([51.5, -0.09]).addTo(map)
.bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
.openPopup();

L.marker([51.5, -0.09]).closePopup(boo);
about 4 years ago · Juan Pablo Isaza 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!