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

161
Visualizações
Drag element to other page

Im trying to achieve behaviour where user could drag elements from a leaflet map to other page where there is another map.

To be able to drag out of the map and go hover over link in a navbar which after one second time redirects me to the other page, I did these steps:

1 - The whole page has onmousemove event listener (when dragging is active).

2 - When I want to start dragging some polygon from the map, I actually create a new element (looking similiar to the one in the map) with absolute position and the onmousemove listener is setting its position based on the cursors position.

3 - After hovering over the link and being redirected to the other page, after the reload, I reconstruct the "dragged" element and I re-add the onmousemove event listener (as in step 1). BUT because it should be drag n drop like experience, the user is still holding the left-mouse button down and the re-added onmousemove event listener starts doing its think only after user stop holding the left-mouse button down.

What I'd like to achieve is that the re-added onmouse event listens from the very beginning even if left-mouse button is down all the time during the page load. Or if there is other way how to go around this.

Thank you

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