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

128
Visualizações
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 à 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