Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

272
Vistas
LEAFLET JS: Get Polyline ID on MouseOver

I want to move the mouse over an specific line of the polylines and get data of that line. I've been trying this for a while with no success, here is my code:

var allHover = L.polyline([
       [
         [45.51, -122.68],
         [37.77, -122.43],
         [34.04, -118.2]
       ],
       [
         [40.78, -73.91],
         [41.83, -87.62],
         [32.76, -96.72]
       ]
      ], {
      color: 'rgba(0,0,0,0)',
      weight: 15
    }).addTo(map);

allHover.on('mouseover', function(e) {
    var info = e.target;
    console.log(info);
}); 

allHover.on('mouseout', function() {
    console.log('mouse out');
}); 

The problem is that instead of getting just the data from one line, I get the full data. How can I solve that?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda