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

201
Visualizações
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 Respostas
Responde à pergunta

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 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