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

129
Vistas
Hover event over shapefile while drawing on Leaflet

I am using Leaflet.Draw to draw some features such as line, polygon and etc on the map. I also have a shapefile (here named mypoly) already on my map. What I now want is that during the drawing of a new feature such as a line if my mouse cursor moves over mypoly , the mypoly should get highlighted immediately. Here is my attempt :

Map.on('draw:drawstart', function() {

    console.log('drawing started');
    
    mypoly.on('mouseover', function() {

      mypoly.setStyle({
        opacity: 1})
    });

    mypoly.on('mouseout', function() {
 
      mypoly.setStyle({
        opacity: 0.5})
    });


});

It seems to be working when I select a drawing tool and hover over the mypoly but the moment I start real drawing and try to move my mouse cursor over the mypoly, the highlight functionality doesn't work. Any suggestion/ solution would be appreciated. Thanks in advance.

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