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

193
Views
leaflet sublayer on click event not under action

I have created two feature-collection(polygon , multi polygon) layers and applied the on click event on both of them. layer2(which is above the layer1) is completely covering the area of layer1. So when i click on the layer2 , the respective click event is coming under action. And the click event of layer1 is not coming under action. what i want is that when i click on any layer , click event of both the layers should be triggered.

  layer1 = L.geoJSON(data2,{
                    onEachFeature: onEachFeature
                }).addTo(map);
                layer2 = L.geoJSON(data1,{
                    onEachFeature: onEachFeature2
                }).addTo(map);

                var overlays = {
                    "layer one": layer1,
                    "layer two": layer2
                };

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

A way would be to listen on the map for the click event:

map.on('click',(e)=>console.log(e))
about 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!