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

184
Visualizações
javascript function in leaflet popup

I am trying to show a specific earthquake event when the user clicks on details in the popup (right now it just shows all of them)

    mymap.addLayer(markers);

    let template = `

    <h3>Earthquake</h3>
    <article><a href="/data/earthquakes_events.json">Details</a></article>
    `
    markers.bindPopup(template);

I have written this function to return the specific earthquake:

let earthquakes = earthquakes_events.json
function GetEarthquake (lat, long) {
    var index = earthquakes.findIndex(obj => obj.latitude == lat && obj.longitude == long)
    return earthquakes[index] // returns the whole object
}

Now I would like to use this function with the latitude and longitude info from the mouseevent but I don't know how

about 4 years ago · Juan Pablo Isaza
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